1 /**************************************************************
2 * Copyright (C) 2001 Alex Rozin, Optical Access
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation for any purpose and without fee is hereby granted,
8 * provided that the above copyright notice appear in all copies and that
9 * both that copyright notice and this permission notice appear in
10 * supporting documentation.
12 * ALEX ROZIN DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
13 * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
14 * ALEX ROZIN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
15 * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
16 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
17 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
19 ******************************************************************/
21 #ifndef _agutil_api_h_included__
22 #define _agutil_api_h_included__
27 #warning MEMORY DEBUG VERSION
28 void *dbg_f_AGMALLOC(size_t size);
29 void dbg_f_AGFREE(void *ptr);
30 char *dbg_f_AGSTRDUP(const char *s);
31 void dbg_f_AG_MEM_REPORT(void);
32 # define AGMALLOC(X) dbg_f_AGMALLOC(X)
33 # define AGFREE(X) { dbg_f_AGFREE(X); X = NULL; }
34 # define AGSTRDUP(X) dbg_f_AGSTRDUP(X)
36 # define AGMALLOC(X) malloc(X)
37 # define AGFREE(X) { free(X); X = NULL; }
38 # define AGSTRDUP(X) strdup(X)
43 oid objid[MAX_OID_LEN];
46 void ag_trace(const char *format, ...);
48 int AGUTIL_advance_index_name(struct variable *vp, oid * name,
49 size_t * length, int exact);
50 int AGUTIL_get_int_value(u_char * var_val, u_char var_val_type,
51 size_t var_val_len, long min_value,
52 long max_value, long *long_tmp);
53 int AGUTIL_get_string_value(u_char * var_val,
56 size_t buffer_max_size,
57 u_char should_zero_limited,
58 size_t * buffer_actual_size,
60 int AGUTIL_get_oid_value(u_char * var_val, u_char var_val_type,
62 VAR_OID_T * data_source_ptr);
64 u_long AGUTIL_sys_up_time(void);
67 #define ETH_STATS_T UID_PORT_STATISTICS_T
86 u_long pkts_1024_1518;
90 void SYSTEM_get_eth_statistics(VAR_OID_T * data_source,
93 #endif /* _agutil_api_h_included__ */