You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.5 KiB

  1. /*
  2. * siit.h -- definitions for the SIIT module
  3. *
  4. *
  5. */
  6. /*
  7. * Constants
  8. */
  9. /* SIIT_ETH control the name of SIIT interface:
  10. * 0 - interface name is siit0,
  11. * 1 - interface name is ethX.
  12. */
  13. #define SIIT_ETH 0
  14. #define BUFF_SIZE 4096
  15. #define FRAG_BUFF_SIZE 1232 /* IPv6 max fragment size without IPv6 header
  16. * to fragmanet IPv4 if result IPv6 packet will be > 1280
  17. */
  18. #define TRANSLATED_PREFIX 0x0000ffff /* third byte in IPv4-translated addr prefix */
  19. #define MAPPED_PREFIX 0x0000ffff /* third byte in IPv4-mapped addr prefix */
  20. #define IP4_IP6_HDR_DIFF 20 /* diffirence between IPv4 and IPv6 headers */
  21. #define IP6_FRAGMENT_SIZE 8 /* size of Fragment Header */
  22. /* IPv6 header fields masks */
  23. #define IP6F_OFF_MASK 0xfff8 /* mask out offset from frag_off */
  24. #define IP6F_RESERVED_MASK 0x0006 /* reserved bits in frag_off */
  25. #define IP6F_MORE_FRAG 0x0001 /* more-fragments flag */
  26. /*
  27. * Macros to help debugging
  28. */
  29. #undef PDEBUG /* undef it, just in case */
  30. #ifdef SIIT_DEBUG
  31. # ifdef __KERNEL__
  32. /* This one if debugging is on, and kernel space */
  33. # define PDEBUG(fmt, args...) printk(KERN_DEBUG "siit: " fmt, ## args)
  34. # else
  35. /* This one for user space */
  36. # define PDEBUG(fmt, args...) fprintf(stderr, fmt, ## args)
  37. # endif
  38. #else
  39. # define PDEBUG(fmt, args...) /* not debugging: nothing */
  40. #endif
  41. #undef PDEBUGG
  42. #define PDEBUGG(fmt, args...)