New revision of the Tunnel6 client with improvements and routed prefix support
[tunnel6.git] / client / src / ipv6.h
blobdd8e569f65e1a5c7f34bc3bdbfe68237dc550df0
1 /*
2 * tunnel6
3 * Copyright (C) 2010 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef _IPV6_H
21 #define _IPV6_H
23 #define IPV6_TYPE_ICMPv6 0x3a
25 /* IPv6 address */
26 typedef unsigned short ipv6_addr_t[8]; /* used to store ipv6 address */
27 typedef unsigned char ipv6_prefix_t[16];/* used to store the prefix address - last byte is length */
29 /* IPv6 header structure */
30 struct proto_ipv6_t {
31 unsigned char ver; /* version */
32 unsigned char tclass; /* traffic class */
33 unsigned short flabel; /* flow label */
35 unsigned short pl_len; /* payload length*/
37 unsigned char nhead; /* next header */
39 unsigned char hop; /* hop limit */
41 ipv6_addr_t src; /* source ip address */
42 ipv6_addr_t dest; /* destination ip address */
45 extern unsigned ipv6_cmp (ipv6_addr_t ip, ipv6_addr_t ip2);
46 extern unsigned ipv6_cmp_prefix (ipv6_prefix_t pr, ipv6_prefix_t ip);
47 extern char *ipv6_print (ipv6_addr_t ip);
48 extern int ipv6_send (char *data, int len);
49 extern int ipv6_init ();
51 #endif