snmpUDPIPv4BaseDomain.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* UDPIPV4 base transport support functions
  2. *
  3. * Portions of this file are copyrighted by:
  4. * Copyright (c) 2016 VMware, Inc. All rights reserved.
  5. * Use is subject to license terms specified in the COPYING file
  6. * distributed with the Net-SNMP package.
  7. */
  8. #ifndef SNMPUDPIPV4BASE_H
  9. #define SNMPUDPIPV4BASE_H
  10. #ifdef HAVE_SYS_SOCKET_H
  11. #include <sys/socket.h>
  12. #endif
  13. #ifdef HAVE_NETINET_IN_H
  14. #include <netinet/in.h>
  15. #endif
  16. config_require(UDPBase);
  17. config_require(IPv4Base);
  18. #include <net-snmp/library/snmpIPv4BaseDomain.h>
  19. #include <net-snmp/library/snmpUDPBaseDomain.h>
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. /*
  24. * Prototypes
  25. */
  26. netsnmp_transport *
  27. netsnmp_udpipv4base_transport(const struct netsnmp_ep *ep, int local);
  28. netsnmp_transport *
  29. netsnmp_udpipv4base_transport_with_source(const struct netsnmp_ep *ep,
  30. int local,
  31. const struct netsnmp_ep *src_addr);
  32. netsnmp_transport *
  33. netsnmp_udpipv4base_tspec_transport(netsnmp_tdomain_spec *tspec);
  34. /** internal functions for derivatives of udpipv4base */
  35. netsnmp_transport *
  36. netsnmp_udpipv4base_transport_init(const struct netsnmp_ep *ep,
  37. int local);
  38. int
  39. netsnmp_udpipv4base_transport_socket(int flags);
  40. int
  41. netsnmp_udpipv4base_transport_bind(netsnmp_transport *t,
  42. const struct netsnmp_ep *ep,
  43. int flags);
  44. void
  45. netsnmp_udpipv4base_transport_get_bound_addr(netsnmp_transport *t);
  46. #if defined(HAVE_IP_PKTINFO) || defined(HAVE_IP_RECVDSTADDR)
  47. int netsnmp_udpipv4_recvfrom(int s, void *buf, int len,
  48. struct sockaddr *from, socklen_t *fromlen,
  49. struct sockaddr *dstip, socklen_t *dstlen,
  50. int *if_index);
  51. int netsnmp_udpipv4_sendto(int fd, const struct in_addr *srcip,
  52. int if_index, const struct sockaddr *remote,
  53. const void *data, int len);
  54. #endif
  55. #ifdef __cplusplus
  56. }
  57. #endif
  58. #endif /* SNMPUDPIPV4BASE_H */