Debian Codegraph @

snmplib/transports/snmpIPBaseDomain.h

raw
1 #ifndef _SNMPIPBASEDOMAIN_H_
2 #define _SNMPIPBASEDOMAIN_H_
3
4 #include <net-snmp/types.h>
5 #ifdef HAVE_NETINET_IN_H
6 #include <netinet/in.h>
7 #endif
8
9 /**
10 * SNMP endpoint specification.
11 * @param a Address family, network address and port number.
12 * @param iface Network interface name in ASCII format. May be empty.
13 */
14 struct netsnmp_ep {
15 union {
16 struct sockaddr_in sin;
17 #if defined(NETSNMP_TRANSPORT_UDPIPV6_DOMAIN) || \
18 defined(NETSNMP_TRANSPORT_TCPIPV6_DOMAIN)
19 struct sockaddr_in6 sin6;
20 #endif
21 } a;
22 char iface[16];
23 };
24
25 /**
26 * SNMP endpoint with the network name in ASCII format.
27 * @param addr Network address or host name as an ASCII string.
28 * @param iface Network interface, e.g. "lo".
29 * @param port Port number. "" means that no port number has been specified. "0"
30 * means "bind to any port".
31 */
32 struct netsnmp_ep_str {
33 char *addr;
34 char iface[16];
35 char port[6];
36 };
37
38 struct netsnmp_transport_s;
39
40 int netsnmp_parse_ep_str(struct netsnmp_ep_str *ep_str, const char *endpoint);
41 int netsnmp_bindtodevice(int fd, const char *iface);
42 int netsnmp_ipbase_session_init(struct netsnmp_transport_s *transport,
43 struct snmp_session *sess);
44
45 #endif /* _SNMPIPBASEDOMAIN_H_ */