2
* UDP-MIB endpoint architecture support
4
* $Id: udp_endpoint_common.c,v 1.2 2005/12/11 17:55:01 rstory Exp $
6
#include <net-snmp/net-snmp-config.h>
7
#include <net-snmp/net-snmp-includes.h>
8
#include "udp-mib/udpEndpointTable/udpEndpointTable_constants.h"
10
#include <net-snmp/agent/net-snmp-agent-includes.h>
11
#include <net-snmp/data_access/ipaddress.h>
12
#include <net-snmp/data_access/udp_endpoint.h>
14
#include "udp_endpoint_private.h"
16
/**---------------------------------------------------------------------*/
22
/**---------------------------------------------------------------------*/
28
netsnmp_access_udp_endpoint_init(void)
32
/**---------------------------------------------------------------------*/
37
* initialize udp_endpoint container
40
netsnmp_access_udp_endpoint_container_init(u_int flags)
42
netsnmp_container *container;
44
DEBUGMSGTL(("access:udp_endpoint:container", "init\n"));
47
* create the containers.
49
container = netsnmp_container_find("access_udp_endpoint:table_container");
50
if (NULL == container)
57
* load udp_endpoint information in specified container
59
* @param container empty container, or NULL to have one created for you
60
* @param load_flags flags to modify behaviour.
63
* @retval !NULL pointer to container
66
netsnmp_access_udp_endpoint_container_load(netsnmp_container* container,
71
DEBUGMSGTL(("access:udp_endpoint:container", "load\n"));
73
if (NULL == container)
74
container = netsnmp_access_udp_endpoint_container_init(0);
75
if (NULL == container) {
77
"no container specified/found for access_udp_endpoint\n");
82
netsnmp_arch_udp_endpoint_container_load(container, load_flags);
84
netsnmp_access_udp_endpoint_container_free(container, 0);
92
netsnmp_access_udp_endpoint_container_free(netsnmp_container *container,
95
DEBUGMSGTL(("access:udp_endpoint:container", "free\n"));
97
if (NULL == container) {
99
"invalid container for netsnmp_access_udp_endpoint_free\n");
103
if(! (free_flags & NETSNMP_ACCESS_UDP_ENDPOINT_FREE_DONT_CLEAR)) {
107
CONTAINER_CLEAR(container,
108
(netsnmp_container_obj_func*)free,
112
if(! (free_flags & NETSNMP_ACCESS_UDP_ENDPOINT_FREE_KEEP_CONTAINER))
113
CONTAINER_FREE(container);
116
/**---------------------------------------------------------------------*/
122
netsnmp_udp_endpoint_entry *
123
netsnmp_access_udp_endpoint_entry_create(void)
125
netsnmp_udp_endpoint_entry *entry =
126
SNMP_MALLOC_TYPEDEF(netsnmp_udp_endpoint_entry);
128
DEBUGMSGTL(("access:udp_endpoint:entry", "create\n"));
133
entry->oid_index.len = 1;
134
entry->oid_index.oids = (oid *) & entry->index;
142
netsnmp_access_udp_endpoint_entry_free(netsnmp_udp_endpoint_entry * entry)
144
DEBUGMSGTL(("access:udp_endpoint:entry", "free\n"));
150
* SNMP_FREE not needed, for any of these,
151
* since the whole entry is about to be freed
158
/**---------------------------------------------------------------------*/
167
_entry_release(netsnmp_udp_endpoint_entry * entry, void *context)
169
netsnmp_access_udp_endpoint_entry_free(entry);
172
/**---------------------------------------------------------------------*/