Deleted Added
full compact
bridge_port.c (171791) bridge_port.c (228990)
1/*-
2 * Copyright (c) 2006 Shteryana Shopova <syrinx@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * Bridge MIB implementation for SNMPd.
27 * Bridge ports.
28 *
1/*-
2 * Copyright (c) 2006 Shteryana Shopova <syrinx@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * Bridge MIB implementation for SNMPd.
27 * Bridge ports.
28 *
29 * $FreeBSD: head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c 171791 2007-08-08 19:27:50Z syrinx $
29 * $FreeBSD: head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c 228990 2011-12-30 10:58:14Z uqs $
30 */
31
32#include <sys/queue.h>
33#include <sys/socket.h>
34#include <sys/types.h>
35
36#include <net/ethernet.h>
37#include <net/if.h>

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

82 free(bif->f_bp);
83 bif->f_bp = bp;
84 }
85}
86
87/*
88 * Insert a port entry in the base port TAILQ starting to search
89 * for its place from the position of the first bridge port for the bridge
30 */
31
32#include <sys/queue.h>
33#include <sys/socket.h>
34#include <sys/types.h>
35
36#include <net/ethernet.h>
37#include <net/if.h>

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

82 free(bif->f_bp);
83 bif->f_bp = bp;
84 }
85}
86
87/*
88 * Insert a port entry in the base port TAILQ starting to search
89 * for its place from the position of the first bridge port for the bridge
90 * interface. Update the first bridge port if neccessary.
90 * interface. Update the first bridge port if necessary.
91 */
92static void
93bridge_port_insert_at(struct bridge_ports *headp,
94 struct bridge_port *bp, struct bridge_port **f_bp)
95{
96 struct bridge_port *t1;
97
98 assert(f_bp != NULL);

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

114 */
115 if (t1 == NULL)
116 TAILQ_INSERT_TAIL(headp, bp, b_p);
117 else
118 TAILQ_INSERT_BEFORE(t1, bp, b_p);
119}
120
121/*
91 */
92static void
93bridge_port_insert_at(struct bridge_ports *headp,
94 struct bridge_port *bp, struct bridge_port **f_bp)
95{
96 struct bridge_port *t1;
97
98 assert(f_bp != NULL);

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

114 */
115 if (t1 == NULL)
116 TAILQ_INSERT_TAIL(headp, bp, b_p);
117 else
118 TAILQ_INSERT_BEFORE(t1, bp, b_p);
119}
120
121/*
122 * Find a port entry's possition in the ports list according
122 * Find a port entry's position in the ports list according
123 * to it's parent bridge interface name. Returns a NULL if
124 * we should be at the TAILQ head, otherwise the entry after
125 * which we should be inserted.
126 */
127static struct bridge_port *
128bridge_port_find_pos(struct bridge_ports *headp, uint32_t b_idx)
129{
130 uint32_t t_idx;

--- 1383 unchanged lines hidden ---
123 * to it's parent bridge interface name. Returns a NULL if
124 * we should be at the TAILQ head, otherwise the entry after
125 * which we should be inserted.
126 */
127static struct bridge_port *
128bridge_port_find_pos(struct bridge_ports *headp, uint32_t b_idx)
129{
130 uint32_t t_idx;

--- 1383 unchanged lines hidden ---