net-snmp 5.7
types.h
00001 #ifndef NET_SNMP_LIBRARY_TYPES_H
00002 #define NET_SNMP_LIBRARY_TYPES_H
00003 
00004 #ifndef NET_SNMP_CONFIG_H
00005 #error "Please include <net-snmp/net-snmp-config.h> before this file"
00006 #endif
00007 
00008 
00009 #include <net-snmp/types.h>
00010 
00011 
00012 typedef struct netsnmp_index_s {
00013     size_t          len;
00014     oid            *oids;
00015 } netsnmp_index;
00016 
00017 typedef struct netsnmp_void_array_s {
00018     size_t          size;
00019     void          **array;
00020 } netsnmp_void_array;
00021 
00022 /*
00023  * references to various types
00024  */
00025 typedef struct netsnmp_ref_void {
00026     void           *val;
00027 } netsnmp_ref_void;
00028 
00029 typedef union {
00030     u_long          ul;
00031     u_int           ui;
00032     u_short         us;
00033     u_char          uc;
00034     long            sl;
00035     int             si;
00036     short           ss;
00037     char            sc;
00038     char           *cp;
00039     void           *vp;
00040 } netsnmp_cvalue;
00041 
00042 typedef struct netsnmp_ref_size_t_s {
00043     size_t          val;
00044 }              *netsnmp_ref_size_t;
00045 
00046 /*
00047  * Structure for holding a set of file descriptors, similar to fd_set.
00048  *
00049  * This structure however can hold so-called large file descriptors
00050  * (>= FD_SETSIZE or 1024) on Unix systems or more than FD_SETSIZE (64)
00051  * sockets on Windows systems.
00052  *
00053  * It is safe to allocate this structure on the stack.
00054  *
00055  * This structure must be initialized by calling netsnmp_large_fd_set_init()
00056  * and must be cleaned up via netsnmp_large_fd_set_cleanup(). If this last
00057  * function is not called this may result in a memory leak.
00058  *
00059  * The members of this structure are:
00060  * lfs_setsize: maximum set size.
00061  * lsf_setptr:  points to lfs_set if lfs_setsize <= FD_SETSIZE, and otherwise
00062  *              to dynamically allocated memory.
00063  * lfs_set:     file descriptor / socket set data if lfs_setsize <= FD_SETSIZE.
00064  */
00065 typedef struct netsnmp_large_fd_set_s {
00066     unsigned        lfs_setsize;
00067     fd_set         *lfs_setptr;
00068     fd_set          lfs_set;
00069 } netsnmp_large_fd_set;
00070 #endif                          /* NET_SNMP_LIBRARY_TYPES_H */