ipv6.h

Go to the documentation of this file.
00001 /*
00002  ** Copyright(C) 2007 INL
00003  ** Written by Victor Stinner <victor.stinner@inl.fr>
00004  **
00005  ** $Id$
00006  **
00007  ** This program is free software; you can redistribute it and/or modify
00008  ** it under the terms of the GNU General Public License as published by
00009  ** the Free Software Foundation, version 3 of the License.
00010  **
00011  ** This program is distributed in the hope that it will be useful,
00012  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  ** GNU General Public License for more details.
00015  **
00016  ** You should have received a copy of the GNU General Public License
00017  ** along with this program; if not, write to the Free Software
00018  ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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 

Generated on Sat Nov 22 04:00:37 2008 for NuFW by  doxygen 1.4.7