trill.h revision 4eaa471005973e11a6110b69fe990530b3b95a38
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _NET_TRILL_H
#define _NET_TRILL_H
#include <sys/ethernet.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Various well-known Ethernet addresses used by TRILL */
#define TRILL_PROTOCOL_VERS 0 /* th_version */
/* Nickname range */
#define RBRIDGE_NICKNAME_MIN 0x0000
#define RBRIDGE_NICKNAME_MAX 0xFFFF
/* Define well-known nicknames */
#define RBRIDGE_NICKNAME_MINRES 0xFFC0
/* AF_TRILL IOCTL codes */
typedef struct trill_header {
#ifdef _BIT_FIELDS_HTOL
#else
#endif
#ifdef _BIT_FIELDS_HTOL
#else
#endif
#define TRILL_HDR_ALIGN (sizeof (uint16_t))
do { \
} while (0)
#define GET_TRILL_OPTS_LEN(hdr_p) \
/* RBridge nick and tree information (*variable* size) */
typedef struct trill_nickinfo_s {
/* Nickname of the RBridge */
/* Next-hop SNPA address to reach this RBridge */
/* Link on our system to use to reach next-hop */
/* Num of *our* adjacencies on a tree rooted at this RBridge */
/* Num of distribution tree root nicks chosen by this RBridge */
/*
* Variable size bytes to store adjacency nicks, distribution
* tree roots and VLAN filter lists. Adjacency nicks and
* distribution tree roots are 16-bit fields.
*
* Number of VLAN filter lists is equal to tni_adjcount as
* the VLAN filter list is one per adjacency in each DT.
* VLAN filter list is a 512 byte bitmap with the set of VLANs
* that are reachable downstream via the adjacency.
*/
typedef struct trill_listnick_s {
/* Access the adjacency nick list at the end of trill_nickinfo_t */
#define TNI_ADJNICK(v, n) (TNI_ADJNICKSPTR(v)[(n)])
/* Access the DT root nick list in trill_nickinfo_t after adjacency nicks */
#define TNI_DTROOTNICK(v, n) (TNI_DTROOTNICKSPTR(v)[(n)])
/* Access the VLAN filter list in trill_nickinfo_t after DT Roots */
#define TNI_VLANFILTERMAP(v, n) \
#define TNI_TOTALSIZE(v) (sizeof (trill_nickinfo_t) + \
(sizeof (uint16_t) * (v)->tni_adjcount) + \
(sizeof (uint16_t) * (v)->tni_dtrootcount) + \
/*
* This is a special value used in the sockaddr_dl "selector" field to denote
* that the packet represents a Bridging PDU. The core STP instance is not
* defined on a VLAN, so this overload is safe. All other selector values are
* used for TRILL IS-IS PDUs to indicate VLAN ID.
*/
#define TRILL_TCI_BPDU 0xFFFF
#ifdef __cplusplus
}
#endif
#endif /* _NET_TRILL_H */