summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/ndp.h1
-rw-r--r--libndp/libndp.c12
2 files changed, 13 insertions, 0 deletions
diff --git a/include/ndp.h b/include/ndp.h
index cf5fadb..6f310d6 100644
--- a/include/ndp.h
+++ b/include/ndp.h
@@ -101,6 +101,7 @@ struct ndp_msgr *ndp_msgr(struct ndp_msg *msg);
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);
typedef int (*ndp_msgrcv_handler_func_t)(struct ndp *ndp, struct ndp_msg *msg,
diff --git a/libndp/libndp.c b/libndp/libndp.c
index 99ad3b5..0c631b0 100644
--- a/libndp/libndp.c
+++ b/libndp/libndp.c
@@ -1035,6 +1035,18 @@ uint32_t ndp_msg_ifindex(struct ndp_msg *msg)
}
/**
+ * ndp_msg_ifindex_set:
+ * @msg: message structure
+ *
+ * Set raw interface index of message.
+ **/
+NDP_EXPORT
+void ndp_msg_ifindex_set(struct ndp_msg *msg, uint32_t ifindex)
+{
+ msg->ifindex = ifindex;
+}
+
+/**
* ndp_msg_send:
* @ndp: libndp library context
* @msg: message structure