/share/man/man4/ng_vlan.4

https://bitbucket.org/freebsd/freebsd-head/ · Forth · 145 lines · 142 code · 3 blank · 0 comment · 0 complexity · d1850ca09c77aa89f1b69bd366746d1f MD5 · raw file

  1. .\" Copyright (c) 2003 Ruslan Ermilov
  2. .\" All rights reserved.
  3. .\"
  4. .\" Redistribution and use in source and binary forms, with or without
  5. .\" modification, are permitted provided that the following conditions
  6. .\" are met:
  7. .\" 1. Redistributions of source code must retain the above copyright
  8. .\" notice, this list of conditions and the following disclaimer.
  9. .\" 2. Redistributions in binary form must reproduce the above copyright
  10. .\" notice, this list of conditions and the following disclaimer in the
  11. .\" documentation and/or other materials provided with the distribution.
  12. .\"
  13. .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  14. .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  15. .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  16. .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  17. .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  18. .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  19. .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  20. .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  21. .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  22. .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. .\" SUCH DAMAGE.
  24. .\"
  25. .\" $FreeBSD$
  26. .\"
  27. .Dd March 1, 2004
  28. .Dt NG_VLAN 4
  29. .Os
  30. .Sh NAME
  31. .Nm ng_vlan
  32. .Nd IEEE 802.1Q VLAN tagging netgraph node type
  33. .Sh SYNOPSIS
  34. .In sys/types.h
  35. .In netgraph.h
  36. .In netgraph/ng_vlan.h
  37. .Sh DESCRIPTION
  38. The
  39. .Nm vlan
  40. node type multiplexes frames tagged according to
  41. the IEEE 802.1Q standard between different hooks.
  42. .Pp
  43. Each node has two special hooks,
  44. .Va downstream
  45. and
  46. .Va nomatch ,
  47. and an arbitrary number of
  48. .Dq vlan
  49. hooks, each associated with a particular VLAN tag.
  50. .Pp
  51. An
  52. .Dv ETHERTYPE_VLAN
  53. frame received on the
  54. .Va downstream
  55. hook with a tag that the node has been configured to filter
  56. is sent out the corresponding
  57. .Dq vlan
  58. hook.
  59. If it does not match any of the configured tags, or is not of a type
  60. .Dv ETHERTYPE_VLAN ,
  61. it is sent out the
  62. .Va nomatch
  63. hook.
  64. If the
  65. .Va nomatch
  66. hook is not connected, the packet is dropped.
  67. .Pp
  68. An Ethernet frame received on the
  69. .Va nomatch
  70. hook is passed unmodified to the
  71. .Va downstream
  72. hook.
  73. .Pp
  74. An Ethernet frame received on any of the
  75. .Dq vlan
  76. hooks is tagged accordingly and sent out the
  77. .Va downstream
  78. hook.
  79. .Sh HOOKS
  80. This node type supports the following hooks:
  81. .Bl -tag -width ".Va downstream"
  82. .It Va downstream
  83. Typically this hook would be connected to a
  84. .Xr ng_ether 4
  85. node, using the
  86. .Va lower
  87. hook.
  88. .It Va nomatch
  89. Typically this hook would also be connected to an
  90. .Xr ng_ether 4
  91. type node using the
  92. .Va upper
  93. hook.
  94. .It Aq Em "any valid name"
  95. Any other hook name will be accepted and should later be associated with
  96. a particular tag.
  97. Typically this hook would be attached to an
  98. .Xr ng_eiface 4
  99. type node using the
  100. .Va ether
  101. hook.
  102. .El
  103. .Sh CONTROL MESSAGES
  104. This node type supports the generic control messages, plus the following:
  105. .Bl -tag -width indent
  106. .It Dv NGM_VLAN_ADD_FILTER Pq Li addfilter
  107. Associates a hook with the tag.
  108. .It Dv NGM_VLAN_DEL_FILTER Pq Li delfilter
  109. Disassociates a hook from the tag.
  110. .It Dv NGM_VLAN_GET_TABLE Pq Li gettable
  111. Returns a table of all hook/tag associations.
  112. .El
  113. .Sh EXAMPLES
  114. .Bd -literal
  115. #!/bin/sh
  116. ETHER_IF=rl0
  117. ngctl -f- <<EOF
  118. shutdown ${ETHER_IF}:
  119. mkpeer ${ETHER_IF}: vlan lower downstream
  120. name ${ETHER_IF}:lower vlan
  121. connect ${ETHER_IF}: vlan: upper nomatch
  122. EOF
  123. ngctl mkpeer vlan: eiface vlan123 ether
  124. ngctl msg vlan: addfilter '{ vlan=123 hook="vlan123" }'
  125. .Ed
  126. .Sh SHUTDOWN
  127. This node shuts down upon receipt of a
  128. .Dv NGM_SHUTDOWN
  129. control message, or when all hooks have been disconnected.
  130. .Sh SEE ALSO
  131. .Xr netgraph 4 ,
  132. .Xr ng_eiface 4 ,
  133. .Xr ng_ether 4 ,
  134. .Xr ngctl 8 ,
  135. .Xr nghook 8
  136. .Sh HISTORY
  137. The
  138. .Nm
  139. node type appeared in
  140. .Fx 4.10 .
  141. .Sh AUTHORS
  142. .An Ruslan Ermilov Aq ru@FreeBSD.org