summaryrefslogtreecommitdiff
path: root/include/net-snmp/data_access/udp_endpoint.h
blob: 36231eec4b13382781abaf0e84526b07bceba952 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*
 * udp_endpoint data access header
 *
 * $Id$
 */
#ifndef NETSNMP_ACCESS_UDP_ENDPOINT_H
#define NETSNMP_ACCESS_UDP_ENDPOINT_H

#ifndef NETSNMP_ACCESS_IPADDRESS_BUF_SIZE
#   error "include <net-snmp/data_access/ipaddress.h> before this file"
#endif

#ifdef __cplusplus
extern          "C" {
#endif

/**---------------------------------------------------------------------*/
/*
 * structure definitions
 */

/*
 * netsnmp_udp_endpoint_entry
 *   - primary udp_endpoint structure for both ipv4 & ipv6
 */
    typedef struct netsnmp_udp_endpoint_s {

        netsnmp_index oid_index;   /* MUST BE FIRST!! for container use */
        oid           index; /* sl */

        int       flags; /* for net-snmp use */

        u_char    loc_addr[NETSNMP_ACCESS_IPADDRESS_BUF_SIZE];
        u_char    rmt_addr[NETSNMP_ACCESS_IPADDRESS_BUF_SIZE];

        u_char    loc_addr_len;/* address len, 4 | 16 */
        u_char    rmt_addr_len;/* address len, 4 | 16 */
        u_char    state; /* not in the mib, but what the heck */

        u_short   loc_port;
        u_short   rmt_port;

        u_int     instance;
        u_int     pid;
   
    } netsnmp_udp_endpoint_entry;


/**---------------------------------------------------------------------*/
/*
 * ACCESS function prototypes
 */
/*
 * ifcontainer init
 */
    netsnmp_container *
    netsnmp_access_udp_endpoint_container_init(u_int init_flags);
#define NETSNMP_ACCESS_UDP_ENDPOINT_INIT_NOFLAGS               0x0000

/*
 * ifcontainer load and free
 */
    netsnmp_container*
    netsnmp_access_udp_endpoint_container_load(netsnmp_container* c,
                                          u_int load_flags);
#define NETSNMP_ACCESS_UDP_ENDPOINT_LOAD_NOFLAGS               0x0000

    void netsnmp_access_udp_endpoint_container_free(netsnmp_container *c,
                                               u_int free_flags);
#define NETSNMP_ACCESS_UDP_ENDPOINT_FREE_NOFLAGS               0x0000
#define NETSNMP_ACCESS_UDP_ENDPOINT_FREE_DONT_CLEAR            0x0001
#define NETSNMP_ACCESS_UDP_ENDPOINT_FREE_KEEP_CONTAINER        0x0002


/*
 * create/free a udp_endpoint entry
 */
    netsnmp_udp_endpoint_entry *
    netsnmp_access_udp_endpoint_entry_create(void);

    void netsnmp_access_udp_endpoint_entry_free(netsnmp_udp_endpoint_entry *e);

/*
 * update/compare
 */

/*
 * find entry in container
 */
/** not yet */



/**---------------------------------------------------------------------*/

# ifdef __cplusplus
}
#endif

#endif /* NETSNMP_ACCESS_UDP_ENDPOINT_H */