addr_hash.h 606 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * addr_hash.h:
  3. *
  4. */
  5. #ifndef __ADDR_HASH_H_ /* include guard */
  6. #define __ADDR_HASH_H_
  7. #include <sys/types.h>
  8. #include <sys/socket.h>
  9. #include <netinet/in.h>
  10. #include "hash.h"
  11. typedef struct {
  12. int af;
  13. unsigned short int protocol;
  14. unsigned short int src_port;
  15. union {
  16. struct in_addr src;
  17. struct in6_addr src6;
  18. };
  19. unsigned short int dst_port;
  20. union {
  21. struct in_addr dst;
  22. struct in6_addr dst6;
  23. };
  24. } addr_pair;
  25. typedef addr_pair key_type; /* index into hash table */
  26. hash_type* addr_hash_create(void);
  27. #endif /* __ADDR_HASH_H_ */