1 #ifndef NET_SNMP_LIBRARY_TYPES_H 2 #define NET_SNMP_LIBRARY_TYPES_H 3 4 #ifndef NET_SNMP_CONFIG_H 5 #error "Please include <net-snmp/net-snmp-config.h> before this file" 6 #endif 7 8 9 #include <net-snmp/types.h> 10 11 12 typedef struct netsnmp_index_s { 13 size_t len; 14 oid *oids; 15 } netsnmp_index; 16 17 typedef struct netsnmp_void_array_s { 18 size_t size; 19 void **array; 20 } netsnmp_void_array; 21 22 /* 23 * references to various types 24 */ 25 typedef struct netsnmp_ref_void { 26 void *val; 27 } netsnmp_ref_void; 28 29 typedef union { 30 u_long ul; 31 u_int ui; 32 u_short us; 33 u_char uc; 34 long sl; 35 int si; 36 short ss; 37 char sc; 38 char *cp; 39 void *vp; 40 } netsnmp_cvalue; 41 42 typedef struct netsnmp_ref_size_t_s { 43 size_t val; 44 } *netsnmp_ref_size_t; 45 46 /* 47 * Structure for holding a set of file descriptors, similar to fd_set. 48 * 49 * This structure however can hold so-called large file descriptors 50 * (>= FD_SETSIZE or 1024) on Unix systems or more than FD_SETSIZE (64) 51 * sockets on Windows systems. 52 * 53 * It is safe to allocate this structure on the stack. 54 * 55 * This structure must be initialized by calling netsnmp_large_fd_set_init() 56 * and must be cleaned up via netsnmp_large_fd_set_cleanup(). If this last 57 * function is not called this may result in a memory leak. 58 * 59 * The members of this structure are: 60 * lfs_setsize: maximum set size. 61 * lsf_setptr: points to lfs_set if lfs_setsize <= FD_SETSIZE, and otherwise 62 * to dynamically allocated memory. 63 * lfs_set: file descriptor / socket set data if lfs_setsize <= FD_SETSIZE. 64 */ 65 typedef struct netsnmp_large_fd_set_s { 66 unsigned lfs_setsize; 67 fd_set *lfs_setptr; 68 fd_set lfs_set; 69 } netsnmp_large_fd_set; 70 #endif /* NET_SNMP_LIBRARY_TYPES_H */ 71