docsis_encode.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. * Copyright (c) 2014 - 2015 Adrian Simionov, daniel.simionov@gmail.com
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License along
  18. * with this program; if not, write to the Free Software Foundation, Inc.,
  19. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  20. *
  21. * DOCSIS is a registered trademark of Cablelabs, http://www.cablelabs.com
  22. */
  23. #ifndef _DOCSIS_ENCODE_H
  24. #define _DOCSIS_ENCODE_H
  25. /* each of these returns the length of the value parsed ! */
  26. int encode_uint (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  27. int encode_uint24 (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  28. int encode_ushort (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  29. int encode_uchar (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  30. int encode_ip (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  31. int encode_ip_list (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  32. int encode_ip6 (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  33. int encode_ip6_list (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  34. int encode_ip6_prefix_list (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  35. int encode_ip_ip6 (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  36. int encode_char_ip_ip6 (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  37. int encode_ip_ip6_port (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  38. int encode_lenzero (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  39. int encode_ether (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  40. int encode_dual_qtag (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  41. int encode_char_list (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  42. int encode_ethermask (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  43. int encode_string (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  44. int encode_strzero (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  45. int encode_hexstr (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  46. int encode_oid (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  47. int encode_ushort_list (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  48. int encode_nothing (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  49. #endif /* _DOCSIS_ENCODE_H */