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

SNMP编程

开发平台:

Unix_Linux

  1. #ifndef _SNMPCALLBACKDOMAIN_H
  2. #define _SNMPCALLBACKDOMAIN_H
  3. #ifndef NET_SNMP_CONFIG_H
  4. #error "Please include <netsnmp/net-snmp-config.h> before this file"
  5. #endif
  6. #ifdef __cplusplus
  7. extern          "C" {
  8. #endif
  9. #ifdef SNMP_TRANSPORT_CALLBACK_DOMAIN
  10. #include <net-snmp/library/snmp_transport.h>
  11. typedef struct netsnmp_callback_pass_s {
  12.     int             return_transport_num;
  13.     netsnmp_pdu    *pdu;
  14.     struct netsnmp_callback_pass_s *next;
  15. } netsnmp_callback_pass;
  16. typedef struct netsnmp_callback_info_s {
  17.     int             linkedto;
  18.     void           *parent_data;
  19.     netsnmp_callback_pass *data;
  20.     int             callback_num;
  21.     int             pipefds[2];
  22. } netsnmp_callback_info;
  23. netsnmp_transport *netsnmp_callback_transport(int);
  24. int             netsnmp_callback_hook_parse(netsnmp_session * sp,
  25.                                             netsnmp_pdu *pdu,
  26.                                             u_char * packetptr,
  27.                                             size_t len);
  28. int             netsnmp_callback_hook_build(netsnmp_session * sp,
  29.                                             netsnmp_pdu *pdu,
  30.                                             u_char * ptk, size_t * len);
  31. int             netsnmp_callback_check_packet(u_char * pkt, size_t len);
  32. netsnmp_pdu    *netsnmp_callback_create_pdu(netsnmp_transport *transport,
  33.                                             void *opaque, size_t olength);
  34. netsnmp_session *netsnmp_callback_open(int attach_to,
  35.                                        int (*return_func) (int op,
  36.                                                            netsnmp_session
  37.                                                            * session,
  38.                                                            int reqid,
  39.                                                            netsnmp_pdu
  40.                                                            *pdu,
  41.                                                            void *magic),
  42.                                        int (*fpre_parse) (netsnmp_session
  43.                                                           *,
  44.                                                           struct
  45.                                                           netsnmp_transport_s
  46.                                                           *, void *, int),
  47.                                        int (*fpost_parse) (netsnmp_session
  48.                                                            *,
  49.                                                            netsnmp_pdu *,
  50.                                                            int));
  51. void             netsnmp_clear_callback_list(void);
  52. #else
  53. #define netsnmp_clear_callback_list()
  54.      
  55. #endif /*SNMP_TRANSPORT_CALLBACK_DOMAIN*/
  56. #ifdef __cplusplus
  57. }
  58. #endif
  59. #endif/*_SNMPCALLBACKDOMAIN_H*/