4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _BRIDGED_GLOBAL_H
28 #define _BRIDGED_GLOBAL_H
31 * Globally visible symbols within the "bridged" bridging daemon
34 #include <sys/types.h>
35 #include <sys/ethernet.h>
36 #include <net/bridge.h>
39 #include <libdlbridge.h>
49 boolean_t phys_status
; /* physical layer status */
50 boolean_t admin_status
; /* administrative status */
51 boolean_t kern_added
; /* set when added to kernel bridge */
52 boolean_t stp_added
; /* set when added to STP machine */
53 boolean_t referenced
; /* used for refresh */
54 boolean_t sdu_failed
; /* set for non-matching max SDU */
55 boolean_t admin_non_stp
; /* copy of STP library config */
56 boolean_t bpdu_protect
; /* BPDU seen when non-STP */
59 dlpi_notifyid_t notifyid
;
62 uchar_t mac_addr
[ETHERADDRL
];
65 /* Number of reserved (internal) fdarray entries */
69 extern int lock_engine(void);
70 extern void unlock_engine(void);
71 extern ssize_t
strioctl(int, int, void *, size_t);
72 extern struct portdata
*find_by_linkid(datalink_id_t
);
73 extern void get_dladm_speed(struct portdata
*);
74 extern void enable_forwarding(struct portdata
*);
75 extern boolean_t debugging
;
76 extern uint32_t tablemax
;
77 extern const char *instance_name
;
78 extern dladm_handle_t dlhandle
;
79 extern boolean_t shutting_down
;
80 extern struct pollfd
*fdarray
;
83 extern void init_door(void);
86 extern boolean_t
port_dlpi_open(const char *, struct portdata
*,
90 extern void rstp_init(void);
91 extern void rstp_refresh(void);
92 extern void rstp_change_mac(struct portdata
*, const unsigned char *);
93 extern boolean_t
rstp_add_port(struct portdata
*);
96 extern void open_bridge_control(void);
97 extern void event_loop(void);
98 extern int refresh_count
;
99 extern dladm_bridge_prot_t protect
;
100 extern uint_t nextport
;
101 extern struct portdata
**allports
;
102 extern int control_fd
;
108 #endif /* _BRIDGED_GLOBAL_H */