Deleted Added
full compact
if_lagg.h (232008) if_lagg.h (232629)
1/* $OpenBSD: if_trunk.h,v 1.11 2007/01/31 06:20:19 reyk Exp $ */
2
3/*
4 * Copyright (c) 2005, 2006 Reyk Floeter <reyk@openbsd.org>
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 *
1/* $OpenBSD: if_trunk.h,v 1.11 2007/01/31 06:20:19 reyk Exp $ */
2
3/*
4 * Copyright (c) 2005, 2006 Reyk Floeter <reyk@openbsd.org>
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 *
18 * $FreeBSD: head/sys/net/if_lagg.h 232008 2012-02-22 22:01:30Z thompsa $
18 * $FreeBSD: head/sys/net/if_lagg.h 232629 2012-03-06 22:58:13Z thompsa $
19 */
20
21#ifndef _NET_LAGG_H
22#define _NET_LAGG_H
23
24#include <sys/sysctl.h>
25
26/*
27 * Global definitions
28 */
29
30#define LAGG_MAX_PORTS 32 /* logically */
31#define LAGG_MAX_NAMESIZE 32 /* name of a protocol */
32#define LAGG_MAX_STACKING 4 /* maximum number of stacked laggs */
33
19 */
20
21#ifndef _NET_LAGG_H
22#define _NET_LAGG_H
23
24#include <sys/sysctl.h>
25
26/*
27 * Global definitions
28 */
29
30#define LAGG_MAX_PORTS 32 /* logically */
31#define LAGG_MAX_NAMESIZE 32 /* name of a protocol */
32#define LAGG_MAX_STACKING 4 /* maximum number of stacked laggs */
33
34/* Lagg flags */
35#define LAGG_F_HASHL2 0x00000001 /* hash layer 2 */
36#define LAGG_F_HASHL3 0x00000002 /* hash layer 3 */
37#define LAGG_F_HASHL4 0x00000004 /* hash layer 4 */
38#define LAGG_F_HASHMASK 0x00000007
39
34/* Port flags */
35#define LAGG_PORT_SLAVE 0x00000000 /* normal enslaved port */
36#define LAGG_PORT_MASTER 0x00000001 /* primary port */
37#define LAGG_PORT_STACK 0x00000002 /* stacked lagg port */
38#define LAGG_PORT_ACTIVE 0x00000004 /* port is active */
39#define LAGG_PORT_COLLECTING 0x00000008 /* port is receiving frames */
40#define LAGG_PORT_DISTRIBUTING 0x00000010 /* port is sending frames */
41#define LAGG_PORT_DISABLED 0x00000020 /* port is disabled */

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

117 struct lacp_opreq rpsc_lacp;
118 } ra_psc;
119#define ra_lacpreq ra_psc.rpsc_lacp
120};
121
122#define SIOCGLAGG _IOWR('i', 143, struct lagg_reqall)
123#define SIOCSLAGG _IOW('i', 144, struct lagg_reqall)
124
40/* Port flags */
41#define LAGG_PORT_SLAVE 0x00000000 /* normal enslaved port */
42#define LAGG_PORT_MASTER 0x00000001 /* primary port */
43#define LAGG_PORT_STACK 0x00000002 /* stacked lagg port */
44#define LAGG_PORT_ACTIVE 0x00000004 /* port is active */
45#define LAGG_PORT_COLLECTING 0x00000008 /* port is receiving frames */
46#define LAGG_PORT_DISTRIBUTING 0x00000010 /* port is sending frames */
47#define LAGG_PORT_DISABLED 0x00000020 /* port is disabled */

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

