summaryrefslogtreecommitdiff
path: root/lib/zclient.h
diff options
context:
space:
mode:
authorDaniel Walton <dwalton@cumulusnetworks.com>2017-08-28 06:59:38 -0700
committerDaniel Walton <dwalton@cumulusnetworks.com>2017-08-28 06:59:38 -0700
commit31d5efe2ea59ea4bc2e1101127c757129e9a5327 (patch)
tree78a22166c0865bc81800566c912fc8058d9fbef0 /lib/zclient.h
parent7f32323620077157dda1127c86ea792e4f5fcd89 (diff)
parent3df31ebb0328b4b84fa11d5fbd956dcc30c44dfe (diff)
Merge branch 'master' of https://github.com/dwalton76/frr into bgpd-draft-ietf-grow-bgp-gshut-10
Conflicts: bgpd/bgp_route.c
Diffstat (limited to 'lib/zclient.h')
-rw-r--r--lib/zclient.h72
1 files changed, 37 insertions, 35 deletions
diff --git a/lib/zclient.h b/lib/zclient.h
index 15d1858d84..7c4780201e 100644
--- a/lib/zclient.h
+++ b/lib/zclient.h
@@ -21,7 +21,7 @@
#ifndef _ZEBRA_ZCLIENT_H
#define _ZEBRA_ZCLIENT_H
-/* For struct zapi_ipv{4,6}. */
+/* For struct zapi_route. */
#include "prefix.h"
/* For struct interface and struct connected. */
@@ -59,6 +59,8 @@ typedef enum {
ZEBRA_INTERFACE_UP,
ZEBRA_INTERFACE_DOWN,
ZEBRA_INTERFACE_SET_MASTER,
+ ZEBRA_ROUTE_ADD,
+ ZEBRA_ROUTE_DELETE,
ZEBRA_IPV4_ROUTE_ADD,
ZEBRA_IPV4_ROUTE_DELETE,
ZEBRA_IPV6_ROUTE_ADD,
@@ -85,10 +87,8 @@ typedef enum {
ZEBRA_BFD_DEST_DEREGISTER,
ZEBRA_BFD_DEST_UPDATE,
ZEBRA_BFD_DEST_REPLAY,
- ZEBRA_REDISTRIBUTE_IPV4_ADD,
- ZEBRA_REDISTRIBUTE_IPV4_DEL,
- ZEBRA_REDISTRIBUTE_IPV6_ADD,
- ZEBRA_REDISTRIBUTE_IPV6_DEL,
+ ZEBRA_REDISTRIBUTE_ROUTE_ADD,
+ ZEBRA_REDISTRIBUTE_ROUTE_DEL,
ZEBRA_VRF_UNREGISTER,
ZEBRA_VRF_ADD,
ZEBRA_VRF_DELETE,
@@ -100,10 +100,6 @@ typedef enum {
ZEBRA_INTERFACE_LINK_PARAMS,
ZEBRA_MPLS_LABELS_ADD,
ZEBRA_MPLS_LABELS_DELETE,
- ZEBRA_IPV4_NEXTHOP_ADD,
- ZEBRA_IPV4_NEXTHOP_DELETE,
- ZEBRA_IPV6_NEXTHOP_ADD,
- ZEBRA_IPV6_NEXTHOP_DELETE,
ZEBRA_IPMR_ROUTE_STATS,
ZEBRA_LABEL_MANAGER_CONNECT,
ZEBRA_GET_LABEL_CHUNK,
@@ -141,10 +137,6 @@ struct zclient {
/* Socket to zebra daemon. */
int sock;
- /* Flag of communication to zebra is enabled or not. Default is on.
- This flag is disabled by `no router zebra' statement. */
- int enable;
-
/* Connection failure count. */
int fail;
@@ -194,14 +186,10 @@ struct zclient {
int (*nexthop_update)(int, struct zclient *, uint16_t, vrf_id_t);
int (*import_check_update)(int, struct zclient *, uint16_t, vrf_id_t);
int (*bfd_dest_replay)(int, struct zclient *, uint16_t, vrf_id_t);
- int (*redistribute_route_ipv4_add)(int, struct zclient *, uint16_t,
- vrf_id_t);
- int (*redistribute_route_ipv4_del)(int, struct zclient *, uint16_t,
- vrf_id_t);
- int (*redistribute_route_ipv6_add)(int, struct zclient *, uint16_t,
- vrf_id_t);
- int (*redistribute_route_ipv6_del)(int, struct zclient *, uint16_t,
- vrf_id_t);
+ int (*redistribute_route_add)(int, struct zclient *, uint16_t,
+ vrf_id_t);
+ int (*redistribute_route_del)(int, struct zclient *, uint16_t,
+ vrf_id_t);
int (*fec_update)(int, struct zclient *, uint16_t);
int (*local_vni_add)(int, struct zclient *, uint16_t, vrf_id_t);
int (*local_vni_del)(int, struct zclient *, uint16_t, vrf_id_t);
@@ -212,13 +200,12 @@ struct zclient {
/* Zebra API message flag. */
#define ZAPI_MESSAGE_NEXTHOP 0x01
-#define ZAPI_MESSAGE_IFINDEX 0x02
-#define ZAPI_MESSAGE_DISTANCE 0x04
-#define ZAPI_MESSAGE_METRIC 0x08
-#define ZAPI_MESSAGE_TAG 0x10
-#define ZAPI_MESSAGE_MTU 0x20
-#define ZAPI_MESSAGE_SRCPFX 0x40
-#define ZAPI_MESSAGE_LABEL 0x80
+#define ZAPI_MESSAGE_DISTANCE 0x02
+#define ZAPI_MESSAGE_METRIC 0x04
+#define ZAPI_MESSAGE_TAG 0x08
+#define ZAPI_MESSAGE_MTU 0x10
+#define ZAPI_MESSAGE_SRCPFX 0x20
+#define ZAPI_MESSAGE_LABEL 0x40
/* Zserv protocol message header */
struct zserv_header {
@@ -232,6 +219,16 @@ struct zserv_header {
uint16_t command;
};
+struct zapi_nexthop {
+ enum nexthop_types_t type;
+ ifindex_t ifindex;
+ union g_addr gate;
+
+ /* MPLS labels for BGP-LU or Segment Routing */
+ uint8_t label_num;
+ mpls_label_t labels[MPLS_MAX_LABELS];
+};
+
struct zapi_route {
u_char type;
u_short instance;
@@ -242,8 +239,11 @@ struct zapi_route {
safi_t safi;
- u_char nexthop_num;
- struct nexthop **nexthop;
+ struct prefix prefix;
+ struct prefix_ipv6 src_prefix;
+
+ u_int16_t nexthop_num;
+ struct zapi_nexthop nexthops[MULTIPATH_NUM];
u_char distance;
@@ -369,7 +369,7 @@ extern struct interface *zebra_interface_vrf_update_read(struct stream *s,
extern void zebra_interface_if_set_value(struct stream *, struct interface *);
extern void zebra_router_id_update_read(struct stream *s, struct prefix *rid);
extern int zapi_ipv4_route(u_char, struct zclient *, struct prefix_ipv4 *,
- struct zapi_ipv4 *);
+ struct zapi_ipv4 *) __attribute__((deprecated));
extern struct interface *zebra_interface_link_params_read(struct stream *);
extern size_t zebra_interface_link_params_write(struct stream *,
@@ -420,11 +420,13 @@ struct zapi_ipv6 {
extern int zapi_ipv6_route(u_char cmd, struct zclient *zclient,
struct prefix_ipv6 *p, struct prefix_ipv6 *src_p,
- struct zapi_ipv6 *api);
+ struct zapi_ipv6 *api) __attribute__((deprecated));
extern int zapi_ipv4_route_ipv6_nexthop(u_char, struct zclient *,
struct prefix_ipv4 *,
- struct zapi_ipv6 *);
-extern int zapi_route(u_char cmd, struct zclient *zclient, struct prefix *p,
- struct prefix_ipv6 *src_p, struct zapi_route *api);
+ struct zapi_ipv6 *)
+ __attribute__((deprecated));
+extern int zclient_route_send(u_char, struct zclient *, struct zapi_route *);
+extern int zapi_route_encode(u_char, struct stream *, struct zapi_route *);
+extern int zapi_route_decode(struct stream *, struct zapi_route *);
#endif /* _ZEBRA_ZCLIENT_H */