aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2006-08-07 20:57:44 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 17:54:01 -0400
commit9067c722cf6930adf1df2d169de9094dd90b0c33 (patch)
treeeb2133038cbd85bbf55b5acd2d5297f03357e45b /include
parent8b8aec508302d4e63fd88f47894805115277f70f (diff)
[NEIGH]: Move netlink neighbour bits to linux/neighbour.h
Moves netlink neighbour bits to linux/neighbour.h. Also moves bits to be exported to userspace from net/neighbour.h to linux/neighbour.h and removes __KERNEL__ guards, userspace is not supposed to be using it. rtnetlink_rcv_msg() is not longer required to parse attributes for the neighbour layer, remove dependency on obsolete and buggy rta_buf. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/neighbour.h65
-rw-r--r--include/linux/rtnetlink.h63
-rw-r--r--include/net/neighbour.h39
3 files changed, 67 insertions, 100 deletions
diff --git a/include/linux/neighbour.h b/include/linux/neighbour.h
new file mode 100644
index 00000000000..8e8293d86fb
--- /dev/null
+++ b/include/linux/neighbour.h
@@ -0,0 +1,65 @@
1#ifndef __LINUX_NEIGHBOUR_H
2#define __LINUX_NEIGHBOUR_H
3
4#include <linux/netlink.h>
5
6struct ndmsg
7{
8 __u8 ndm_family;
9 __u8 ndm_pad1;
10 __u16 ndm_pad2;
11 __s32 ndm_ifindex;
12 __u16 ndm_state;
13 __u8 ndm_flags;
14 __u8 ndm_type;
15};
16
17enum
18{
19 NDA_UNSPEC,
20 NDA_DST,
21 NDA_LLADDR,
22 NDA_CACHEINFO,
23 NDA_PROBES,
24 __NDA_MAX
25};
26
27#define NDA_MAX (__NDA_MAX - 1)
28
29/*
30 * Neighbor Cache Entry Flags
31 */
32
33#define NTF_PROXY 0x08 /* == ATF_PUBL */
34#define NTF_ROUTER 0x80
35
36/*
37 * Neighbor Cache Entry States.
38 */
39
40#define NUD_INCOMPLETE 0x01
41#define NUD_REACHABLE 0x02
42#define NUD_STALE 0x04
43#define NUD_DELAY 0x08
44#define NUD_PROBE 0x10
45#define NUD_FAILED 0x20
46
47/* Dummy states */
48#define NUD_NOARP 0x40
49#define NUD_PERMANENT 0x80
50#define NUD_NONE 0x00
51
52/* NUD_NOARP & NUD_PERMANENT are pseudostates, they never change
53 and make no address resolution or NUD.
54 NUD_PERMANENT is also cannot be deleted by garbage collectors.
55 */
56
57struct nda_cacheinfo
58{
59 __u32 ndm_confirmed;
60 __u32 ndm_used;
61 __u32 ndm_updated;
62 __u32 ndm_refcnt;
63};
64
65#endif
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 84f3eb426da..9750f0214c2 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -386,69 +386,6 @@ struct rta_session
386 386
387 387
388 388
389/**************************************************************
390 * Neighbour discovery.
391 ****/
392
393struct ndmsg
394{
395 unsigned char ndm_family;
396 unsigned char ndm_pad1;
397 unsigned short ndm_pad2;
398 int ndm_ifindex; /* Link index */
399 __u16 ndm_state;
400 __u8 ndm_flags;
401 __u8 ndm_type;
402};
403
404enum
405{
406 NDA_UNSPEC,
407 NDA_DST,
408 NDA_LLADDR,
409 NDA_CACHEINFO,
410 NDA_PROBES,
411 __NDA_MAX
412};
413
414#define NDA_MAX (__NDA_MAX - 1)
415
416#define NDA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndmsg))))
417#define NDA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndmsg))
418
419/*
420 * Neighbor Cache Entry Flags
421 */
422
423#define NTF_PROXY 0x08 /* == ATF_PUBL */
424#define NTF_ROUTER 0x80
425
426/*
427 * Neighbor Cache Entry States.
428 */
429
430#define NUD_INCOMPLETE 0x01
431#define NUD_REACHABLE 0x02
432#define NUD_STALE 0x04
433#define NUD_DELAY 0x08
434#define NUD_PROBE 0x10
435#define NUD_FAILED 0x20
436
437/* Dummy states */
438#define NUD_NOARP 0x40
439#define NUD_PERMANENT 0x80
440#define NUD_NONE 0x00
441
442
443struct nda_cacheinfo
444{
445 __u32 ndm_confirmed;
446 __u32 ndm_used;
447 __u32 ndm_updated;
448 __u32 ndm_refcnt;
449};
450
451
452/***************************************************************** 389/*****************************************************************
453 * Neighbour tables specific messages. 390 * Neighbour tables specific messages.
454 * 391 *
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 4901ee44687..74c4b6ff8a5 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -1,6 +1,8 @@
1#ifndef _NET_NEIGHBOUR_H 1#ifndef _NET_NEIGHBOUR_H
2#define _NET_NEIGHBOUR_H 2#define _NET_NEIGHBOUR_H
3 3
4#include <linux/neighbour.h>
5
4/* 6/*
5 * Generic neighbour manipulation 7 * Generic neighbour manipulation
6 * 8 *
@@ -14,40 +16,6 @@
14 * - Add neighbour cache statistics like rtstat 16 * - Add neighbour cache statistics like rtstat
15 */ 17 */
16 18
17/* The following flags & states are exported to user space,
18 so that they should be moved to include/linux/ directory.
19 */
20
21/*
22 * Neighbor Cache Entry Flags
23 */
24
25#define NTF_PROXY 0x08 /* == ATF_PUBL */
26#define NTF_ROUTER 0x80
27
28/*
29 * Neighbor Cache Entry States.
30 */
31
32#define NUD_INCOMPLETE 0x01
33#define NUD_REACHABLE 0x02
34#define NUD_STALE 0x04
35#define NUD_DELAY 0x08
36#define NUD_PROBE 0x10
37#define NUD_FAILED 0x20
38
39/* Dummy states */
40#define NUD_NOARP 0x40
41#define NUD_PERMANENT 0x80
42#define NUD_NONE 0x00
43
44/* NUD_NOARP & NUD_PERMANENT are pseudostates, they never change
45 and make no address resolution or NUD.
46 NUD_PERMANENT is also cannot be deleted by garbage collectors.
47 */
48
49#ifdef __KERNEL__
50
51#include <asm/atomic.h> 19#include <asm/atomic.h>
52#include <linux/netdevice.h> 20#include <linux/netdevice.h>
53#include <linux/skbuff.h> 21#include <linux/skbuff.h>
@@ -374,6 +342,3 @@ struct neighbour_cb {
374#define NEIGH_CB(skb) ((struct neighbour_cb *)(skb)->cb) 342#define NEIGH_CB(skb) ((struct neighbour_cb *)(skb)->cb)
375 343
376#endif 344#endif
377#endif
378
379