docsis_decode.h 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * DOCSIS configuration file encoder.
  3. * Copyright (c) 2001 Cornel Ciocirlan, ctrl@users.sourceforge.net.
  4. * Copyright (c) 2002,2003,2004,2005 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 along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. * DOCSIS is a registered trademark of Cablelabs, http://www.cablelabs.com
  21. */
  22. #ifndef _DOCSIS_DECODE_H
  23. #define _DOCSIS_DECODE_H
  24. #include <stdlib.h>
  25. #include "docsis_common.h"
  26. struct symbol_entry *find_symbol_by_code_and_pid (unsigned char code, unsigned int pid);
  27. void decode_special (unsigned char *tlvbuf, symbol_type *sym, size_t length);
  28. void decode_uint (unsigned char *tlvbuf, struct symbol_entry *sym, size_t length );
  29. void decode_uint24 (unsigned char *tlvbuf, struct symbol_entry *sym, size_t length );
  30. void decode_ushort (unsigned char *tlvbuf, symbol_type *sym, size_t length );
  31. void decode_uchar (unsigned char *tlvbuf, symbol_type *sym, size_t length );
  32. void decode_ip (unsigned char *tlvbuf, symbol_type *sym, size_t length );
  33. void decode_ip_list (unsigned char *tlvbuf, symbol_type *sym, size_t length );
  34. void decode_ip6 (unsigned char *tlvbuf, symbol_type *sym, size_t length );
  35. void decode_ip6_list (unsigned char *tlvbuf, symbol_type *sym, size_t length );
  36. void decode_ip6_prefix_list (unsigned char *tlvbuf, symbol_type *sym, size_t length );
  37. void decode_ip_ip6 (unsigned char *tlvbuf, symbol_type *sym, size_t length );
  38. void decode_char_ip_ip6 (unsigned char *tlvbuf, symbol_type *sym, size_t length );
  39. void decode_ip_ip6_port (unsigned char *tlvbuf, symbol_type *sym, size_t length );
  40. void decode_lenzero (unsigned char *tlvbuf, symbol_type *sym, size_t length );
  41. void decode_ether (unsigned char *tlvbuf, symbol_type *sym, size_t length );
  42. void decode_dual_qtag (unsigned char *tlvbuf, symbol_type *sym, size_t length );
  43. void decode_dual_int (unsigned char *tlvbuf, symbol_type *sym, size_t length );
  44. void decode_ethermask (unsigned char *tlvbuf, symbol_type *sym, size_t length );
  45. void decode_md5 (unsigned char *tlvbuf, symbol_type *sym, size_t length);
  46. void decode_snmp_wd (unsigned char *tlvbuf, symbol_type *sym, size_t length);
  47. void decode_snmp_object (unsigned char *tlvbuf, symbol_type *sym, size_t length);
  48. void decode_oid (unsigned char *tlvbuf, symbol_type *sym, size_t length);
  49. void decode_string (unsigned char *tlvbuf, symbol_type *sym, size_t length);
  50. void decode_strzero (unsigned char *tlvbuf, symbol_type *sym, size_t length);
  51. void decode_hexstr (unsigned char *tlvbuf, symbol_type *sym, size_t length);
  52. void decode_ushort_list (unsigned char *tlvbuf, symbol_type *sym, size_t length);
  53. void decode_unknown (unsigned char *tlvbuf, symbol_type *sym, size_t length );
  54. void decode_aggregate (unsigned char *tlvbuf, symbol_type *sym, size_t length);
  55. void decode_main_aggregate (unsigned char *tlvbuf, size_t buflen);
  56. void decode_vspecific(unsigned char *tlvbuf, symbol_type *sym, size_t length);
  57. int hexadecimal_to_binary(const char *string, unsigned char *out_buf);
  58. int str_isalpha (const char *str, size_t str_len);
  59. int str_isprint (const char *str, size_t str_len);
  60. void snprint_hexadecimal ( char *outbuf, size_t outsize, const char *str, size_t str_len );
  61. void __docsis_indent ( int opCode, int doPrint );
  62. #endif /* _DOCSIS_DECODE_H */