1*10491SRishi.Srivatsavai@Sun.COM /* 2*10491SRishi.Srivatsavai@Sun.COM * CDDL HEADER START 3*10491SRishi.Srivatsavai@Sun.COM * 4*10491SRishi.Srivatsavai@Sun.COM * The contents of this file are subject to the terms of the 5*10491SRishi.Srivatsavai@Sun.COM * Common Development and Distribution License (the "License"). 6*10491SRishi.Srivatsavai@Sun.COM * You may not use this file except in compliance with the License. 7*10491SRishi.Srivatsavai@Sun.COM * 8*10491SRishi.Srivatsavai@Sun.COM * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*10491SRishi.Srivatsavai@Sun.COM * or http://www.opensolaris.org/os/licensing. 10*10491SRishi.Srivatsavai@Sun.COM * See the License for the specific language governing permissions 11*10491SRishi.Srivatsavai@Sun.COM * and limitations under the License. 12*10491SRishi.Srivatsavai@Sun.COM * 13*10491SRishi.Srivatsavai@Sun.COM * When distributing Covered Code, include this CDDL HEADER in each 14*10491SRishi.Srivatsavai@Sun.COM * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*10491SRishi.Srivatsavai@Sun.COM * If applicable, add the following below this CDDL HEADER, with the 16*10491SRishi.Srivatsavai@Sun.COM * fields enclosed by brackets "[]" replaced with your own identifying 17*10491SRishi.Srivatsavai@Sun.COM * information: Portions Copyright [yyyy] [name of copyright owner] 18*10491SRishi.Srivatsavai@Sun.COM * 19*10491SRishi.Srivatsavai@Sun.COM * CDDL HEADER END 20*10491SRishi.Srivatsavai@Sun.COM */ 21*10491SRishi.Srivatsavai@Sun.COM 22*10491SRishi.Srivatsavai@Sun.COM /* 23*10491SRishi.Srivatsavai@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 24*10491SRishi.Srivatsavai@Sun.COM * Use is subject to license terms. 25*10491SRishi.Srivatsavai@Sun.COM */ 26*10491SRishi.Srivatsavai@Sun.COM 27*10491SRishi.Srivatsavai@Sun.COM #ifndef _NET_BRIDGE_H 28*10491SRishi.Srivatsavai@Sun.COM #define _NET_BRIDGE_H 29*10491SRishi.Srivatsavai@Sun.COM 30*10491SRishi.Srivatsavai@Sun.COM /* 31*10491SRishi.Srivatsavai@Sun.COM * Private communication interface between bridging related daemons and kernel 32*10491SRishi.Srivatsavai@Sun.COM * layer-two (Ethernet) bridging module. 33*10491SRishi.Srivatsavai@Sun.COM */ 34*10491SRishi.Srivatsavai@Sun.COM 35*10491SRishi.Srivatsavai@Sun.COM #include <sys/param.h> 36*10491SRishi.Srivatsavai@Sun.COM #include <sys/dld.h> 37*10491SRishi.Srivatsavai@Sun.COM #include <sys/dld_ioc.h> 38*10491SRishi.Srivatsavai@Sun.COM #include <sys/ethernet.h> 39*10491SRishi.Srivatsavai@Sun.COM 40*10491SRishi.Srivatsavai@Sun.COM #ifdef __cplusplus 41*10491SRishi.Srivatsavai@Sun.COM extern "C" { 42*10491SRishi.Srivatsavai@Sun.COM #endif 43*10491SRishi.Srivatsavai@Sun.COM 44*10491SRishi.Srivatsavai@Sun.COM /* Specified by IEEE 802.1d */ 45*10491SRishi.Srivatsavai@Sun.COM #define BRIDGE_GROUP_ADDRESS { 0x01, 0x80, 0xC2, 0, 0, 0 } 46*10491SRishi.Srivatsavai@Sun.COM 47*10491SRishi.Srivatsavai@Sun.COM /* The constant below is "BRG" in hex. */ 48*10491SRishi.Srivatsavai@Sun.COM #define _BRIOC(n) (0x42524700 + (n)) 49*10491SRishi.Srivatsavai@Sun.COM 50*10491SRishi.Srivatsavai@Sun.COM #define BRIOC_NEWBRIDGE _BRIOC(1) /* Create bridge; bridge_newbridge_t */ 51*10491SRishi.Srivatsavai@Sun.COM #define BRIOC_ADDLINK _BRIOC(2) /* Add link to bridge; linkid+name */ 52*10491SRishi.Srivatsavai@Sun.COM #define BRIOC_REMLINK _BRIOC(3) /* Remove link from bridge; linkid */ 53*10491SRishi.Srivatsavai@Sun.COM #define BRIOC_SETSTATE _BRIOC(4) /* bridge_setstate_t */ 54*10491SRishi.Srivatsavai@Sun.COM #define BRIOC_SETPVID _BRIOC(5) /* bridge_setpvid_t */ 55*10491SRishi.Srivatsavai@Sun.COM #define BRIOC_VLANENAB _BRIOC(6) /* bridge_vlanenab_t */ 56*10491SRishi.Srivatsavai@Sun.COM #define BRIOC_FLUSHFWD _BRIOC(7) /* bridge_flushfwd_t */ 57*10491SRishi.Srivatsavai@Sun.COM #define BRIOC_LISTFWD _BRIOC(8) /* bridge_listfwd_t */ 58*10491SRishi.Srivatsavai@Sun.COM #define BRIOC_TABLEMAX _BRIOC(8) /* uint32_t */ 59*10491SRishi.Srivatsavai@Sun.COM 60*10491SRishi.Srivatsavai@Sun.COM #define BRIDGE_CTL "bridgectl" 61*10491SRishi.Srivatsavai@Sun.COM #define BRIDGE_CTLPATH "/dev/" BRIDGE_CTL 62*10491SRishi.Srivatsavai@Sun.COM 63*10491SRishi.Srivatsavai@Sun.COM typedef struct bridge_newbridge_s { 64*10491SRishi.Srivatsavai@Sun.COM datalink_id_t bnb_linkid; /* bridge link ID */ 65*10491SRishi.Srivatsavai@Sun.COM char bnb_name[MAXNAMELEN]; /* bridge name */ 66*10491SRishi.Srivatsavai@Sun.COM } bridge_newbridge_t; 67*10491SRishi.Srivatsavai@Sun.COM 68*10491SRishi.Srivatsavai@Sun.COM typedef enum bridge_state_e { 69*10491SRishi.Srivatsavai@Sun.COM BLS_BLOCKLISTEN, /* blocking or listening state */ 70*10491SRishi.Srivatsavai@Sun.COM BLS_LEARNING, /* learning state */ 71*10491SRishi.Srivatsavai@Sun.COM BLS_FORWARDING /* forwarding state */ 72*10491SRishi.Srivatsavai@Sun.COM } bridge_state_t; 73*10491SRishi.Srivatsavai@Sun.COM 74*10491SRishi.Srivatsavai@Sun.COM typedef struct bridge_setstate_s { 75*10491SRishi.Srivatsavai@Sun.COM datalink_id_t bss_linkid; 76*10491SRishi.Srivatsavai@Sun.COM bridge_state_t bss_state; 77*10491SRishi.Srivatsavai@Sun.COM } bridge_setstate_t; 78*10491SRishi.Srivatsavai@Sun.COM 79*10491SRishi.Srivatsavai@Sun.COM typedef struct bridge_setpvid_s { 80*10491SRishi.Srivatsavai@Sun.COM datalink_id_t bsv_linkid; 81*10491SRishi.Srivatsavai@Sun.COM uint_t bsv_vlan; 82*10491SRishi.Srivatsavai@Sun.COM } bridge_setpvid_t; 83*10491SRishi.Srivatsavai@Sun.COM 84*10491SRishi.Srivatsavai@Sun.COM typedef struct bridge_vlanenab_s { 85*10491SRishi.Srivatsavai@Sun.COM datalink_id_t bve_linkid; 86*10491SRishi.Srivatsavai@Sun.COM uint_t bve_vlan; 87*10491SRishi.Srivatsavai@Sun.COM boolean_t bve_onoff; 88*10491SRishi.Srivatsavai@Sun.COM } bridge_vlanenab_t; 89*10491SRishi.Srivatsavai@Sun.COM 90*10491SRishi.Srivatsavai@Sun.COM typedef struct bridge_flushfwd_s { 91*10491SRishi.Srivatsavai@Sun.COM datalink_id_t bff_linkid; 92*10491SRishi.Srivatsavai@Sun.COM boolean_t bff_exclude; 93*10491SRishi.Srivatsavai@Sun.COM } bridge_flushfwd_t; 94*10491SRishi.Srivatsavai@Sun.COM 95*10491SRishi.Srivatsavai@Sun.COM typedef struct bridge_listfwd_s { 96*10491SRishi.Srivatsavai@Sun.COM char blf_name[MAXNAMELEN]; /* bridge name */ 97*10491SRishi.Srivatsavai@Sun.COM ether_addr_t blf_dest; 98*10491SRishi.Srivatsavai@Sun.COM uint16_t blf_trill_nick; 99*10491SRishi.Srivatsavai@Sun.COM uint_t blf_ms_age; 100*10491SRishi.Srivatsavai@Sun.COM boolean_t blf_is_local; 101*10491SRishi.Srivatsavai@Sun.COM datalink_id_t blf_linkid; 102*10491SRishi.Srivatsavai@Sun.COM } bridge_listfwd_t; 103*10491SRishi.Srivatsavai@Sun.COM 104*10491SRishi.Srivatsavai@Sun.COM /* Upward control messages */ 105*10491SRishi.Srivatsavai@Sun.COM typedef struct bridge_ctl_s { 106*10491SRishi.Srivatsavai@Sun.COM datalink_id_t bc_linkid; 107*10491SRishi.Srivatsavai@Sun.COM boolean_t bc_failed; /* Max SDU mismatch */ 108*10491SRishi.Srivatsavai@Sun.COM } bridge_ctl_t; 109*10491SRishi.Srivatsavai@Sun.COM 110*10491SRishi.Srivatsavai@Sun.COM /* GLDv3 control ioctls used by Bridging */ 111*10491SRishi.Srivatsavai@Sun.COM #define BRIDGE_IOC_LISTFWD BRIDGEIOC(1) 112*10491SRishi.Srivatsavai@Sun.COM 113*10491SRishi.Srivatsavai@Sun.COM #ifdef __cplusplus 114*10491SRishi.Srivatsavai@Sun.COM } 115*10491SRishi.Srivatsavai@Sun.COM #endif 116*10491SRishi.Srivatsavai@Sun.COM 117*10491SRishi.Srivatsavai@Sun.COM #endif /* _NET_BRIDGE_H */ 118