net-snmp 5.7
snmpCallbackDomain.h
00001 #ifndef _SNMPCALLBACKDOMAIN_H
00002 #define _SNMPCALLBACKDOMAIN_H
00003 
00004 #ifndef NET_SNMP_CONFIG_H
00005 #error "Please include <netsnmp/net-snmp-config.h> before this file"
00006 #endif
00007 
00008 #ifdef __cplusplus
00009 extern          "C" {
00010 #endif
00011 
00012 #ifdef NETSNMP_TRANSPORT_CALLBACK_DOMAIN
00013 
00014 #include <net-snmp/types.h>
00015 #include <net-snmp/library/snmp_transport.h>
00016 
00017 typedef struct netsnmp_callback_pass_s {
00018     int             return_transport_num;
00019     netsnmp_pdu    *pdu;
00020     struct netsnmp_callback_pass_s *next;
00021 } netsnmp_callback_pass;
00022 
00023 typedef struct netsnmp_callback_info_s {
00024     int             linkedto;
00025     void           *parent_data;
00026     netsnmp_callback_pass *data;
00027     int             callback_num;
00028     int             pipefds[2];
00029 } netsnmp_callback_info;
00030 
00031 netsnmp_transport *netsnmp_callback_transport(int);
00032 int             netsnmp_callback_hook_parse(netsnmp_session * sp,
00033                                             netsnmp_pdu *pdu,
00034                                             u_char * packetptr,
00035                                             size_t len);
00036 int             netsnmp_callback_hook_build(netsnmp_session * sp,
00037                                             netsnmp_pdu *pdu,
00038                                             u_char * ptk, size_t * len);
00039 int             netsnmp_callback_check_packet(u_char * pkt, size_t len);
00040 netsnmp_pdu    *netsnmp_callback_create_pdu(netsnmp_transport *transport,
00041                                             void *opaque, size_t olength);
00042 NETSNMP_IMPORT
00043 netsnmp_session *netsnmp_callback_open(int attach_to,
00044                                        int (*return_func) (int op,
00045                                                            netsnmp_session
00046                                                            * session,
00047                                                            int reqid,
00048                                                            netsnmp_pdu
00049                                                            *pdu,
00050                                                            void *magic),
00051                                        int (*fpre_parse) (netsnmp_session
00052                                                           *,
00053                                                           struct
00054                                                           netsnmp_transport_s
00055                                                           *, void *, int),
00056                                        int (*fpost_parse) (netsnmp_session
00057                                                            *,
00058                                                            netsnmp_pdu *,
00059                                                            int));
00060 NETSNMP_IMPORT
00061 void             netsnmp_clear_callback_list(void);
00062 
00063 #else
00064 
00065 #define netsnmp_clear_callback_list()
00066 
00067      
00068 #endif /*NETSNMP_TRANSPORT_CALLBACK_DOMAIN*/
00069 
00070 #ifdef __cplusplus
00071 }
00072 #endif
00073 #endif/*_SNMPCALLBACKDOMAIN_H*/