diff options
-rw-r--r-- | share/man/man4/bridge.4 | 17 | ||||
-rw-r--r-- | share/man/man4/switch.4 | 203 |
2 files changed, 217 insertions, 3 deletions
diff --git a/share/man/man4/bridge.4 b/share/man/man4/bridge.4 index c3938ba5d66..e724ba18528 100644 --- a/share/man/man4/bridge.4 +++ b/share/man/man4/bridge.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: bridge.4,v 1.73 2016/06/07 20:25:48 sthen Exp $ +.\" $OpenBSD: bridge.4,v 1.74 2016/09/04 16:06:47 yasuoka Exp $ .\" .\" Copyright (c) 1999-2001 Jason L. Wright (jason@thought.net) .\" All rights reserved. @@ -24,7 +24,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: June 7 2016 $ +.Dd $Mdocdate: September 4 2016 $ .Dt BRIDGE 4 .Os .Sh NAME @@ -148,6 +148,11 @@ calls are specific to devices. They are defined in .In sys/sockio.h . +Some of +.Xr ioctl 2 +calls are used by +.Xr switch 4 +as well. .Bl -tag -width Ds .It Dv SIOCBRDGIFS Fa "struct ifbifconf *" Retrieve member interface list from a bridge. @@ -184,7 +189,7 @@ struct ifbreq { 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_portno; /* member port number */ u_int32_t ifbr_path_cost; /* member stp path cost */ }; @@ -357,6 +362,8 @@ struct ifbrparam { u_int8_t ifbrpu_hellotime; /* hello time */ u_int8_t ifbrpu_fwddelay; /* fwd delay */ u_int8_t ifbrpu_maxage; /* max age */ + u_int64_t ifbrpu_datapath; /* datapath-id */ + u_int32_t ifbrpu_maxgroup; /* group size */ } ifbrp_ifbrpu; }; #define ifbrp_csize ifbrp_ifbrpu.ifbrpu_csize @@ -365,6 +372,9 @@ struct ifbrparam { #define ifbrp_hellotime ifbrp_ifbrpu.ifbrpu_hellotime #define ifbrp_fwddelay ifbrp_ifbrpu.ifbrpu_fwddelay #define ifbrp_maxage ifbrp_ifbrpu.ifbrpu_maxage +#define ifbrp_datapath ifbrp_ifbrpu.ifbrpu_datapath +#define ifbrp_maxflow ifbrp_ifbrpu.ifbrpu_csize +#define ifbrp_maxgroup ifbrp_ifbrpu.ifbrpu_maxgroup .Ed .Pp Note that the @@ -657,6 +667,7 @@ and certificates, to impersonate the protected host(s)). .Xr ipsec 4 , .Xr netintro 4 , .Xr pf 4 , +.Xr switch 4 , .Xr vether 4 , .Xr hostname.if 5 , .Xr ifconfig 8 , diff --git a/share/man/man4/switch.4 b/share/man/man4/switch.4 new file mode 100644 index 00000000000..9d07db9cd37 --- /dev/null +++ b/share/man/man4/switch.4 @@ -0,0 +1,203 @@ +.\" $OpenBSD: switch.4,v 1.1 2016/09/04 16:06:47 yasuoka Exp $ +.\" +.\" Copyright (c) 2016 YASUOKA Masahiko <yasuoka@openbsd.org> +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: September 4 2016 $ +.Dt SWITCH 4 +.Os +.Sh NAME +.Nm switch +.Nd Network switch pseudo device +.Sh SYNOPSIS +.Cd "pseudo-device switch" +.Pp +.In sys/types.h +.In net/if.h +.In netinet/in.h +.In netinet/if_ether.h +.In net/if_bridge.h +.Sh DESCRIPTION +The +.Nm +driver provides a network interface pseudo-device. +The interface is the forwarding part of a network switch, +and it works along with a controller which usually is +.Xr switchd 8 +or +.Xr switchctl 8 through the device +.Pa /dev/switchN . +As the protocol between the +.Nm +device +and the controller, +OpenFlow 1.3 is supported. +.Pp +A +.Nm +interface is created using the +.Ic ifconfig switch Ns Ar N Ic create +or by opening the character device +.Pa /dev/switchN . +.Pp +.Pa /dev/switchN +is the OpenFlow channel of the interface +.Pa switchN . +It is used for exchanging OpenFlow messages. +The device grantees +.Xr read 2 +returns a complete OpenFlow message, it never return a message partially. +The program which uses the +.Pa /dev/switchN +must write(2) per a complete OpenFlow message. +.Sh IOCTLS +A +.Nm +interface responds to all of the +.Xr ioctl 2 +calls specific to other interfaces listed in +.Xr netintro 4 . +.Pp +The following +.Xr ioctl 2 +calls are used commonly by +.Nm +and +.Xr bridge 4 . +.Pp +.Bl -bullet -offset indent -compact +.It +.Dv SIOCBRDGIFS +.It +.Dv SIOCBRDGADD +.It +.Dv SIOCBRDGDEL +.It +.Dv SIOCBRDGGIFFLGS +.It +.Dv SIOCBRDGSIFFLGS +.El +.Pp +Also the parameter structures are used commonly by +.Nm +and +.Xr bridge 4 . +.Pp +The following +.Xr ioctl +calls are +specific for +.Nm +interface. +They are defined in +.In sys/sockio.h . +.Bl -tag -width Ds +.It Dv SIOCBRDGADDL Fa "struct ifbreq *" +Add the interface named in +.Va ifbr_ifsname +to the switch named in +.Va ifbr_name +as a local port which connects the local system's network stacks. +Only one +.Xr vether 4 +interface can be added as a local port. +.It Dv SIOCSWGDPID +Retrieve the datapath_id in OpenFlow protocol of the switch named in +.Va ifbrp_name +into +.Va ifbrpu_datapath +field. +.It Dv SIOCSWSDPID Fa "struct ifbrparam" +Set the datapath_id in OpenFlow protocol of the switch named in +.Va ifbrp_name +to the value in +.Va ifbrpu_datapath +field. +.It Dv SIOCSWGFLOWMAX Fa "struct ifbrparam" +Retrieve the maximum number of flows in OpenFlow protocol of the switch named in +.Va ifbrp_name +into +.Va ifbrp_maxflow +field. +.It Dv SIOCSWSFLOWMAX Fa "struct ifbrparam" +Set the maximum number of flows in OpenFlow protocol of the switch named in +.Va ifbrp_name +to the value in +.Va ifbrpu_maxflow +field. +.It Dv SIOCSWGMAXGROUP Fa "struct ifbrparam" +Retrieve the maximum number of groups in OpenFlow protocol of the switch named +in +.Va ifbrp_name +into +.Va ifbrpu_maxgroup +field. +.It Dv SIOCSWSMAXGROUP Fa "struct ifbrparam" +Set the maximum number of groups in OpenFlow protocol of the switch named in +.Va ifbrp_name +to the value in +.Va ifbrpu_maxgroup +field. +.It Dv SIOCSWSPORTNO Fa "struct ifbreq" +Set the port_no in OpenFlow protocol of the port named in +.Va ifbr_ifsname +of the switch named in +.Va ifbr_name +to +.Va ifbr_portno +field. +.El +.Sh FILES +.Bl -tag -width /dev/switch* -compact +.It Pa /dev/switch* +.El +.Sh ERRORS +If open fails, +.Xr errno 2 +may be set to one of: +.Bl -tag -width Er +.It Bq Er ENXIO +Could not create the interface. +.It Bq Er EBUSY +The device was already opened. +.It Bq Er ENOBUF +Out of memory. +.El +.Sh SEE ALSO +.Xr bridge 4 , +.Xr inet 4 , +.Xr inet6 4 , +.Xr vether 4 , +.Xr hostname.if 5 , +.Xr ifconfig 8 , +.Xr netstart 8 +.Xr switchctl 8 , +.Xr switchd 8 , +.Sh STANDARDS +.Rs +.%A Open Networking Foundation (ONF) +.%D March 26, 2015 +.%R Version 1.3.5 (Protocol version 0x04) +.%T OpenFlow Switch Specification +.Re +.Sh HISTORY +The +.Nm +driver first appeared in +.Ox 6.1 . +.Sh AUTHORS +The +.Nm +driver written by +.An Kazuya Goda Aq Mt goda@openbsd.org . |