udp_endpoint.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. * udp_endpoint data access header
  3. *
  4. * $Id$
  5. */
  6. #ifndef NETSNMP_ACCESS_UDP_ENDPOINT_H
  7. #define NETSNMP_ACCESS_UDP_ENDPOINT_H
  8. #ifndef NETSNMP_ACCESS_IPADDRESS_BUF_SIZE
  9. # error "include <net-snmp/data_access/ipaddress.h> before this file"
  10. #endif
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. /**---------------------------------------------------------------------*/
  15. /*
  16. * structure definitions
  17. */
  18. /*
  19. * netsnmp_udp_endpoint_entry
  20. * - primary udp_endpoint structure for both ipv4 & ipv6
  21. */
  22. typedef struct netsnmp_udp_endpoint_s {
  23. netsnmp_index oid_index; /* MUST BE FIRST!! for container use */
  24. oid index; /* sl */
  25. int flags; /* for net-snmp use */
  26. u_char loc_addr[NETSNMP_ACCESS_IPADDRESS_BUF_SIZE];
  27. u_char rmt_addr[NETSNMP_ACCESS_IPADDRESS_BUF_SIZE];
  28. u_char loc_addr_len;/* address len, 4 | 16 */
  29. u_char rmt_addr_len;/* address len, 4 | 16 */
  30. u_char state; /* not in the mib, but what the heck */
  31. u_short loc_port;
  32. u_short rmt_port;
  33. u_int instance;
  34. u_int pid;
  35. } netsnmp_udp_endpoint_entry;
  36. /**---------------------------------------------------------------------*/
  37. /*
  38. * ACCESS function prototypes
  39. */
  40. /*
  41. * ifcontainer init
  42. */
  43. netsnmp_container *
  44. netsnmp_access_udp_endpoint_container_init(u_int init_flags);
  45. #define NETSNMP_ACCESS_UDP_ENDPOINT_INIT_NOFLAGS 0x0000
  46. /*
  47. * ifcontainer load and free
  48. */
  49. netsnmp_container*
  50. netsnmp_access_udp_endpoint_container_load(netsnmp_container* c,
  51. u_int load_flags);
  52. #define NETSNMP_ACCESS_UDP_ENDPOINT_LOAD_NOFLAGS 0x0000
  53. void netsnmp_access_udp_endpoint_container_free(netsnmp_container *c,
  54. u_int free_flags);
  55. #define NETSNMP_ACCESS_UDP_ENDPOINT_FREE_NOFLAGS 0x0000
  56. #define NETSNMP_ACCESS_UDP_ENDPOINT_FREE_DONT_CLEAR 0x0001
  57. #define NETSNMP_ACCESS_UDP_ENDPOINT_FREE_KEEP_CONTAINER 0x0002
  58. /*
  59. * create/free a udp_endpoint entry
  60. */
  61. netsnmp_udp_endpoint_entry *
  62. netsnmp_access_udp_endpoint_entry_create(void);
  63. void netsnmp_access_udp_endpoint_entry_free(netsnmp_udp_endpoint_entry *e);
  64. /*
  65. * update/compare
  66. */
  67. /*
  68. * find entry in container
  69. */
  70. /** not yet */
  71. /**---------------------------------------------------------------------*/
  72. # ifdef __cplusplus
  73. }
  74. #endif
  75. #endif /* NETSNMP_ACCESS_UDP_ENDPOINT_H */