- SIOCBRDGIFS"structifbifconf *"
-
Retrieve member interface list from a bridge.
This request takes an
ifbifconf
structure (see below) as a value-result parameter.
The
ifbic_len
field should be initially set to the size of the buffer
pointed to by
ifbic_buf.
On return it will contain the length, in bytes, of the configuration
list.
Alternatively, if the
ifbic_len
passed in is set to 0,
SIOCBRDGIFS
will set
ifbic_len
to the size that
ifbic_buf
needs to be to fit the entire configuration list,
and will not fill in the other parameters.
This is useful for determining the exact size that
ifbic_buf
needs to be in advance.
The argument structure is defined as follows:
struct ifbreq {
char ifbr_name[IFNAMSIZ]; /* bridge ifs name */
char ifbr_ifsname[IFNAMSIZ];/* member ifs name */
u_int32_t ifbr_ifsflags; /* member ifs flags */
u_int8_t ifbr_state; /* member stp state */
u_int8_t ifbr_priority; /* member stp priority */
u_int8_t ifbr_portno; /* member port number */
u_int32_t ifbr_path_cost; /* member stp path cost */
};
/* ifbr_ifsflags flags about interfaces */
#define IFBIF_LEARNING 0x0001 /* ifs can learn */
#define IFBIF_DISCOVER 0x0002 /* sends packets w/unknown dst */
#define IFBIF_BLOCKNONIP 0x0004 /* ifs blocks non-IP/ARP in/out */
#define IFBIF_STP 0x0008 /* participate in spanning tree*/
#define IFBIF_SPAN 0x0100 /* ifs is a span port (ro) */
#define IFBIF_RO_MASK 0xff00 /* read only bits */
struct ifbifconf {
char ifbic_name[IFNAMSIZ]; /* bridge ifs name */
u_int32_t ifbic_len; /* buffer size */
union {
caddr_t ifbicu_buf;
struct ifbreq *ifbicu_req;
} ifbic_ifbicu;
#define ifbic_buf ifbic_ifbicu.ifbicu_buf
#define ifbic_req ifbic_ifbicu.ifbicu_req
};
- SIOCBRDGADD"structifbreq *"
-
Add the interface named in
ifbr_ifsname
to the bridge named in
ifbr_name.
- SIOCBRDGDEL"structifbreq *"
-
Delete the interface named in
ifbr_ifsname
from the bridge named in
ifbr_name.
- SIOCBRDGADDS"structifbreq *"
-
Add the interface named in
ifbr_ifsname
as a span port to the bridge named in
ifbr_name.
- SIOCBRDGDELS"structifbreq *"
-
Delete the interface named in
ifbr_ifsname
from the list of span ports of the bridge named in
ifbr_name.
- SIOCBRDGSIFFLGS"structifbreq *"
-
Set the bridge member interface flags for the interface named in
ifbr_ifsname
attached to the bridge
ifbr_name.
If the flag
IFBIF_LEARNING
is set on an interface, source addresses from frames received on the
interface are recorded in the address cache.
If the flag
IFBIF_DISCOVER
is set, the interface will receive packets destined for unknown
destinations, otherwise a frame that has a destination not found
in the address cache is not forwarded to this interface.
The default for newly added interfaces has both flags set.
If the flag
IFBIF_BLOCKNONIP
is set, packets that are one of
ip(4),
ip6(4),
arp(4),
or
Reverse ARP will not be bridged from and to the interface.
- SIOCBRDGGIFFLGS"structifbreq *"
-
Retrieve the bridge member interface flags for the interface named in
ifbr_ifsname
attached to the bridge
ifbr_name.
- SIOCBRDGRTS"structifbaconf *"
-
Retrieve the address cache of the bridge named in
ifbac_name.
This request takes an
ifbaconf
structure (see below) as a value-result parameter.
The
ifbac_len
field should be initially set to the size of the buffer pointed to by
ifbac_buf.
On return, it will contain the length, in bytes, of the configuration list.
Alternatively, if the
ifbac_len
passed in is set to 0,
SIOCBRDGRTS
will set it to the size that
ifbac_buf
needs to be to fit the entire configuration list, and will not fill in the other
parameters.
As with
SIOCBRDGIFS,
this is useful for determining the exact size that
ifbac_buf
needs to be in advance.
The argument structure is defined as follows:
struct ifbareq {
char ifba_name[IFNAMSIZ]; /* bridge name */
char ifba_ifsname[IFNAMSIZ];/* destination ifs */
u_int8_t ifba_age; /* address age */
u_int8_t ifba_flags; /* address flags */
struct ether_addr ifba_dst; /* destination addr */
};
#define IFBAF_TYPEMASK 0x03 /* address type mask */
#define IFBAF_DYNAMIC 0x00 /* dynamically learned */
#define IFBAF_STATIC 0x01 /* static address */
struct ifbaconf {
char ifbac_name[IFNAMSIZ]; /* bridge ifs name */
u_int32_t ifbac_len; /* buffer size */
union {
caddr_t ifbacu_buf; /* buffer */
struct ifbareq *ifbacu_req; /* request pointer */
} ifbac_ifbacu;
#define ifbac_buf ifbac_ifbacu.ifbacu_buf
#define ifbac_req ifbac_ifbacu.ifbacu_req
};
Address cache entries with the type set to
IFBAF_DYNAMIC
in
ifba_flags
are entries learned by the bridge.
Entries with the type set to
IFBAF_STATIC
are manually added entries.
- SIOCBRDGSADDR"structifbareq *"
-
Add an entry, manually, to the address cache for the bridge named in
ifba_name.
The address and its associated interface and flags are set in the
ifba_dst,
ifba_ifsname,
and
ifba_flags
fields, respectively.
- SIOCBRDGDADDR"structifbareq *"
-
Delete an entry from the address cache of the bridge named in
ifba_name.
Entries are deleted strictly based on the address field
ifba_dst.
- SIOCBRDGFLUSH"structifbreq *"
-
Flush addresses from the cache.
ifbr_name
contains the name of the bridge device, and
ifbr_ifsflags
should be set to
IFBF_FLUSHALL
to flush all addresses from the cache or
IFBF_FLUSHDYN
to flush only the dynamically learned addresses from the cache.
- SIOCBRDGSCACHE"structifbrparam *"
-
Set the maximum address cache size for the bridge named in
ifbrp_name
to
ifbrp_csize
entries.
The argument structure is as follows:
struct ifbrparam {
char ifbrp_name[IFNAMSIZ];
union {
u_int32_t ifbrpu_csize; /* cache size */
int ifbrpu_ctime; /* cache time */
u_int16_t ifbrpu_prio; /* bridge priority */
u_int8_t ifbrpu_hellotime; /* hello time */
u_int8_t ifbrpu_fwddelay; /* fwd delay */
u_int8_t ifbrpu_maxage; /* max age */
} ifbrp_ifbrpu;
};
#define ifbrp_csize ifbrp_ifbrpu.ifbrpu_csize
#define ifbrp_ctime ifbrp_ifbrpu.ifbrpu_ctime
#define ifbrp_prio ifbrp_ifbrpu.ifbrpu_prio
#define ifbrp_hellotime ifbrp_ifbrpu.ifbrpu_hellotime
#define ifbrp_fwddelay ifbrp_ifbrpu.ifbrpu_fwddelay
#define ifbrp_maxage ifbrp_ifbrpu.ifbrpu_maxage
Note that the
ifbrp_ctime, ifbrp_hellotime , ifbrp_fwddelay
and
ifbrp_maxage
fields are in seconds.
- SIOCBRDGGCACHE"structifbrparam *"
-
Retrieve the maximum size of the address cache for the bridge
ifbrp_name.
- SIOCBRDGSTO"structifbrparam *"
-
Set the time, in seconds, for how long addresses which have not been
seen on the network (i.e., have not transmitted a packet) will remain in
the cache to the value
ifbrp_ctime.
If the time is set to zero, no aging is performed on the address cache.
- SIOCBRDGGTO"structifbrparam *"
-
Retrieve the address cache expiration time (see above).
- SIOCBRDGARL"structifbrlreq *"
-
Add an Ethernet address filtering rule to the bridge on a specific interface.
ifbr_name
contains the name of the bridge device, and
ifbr_ifsname
contains the name of the bridge member interface.
Rules are applied in the order in which they were added to the bridge,
and the first matching rule's action parameter determines the fate of
the packet.
The
ifbr_action
field is one of
BRL_ACTION_PASS
or
BRL_ACTION_BLOCK,
to pass or block matching frames, respectively.
The
ifbr_flags
field specifies whether the rule should match on input, output, or both
by using the flags
BRL_FLAG_IN
and
BRL_FLAG_OUT.
At least one of these flags must be set.
The
ifbr_flags
field
also specifies whether either (or both) of the source and destination
addresses should be matched by using the
BRL_FLAG_SRCVALID
and
BRL_FLAG_DSTVALID
flags.
The
ifbr_src
field is the source address that triggers the rule (only considered if
ifbr_flags
has the
BRL_FLAG_SRCVALID
bit set).
The
ifbr_src
field is the destination address that triggers the rule (only considered if
ifbr_flags
has the
BRL_FLAG_DSTVALID
bit set).
If neither bit is set, the rule matches all frames.
The argument structure is as follows:
struct ifbrlreq {
char ifbr_name[IFNAMSIZ]; /* bridge ifs name */
char ifbr_ifsname[IFNAMSIZ]; /* member ifs name */
u_int8_t ifbr_action; /* disposition */
u_int8_t ifbr_flags; /* flags */
struct ether_addr ifbr_src; /* source mac */
struct ether_addr ifbr_dst; /* destination mac */
char ifbr_tagname[PF_TAG_NAME_SIZE]; /* pf tagname */
};
#define BRL_ACTION_BLOCK 0x01 /* block frame */
#define BRL_ACTION_PASS 0x02 /* pass frame */
#define BRL_FLAG_IN 0x08 /* input rule */
#define BRL_FLAG_OUT 0x04 /* output rule */
#define BRL_FLAG_SRCVALID 0x02 /* src valid */
#define BRL_FLAG_DSTVALID 0x01 /* dst valid */
- SIOCBRDGFRL"structifbrlreq *"
-
Remove all filtering rules from a bridge interface member.
ifbr_name
contains the name of the bridge device, and
ifbr_ifsname
contains the name of the bridge member interface.
- SIOCBRDGGRL"structifbrlconf *"
-
Retrieve all of the rules from the bridge,
ifbrl_name,
for the member interface,
ifbrl_ifsname.
This request takes an
ifbrlconf
structure (see below) as a value-result parameter.
The
ifbrl_len
field should be initially set to the size of the buffer pointed to by
ifbrl_buf.
On return, it will contain the length, in bytes, of the configuration list.
Alternatively, if the
ifbrl_len
passed in is set to 0,
SIOCBRDGGRL
will set it to the size that
ifbrl_buf
needs to be to fit the entire configuration list, and will not fill in the other
parameters.
As with
SIOCBRDGIFS,
this is useful for determining the exact size that
ifbrl_buf
needs to be in advance.
The argument structure is defined as follows:
struct ifbrlconf {
char ifbrl_name[IFNAMSIZ]; /* bridge ifs name */
char ifbrl_ifsname[IFNAMSIZ]; /* member ifs name */
u_int32_t ifbrl_len; /* buffer size */
union {
caddr_t ifbrlu_buf;
struct ifbrlreq *ifbrlu_req;
} ifbrl_ifbrlu;
#define ifbrl_buf ifbrl_ifbrlu.ifbrlu_buf
#define ifbrl_req ifbrl_ifbrlu.ifbrlu_req
};
- SIOCBRDGGPRI"structifbrparam *"
-
Retrieve the Spanning Tree Protocol (STP) priority parameter of the bridge into
the
ifbrp_prio
field.
- SIOCBRDGSPRI"structifbrparam *"
-
Set the STP priority parameter of the bridge to the value in
ifbrp_prio.
- SIOCBRDGGHT"structifbrparam *"
-
Retrieve the STP hello time parameter, in seconds, of the bridge into the
ifbrp_hellotime
field.
- SIOCBRDGSHT"structifbrparam *"
-
Set the STP hello time parameter, in seconds, of the bridge to the value in
ifbrp_hellotime.
The value in
ifbrp_hellotime
cannot be zero.
- SIOCBRDGGFD"structifbrparam *"
-
Retrieve the STP forward delay parameter, in seconds, of the bridge into the
ifbrp_fwddelay
field.
- SIOCBRDGSFD"structifbrparam *"
-
Set the STP forward delay parameter, in seconds, of the bridge to the value in
ifbrp_fwddelay.
The value in
ifbrp_fwddelay
cannot be zero.
- SIOCBRDGGMA"structifbrparam *"
-
Retrieve the STP maximum age parameter, in seconds, of the bridge into the
ifbrp_maxage
field.
- SIOCBRDGSMA"structifbrparam *"
-
Set the STP maximum age parameter, in seconds, of the bridge to the value in
ifbrp_maxage.
The value in
ifbrp_maxage
cannot be zero.
- SIOCBRDGSIFPRIO"structifbreq *"
-
Set the STP priority parameter of the interface named in
ifbr_ifsname
to the value in
ifbr_priority.
- SIOCBRDGSIFCOST"structifbreq *"
-
Set the STP cost parameter of the interface named in
ifbr_ifsname
to the value in
ifbr_path_cost.
The value in
ifbr_path_cost
must be greater than or equal to one.