generate-settings.sh 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/bin/sh
  2. # This script generates an HTML file which contains an overview of all configuration settings supported by DOCSIS,
  3. # as defined in ../src/docsis_symtable.h.
  4. # Tried to make it as portable as possible. We still need sh, sed & awk.
  5. if test $# -ne 2; then
  6. echo "Usage: $0 <output_file> <package_version>"
  7. exit 1;
  8. fi
  9. cat > $1 << EOF
  10. <html>
  11. <head>
  12. <title>DOCSIS Configuration Settings</title>
  13. </head>
  14. <body bgcolor=#ffffff>
  15. <h3> DOCSIS Configuration Settings</h3>
  16. <p> In the table below you can find a list of all Configuration Settings understood by this program. The name should be self-descriptive; if not you can refer to the DOCSIS RFI specification - Appendix C, for detailed explanations of what each of these mean.
  17. <p> For String and Hexadecimal strings, the "Range" field means the minimum and maximum length of the string. For "List" types, it represents the number of elements in the list.
  18. <p> This list was generated for docsis version $2.
  19. <table cellpadding=5 bgcolor=#000000>
  20. <tr bgcolor=#ffffff><td><b>Configuration Setting</b></td><td><b>Type</b></td><td><b>Range of values allowed</b></td></tr>
  21. EOF
  22. grep -e "^{" ../src/docsis_symtable.h\
  23. | grep -v "*"\
  24. | grep -v "decode_md5"\
  25. | awk '{print $5 "_" $3 " " $7 " " $8 " " $9}' \
  26. | sed 's/\"//g' \
  27. | sed 's/^0,_//g' \
  28. | sed 's/^[0-9]*,_/\&nbsp\;\&nbsp\;\&nbsp\;\&nbsp\;/g'\
  29. | sed 's/\decode_//g' \
  30. | sed 's/\ //g' | tr -s "\(\)" "%%" \
  31. | sed 's/^/<tr\ bgcolor=#ffffff><td><b>/g' \
  32. | sed 's/,\%/<\/b><\/td><td>/g' \
  33. | sed 's/%,/<\/td><td>/g' \
  34. | sed 's/,/-/g' \
  35. | sed 's/$/<\/td><\/tr>/g'\
  36. | sed 's/uchar/Unsigned Integer/g' \
  37. | sed 's/uint/Unsigned Integer/g' \
  38. | sed 's/ushort_list/Unsigned Integer List - comma separated/g' \
  39. | sed 's/ushort/Unsigned Integer/g' \
  40. | sed 's/0xFFFFFFFF/4294967296/g' \
  41. | sed 's/ip/IP address/g' \
  42. | sed 's/ether/Ethernet MAC address/g' \
  43. | sed 's/ethermask/Ethernet MAC address mask/g' \
  44. | sed 's/hexstr/Hexadecimal characters/g' \
  45. | sed 's/string/String - double quote delimited/g' \
  46. | sed 's/strzero/String - double quote delimited/g' \
  47. | sed 's/aggregate/Aggregate/g' \
  48. | sed 's/vspecific/Aggregate/g' \
  49. | sed 's/oid/SNMP Object Identifier - numeric/g' \
  50. | sed 's/snmp_wd/SNMP Write Control - OID, value/g' \
  51. | sed 's/snmp_object/SNMP MIB Object- OID, Type, Value/g' \
  52. | sed 's/0-0/Not Applicable/g' >> $1
  53. echo "</table></body></html>" >> $1