snmpCallbackDomain.h 2.8 KB

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