📄 openbsd-manpages-bridge.html
字号:
struct ifbcachereq {
char ifbc_name[IFNAMSIZ]; /* bridge */
u_int32_t ifbc_size; /* size */
};
SIOCBRDGGCACHE (struct ifbcachereq) Retrieve the maximum size of the
address cache for the bridge ifbc_name.
SIOCBRDGSTO (struct ifbcachetoreq) Set the time, in seconds, that
addresses which have not been seen on the network
(transmitted a packet) remain in the cache. If the time
is set to zero, no aging is performed on the address
cache. The argument structure is as follows:
struct ifbcachetoreq {
char ifbct_name[IFNAMSIZ]; /* bridge */
u_int32_t ifbct_time; /* time */
};
SIOCBRDGGTO (struct ifbcachetoreq) Retrieve the address cache expi-
ration time (see above).
SIOCBRDGFLUSH (struct ifbreq) 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.
SIOCBRDGARL (struct ifbrlreq) Add an Ethernet address filtering rule
to the bridge on a specific interface. ifbr_name con-
tains the name of the bridge device, and ifbr_ifsname
contains the name of the bridge member interface. The
ifbr_action field is one of BRL_ACTION_PASS or
BRL_ACTION_BLOCK, to pass or block matching frames re-
spectively. The ifbr_flags specifies whether the rule
should match on input, output, or both be using the
flags BRL_FLAG_IN and BRL_FLAG_OUT. It 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 consid-
ered if ifbr_flags has the BRL_FLAG_DSTVALID bit set).
The argument structure is as follows:
struct ifbrlreq {
char ifbr_name[IFNAMSIZ];
char ifbr_ifsname[IFNAMSIZ];
u_int8_t ifbr_action;
u_int8_t ifbr_flags;
struct ether_addr ifbr_src;
struct ether_addr ifbr_dst;
char ifbr_tagname[PF_TAG_NAME_SIZE];
};
#define BRL_ACTION_BLOCK 0x01
#define BRL_ACTION_PASS 0x02
#define BRL_FLAG_IN 0x08
#define BRL_FLAG_OUT 0x04
SIOCBRDGFRL (struct ifbrlreq) 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 (struct ifbrlconf) Retrieve all of the rules from the
bridge, ifbrl_name, for the member interface,
ifbrl_ifsname. This request takes an ifbrlconf struc-
ture (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 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]; /* brdg nam */
char ifbrl_ifsname[IFNAMSIZ];/* ifs name */
u_int32_t ifbr_len; /* buf len */
union {
caddr_t ifbrlu_buf;
struct ifbrlreq *ifbrlu_req;
} ifrl_ifbrlu;
#define ifbrl_buf ifbrl_ifbrlu.ifbrlu_buf
#define ifbrl_req ifbrl_ifbrlu.ifbrlu_req
};
SIOCBRDGARL (struct ifbrlreq) Add a filtering rule to the bridge
named in ifbr_name on the interface named in
ifbr_ifsname. The argument structure is as follows:
struct ifbrlreq {
char ifbr_name[IFNAMSIZ]; /* bridge */
char ifbr_ifsname[IFNAMSIZ]; /* ifs */
u_int8_t ifbr_action; /* handling */
u_int8_t ifbr_flags; /* flags */
struct ether_addr ifbr_src; /* src mac */
struct ether_addr ifbr_dst; /* dst mac */
};
#define BRL_ACTION_BLOCK 0x01
#define BRL_ACTION_PASS 0x02
#define BRL_FLAG_IN 0x08
#define BRL_FLAG_OUT 0x04
#define BRL_FLAG_SRCVALID 0x02
#define BRL_FLAG_DSTVALID 0x01
Rules are applied in the order in which they were added
to the bridge, and the first matching rule's action pa-
rameter determines the fate of the packet. The
ifbr_action parameter specifies whether a frame matching
the rule is to be blocked or passed.
If the BRL_FLAG_IN bit is set in ifbr_flags, then the
rule applies to frames received by the interface. If
the BRL_FLAG_OUT bit is set, then the rule applies to
frame transmitted by the interface. At least one of
BRL_FLAG_IN or BRL_FLAG_OUT must be set.
The source Ethernet address in ifbr_src is checked if
the BRL_FLAG_SRCVALID bit is set in ifbr_flags. The
destination address in ifbr_dst is checked if the
BRL_FLAG_DSTVALID bit is set. If neither bit is set,
the rule matches all frames.
SIOCBRDGFRL (struct ifbrlreq) Flush rules from the bridge ifbr_name
on the interface ifbr_ifsname.
SIOCBRDGGRL (struct ifbrlconf) Retrieve an array of rules from the
bridge for a particular interface. This request takes
an ifbrlconf structure (see below) as a value-result pa-
rameter. The ifbrl_len field should be initially set to
the size of the buffer pointed to by ifbrl_buf. On re-
turn it will contain the length, in bytes, of the rule
list. Alternatively, if the ifbrl_len passed in is set
to 0, SIOCBRDGGRL will set ifbrl_len to the size that
ifbrl_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 ifbrl_buf
needs to be in advance.
The argument structure is as follows:
struct ifbrlconf {
char ifbrl_name[IFNAMSIZ]; /* bridge */
char ifbrl_ifsname[IFNAMSIZ];/* member */
u_int32_t ifbrl_len; /* buflen */
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
};
ERRORS
If the ioctl call fails, errno is set to one of the following values:
[ENOENT] For an add request, this means that the named interface is
not configured into the system. For a delete operation, it
means that the named interface is not a member of the
bridge. For an address cache deletion, the address was not
found in the table.
[ENOMEM] Memory could not be allocated for an interface or cache en-
try to be added to the bridge.
[EEXIST] The named interface is already a member of the bridge.
[EBUSY] The named interface is already a member of another bridge.
[EINVAL] The named interface is not an Ethernet interface or an in-
valid ioctl was performed on the bridge.
[ENETDOWN] Address cache operation (flush, add, delete) on a bridge
that is in the down state.
[ESRCH] No such member interface in the bridge.
SEE ALSO
<A
HREF="openbsd-manpages-netintro.html"
>netintro</A
>, <A
HREF="openbsd-manpages-stp.html"
>spanning-tree</A
>
AUTHORS
The bridge kernel interface was written by Jason L. Wright
<jason@thought.net> as part of an undergraduate independent study at
the University of North Carolina at Greensboro. </PRE
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="openbsd-manpages-netintro.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ecos-ref.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="openbsd-manpages-stp.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>OpenBSD networking facilities</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="tcpip-openbsd-tcpip-apis.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Spanning Tree Protocol</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -