Deleted Added
full compact
hostres_network_tbl.c (154133) hostres_network_tbl.c (160341)
1/*-
2 * Copyright (c) 2005-2006 The FreeBSD Project
3 * All rights reserved.
4 *
5 * Author: Victor Cruceru <soc-victor@freebsd.org>
6 *
7 * Redistribution of this software and documentation and use in source and
8 * binary forms, with or without modification, are permitted provided that

--- 12 unchanged lines hidden (view full) ---

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
1/*-
2 * Copyright (c) 2005-2006 The FreeBSD Project
3 * All rights reserved.
4 *
5 * Author: Victor Cruceru <soc-victor@freebsd.org>
6 *
7 * Redistribution of this software and documentation and use in source and
8 * binary forms, with or without modification, are permitted provided that

--- 12 unchanged lines hidden (view full) ---

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $FreeBSD: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_network_tbl.c 154133 2006-01-09 12:33:45Z harti $
29 * $FreeBSD: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_network_tbl.c 160341 2006-07-14 09:07:56Z harti $
30 */
31
32/*
33 * Host Resources MIB implementation for SNMPd: instrumentation for
34 * hrNetworkTable
35 */
36
37#include <sys/types.h>

--- 24 unchanged lines hidden (view full) ---

62/*
63 * This structure is used to hold a SNMP table entry
64 * for HOST-RESOURCES-MIB's hrNetworkTable
65 */
66struct network_entry {
67 int32_t index;
68 int32_t ifIndex;
69 TAILQ_ENTRY(network_entry) link;
30 */
31
32/*
33 * Host Resources MIB implementation for SNMPd: instrumentation for
34 * hrNetworkTable
35 */
36
37#include <sys/types.h>

--- 24 unchanged lines hidden (view full) ---

62/*
63 * This structure is used to hold a SNMP table entry
64 * for HOST-RESOURCES-MIB's hrNetworkTable
65 */
66struct network_entry {
67 int32_t index;
68 int32_t ifIndex;
69 TAILQ_ENTRY(network_entry) link;
70#define HR_NETWORK_FOUND 0x001
70#define HR_NETWORK_FOUND 0x001
71 uint32_t flags;
72
73};
74TAILQ_HEAD(network_tbl, network_entry);
75
76/* the head of the list with hrNetworkTable's entries */
77static struct network_tbl network_tbl = TAILQ_HEAD_INITIALIZER(network_tbl);
78

--- 88 unchanged lines hidden (view full) ---

167
168 if ((dev = device_find_by_name(dname)) == NULL) {
169 HRDBG("%s not in hrDeviceTable", dname);
170 free(dname);
171 continue;
172 }
173 HRDBG("%s found in hrDeviceTable", dname);
174
71 uint32_t flags;
72
73};
74TAILQ_HEAD(network_tbl, network_entry);
75
76/* the head of the list with hrNetworkTable's entries */
77static struct network_tbl network_tbl = TAILQ_HEAD_INITIALIZER(network_tbl);
78

--- 88 unchanged lines hidden (view full) ---

167
168 if ((dev = device_find_by_name(dname)) == NULL) {
169 HRDBG("%s not in hrDeviceTable", dname);
170 free(dname);
171 continue;
172 }
173 HRDBG("%s found in hrDeviceTable", dname);
174
175 dev->type = OIDX_hrDeviceNetwork_c;
175 dev->type = &OIDX_hrDeviceNetwork_c;
176 dev->flags |= HR_DEVICE_IMMUTABLE;
177
178 free(dname);
179
180 /* Then check hrNetworkTable for this device */
181 TAILQ_FOREACH(net, &network_tbl, link)
182 if (net->index == dev->index)
183 break;

--- 119 unchanged lines hidden ---
176 dev->flags |= HR_DEVICE_IMMUTABLE;
177
178 free(dname);
179
180 /* Then check hrNetworkTable for this device */
181 TAILQ_FOREACH(net, &network_tbl, link)
182 if (net->index == dev->index)
183 break;

--- 119 unchanged lines hidden ---