int6krule.1.html 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  1. <?xml version='1.0' encoding='iso-8859-1'?>
  2. <!doctype html public '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
  3. <html xmlns='http://www.w3c.org/1999/xhtml' lang='en-us'>
  4. <head>
  5. <title>
  6. int6krule.1
  7. </title>
  8. <meta http-equiv='content-type' content='text/html;iso-8859-1'/>
  9. <meta name='generator' content='motley-tools 1.9.4 13:40:33 Feb 18 2015'/>
  10. <meta name='author' content='cmaier@cmassoc.net'/>
  11. <meta name='robots' content='noindex,nofollow'/>
  12. <link href='toolkit.css' rel='stylesheet' type='text/css'/>
  13. </head>
  14. <body>
  15. <div class='headerlink'>
  16. [<a href='int6krate.1.html' title=' int6krate.1 '>PREV</a>]
  17. [<a href='toolkit.html' title=' Index '>HOME</a>]
  18. [<a href='int6kstat.1.html' title=' int6kstat.1 '>NEXT</a>]
  19. </div>
  20. <pre>
  21. int6krule(1) Qualcomm Atheros Open Powerline Toolkit int6krule(1)
  22. NAME
  23. int6krule - Stream Classification Utility
  24. SYNOPSIS
  25. int6krule [options] action operand condition [condition] [condition] control volatility [device] [device] [...]
  26. where condition is a field operator value sequence.
  27. DESCRIPTION
  28. Format and send stream classification rules to one or more devices. Rules specify an action to be taken when a frame
  29. satisfies selection criteria. Selection criteria consists of one, two or three conditions where any or all conditions
  30. must be satisfied. Each condition consists of a field type, a relational operator and a value. Rules may be added to a
  31. device, or removed from a device, so that they have permanent or temporary effect.
  32. Classification rules are cumulative. If a new rule set is identical to an old rule set then an error will occur unless
  33. it contains a different Transmission Action. In that case the old rule will be replaced. Identical classification rule
  34. sets are permitted if one of the sets is associated with a VLAN tag action. Classification is based on the original
  35. frame before is is altered by VLAN Tag insertion or removal.
  36. Classification is multi-dimensional and the terminology used here may seem strange at first. Refer to the Qualcomm
  37. Atheros Firmware Techncial Reference Manual description of the VS_CLASSIFICATION management message for a full explana‐
  38. tion.
  39. This program is part of the Qualcomm Atheros Powerline Toolkit. See the plc man page for an overview and installation
  40. instructions.
  41. OPTIONS
  42. -e Redirects stderr messages to stdout. By convention status and error messages are printed on stderr while primary
  43. program output is printed on stdout. This option prints all output on stdout in cases where this is desired.
  44. -i interface
  45. Select the host Ethernet interface. All requests are sent via this host interface and only reponses received via
  46. this host interface are recognized. The default interface is eth1 because most people use eth0 as their principle
  47. network connection; however, if environment string &quot;PLC&quot; is defined then it takes precedence over the default
  48. interface. This option then takes precedence over either default.
  49. -r Read rules from a device and display them on stdout.
  50. -q Suppresses status messages on stderr.
  51. -s Print a list of program keywords on stdout. This option over-rides all others, except -? and -!, and the program
  52. will terminate without further action.
  53. -t milliseconds
  54. Read timeout in milliseconds. Values range from 0 through UINT_MAX. This is the maximum time allowed for a
  55. response. The default is shown in brackets on the program menu. -T tag The VLAN tag to be inserted into frames
  56. before they are transmitted. The tag is a 32-bit hexadecimal integer with optional &quot;0x&quot; prefix. This option is
  57. required for action TagTX and must be omitted for all other actions.
  58. -v Print additional information on stdout. In particular, this option dumps incoming and outgoing packets which can
  59. be saved as text files for reference.
  60. -V version
  61. The CSPEC version number expressed as a small decimal integer. This option is required (and should be 2) for
  62. action TagTX and must be omitted for all other actions.
  63. -?,--help
  64. Print program help summary on stdout. This option takes precedence over other options on the command line.
  65. -!,--version
  66. Print program version information on stdout. This option takes precedence over other options on the command line.
  67. Use this option when sending screen dumps to Atheros Technical Support so that they know exactly which version of
  68. the Linux Toolkit you are using.
  69. ARGUMENTS
  70. action The action to be taken for frames that meet any (or all) selection criteria. Valid actions are listed and
  71. described under ACTIONS.
  72. operand
  73. The operand specifies the logical relationship between conditions before the action to be taken. Valid operands
  74. are listed and described under OPERANDS.
  75. condition
  76. A conditional expression consisting of a field, operator and value. See CONDITIONS for more information.
  77. control
  78. The control specifies the action to be taken by the device upon receipt of the rule. The basic actions are to add
  79. it to, or remove it from, the list of existing rules. Valid controls are listed and described under CONTROLS.
  80. volatility
  81. The volatility specifies the effective lifetime of the rule. Temoprary rules are stored in SDRAM and are lost
  82. then the device is reset. Permanent rules are stored in NVRAM and are restored after the device is reset. Valid
  83. volatilities are listed and described under VOLATILITY.
  84. device The MAC address of some powerline device. More than one address may be specified on the command line. If more
  85. than one address is specified then operations are performed on each device in turn. The default address is
  86. &quot;local&quot;. See DEVICES for more information.
  87. ACTIONS
  88. Actions indcate the disposition of frames that match selection criteria. They are expressed as discrete alphanumeric
  89. strings entered in upper, lower or mixed character case. They are position sensitive. Failure to enter a known action
  90. will results in an error message that lists permitted actions.
  91. CAP0,CAP1,CAP2,CAP3
  92. Assign a specific Channel Access Priority to frames.
  93. Drop,DropTX
  94. Do not forward frames over powerline.
  95. DropRX Do not forward frames to host.
  96. Boost Boost frame priority to CAP3 for MMEs only. At least one condition must be &quot;MME&quot;.
  97. StripTX
  98. Remove the VLAN Tag from frames before transmission over powerline. This option checks for a VLAN Tag even when
  99. there are no VLAN related conditions.
  100. StripRX
  101. Remove the VLAN Tag from frames before forwarding to host. This option checks for a VLAN Tag even when there are
  102. no VLAN related conditions.
  103. TagTX Insert a given VLAN Tag into frames before transmission over powerline. This action requires option -T to specify
  104. the tag and option -V to specify the CSPEC version.
  105. OPERANDS
  106. The operand indicates the logical relationship that must exist between conditions in the rule set before the action is
  107. applied to a frame. Operands are expressed as discrete alphanumeric strings entered in upper, lower or mixed character
  108. case. Failure to enter a known operand will result in an error message that lists permitted operands. They are positon
  109. sensitive. One operand is allowed and it must appear after the action and before any condition.
  110. Any Apply the action to frames that satisfy any of the conditions. This is equivalent to the logical or operation.
  111. All Apply the action to frames that satisfy all of the conditions. This is equivalent to the logical and operation.
  112. Always Apply the action to all frames. All conditions are ignored.
  113. CONDITIONS
  114. A condition consists of a field, an operator and a value. One condition is required but three are permitted. Condition
  115. order is not important but all conditions must appear after the operand and before the control.
  116. field The field is the part of the Ethernet frame to be examined. Some fields are not valid for some actions but this
  117. program does not enforce such rules since validation is performed by runtime firmware on each device. Recognized
  118. fields are listed and described under FIELDS.
  119. operator
  120. The operator specifies the relationsip that must exist between the field and value in order for the condition to
  121. evaluate True. Currently, only equality operators are supported. Valid operators are listed and described under
  122. OPERATORS.
  123. value The value must be appropriate to the field type. Some fields are MAC or IP addresses, some are integers, some are
  124. bitmaps and others are states. Integers and bitmaps may be expressed in binary, decimal or hexadecimal format.
  125. Binary values staRt with 0b. Hexadecimal values start with 0x. States are expressed using keywords. Users are
  126. responsible for knowing how many bits are significant for each type of value. Valid values are described along
  127. with fields under FIELDS.
  128. FIELDS
  129. Fields indicate the portion of the frame that is inspected during selection and the size and format of the value permited
  130. in the condition statement. They are expressed as discrete alphanumeric strings entered in upper, lower or mixed charac‐
  131. ter case. Failure to enter a known field will result in an error message that lists permitted fields.
  132. ET A 16-bit Ethertype expressed in hexadecimal with optional &quot;0x&quot; prefix. The format is described in IEEE Standard
  133. 802-2001 [4].
  134. EthDA A 48-bit Ethernet destination address expressed in hexadecimal. Octets may be separated with optional colons for
  135. clarity. The format is described in IEEE Standard 802-2001 [4].
  136. EthSA A 48-bit Ethernet source address expressed in hexadecimal. Octets may be separated with optional colons for clar‐
  137. ity. The format is described in IEEE Standard 802-2001 [4].
  138. IPSP A 16-bit IP source port expressed as a decimal integer. This condition applies to either TCP or UDP packets,
  139. depending on the protocol used, and is valid only for actions &quot;CAP0&quot;, &quot;CAP1&quot;, &quot;CAP2&quot;, &quot;CAP3&quot; and &quot;Drop&quot;.
  140. IPDP A 16-bit IP destination port expressed as a decimal integer. This condition applies to either TCP or UDP packets,
  141. depending on the protocol used, and is valid only for actions &quot;CAP0&quot;, &quot;CAP1&quot;, &quot;CAP2&quot;, &quot;CAP3&quot; and &quot;Drop&quot;.
  142. IPV4TOS
  143. An 8-bit Type-of-Service code where the format is defined in the RFC 791 (Internet Protocol) [14].
  144. IPV4PROT
  145. An 8-bit Ethernet protocol code. The format is defined in the RFC 791 (Internet Protocol) [14].
  146. IPV4SA A 32-bit Internet Protocol source address expressed in dotted-decimal notation. The official format is defined in
  147. RFC 791 (Internet Protocol) [14]. Our implementation permits empty octets and leading zeros within fields. For
  148. example, &quot;...&quot; is equivalent to &quot;0.0.0.0 and &quot;127..000.001&quot; is equivalent to &quot;127.0.0.1&quot;.
  149. IPV4DA A 32-bit Internet Protocol destination address expressed in dotted-decimal notation. The official format is
  150. defined in RFC 791 (internet Protocol) [14]. Our implementation permits empty octets and leading zeros within
  151. fields. For example, &quot;...&quot; is equivalent to &quot;0.0.0.0 and &quot;127..000.001&quot; is equivalent to &quot;127.0.0.1&quot;.
  152. IPV6TC An 8-bit Internet Protocol V6 traffic class expressed as defined in RFC 2460 (Internet Protocol Version 6) [17].
  153. IPV6FL A 24-bit IPV6 flow label where the lower 20 bits are the IPv6 Flow Label defined in RFC 2460 (Internat Protocol
  154. Version 6) [17]. The upper 4 bits should be zero. The value can be entered either as a decimal, binary or hex
  155. integer.
  156. IPV6SA A 128-bit IPV6 source address expressed as colon-separated hexadecmial quartets (octet pairs). The official for‐
  157. mat is defined in RFC 2460 (Internet Protocol Version 6) [17]. Our implementation permits multiple empty fields,
  158. abreviated fields and leading zeros within fields. When multiple empty fields appear, the right-most occurance
  159. expands to multiple zeros. For example, &quot;AAAA::BBBB::CCCC&quot; is equivalent to
  160. &quot;AAAA:0000:BBBB:0000:0000:0000:0000:CCCC&quot;.
  161. IPV6DA A 128-bit IPV6 destination address expressed as colon-separated hexadecimal quartets (octet pairs). The official
  162. format is defined in RFC 2460 (Internet Protocol Version 6) [17]. Our implementation permits multiple empty
  163. fields, abbreviated fields and leading zeros within fields. When multiple empty fields appear, the right-most
  164. occurance expands to zeros. For example, &quot;:1::2&quot; is equivalent to &quot;0000:0001:0000:0000:0000:0000:0000:0002&quot;.
  165. MME A 24-bit Atheros HomePlugAV Management Message type expressed as a hex byte stream. For clarity, the recommeded
  166. format it &quot;xx:xxxx&quot;. The first byte is the MMV. The next two bytes are the MMTYPE. Both are defined in the
  167. HomePlug AV Specification. The MMTYPE will match all MME variants, such as Request, Confirm, Indicate and
  168. Response because the lower two bits are ignored. This field is only valid for action &quot;Boost&quot;.
  169. TCPAck The string &quot;True&quot; or &quot;False&quot; to indicate that the frame is (or is not) a TCP Acknowledgement. Double negatives
  170. are allowed so &quot;Is True&quot; is equvalent to &quot;Not False&quot; and &quot;Is False&quot; is equivalent to &quot;Not True&quot;.
  171. TCPSP A 16-bit TCP source port as a decimal integer. The format is defined in RFC 793 (Transmission Control Protocol
  172. [15]).
  173. TCPDP A 16-bit TCP destination port expressed as a decimal integer. The format is defined in RFC 793 (Transmission Con‐
  174. trol Protocol [15]).
  175. UDPSP A 16-bit UDP source port expressed as a decimal integer. The format is defined in RFC 768 (User Datagram Protocol
  176. [13]).
  177. UDPDP A 16-bit UDP destination port expressed as a decimal integer. The format is defined in RFC 768 (User Datagram
  178. Protocol [13]).
  179. VLANID A 16-bit VLAN identifier where the lower 12 bits are the VLAN Identifier (VID) defined in IEEE Std 802.1Q-1998
  180. (Virtual Bridged Local Area Networks) [11]. The upper 4 bits should be zero.
  181. VLANUP An 8-bit Ethernet VLAN tag where the lower 3 bits are the User Priority sub-field of a VLAN Tag defined in IEEE
  182. Std 802.1Q-1998 (Virtual Bridged Local Area Networks) [11]. The upper 5 bits should be zero.
  183. VLANTag
  184. The string &quot;Present&quot; or &quot;Missing&quot; to indicate the presence (or absence) of one or more VLAN Tags within a frame.
  185. This classifier is essentially equivalent to &quot;ET Is 0x8100&quot;. Double negatives are allowed so &quot;Is Present&quot; is
  186. equivalent to &quot;Not Missing&quot; and &quot;Is Missing&quot; is equivalent to &quot;Not Present&quot;.
  187. OPERATORS
  188. An operator indicates an equality between a field and a value. An operator is an alphanumeric string entered in upper,
  189. lower or mixed character case. Failure to enter a known operator will result in an error message that lists permitted
  190. operators. Operators are position sensitive and must appear between each field and value.
  191. Is Indicates that the frame field must equal the associated value for the condition to evaluate true.
  192. Not Indicates that the frame field must not equal the associated value for the condition to evaluate true.
  193. STATES
  194. A state is a special case of value.
  195. True,On,Yes,Present
  196. Indicates a positive state or presence of some entity. All are equivalent and can be used interchangeably. Dou‐
  197. ble negatives are permitted so &quot;Is True&quot; is equvalent to &quot;Not False&quot;.
  198. False,Off,No,Missing
  199. Indicates a negative state or absence of some entity. All are equivalent and can be used interchangeably. Double
  200. negatives are permitted so &quot;Is False&quot; is equvalent to &quot;Not True&quot;.
  201. CONTROLS
  202. The control determines how the devices will handle the rule after it is validated. It is expressed as a discrete
  203. alphanumeric string entered in upper, lower or mixed character case. Failure to enter a known control will result in an
  204. error message that lists permitted controls. The control is position sensitive and must occur after condition and before
  205. volatility.
  206. Add Adds the rule to the current list of rules unless a violation occurs. In some cases, a rule may replace an exist‐
  207. ing rule instead of being added.
  208. Rem,Remove
  209. Remove the rule from the current list of rules unless a violation occurs.
  210. VOLATILITY
  211. The volatility determines which device rule set will be affected by the action. It is expressed as a discrete alphanu‐
  212. meric string entered in upper, lower or mixed character case. Failure to enter a known volatility will result in an
  213. error message that lists permitted volatilities. The volatility is position sensitive and must occur after control.
  214. Temp The temporary rule set will be modified. The temporary rule set resides in the working PIB stored in SDRAM.
  215. Perm The permanent rule set will be modified. The permanent rule set resides in the user PIB stored in NVRAM.
  216. DEVICES
  217. Powerline devices use Ethernet Media Access Control (MAC) addresses. A MAC address is a 48-bit value entered as 12 hexa‐
  218. decimal digits in upper, lower or mixed character case. Octets may be separated with colons for clarity. For example,
  219. &quot;00b052000001&quot;, &quot;00:b0:52:00:00:01&quot; and &quot;00b052:000001&quot; are valid and equivalent.
  220. The following MAC addresses are special and may be entered by name instead of number.
  221. all Same as &quot;broadcast&quot;.
  222. broadcast
  223. A synonym for the Ethernet broadcast address, FF:FF:FF:FF:FF:FF. All devices, whether local, remote or foreign
  224. recognize messages sent to this address. A remote device is any device at the far end of a powerline connection.
  225. A foreign device is any device not manufactured by Atheros.
  226. local A synonym for the Qualcomm Atheros vendor specific Local Management Address (LMA), 00:B0:52:00:00:01. All local
  227. Atheros devices recognize this address but remote and foreign devices do not. A remote device is any device at
  228. the far end of a powerline connection. A foreign device is any device not manufactured by Atheros.
  229. REFERENCES
  230. See the Qualcomm Atheros HomePlug AV Firmware Technical Reference Manual for more information.
  231. DISCLAIMER
  232. Atheros HomePlug AV Vendor Specific Management Message structure and content is proprietary to Qualcomm Atheros, Ocala FL
  233. USA. Consequently, public information is not available. Qualcomm Atheros reserves the right to modify message structure
  234. or content in future firmware releases without any obligation to notify or compensate users of this program.
  235. EXAMPLES
  236. This command adds a temporary classification rule to the classification table on device B00:B0:52:BA:BE:01. The rule
  237. instructs the device to drop frames that match either (any) of two conditions. The first condition states that the IPv4
  238. source address is 192.168.99.2. The second conditon states that the IPv4 destination address is 192.168.99.100.
  239. # int6krule drop any IPv4SA is 192.168.99.2 IPv4DA is 192.168.99.100 add temp 00:B0:52:BA:BE:01
  240. Observe that the action, operand and conditions come first then the control and volatility then the affected devices. Up
  241. to three conditions may be specified. Keyword order is important. Character case is not important.
  242. The following example prints a list of programmed keywords on stdout for reference. The example shown here has been
  243. abbreviate due to formatting limitations.
  244. # int6krule -s
  245. Controls are 'Add'|'Rem'|'Remove'
  246. Volatilities are 'Temp'|'Perm'
  247. Actions are 'CAP0'|'CAP1'|'CAP2'|'CAP3'|'Boost'|...|'StripTX'|'StripRX'|'TagRX'
  248. Operands are 'All'|'Any'|'Always'
  249. Fields are 'EthDA'|'EthSA'|'VLANUP'|'VLANID'|'IPv4TOS'|...|'TCPAck'|'VLANTag'
  250. Operators are 'Is'|'Not'
  251. More example follow:
  252. Ethernet Address Rules
  253. Ethernet address rules have the following general format:
  254. | CAP0 | ANY | EthSA | IS | xx:xx:xx:xx:xx:xx | ADD | TEMP | xx:xx:xx:xx:xx:xx
  255. | CAP1 | ALL | EthDA | NOT | | REMOVE | PERM |
  256. | CAP2 |
  257. | CAP3 |
  258. | DROP |
  259. For example, instruct device 00:B0:52:BA:BE:FF to temporarily add a rule to forward frames from 00:2B:FE:CA:FE:BA at
  260. CAP3. Observe Ethernet hardware addresses are used both in the condition and for the affected powerline devices.
  261. # int6krule cap3 any ethsa is 00:2b:fe:ca:fe:ba add temp 00:b0;52:ba:be:ff
  262. IP Address Rules
  263. IP address rules have the following general format:
  264. | CAP0 | ANY | IPv4SA | IS | ddd.ddd.ddd.ddd | ADD | TEMP | xx:xx:xx:xx:xx:xx
  265. | CAP1 | ALL | IPv4DA | NOT | | REMOVE | PERM |
  266. | CAP2 |
  267. | CAP3 |
  268. | DROP |
  269. For example, instruct device 00:B0:52:BA:BE:FF to permanently remove the rule that drops packets from 192.168.99.1.
  270. Notice that the IP address is specified in dotted decimal format but the device address is specified in hexadecimal octet
  271. format. Dotted decimal format permits empty and variable length octets but octet delimiters are mandatory. Hexadecimal
  272. octet format requires fixed length octets but octet delimiters are optional.
  273. # int6krule drop any ipv4sa is 192.168.99.1 remove perm 00:b0:52:ba:be:ff
  274. IP Protocol Rules
  275. IP protocol rules have the following general format:
  276. | CAP0 | ANY | IPv4PROT | IS | xxxx | ADD | TEMP | xx:xx:xx:xx:xx:xx
  277. | CAP1 | ALL | | NOT | | REMOVE | PERM |
  278. | CAP2 |
  279. | CAP3 |
  280. | DROP |
  281. For example, to instruct device 00:B0:52:BA:BE:FF to permanently add a rule to forward non-IP packets at CAP2. In this
  282. example, delmiters have been omitted from the device Ethernet address.
  283. # int6krule CAP2 all ipv4prot not 0x0800 add perm 00b052babeff
  284. SEE ALSO
  285. plc(1), int6krate(1), int6kstat(1), int6ktone(7)
  286. CREDITS
  287. Charles Maier &lt;cmaier@qca.qualcomm.com&gt;
  288. open-plc-utils-0.0.3 Mar 2014 int6krule(1)
  289. </pre>
  290. <div class='footerlink'>
  291. [<a href='int6krate.1.html' title=' int6krate.1 '>PREV</a>]
  292. [<a href='toolkit.html' title=' Index '>HOME</a>]
  293. [<a href='int6kstat.1.html' title=' int6kstat.1 '>NEXT</a>]
  294. </div>
  295. </body>
  296. </html>