docsis_symtable.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. /*
  2. * DOCSIS configuration file encoder.
  3. * Copyright (c) 2001 Cornel Ciocirlan, ctrl@users.sourceforge.net.
  4. * Copyright (c) 2002 Evvolve Media SRL,office@evvolve.com
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. *
  20. * DOCSIS is a registered trademark of Cablelabs, http://www.cablelabs.com
  21. */
  22. #ifndef _DOCSIS_SYMTABLE_H
  23. #define _DOCSIS_SYMTABLE_H
  24. #include "docsis.h"
  25. #include "docsis_decode.h"
  26. /*
  27. * get_nothing is used for non-numeric data, where we use other functions
  28. * that would have prototypes which don't match symbol_type
  29. * This is a list and a tree at the same time. The "parent_id" of each entry is a pointer to the
  30. * parent row in this table; ClassId for example has "6" as parent ID which is the index
  31. * in the table of ClassOfService
  32. */
  33. /* id "identifier" docsis_code parent_id ... */
  34. symbol_type symtable[NUM_IDENTIFIERS] = {
  35. { 0, "/* Pad */", 0, 0, (get_nothing), (decode_special), 0, 0 },
  36. { 1, "DownstreamFrequency", 1, 0, (get_uint), (decode_uint), 88000000, 860000000 },
  37. { 2, "UpstreamChannelId", 2, 0, (get_uchar), (decode_uchar), 0, 255 },
  38. { 3, "NetworkAccess", 3, 0, (get_uchar), (decode_uchar), 0, 1 },
  39. { 4, "CmMic", 6, 0, (get_nothing), (decode_md5), 0, 0 },
  40. { 5, "CmtsMic", 7, 0, (get_nothing), (decode_md5), 0, 0 },
  41. { 6, "ClassOfService", 4, 0, (get_nothing), (decode_aggregate), 0, 0 },
  42. { 7, "ClassID", 1, 6, (get_uchar), (decode_uchar), 1, 16 },
  43. { 8, "MaxRateDown", 2, 6, (get_uint), (decode_uint), 0, 52000000 },
  44. { 9, "MaxRateUp", 3, 6, (get_uint), (decode_uint), 0, 10000000 },
  45. { 10, "PriorityUp", 4, 6, (get_uchar), (decode_uchar), 0, 7 },
  46. { 11, "GuaranteedUp", 5, 6, (get_uint), (decode_uint), 0, 10000000 },
  47. { 12, "MaxBurstUp", 6, 6, (get_ushort), (decode_ushort), 0, 65535 },
  48. { 13, "PrivacyEnable", 7, 6, (get_uchar), (decode_uchar), 0, 1 },
  49. { 14, "SwUpgradeFilename", 9, 0, (get_string), (decode_string), 0, 0 },
  50. { 15, "SnmpWriteControl", 10, 0, (get_nothing), (decode_snmp_wd), 0, 0 },
  51. { 16, "SnmpMibObject", 11, 0, (get_nothing), (decode_snmp_object), 0, 0 }, /* has encode_vbind */
  52. { 17, "CpeMacAddress", 14, 0, (get_ether), (decode_ether), 0, 0 },
  53. { 18, "BaselinePrivacy", 17, 0, (get_nothing), (decode_aggregate), 0, 0 },
  54. { 19, "AuthTimeout", 1, 18, (get_uint), (decode_uint), 1, 30 },
  55. { 20, "ReAuthTimeout", 2, 18, (get_uint), (decode_uint), 1, 20 },
  56. { 21, "AuthGraceTime", 3, 18, (get_uint), (decode_uint), 1, 1800 },
  57. { 22, "OperTimeout", 4, 18, (get_uint), (decode_uint), 1, 10 },
  58. { 23, "ReKeyTimeout", 5, 18, (get_uint), (decode_uint), 1, 10 },
  59. { 24, "TEKGraceTime", 6, 18, (get_uint), (decode_uint), 1, 1800 },
  60. { 25, "AuthRejectTimeout", 7, 18, (get_uint), (decode_uint), 1, 600 },
  61. { 26, "MaxCPE", 18, 0, (get_uchar), (decode_uchar), 0, 16 },
  62. { 27, "SwUpgradeServer", 21, 0, (get_ip), (decode_ip), 0, 0 },
  63. /* DOCSIS 1.1-2.0 */
  64. { 28, "UsPacketClass", 22, 0, (get_nothing), (decode_aggregate), 0, 0 },
  65. { 29, "ClassifierRef", 1, 28, (get_uchar), (decode_uchar), 1, 255 },
  66. { 30, "ClassifierId", 2, 28, (get_ushort), (decode_ushort), 1, 65535 },
  67. { 31, "ServiceFlowRef", 3, 28, (get_ushort), (decode_ushort), 1, 65535 },
  68. { 32, "ServiceFlowId", 4, 28, (get_uint), (decode_uint), 1, 0xFFFFFFFF },
  69. { 33, "RulePriority", 5, 28, (get_uchar), (decode_uchar), 0, 255 },
  70. { 34, "ActivationState", 6, 28, (get_uchar), (decode_uchar), 0, 1 },
  71. { 35, "DscAction ", 7, 28, (get_uchar), (decode_uchar), 0, 2 },
  72. { 36, "IpPacketClassifier", 9, 28, (get_nothing), (decode_aggregate), 0, 0 },
  73. { 37, "IpTos", 1, 36, (get_hexstr), (decode_hexstr), 3, 3 },
  74. { 38, "IpProto", 2, 36, (get_ushort), (decode_ushort), 0, 257 },
  75. { 39, "IpSrcAddr", 3, 36, (get_ip), (decode_ip), 0, 0 },
  76. { 40, "IpSrcMask", 4, 36, (get_ip), (decode_ip), 0, 0 },
  77. { 41, "IpDstAddr", 5, 36, (get_ip), (decode_ip), 0, 0 },
  78. { 42, "IpDstMask", 6, 36, (get_ip), (decode_ip), 0, 0 },
  79. { 43, "SrcPortStart", 7, 36, (get_ushort), (decode_ushort), 0, 65535 },
  80. { 44, "SrcPortEnd", 8, 36, (get_ushort), (decode_ushort), 0, 65535 },
  81. { 45, "DstPortStart", 9, 36, (get_ushort), (decode_ushort), 0, 65535 },
  82. { 46, "DstPortEnd", 10,36, (get_ushort), (decode_ushort), 0, 65535 },
  83. { 47, "LLCPacketClassifier", 10,28, (get_nothing), (decode_aggregate), 0, 0 },
  84. { 48, "DstMacAddress", 1, 47, (get_ethermask), (decode_ethermask), 0, 0 },
  85. { 49, "SrcMacAddress", 2, 47, (get_ether), (decode_ether), 0, 0 },
  86. { 50, "EtherType", 3, 47, (get_hexstr), (decode_hexstr), 3, 3 },
  87. { 51, "IEEE802Classifier", 11,28, (get_nothing), (decode_aggregate), 0, 0 },
  88. { 52, "UserPriority", 1, 51, (get_ushort), (decode_ushort), 0, 0 },
  89. { 53, "VlanID", 2, 51, (get_ushort), (decode_ushort), 0, 0 },
  90. /* TODO: Vendor Specific support in the IEEE802Classifier */
  91. { 54, "DsPacketClass", 23, 0, (get_nothing), (decode_aggregate), 0, 0 },
  92. { 55, "ClassifierRef", 1, 54, (get_uchar), (decode_uchar), 1, 255 },
  93. { 56, "ClassifierId", 2, 54, (get_ushort), (decode_ushort), 1, 65535 },
  94. { 57, "ServiceFlowRef", 3, 54, (get_ushort), (decode_ushort), 1, 65535 },
  95. { 58, "ServiceFlowId", 4, 54, (get_uint), (decode_uint), 1, 0xFFFFFFFF },
  96. { 59, "RulePriority", 5, 54, (get_uchar), (decode_uchar), 0, 255 },
  97. { 60, "ActivationState", 6, 54, (get_uchar), (decode_uchar), 0, 1 },
  98. { 61, "DscAction ", 7, 54, (get_uchar), (decode_uchar), 0, 2 },
  99. { 62, "IpPacketClassifier", 9, 54, (get_nothing), (decode_aggregate), 0, 0 },
  100. { 63, "IpTos", 1, 62, (get_hexstr), (decode_hexstr), 3, 3 },
  101. { 64, "IpProto", 2, 62, (get_ushort), (decode_ushort), 0, 257 },
  102. { 65, "IpSrcAddr", 3, 62, (get_ip), (decode_ip), 0, 0 },
  103. { 66, "IpSrcMask", 4, 62, (get_ip), (decode_ip), 0, 0 },
  104. { 67, "IpDstAddr", 5, 62, (get_ip), (decode_ip), 0, 0 },
  105. { 68, "IpDstMask", 6, 62, (get_ip), (decode_ip), 0, 0 },
  106. { 69, "SrcPortStart", 7, 62, (get_ushort), (decode_ushort), 0, 65535 },
  107. { 70, "SrcPortEnd", 8, 62, (get_ushort), (decode_ushort), 0, 65535 },
  108. { 71, "DstPortStart", 9, 62, (get_ushort), (decode_ushort), 0, 65535 },
  109. { 72, "DstPortEnd", 10,62, (get_ushort), (decode_ushort), 0, 65535 },
  110. { 73, "LLCPacketClassifier", 10,54, (get_nothing), (decode_aggregate), 0, 0 },
  111. { 74, "DstMacAddress", 1, 73, (get_ethermask), (decode_ethermask), 0, 0 },
  112. { 75, "SrcMacAddress", 2, 73, (get_ether), (decode_ether), 0, 0 },
  113. { 76, "EtherType", 3, 73, (get_hexstr), (decode_hexstr), 0, 0 },
  114. { 77, "IEEE802Classifier", 11,54, (get_nothing), (decode_aggregate), 0, 0 },
  115. { 78, "UserPriority", 1, 77, (get_ushort), (decode_ushort), 0, 0 },
  116. { 79, "VlanID", 2, 77, (get_ushort), (decode_ushort), 0, 0 },
  117. /* Upstream Service Flow */
  118. { 80, "UsServiceFlow", 24, 0, (get_nothing), (decode_aggregate), 0, 0 },
  119. { 81, "UsServiceFlowRef", 1, 80, (get_ushort), (decode_ushort), 1, 65535 },
  120. { 81, "UsServiceFlowId", 2, 80, (get_uint), (decode_uint), 1, 0xFFFFFFFF },
  121. { 82, "ServiceClassName", 4, 80, (get_string), (decode_string), 2, 16 },
  122. { 83, "QosParamSetType", 6, 80, (get_uchar), (decode_uchar), 0, 255 },
  123. { 84, "TrafficPriority", 7, 80, (get_uchar), (decode_uchar), 0, 7 },
  124. { 85, "MaxRateSustained", 8, 80, (get_uint), (decode_uint), 0, 0 },
  125. { 86, "MaxTrafficBurst", 9, 80, (get_uint), (decode_uint), 0, 0 },
  126. { 87, "MinReservedRate", 10,80, (get_uint), (decode_uint), 0, 0 },
  127. { 88, "MinResPacketSize", 11,80, (get_ushort), (decode_ushort), 0, 65535 },
  128. { 89, "ActQosParamsTimeout", 12,80, (get_ushort), (decode_ushort), 0, 65535 },
  129. { 89, "AdmQosParamsTimeout", 13,80, (get_ushort), (decode_ushort), 0, 65535 },
  130. /* Upstream Service Flow Specific params */
  131. { 90, "MaxConcatenatedBurst", 14,80, (get_ushort), (decode_ushort), 0, 65535 },
  132. { 91, "SchedulingType", 15,80, (get_uchar), (decode_uchar), 0, 6 },
  133. { 92, "RequestOrTxPolicy", 16,80, (get_hexstr), (decode_hexstr), 4, 4 },
  134. { 93, "NominalPollInterval", 17,80, (get_uint), (decode_uint), 0, 0 },
  135. { 94, "ToleratedPollJitter", 18,80, (get_uint), (decode_uint), 0, 0 },
  136. { 95, "UnsolicitedGrantSize", 19,80, (get_ushort), (decode_ushort), 0, 65535 },
  137. { 96, "NominalGrantInterval", 20,80, (get_uint), (decode_uint), 0, 0},
  138. { 97, "ToleratedGrantJitter", 21,80, (get_uint), (decode_uint), 0, 0 },
  139. { 98, "GrantsPerInterval", 22,80, (get_uchar), (decode_uchar), 0, 127 },
  140. { 99, "IpTosOverwrite", 23,80, (get_hexstr), (decode_hexstr), 2, 2 },
  141. /* Downstream Service Flow */
  142. {100, "DsServiceFlow", 25, 0,(get_nothing), (decode_aggregate), 0, 0 },
  143. {101, "DsServiceFlowRef", 1, 100, (get_ushort), (decode_ushort), 1, 65535 },
  144. {102, "DsServiceFlowId", 2, 100, (get_uint), (decode_uint), 1, 0xFFFFFFFF },
  145. {103, "ServiceClassName", 4, 100, (get_string), (decode_string), 2, 16 },
  146. {104, "QosParamSetType", 6, 100, (get_uchar), (decode_uchar), 0, 255 },
  147. {105, "TrafficPriority", 7, 100, (get_uchar), (decode_uchar), 0, 7 },
  148. {106, "MaxRateSustained", 8, 100, (get_uint), (decode_uint), 0, 0xFFFFFFFF },
  149. {107, "MaxTrafficBurst", 9, 100, (get_uint), (decode_uint), 0, 0xFFFFFFFF },
  150. {108, "MinReservedRate", 10,100, (get_uint), (decode_uint), 0, 0xFFFFFFFF },
  151. {109, "MinResPacketSize", 11,100, (get_ushort), (decode_ushort), 0, 65535 },
  152. {110, "ActQosParamsTimeout", 12,100, (get_ushort), (decode_ushort), 0, 65535 },
  153. {111, "AdmQosParamsTimeout", 13,100, (get_ushort), (decode_ushort), 0, 65535 },
  154. /* Downstream Service Flow Specific Params */
  155. {112, "MaxDsLatency", 14,100, (get_uint), (decode_uint), 0, 0 },
  156. {113, "PHS", 26, 0, (get_nothing), (decode_aggregate), 0, 0 },
  157. {114, "ClassifierRef", 1, 113, (get_uchar), (decode_uchar), 1, 255 },
  158. {115, "ClassifierId", 2, 113, (get_ushort), (decode_ushort), 1, 65535 },
  159. {116, "ServiceFlowRef", 3, 113, (get_ushort), (decode_ushort), 1, 65535 },
  160. {117, "ServiceFlowId", 4, 113, (get_uint), (decode_uint), 1, 0xFFFFFFFF},
  161. {118, "MaxClassifiers", 28, 0, (get_ushort), (decode_ushort), 0, 0 },
  162. {119, "GlobalPrivacyEnable", 29, 0, (get_uchar), (decode_uchar), 0, 0 },
  163. {999, "/* EndOfDataMkr */", 255,0, (get_nothing), (decode_special), 0, 0 }
  164. };
  165. #endif /* _DOCSIS_SYMTABLE_H */