docsis_encode.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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_ENCODE_H
  23. #define _DOCSIS_ENCODE_H
  24. /* each of these returns the length of the value parsed ! */
  25. int encode_uint (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  26. int encode_ushort (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  27. int encode_uchar (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  28. int encode_ip (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  29. int encode_ip6 (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  30. int encode_ip_ip6 (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  31. int encode_char_ip_ip6 (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  32. int encode_ip_ip6_port (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  33. int encode_lenzero (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  34. int encode_ether (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  35. int encode_dual_qtag (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  36. int encode_dual_int (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  37. int encode_ethermask (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  38. int encode_string (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  39. int encode_strzero (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  40. int encode_hexstr (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  41. int encode_oid (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  42. int encode_ushort_list (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  43. int encode_nothing (unsigned char *buf, void *tval, struct symbol_entry *sym_ptr );
  44. #endif /* _DOCSIS_ENCODE_H */