ieee8023ad_lacp.h (168561) | ieee8023ad_lacp.h (168793) |
---|---|
1/* $NetBSD: ieee8023ad_impl.h,v 1.2 2005/12/10 23:21:39 elad Exp $ */ 2 3/*- 4 * Copyright (c)2005 YAMAMOTO Takashi, 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * | 1/* $NetBSD: ieee8023ad_impl.h,v 1.2 2005/12/10 23:21:39 elad Exp $ */ 2 3/*- 4 * Copyright (c)2005 YAMAMOTO Takashi, 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/sys/net/ieee8023ad_lacp.h 168561 2007-04-10 00:27:25Z thompsa $ | 28 * $FreeBSD: head/sys/net/ieee8023ad_lacp.h 168793 2007-04-17 00:35:11Z thompsa $ |
29 */ 30 31/* 32 * IEEE802.3ad LACP 33 * 34 * implementation details. 35 */ 36 --- 135 unchanged lines hidden (view full) --- 172 LACP_MUX_COLLECTING, 173 LACP_MUX_DISTRIBUTING, 174}; 175 176struct lacp_port { 177 TAILQ_ENTRY(lacp_port) lp_dist_q; 178 LIST_ENTRY(lacp_port) lp_next; 179 struct lacp_softc *lp_lsc; | 29 */ 30 31/* 32 * IEEE802.3ad LACP 33 * 34 * implementation details. 35 */ 36 --- 135 unchanged lines hidden (view full) --- 172 LACP_MUX_COLLECTING, 173 LACP_MUX_DISTRIBUTING, 174}; 175 176struct lacp_port { 177 TAILQ_ENTRY(lacp_port) lp_dist_q; 178 LIST_ENTRY(lacp_port) lp_next; 179 struct lacp_softc *lp_lsc; |
180 struct trunk_port *lp_trunk; | 180 struct lagg_port *lp_lagg; |
181 struct ifnet *lp_ifp; 182 struct lacp_peerinfo lp_partner; 183 struct lacp_peerinfo lp_actor; 184#define lp_state lp_actor.lip_state 185#define lp_key lp_actor.lip_key 186 struct timeval lp_last_lacpdu; 187 int lp_lacpdu_sent; 188 enum lacp_mux_state lp_mux_state; --- 11 unchanged lines hidden (view full) --- 200 int la_nports; /* num of distributing ports */ 201 TAILQ_HEAD(, lacp_port) la_ports; /* distributing ports */ 202 struct lacp_peerinfo la_partner; 203 struct lacp_peerinfo la_actor; 204 int la_pending; /* number of ports which is waiting wait_while */ 205}; 206 207struct lacp_softc { | 181 struct ifnet *lp_ifp; 182 struct lacp_peerinfo lp_partner; 183 struct lacp_peerinfo lp_actor; 184#define lp_state lp_actor.lip_state 185#define lp_key lp_actor.lip_key 186 struct timeval lp_last_lacpdu; 187 int lp_lacpdu_sent; 188 enum lacp_mux_state lp_mux_state; --- 11 unchanged lines hidden (view full) --- 200 int la_nports; /* num of distributing ports */ 201 TAILQ_HEAD(, lacp_port) la_ports; /* distributing ports */ 202 struct lacp_peerinfo la_partner; 203 struct lacp_peerinfo la_actor; 204 int la_pending; /* number of ports which is waiting wait_while */ 205}; 206 207struct lacp_softc { |
208 struct trunk_softc *lsc_trunk; | 208 struct lagg_softc *lsc_lagg; |
209 struct lacp_aggregator *lsc_active_aggregator; 210 TAILQ_HEAD(, lacp_aggregator) lsc_aggregators; 211 boolean_t lsc_suppress_distributing; 212 struct callout lsc_transit_callout; 213 struct callout lsc_callout; 214 LIST_HEAD(, lacp_port) lsc_ports; 215 u_int32_t lsc_hashkey; 216}; --- 36 unchanged lines hidden (view full) --- 253} __packed; 254 255#define MARKER_TYPE_INFO 1 256#define MARKER_TYPE_RESPONSE 2 257 258#define LACP_STATE_EQ(s1, s2, mask) \ 259 ((((s1) ^ (s2)) & (mask)) == 0) 260 | 209 struct lacp_aggregator *lsc_active_aggregator; 210 TAILQ_HEAD(, lacp_aggregator) lsc_aggregators; 211 boolean_t lsc_suppress_distributing; 212 struct callout lsc_transit_callout; 213 struct callout lsc_callout; 214 LIST_HEAD(, lacp_port) lsc_ports; 215 u_int32_t lsc_hashkey; 216}; --- 36 unchanged lines hidden (view full) --- 253} __packed; 254 255#define MARKER_TYPE_INFO 1 256#define MARKER_TYPE_RESPONSE 2 257 258#define LACP_STATE_EQ(s1, s2, mask) \ 259 ((((s1) ^ (s2)) & (mask)) == 0) 260 |
261#define LACP_PORT(_tp) ((struct lacp_port *)(_tp)->tp_psc) 262#define LACP_SOFTC(_tr) ((struct lacp_softc *)(_tr)->tr_psc) | 261#define LACP_PORT(_lp) ((struct lacp_port *)(_lp)->lp_psc) 262#define LACP_SOFTC(_sc) ((struct lacp_softc *)(_sc)->sc_psc) |
263 | 263 |
264int lacp_input(struct trunk_port *, struct mbuf *); 265int lacp_marker_input(struct trunk_port *, struct mbuf *); 266struct trunk_port *lacp_select_tx_port(struct trunk_softc *, struct mbuf *); 267int lacp_attach(struct trunk_softc *); 268int lacp_detach(struct trunk_softc *); 269void lacp_init(struct trunk_softc *); 270void lacp_stop(struct trunk_softc *); 271int lacp_port_create(struct trunk_port *); 272void lacp_port_destroy(struct trunk_port *); 273void lacp_linkstate(struct trunk_port *); 274int lacp_port_isactive(struct trunk_port *); | 264int lacp_input(struct lagg_port *, struct mbuf *); 265int lacp_marker_input(struct lagg_port *, struct mbuf *); 266struct lagg_port *lacp_select_tx_port(struct lagg_softc *, struct mbuf *); 267int lacp_attach(struct lagg_softc *); 268int lacp_detach(struct lagg_softc *); 269void lacp_init(struct lagg_softc *); 270void lacp_stop(struct lagg_softc *); 271int lacp_port_create(struct lagg_port *); 272void lacp_port_destroy(struct lagg_port *); 273void lacp_linkstate(struct lagg_port *); 274int lacp_port_isactive(struct lagg_port *); |
275 276/* following constants don't include terminating NUL */ 277#define LACP_MACSTR_MAX (2*6 + 5) 278#define LACP_SYSTEMPRIOSTR_MAX (4) 279#define LACP_SYSTEMIDSTR_MAX (LACP_SYSTEMPRIOSTR_MAX + 1 + LACP_MACSTR_MAX) 280#define LACP_PORTPRIOSTR_MAX (4) 281#define LACP_PORTNOSTR_MAX (4) 282#define LACP_PORTIDSTR_MAX (LACP_PORTPRIOSTR_MAX + 1 + LACP_PORTNOSTR_MAX) 283#define LACP_KEYSTR_MAX (4) 284#define LACP_PARTNERSTR_MAX \ 285 (1 + LACP_SYSTEMIDSTR_MAX + 1 + LACP_KEYSTR_MAX + 1 \ 286 + LACP_PORTIDSTR_MAX + 1) 287#define LACP_LAGIDSTR_MAX \ 288 (1 + LACP_PARTNERSTR_MAX + 1 + LACP_PARTNERSTR_MAX + 1) 289#define LACP_STATESTR_MAX (255) /* XXX */ | 275 276/* following constants don't include terminating NUL */ 277#define LACP_MACSTR_MAX (2*6 + 5) 278#define LACP_SYSTEMPRIOSTR_MAX (4) 279#define LACP_SYSTEMIDSTR_MAX (LACP_SYSTEMPRIOSTR_MAX + 1 + LACP_MACSTR_MAX) 280#define LACP_PORTPRIOSTR_MAX (4) 281#define LACP_PORTNOSTR_MAX (4) 282#define LACP_PORTIDSTR_MAX (LACP_PORTPRIOSTR_MAX + 1 + LACP_PORTNOSTR_MAX) 283#define LACP_KEYSTR_MAX (4) 284#define LACP_PARTNERSTR_MAX \ 285 (1 + LACP_SYSTEMIDSTR_MAX + 1 + LACP_KEYSTR_MAX + 1 \ 286 + LACP_PORTIDSTR_MAX + 1) 287#define LACP_LAGIDSTR_MAX \ 288 (1 + LACP_PARTNERSTR_MAX + 1 + LACP_PARTNERSTR_MAX + 1) 289#define LACP_STATESTR_MAX (255) /* XXX */ |