net-snmp 5.7
snmpUDPIPv4BaseDomain.h
00001 /* UDPIPV4 base transport support functions
00002  */
00003 #ifndef SNMPUDPIPV4BASE_H
00004 #define SNMPUDPIPV4BASE_H
00005 
00006 #if HAVE_SYS_SOCKET_H
00007 #include <sys/socket.h>
00008 #endif
00009 #if HAVE_NETINET_IN_H
00010 #include <netinet/in.h>
00011 #endif
00012 
00013 config_require(UDPBase)
00014 config_require(IPv4Base)
00015 
00016 #include <net-snmp/library/snmpIPv4BaseDomain.h>
00017 #include <net-snmp/library/snmpUDPBaseDomain.h>
00018 
00019 #ifdef __cplusplus
00020 extern          "C" {
00021 #endif
00022 
00023 /*
00024  * Definitions
00025  */
00026 #ifdef  MSG_DONTWAIT
00027 #define NETSNMP_DONTWAIT MSG_DONTWAIT
00028 #else
00029 #define NETSNMP_DONTWAIT 0
00030 #endif
00031 
00032 /*
00033  * Prototypes
00034  */
00035 
00036     netsnmp_transport *netsnmp_udpipv4base_transport(struct sockaddr_in *addr,
00037                                                      int local);
00038 
00039 #if defined(linux) && defined(IP_PKTINFO) \
00040     || defined(IP_RECVDSTADDR) && !defined(_MSC_VER)
00041     int netsnmp_udpipv4_recvfrom(int s, void *buf, int len,
00042                                  struct sockaddr *from, socklen_t *fromlen,
00043                                  struct sockaddr *dstip, socklen_t *dstlen,
00044                                  int *if_index);
00045     int netsnmp_udpipv4_sendto(int fd, struct in_addr *srcip, int if_index,
00046                                struct sockaddr *remote, void *data, int len);
00047 #endif
00048 
00049 
00050 #ifdef __cplusplus
00051 }
00052 #endif
00053 #endif /* SNMPUDPIPV4BASE_H */