docsis_decode.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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_ushort (unsigned char *tlvbuf, symbol_type *sym, size_t length );
  30. void decode_uchar (unsigned char *tlvbuf, symbol_type *sym, size_t length );
  31. void decode_ip (unsigned char *tlvbuf, symbol_type *sym, size_t length );
  32. void decode_ether (unsigned char *tlvbuf, symbol_type *sym, size_t length );
  33. void decode_ethermask (unsigned char *tlvbuf, symbol_type *sym, size_t length );
  34. void decode_md5 (unsigned char *tlvbuf, symbol_type *sym, size_t length);
  35. void decode_snmp_wd (unsigned char *tlvbuf, symbol_type *sym, size_t length);
  36. void decode_snmp_object (unsigned char *tlvbuf, symbol_type *sym, size_t length);
  37. void decode_oid (unsigned char *tlvbuf, symbol_type *sym, size_t length);
  38. void decode_string (unsigned char *tlvbuf, symbol_type *sym, size_t length);
  39. void decode_strzero (unsigned char *tlvbuf, symbol_type *sym, size_t length);
  40. void decode_hexstr (unsigned char *tlvbuf, symbol_type *sym, size_t length);
  41. void decode_ushort_list (unsigned char *tlvbuf, symbol_type *sym, size_t length);
  42. void decode_unknown (unsigned char *tlvbuf, symbol_type *sym, size_t length );
  43. void decode_aggregate (unsigned char *tlvbuf, symbol_type *sym, size_t length);
  44. void decode_main_aggregate (unsigned char *tlvbuf, size_t buflen);
  45. void decode_vspecific(unsigned char *tlvbuf, symbol_type *sym, size_t length);
  46. int hexadecimal_to_binary(const char *string, unsigned char *out_buf);
  47. int str_isalpha (const char *str, size_t str_len);
  48. int str_isprint (const char *str, size_t str_len);
  49. void snprint_hexadecimal ( unsigned char *outbuf, size_t outsize, const char *str, size_t str_len );
  50. void __docsis_indent ( int opCode, int doPrint );
  51. #endif /* _DOCSIS_DECODE_H */