summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJamie Bainbridge <jamie.bainbridge@gmail.com>2016-03-10 16:12:05 +1000
committerJiri Pirko <jiri@mellanox.com>2016-03-10 08:38:01 +0100
commitcb1ab5fc8b993f23924385ebee42d52ff45e4e8a (patch)
tree1122cbdbf48523ab2fc139023d3e1a5b96e4192c /include
parent93d9252427e459d0a4b9434c3ef62685ee5d2d45 (diff)
downloadlibndp-cb1ab5fc8b993f23924385ebee42d52ff45e4e8a.tar.gz
libndp: add option flags to send messages
Within NA and RA message types, there are flags such as Solicited and Override (RFC-4861 Section 4). RA flags are currently implemented but not NA flags, so add remaining NA flag getters/setters. Set Solicited/Override flag on NA when appropriate, add a flags interface to the send API, and implement ability to send Unsolicited NA. Signed-off-by: Jamie Bainbridge <jamie.bainbridge@gmail.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Diffstat (limited to 'include')
-rw-r--r--include/ndp.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/ndp.h b/include/ndp.h
index 4ca33b8..09b234f 100644
--- a/include/ndp.h
+++ b/include/ndp.h
@@ -53,6 +53,9 @@ enum ndp_msg_type {
NDP_MSG_ALL, /* Matches all */
};
+#define ND_OPT_NORMAL 0x0000 /* default, no change to ND message */
+#define ND_OPT_NA_UNSOL 0x0001 /* Unsolicited Neighbour Advertisement */
+
enum ndp_route_preference {
NDP_ROUTE_PREF_LOW = 3,
NDP_ROUTE_PREF_MEDIUM = 0,
@@ -76,7 +79,7 @@ enum ndp_msg_type ndp_msg_type(struct ndp_msg *msg);
struct in6_addr *ndp_msg_addrto(struct ndp_msg *msg);
uint32_t ndp_msg_ifindex(struct ndp_msg *msg);
void ndp_msg_ifindex_set(struct ndp_msg *msg, uint32_t ifindex);
-int ndp_msg_send(struct ndp *ndp, struct ndp_msg *msg);
+int ndp_msg_send(struct ndp *ndp, struct ndp_msg *msg, uint8_t flags);
uint8_t ndp_msgra_curhoplimit(struct ndp_msgra *msgra);
void ndp_msgra_curhoplimit_set(struct ndp_msgra *msgra, uint8_t curhoplimit);
@@ -100,6 +103,14 @@ uint32_t ndp_msgra_retransmit_time(struct ndp_msgra *msgra);
void ndp_msgra_retransmit_time_set(struct ndp_msgra *msgra,
uint32_t retransmit_time);
+bool ndp_msgna_flag_router(struct ndp_msgna *msgna);
+void ndp_msgna_flag_router_set(struct ndp_msgna *msgna, bool flag_router);
+bool ndp_msgna_flag_solicited(struct ndp_msgna *msgna);
+void ndp_msgna_flag_solicited_set(struct ndp_msgna *msgna,
+ bool flag_solicited);
+bool ndp_msgna_flag_override(struct ndp_msgna *msgna);
+void ndp_msgna_flag_override_set(struct ndp_msgna *msgna, bool flag_override);
+
enum ndp_msg_opt_type {
NDP_MSG_OPT_SLLADDR, /* Source Link-layer Address */
NDP_MSG_OPT_TLLADDR, /* Target Link-layer Address */