header_complex.h
上传用户:wxp200602
上传日期:2007-10-30
资源大小:4028k
文件大小:4k
源码类别:

SNMP编程

开发平台:

Unix_Linux

  1. /*
  2.  *  header_complex.h:  More complex storage and data sorting for mib modules
  3.  */
  4. #ifndef _MIBGROUP_HEADER_COMPLEX_H
  5. #define _MIBGROUP_HEADER_COMPLEX_H
  6. struct header_complex_index {
  7.     oid            *name;
  8.     size_t          namelen;
  9.     void           *data;
  10.     struct header_complex_index *next;
  11.     struct header_complex_index *prev;
  12. };
  13. /*
  14.  * Function pointer called by the header_comlpex functions when a client pointer (void * to us) needs to be cleaned. 
  15.  */
  16. typedef void    (HeaderComplexCleaner) (void *);
  17. void           *header_complex(struct header_complex_index *datalist,
  18.                                struct variable *vp, oid * name,
  19.                                size_t * length, int exact,
  20.                                size_t * var_len,
  21.                                WriteMethod ** write_method);
  22. int             header_complex_generate_varoid(netsnmp_variable_list *
  23.                                                var);
  24. int             header_complex_parse_oid(oid * oidIndex, size_t oidLen,
  25.                                          netsnmp_variable_list * data);
  26. void            header_complex_generate_oid(oid * name, size_t * length,
  27.                                             oid * prefix,
  28.                                             size_t prefix_len,
  29.                                             netsnmp_variable_list * data);
  30. void            header_complex_free_all(struct header_complex_index
  31.                                         *thestuff,
  32.                                         HeaderComplexCleaner * cleaner);
  33. void            header_complex_free_entry(struct header_complex_index
  34.                                           *theentry,
  35.                                           HeaderComplexCleaner * cleaner);
  36. void           *header_complex_extract_entry(struct header_complex_index
  37.                                              **thetop,
  38.                                              struct header_complex_index
  39.                                              *thespot);
  40. struct header_complex_index *header_complex_find_entry(struct
  41.                                                        header_complex_index
  42.                                                        *thestuff,
  43.                                                        void *entry);
  44. void           *header_complex_get(struct header_complex_index *datalist,
  45.                                    netsnmp_variable_list * index);
  46. void           *header_complex_get_from_oid(struct header_complex_index
  47.                                             *datalist, oid * searchfor,
  48.                                             size_t searchfdor_len);
  49. struct header_complex_index *header_complex_add_data(struct
  50.                                                      header_complex_index
  51.                                                      **thedata,
  52.                                                      netsnmp_variable_list
  53.                                                      * var, void *data);
  54. /*
  55.  * Note: newoid is copied/cloned for you 
  56.  */
  57. struct header_complex_index *header_complex_add_data_by_oid(struct
  58.                                                             header_complex_index
  59.                                                             **thedata,
  60.                                                             oid * newoid,
  61.                                                             size_t
  62.                                                             newoid_len,
  63.                                                             void *data);
  64. #endif                          /* _MIBGROUP_HEADER_COMPLEX_H */