00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef NUFW_IPV6_H
00022 #define NUFW_IPV6_H
00023
00024 #ifdef FREEBSD
00025 # include <sys/types.h>
00026 # include <netinet/in_systm.h>
00027 #endif
00028
00029 #include <netinet/in.h>
00030
00031 void clear_ipv6(struct in6_addr *ipv6);
00032 void uint32_to_ipv6(const uint32_t ipv4, struct in6_addr *ipv6);
00033 void ipv4_to_ipv6(const struct in_addr ipv4, struct in6_addr *ipv6);
00034 void ipv6_to_ipv4(const struct in6_addr *ipv6, struct in_addr *ipv4);
00035 int is_ipv4(const struct in6_addr *addr);
00036 void format_ipv6(const struct in6_addr *addr, char *buffer, size_t buflen, uint8_t *protocol);
00037 int getsockname_ipv6(int fileno, struct in6_addr *addr);
00038 int hex2ipv6(const char *text, struct in6_addr *ip);
00039 int ipv6_equal(const struct in6_addr *ipa, const struct in6_addr *ipb);
00040 int compare_ipv6_with_mask(const struct in6_addr *addr1,
00041 const struct in6_addr *addr2, const struct in6_addr *mask);
00042 void create_ipv6_netmask(struct in6_addr *netmask, int mask);
00043
00044 #endif
00045