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

SNMP编程

开发平台:

Unix_Linux

  1. /**
  2.  * @file container_iterator.h
  3.  * @addtogroup container_iterator
  4.  * @{
  5.  */
  6. #ifndef _CONTAINER_ITERATOR_HANDLER_H_
  7. #define _CONTAINER_ITERATOR_HANDLER_H_
  8. #include "container.h"
  9. #ifdef __cplusplus
  10. extern          "C" {
  11. #endif
  12.     typedef int (Netsnmp_Iterator_Loop_Key) (void *iterator_ctx,
  13.                                              netsnmp_ref_void* loop_ctx,
  14.                                              netsnmp_ref_void* key);
  15.     typedef int (Netsnmp_Iterator_Loop_Data)(void *iterator_ctx,
  16.                                              netsnmp_ref_void* loop_ctx,
  17.                                              netsnmp_ref_void* data);
  18.     typedef int (Netsnmp_Iterator_Ctx) (void *iterator_ctx,
  19.                                          netsnmp_ref_void* loop_ctx);
  20.     typedef int (Netsnmp_Iterator_Ctx_Dup) (void *iterator_ctx,
  21.                                             netsnmp_ref_void* loop_ctx,
  22.                                             netsnmp_ref_void* dup_ctx,
  23.                                             int reuse);
  24.     typedef int (Netsnmp_Iterator_Op) (void *iterator_ctx);
  25.     typedef int (Netsnmp_Iterator_Data) (void *iterator_ctx,
  26.                                             const void *data);    
  27.     void netsnmp_container_iterator_init(void);
  28.     netsnmp_container* netsnmp_container_iterator_get(
  29.         void *iterator_user_ctx,
  30.         netsnmp_container_compare * compare,
  31.         Netsnmp_Iterator_Loop_Key * get_first,
  32.         Netsnmp_Iterator_Loop_Key * get_next,
  33.         Netsnmp_Iterator_Loop_Data * get_data,
  34.         Netsnmp_Iterator_Ctx_Dup * save_pos, /* iff returning static data */
  35.         Netsnmp_Iterator_Ctx * init_loop_ctx,
  36.         Netsnmp_Iterator_Ctx * cleanup_loop_ctx,
  37.         Netsnmp_Iterator_Data * free_user_ctx,
  38.         int sorted);
  39.     
  40.     /*
  41.      * set up optional callbacks/
  42.      * NOTE: even though the first parameter is a generic netsnmp_container,
  43.      *       this function should only be called for a container created
  44.      *       by netsnmp_container_iterator_get.
  45.      */
  46.     void
  47.     netsnmp_container_iterator_set_data_cb(netsnmp_container *c,
  48.                                            Netsnmp_Iterator_Data * insert_data,
  49.                                            Netsnmp_Iterator_Data * remove_data,
  50.                                            Netsnmp_Iterator_Op * get_size);
  51. #ifdef __cplusplus
  52. }
  53. #endif
  54. #endif                          /* _CONTAINER_ITERATOR_HANDLER_H_ */
  55. /** @} */