net-snmp 5.7
snmpUDPDomain.h
00001 #ifndef _SNMPUDPDOMAIN_H
00002 #define _SNMPUDPDOMAIN_H
00003 
00004 #ifdef __cplusplus
00005 extern          "C" {
00006 #endif
00007 
00008 #include <net-snmp/library/snmp_transport.h>
00009 #include <net-snmp/library/asn1.h>
00010 
00011 #if HAVE_SYS_SOCKET_H
00012 #include <sys/socket.h>
00013 #endif
00014 #if HAVE_NETINET_IN_H
00015 #include <netinet/in.h>
00016 #endif
00017 
00018 config_require(UDPIPv4Base)
00019 #include <net-snmp/library/snmpUDPIPv4BaseDomain.h>
00020 
00021 netsnmp_transport *netsnmp_udp_transport(struct sockaddr_in *addr, int local);
00022 
00023 
00024 /*
00025  * Register any configuration tokens specific to the agent.  
00026  */
00027 
00028 NETSNMP_IMPORT
00029 void            netsnmp_udp_agent_config_tokens_register(void);
00030 
00031 NETSNMP_IMPORT
00032 void            netsnmp_udp_parse_security(const char *token, char *param);
00033 
00034 NETSNMP_IMPORT
00035 int             netsnmp_udp_getSecName(void *opaque, int olength,
00036                                        const char *community,
00037                                        size_t community_len,
00038                                        const char **secname,
00039                                        const char **contextName);
00040 
00041 /*
00042  * "Constructor" for transport domain object.  
00043  */
00044 
00045 void            netsnmp_udp_ctor(void);
00046 
00047 /*
00048  * protected-ish functions used by other core-code
00049  */
00050 char *netsnmp_udp_fmtaddr(netsnmp_transport *t, void *data, int len);
00051 #if defined(linux) && defined(IP_PKTINFO) || \
00052     defined(IP_RECVDSTADDR) && !defined(_MSC_VER)
00053 int netsnmp_udp_recvfrom(int s, void *buf, int len, struct sockaddr *from,
00054                          socklen_t *fromlen, struct sockaddr *dstip,
00055                          socklen_t *dstlen, int *if_index);
00056 int netsnmp_udp_sendto(int fd, struct in_addr *srcip, int if_index,
00057                                            struct sockaddr *remote, void *data, int len);
00058 #endif
00059 
00060 #ifdef __cplusplus
00061 }
00062 #endif
00063 #endif/*_SNMPUDPDOMAIN_H*/