util.h 620 B

1234567891011121314151617181920212223242526272829
  1. #ifndef _UTIL_H_
  2. #define _UTIL_H_
  3. #include <stdlib.h>
  4. #define MAX_FRAGMENTS 10
  5. /* Depreciated */
  6. typedef struct fragment_st {
  7. u_char *data;
  8. u_short ip_len; /* Length of complete packet */
  9. u_short id; /* Length of the IPv4 ID number*/
  10. } fragment;
  11. typedef struct fragment_table_st {
  12. fragment *table;
  13. int len;
  14. int max_len;
  15. } fragment_table;
  16. int report_fragment(const u_char *fragment, u_char *packet, u_int length);
  17. int init_fragment_table(void);
  18. int add_fragment(fragment new_fragment);
  19. void remove_fragment(int index);
  20. int update_fragment(int index, const u_char *data, u_int length);
  21. #endif /* _UTIL_H_ */