123 struct lacp_opreq rpsc_lacp;
124 } ra_psc;
125#define ra_lacpreq ra_psc.rpsc_lacp
126};
127
128#define SIOCGLAGG _IOWR('i', 143, struct lagg_reqall)
129#define SIOCSLAGG _IOW('i', 144, struct lagg_reqall)
130
131struct lagg_reqflags {
132 char rf_ifname[IFNAMSIZ]; /* name of the lagg */
133 uint32_t rf_flags; /* lagg protocol */
134};
135
136#define SIOCGLAGGFLAGS _IOWR('i', 145, struct lagg_reqflags)
137#define SIOCSLAGGHASH _IOW('i', 146, struct lagg_reqflags)
138
125#ifdef _KERNEL
126/*
127 * Internal kernel part
128 */
129
130#define lp_ifname lp_ifp->if_xname /* interface name */
131#define lp_link_state lp_ifp->if_link_state /* link state */
132

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

174 struct ifnet *sc_ifp; /* virtual interface */
175 struct rwlock sc_mtx;
176 int sc_proto; /* lagg protocol */
177 u_int sc_count; /* number of ports */
178 struct lagg_port *sc_primary; /* primary port */
179 struct ifmedia sc_media; /* media config */
180 caddr_t sc_psc; /* protocol data */
181 uint32_t sc_seq; /* sequence counter */
139#ifdef _KERNEL
140/*
141 * Internal kernel part
142 */
143
144#define lp_ifname lp_ifp->if_xname /* interface name */
145#define lp_link_state lp_ifp->if_link_state /* link state */
146

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

188 struct ifnet *sc_ifp; /* virtual interface */
189 struct rwlock sc_mtx;
190 int sc_proto; /* lagg protocol */
191 u_int sc_count; /* number of ports */
192 struct lagg_port *sc_primary; /* primary port */
193 struct ifmedia sc_media; /* media config */
194 caddr_t sc_psc; /* protocol data */
195 uint32_t sc_seq; /* sequence counter */
196 uint32_t sc_flags;
182
183 SLIST_HEAD(__tplhd, lagg_port) sc_ports; /* list of interfaces */
184 SLIST_ENTRY(lagg_softc) sc_entries;
185
186 struct task sc_lladdr_task;
187 SLIST_HEAD(__llqhd, lagg_llq) sc_llq_head; /* interfaces to program
188 the lladdr on */
189

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

239#define LAGG_WUNLOCK(_sc) rw_wunlock(&(_sc)->sc_mtx)
240#define LAGG_RLOCK_ASSERT(_sc) rw_assert(&(_sc)->sc_mtx, RA_RLOCKED)
241#define LAGG_WLOCK_ASSERT(_sc) rw_assert(&(_sc)->sc_mtx, RA_WLOCKED)
242
243extern struct mbuf *(*lagg_input_p)(struct ifnet *, struct mbuf *);
244extern void (*lagg_linkstate_p)(struct ifnet *, int );
245
246int lagg_enqueue(struct ifnet *, struct mbuf *);
197
198 SLIST_HEAD(__tplhd, lagg_port) sc_ports; /* list of interfaces */
199 SLIST_ENTRY(lagg_softc) sc_entries;
200
201 struct task sc_lladdr_task;
202 SLIST_HEAD(__llqhd, lagg_llq) sc_llq_head; /* interfaces to program
203 the lladdr on */
204

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

254#define LAGG_WUNLOCK(_sc) rw_wunlock(&(_sc)->sc_mtx)
255#define LAGG_RLOCK_ASSERT(_sc) rw_assert(&(_sc)->sc_mtx, RA_RLOCKED)
256#define LAGG_WLOCK_ASSERT(_sc) rw_assert(&(_sc)->sc_mtx, RA_WLOCKED)
257
258extern struct mbuf *(*lagg_input_p)(struct ifnet *, struct mbuf *);
259extern void (*lagg_linkstate_p)(struct ifnet *, int );
260
261int lagg_enqueue(struct ifnet *, struct mbuf *);
247uint32_t lagg_hashmbuf(struct mbuf *, uint32_t);
262uint32_t lagg_hashmbuf(struct lagg_softc *, struct mbuf *, uint32_t);
248
249#endif /* _KERNEL */
250
251#endif /* _NET_LAGG_H */
263
264#endif /* _KERNEL */
265
266#endif /* _NET_LAGG_H */