net-snmp 5.7
agent_trap.h
00001 #ifndef AGENT_TRAP_H
00002 #define AGENT_TRAP_H
00003 
00004 #ifdef __cplusplus
00005 extern          "C" {
00006 #endif
00007 
00008 struct agent_add_trap_args {
00009     netsnmp_session *ss;
00010     int             confirm;
00011 };
00012 
00013 void            init_traps(void);
00014 void            send_easy_trap(int, int);
00015 void            send_trap_pdu(netsnmp_pdu *);
00016 void            send_v2trap(netsnmp_variable_list *);
00017 void            send_v3trap(netsnmp_variable_list *vars, const char *context);
00018 void            send_trap_vars(int, int, netsnmp_variable_list *);
00019 void            send_trap_vars_with_context(int trap, int specific, 
00020                                             netsnmp_variable_list *vars,
00021                                             const char *context);
00022 void            send_enterprise_trap_vars(int trap, int specific,
00023                                           const oid * enterprise,
00024                                           int enterprise_length,
00025                                           netsnmp_variable_list * vars);
00026 int             netsnmp_send_traps(int trap, int specific,
00027                           const oid * enterprise, int enterprise_length,
00028                           netsnmp_variable_list * vars,
00029                           /* flags are currently unused */
00030                           const char * context, int flags);
00031 void            snmpd_parse_config_authtrap(const char *, char *);
00032 void            snmpd_parse_config_trapsink(const char *, char *);
00033 void            snmpd_parse_config_trap2sink(const char *, char *);
00034 void            snmpd_parse_config_informsink(const char *, char *);
00035 void            snmpd_parse_config_trapsess(const char *, char *);
00036 void            snmpd_free_trapsinks(void);
00037 void            snmpd_parse_config_trapcommunity(const char *, char *);
00038 void            snmpd_free_trapcommunity(void);
00039 void            send_trap_to_sess(netsnmp_session * sess,
00040                                   netsnmp_pdu *template_pdu);
00041 
00042 int             create_trap_session(char *, u_short, char *, int, int);
00043 int             add_trap_session(netsnmp_session *, int, int, int);
00044 int             remove_trap_session(netsnmp_session *);
00045 
00046 void                   convert_v2_to_v1(netsnmp_variable_list *, netsnmp_pdu *);
00047 netsnmp_variable_list *convert_v1_to_v2(netsnmp_pdu *);
00048 netsnmp_pdu    *convert_v2pdu_to_v1(netsnmp_pdu *);
00049 netsnmp_pdu    *convert_v1pdu_to_v2(netsnmp_pdu *);
00050 
00051 #ifdef __cplusplus
00052 }
00053 #endif
00054 #endif                          /* AGENT_TRAP_H */