diff options
author | Pierre Ynard <linkfanel@yahoo.fr> | 2007-10-11 00:22:05 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-10-11 00:22:05 -0400 |
commit | 31910575a9de61e78065e93846e8e7a4894a18bf (patch) | |
tree | 5dcc41957a62b8ec06575ebfe47c75828caf8bfb /include | |
parent | 092e9d93b3728d484a4e73df9852dc4002cf9923 (diff) |
[IPv6]: Export userland ND options through netlink (RDNSS support)
As discussed before, this patch provides userland with a way to access
relevant options in Router Advertisements, after they are processed
and validated by the kernel. Extra options are processed in a generic
way; this patch only exports RDNSS options described in RFC5006, but
support to control which options are exported could be easily added.
A new rtnetlink message type is defined, to transport Neighbor
Discovery options, along with optional context information. At the
moment only the address of the router sending an RDNSS option is
included, but additional attributes may be later defined, if needed by
new use cases.
Signed-off-by: Pierre Ynard <linkfanel@yahoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/rtnetlink.h | 29 | ||||
-rw-r--r-- | include/net/ndisc.h | 1 |
2 files changed, 30 insertions, 0 deletions
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index dff3192374f8..5bf618241ab9 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -97,6 +97,9 @@ enum { | |||
97 | RTM_SETNEIGHTBL, | 97 | RTM_SETNEIGHTBL, |
98 | #define RTM_SETNEIGHTBL RTM_SETNEIGHTBL | 98 | #define RTM_SETNEIGHTBL RTM_SETNEIGHTBL |
99 | 99 | ||
100 | RTM_NEWNDUSEROPT = 68, | ||
101 | #define RTM_NEWNDUSEROPT RTM_NEWNDUSEROPT | ||
102 | |||
100 | __RTM_MAX, | 103 | __RTM_MAX, |
101 | #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) | 104 | #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) |
102 | }; | 105 | }; |
@@ -479,6 +482,30 @@ enum | |||
479 | #define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg)))) | 482 | #define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg)))) |
480 | #define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg)) | 483 | #define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg)) |
481 | 484 | ||
485 | /******************************************************************** | ||
486 | * Neighbor Discovery userland options | ||
487 | ****/ | ||
488 | |||
489 | struct nduseroptmsg | ||
490 | { | ||
491 | unsigned char nduseropt_family; | ||
492 | unsigned char nduseropt_pad1; | ||
493 | unsigned short nduseropt_opts_len; /* Total length of options */ | ||
494 | __u8 nduseropt_icmp_type; | ||
495 | __u8 nduseropt_icmp_code; | ||
496 | unsigned short nduseropt_pad2; | ||
497 | /* Followed by one or more ND options */ | ||
498 | }; | ||
499 | |||
500 | enum | ||
501 | { | ||
502 | NDUSEROPT_UNSPEC, | ||
503 | NDUSEROPT_SRCADDR, | ||
504 | __NDUSEROPT_MAX | ||
505 | }; | ||
506 | |||
507 | #define NDUSEROPT_MAX (__NDUSEROPT_MAX - 1) | ||
508 | |||
482 | #ifndef __KERNEL__ | 509 | #ifndef __KERNEL__ |
483 | /* RTnetlink multicast groups - backwards compatibility for userspace */ | 510 | /* RTnetlink multicast groups - backwards compatibility for userspace */ |
484 | #define RTMGRP_LINK 1 | 511 | #define RTMGRP_LINK 1 |
@@ -542,6 +569,8 @@ enum rtnetlink_groups { | |||
542 | #define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX | 569 | #define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX |
543 | RTNLGRP_IPV6_RULE, | 570 | RTNLGRP_IPV6_RULE, |
544 | #define RTNLGRP_IPV6_RULE RTNLGRP_IPV6_RULE | 571 | #define RTNLGRP_IPV6_RULE RTNLGRP_IPV6_RULE |
572 | RTNLGRP_ND_USEROPT, | ||
573 | #define RTNLGRP_ND_USEROPT RTNLGRP_ND_USEROPT | ||
545 | __RTNLGRP_MAX | 574 | __RTNLGRP_MAX |
546 | }; | 575 | }; |
547 | #define RTNLGRP_MAX (__RTNLGRP_MAX - 1) | 576 | #define RTNLGRP_MAX (__RTNLGRP_MAX - 1) |
diff --git a/include/net/ndisc.h b/include/net/ndisc.h index 475b10c575b3..6684f7efbeeb 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h | |||
@@ -24,6 +24,7 @@ enum { | |||
24 | ND_OPT_MTU = 5, /* RFC2461 */ | 24 | ND_OPT_MTU = 5, /* RFC2461 */ |
25 | __ND_OPT_ARRAY_MAX, | 25 | __ND_OPT_ARRAY_MAX, |
26 | ND_OPT_ROUTE_INFO = 24, /* RFC4191 */ | 26 | ND_OPT_ROUTE_INFO = 24, /* RFC4191 */ |
27 | ND_OPT_RDNSS = 25, /* RFC5006 */ | ||
27 | __ND_OPT_MAX | 28 | __ND_OPT_MAX |
28 | }; | 29 | }; |
29 | 30 | ||