summaryrefslogtreecommitdiff
path: root/lib/zclient.h
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2021-03-17 18:12:26 +0100
committerPhilippe Guibert <philippe.guibert@6wind.com>2021-04-13 08:58:49 +0200
commitd603c0774ebac58557d8814bdbc2ad16249c21a1 (patch)
treed8f12549091b1b2a96d14aac67d677644c8ed677 /lib/zclient.h
parent850b2b70ac49643416c664d4326db530865f91c0 (diff)
nhrp, zebra, lib: enforce usage of zapi_neigh_ip structure
zapi_nbr structure is renamed to zapi_neigh_ip. Initially used to set a neighbor ip entry for gre interfaces, this structure is used to get events from the zebra layer to nhrp layer. The ndm state has been added, as it is needed on both sides. The zebra dplane layer is slightly modified. Also, to clarify what ZEBRA_NEIGH_ADD/DEL means, a rename is done: it is called now ZEBRA_NEIGH_IP_ADD/DEL, and it signified that this zapi interface permits to set link operations by associating ip addresses to link addresses. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'lib/zclient.h')
-rw-r--r--lib/zclient.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/zclient.h b/lib/zclient.h
index 25b7103116..90240e40b2 100644
--- a/lib/zclient.h
+++ b/lib/zclient.h
@@ -229,8 +229,8 @@ typedef enum {
ZEBRA_NHRP_NEIGH_GET,
ZEBRA_NHRP_NEIGH_REGISTER,
ZEBRA_NHRP_NEIGH_UNREGISTER,
- ZEBRA_NEIGH_ADD,
- ZEBRA_NEIGH_DEL,
+ ZEBRA_NEIGH_IP_ADD,
+ ZEBRA_NEIGH_IP_DEL,
ZEBRA_CONFIGURE_ARP,
} zebra_message_types_t;
@@ -809,13 +809,23 @@ extern struct zclient_options zclient_options_default;
/* link layer representation for GRE like interfaces
* ip_in is the underlay IP, ip_out is the tunnel dest
* index stands for the index of the interface
+ * ndm state stands for the NDM value in netlink
*/
-struct zapi_nbr {
+#define ZEBRA_NEIGH_STATE_REACHABLE (0x02)
+#define ZEBRA_NEIGH_STATE_FAILED (0x20)
+struct zapi_neigh_ip {
int cmd;
struct ipaddr ip_in;
struct ipaddr ip_out;
ifindex_t index;
+ uint32_t ndm_state;
};
+int zclient_neigh_ip_decode(struct stream *s, struct zapi_neigh_ip *api);
+int zclient_neigh_ip_encode(struct stream *s,
+ uint16_t cmd,
+ union sockunion *in,
+ union sockunion *out,
+ struct interface *ifp);
/*
* We reserve the top 4 bits for l2-NHG, everything else