ZDE improvements - global zbitmap_t structure added, added native support for buttons...
[ZeXOS.git] / kernel / include / net / ndp.h
blobbe59bce6bd9bbde4dbe5e004c5a4211ff78f4602
1 /*
2 * ZeX/OS
3 * Copyright (C) 2008 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
4 * Copyright (C) 2009 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef _NDP_H
21 #define _NDP_H
23 #include <net/ip.h>
25 #define NET_NDP_TYPE_RSOL 0x85
26 #define NET_NDP_TYPE_RADVERT 0x86
27 #define NET_NDP_TYPE_NBSOL 0x87
28 #define NET_NDP_TYPE_NBADVERT 0x88
30 typedef struct ndp_cache_context {
31 struct ndp_cache_context *next, *prev;
33 net_ipv6 ip;
34 mac_addr_t mac;
35 } ndp_cache_t;
37 /* ICMP - NDP layer structure */
38 typedef struct proto_icmp_ndp2_t {
39 unsigned char type;
40 unsigned char code;
41 unsigned short checksum;
42 unsigned char hop_limit;
43 unsigned char flags;
44 unsigned short rlifetime;
45 unsigned reach_time;
46 unsigned retr_time;
48 /* 1. ICMPv6 options */
49 unsigned char ptype;
50 unsigned char length;
51 unsigned char prefix_len;
52 unsigned char pflags;
53 unsigned valid_ltime;
54 unsigned pref_ltime;
55 unsigned unused;
56 net_ipv6 prefix;
58 /* 2. ICMPv6 options */
59 unsigned char ll_type;
60 unsigned char ll_length;
61 mac_addr_t ll_mac;
62 } proto_icmp_ndp2_t;
64 typedef struct proto_ndp_t {
65 unsigned char type;
66 unsigned char code;
67 unsigned short checksum;
68 unsigned flags;
69 net_ipv6 target;
71 /* ICMPv6 options */
72 unsigned char ll_type;
73 unsigned char ll_length;
74 mac_addr_t ll_mac;
75 } proto_ndp_t;
77 extern unsigned ndp_cache_add (mac_addr_t mac, net_ipv6 ip);
78 extern unsigned ndp_cache_get (net_ipv6 ip, mac_addr_t *mac);
79 extern unsigned init_proto_ndp ();
81 #endif