diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/mpls.c | 11 | ||||
| -rw-r--r-- | lib/mpls.h | 39 | ||||
| -rw-r--r-- | lib/nexthop_group.c | 51 | ||||
| -rw-r--r-- | lib/nexthop_group.h | 2 | ||||
| -rw-r--r-- | lib/routemap.c | 67 | ||||
| -rw-r--r-- | lib/routemap.h | 4 | ||||
| -rw-r--r-- | lib/subdir.am | 1 | ||||
| -rw-r--r-- | lib/yang_translator.c | 14 | ||||
| -rw-r--r-- | lib/zclient.c | 3 | ||||
| -rw-r--r-- | lib/zclient.h | 1 | ||||
| -rw-r--r-- | lib/zebra.h | 50 |
11 files changed, 167 insertions, 76 deletions
diff --git a/lib/mpls.c b/lib/mpls.c index ac5792a686..1b21dd29ff 100644 --- a/lib/mpls.c +++ b/lib/mpls.c @@ -80,7 +80,7 @@ int mpls_str2label(const char *label_str, uint8_t *num_labels, * Label to string conversion, labels in string separated by '/'. */ char *mpls_label2str(uint8_t num_labels, const mpls_label_t *labels, char *buf, - int len, int pretty) + int len, enum lsp_types_t type, int pretty) { char label_buf[BUFSIZ]; int i; @@ -90,9 +90,14 @@ char *mpls_label2str(uint8_t num_labels, const mpls_label_t *labels, char *buf, if (i != 0) strlcat(buf, "/", len); if (pretty) - label2str(labels[i], label_buf, sizeof(label_buf)); + label2str(labels[i], type, label_buf, + sizeof(label_buf)); else - snprintf(label_buf, sizeof(label_buf), "%u", labels[i]); + snprintf(label_buf, sizeof(label_buf), "%u", + ((type == ZEBRA_LSP_EVPN) + ? label2vni(&labels[i]) + : labels[i])); + strlcat(buf, label_buf, len); } diff --git a/lib/mpls.h b/lib/mpls.h index 74bd7aae3e..069e560f80 100644 --- a/lib/mpls.h +++ b/lib/mpls.h @@ -23,6 +23,7 @@ #define _QUAGGA_MPLS_H #include <zebra.h> +#include <vxlan.h> #include <arpa/inet.h> #ifdef __cplusplus @@ -129,10 +130,36 @@ enum lsp_types_t { ZEBRA_LSP_ISIS_SR = 5,/* IS-IS Segment Routing LSP. */ ZEBRA_LSP_SHARP = 6, /* Identifier for test protocol */ ZEBRA_LSP_SRTE = 7, /* SR-TE LSP */ + ZEBRA_LSP_EVPN = 8, /* EVPN VNI Label */ }; /* Functions for basic label operations. */ +static inline void vni2label(vni_t vni, mpls_label_t *label) +{ + uint8_t *tag = (uint8_t *)label; + + assert(tag); + + tag[0] = (vni >> 16) & 0xFF; + tag[1] = (vni >> 8) & 0xFF; + tag[2] = vni & 0xFF; +} + +static inline vni_t label2vni(const mpls_label_t *label) +{ + uint8_t *tag = (uint8_t *)label; + vni_t vni; + + assert(tag); + + vni = ((uint32_t)*tag++ << 16); + vni |= (uint32_t)*tag++ << 8; + vni |= (uint32_t)(*tag & 0xFF); + + return vni; +} + /* Encode a label stack entry from fields; convert to network byte-order as * the Netlink interface expects MPLS labels to be in this format. */ @@ -168,8 +195,14 @@ static inline void mpls_lse_decode(mpls_lse_t lse, mpls_label_t *label, #define MPLS_INVALID_LABEL_INDEX 0xFFFFFFFF /* Printable string for labels (with consideration for reserved values). */ -static inline char *label2str(mpls_label_t label, char *buf, size_t len) +static inline char *label2str(mpls_label_t label, enum lsp_types_t type, + char *buf, size_t len) { + if (type == ZEBRA_LSP_EVPN) { + snprintf(buf, len, "%u", label2vni(&label)); + return (buf); + } + switch (label) { case MPLS_LABEL_IPV4_EXPLICIT_NULL: strlcpy(buf, "IPv4 Explicit Null", len); @@ -200,7 +233,7 @@ static inline char *label2str(mpls_label_t label, char *buf, size_t len) snprintf(buf, len, "Reserved (%u)", label); else snprintf(buf, len, "%u", label); - return (buf); + return buf; } } @@ -217,7 +250,7 @@ int mpls_str2label(const char *label_str, uint8_t *num_labels, * Label to string conversion, labels in string separated by '/'. */ char *mpls_label2str(uint8_t num_labels, const mpls_label_t *labels, char *buf, - int len, int pretty); + int len, enum lsp_types_t type, int pretty); #ifdef __cplusplus } diff --git a/lib/nexthop_group.c b/lib/nexthop_group.c index 41fe64606b..fd7eee213c 100644 --- a/lib/nexthop_group.c +++ b/lib/nexthop_group.c @@ -41,6 +41,7 @@ struct nexthop_hold { char *intf; bool onlink; char *labels; + vni_t vni; uint32_t weight; char *backup_str; }; @@ -131,6 +132,18 @@ nexthop_group_active_nexthop_num_no_recurse(const struct nexthop_group *nhg) return num; } +bool nexthop_group_has_label(const struct nexthop_group *nhg) +{ + struct nexthop *nhop; + + for (ALL_NEXTHOPS_PTR(nhg, nhop)) { + if (nhop->nh_label) + return true; + } + + return false; +} + struct nexthop *nexthop_exists(const struct nexthop_group *nhg, const struct nexthop *nh) { @@ -791,12 +804,13 @@ static bool nexthop_group_parse_nexthop(struct nexthop *nhop, const union sockunion *addr, const char *intf, bool onlink, const char *name, const char *labels, - int *lbl_ret, uint32_t weight, - const char *backup_str) + vni_t vni, int *lbl_ret, + uint32_t weight, const char *backup_str) { int ret = 0; struct vrf *vrf; int num; + uint8_t labelnum = 0; memset(nhop, 0, sizeof(*nhop)); @@ -837,10 +851,9 @@ static bool nexthop_group_parse_nexthop(struct nexthop *nhop, nhop->type = NEXTHOP_TYPE_IFINDEX; if (labels) { - uint8_t num = 0; mpls_label_t larray[MPLS_MAX_LABELS]; - ret = mpls_str2label(labels, &num, larray); + ret = mpls_str2label(labels, &labelnum, larray); /* Return label parse result */ if (lbl_ret) @@ -848,9 +861,14 @@ static bool nexthop_group_parse_nexthop(struct nexthop *nhop, if (ret < 0) return false; - else if (num > 0) - nexthop_add_labels(nhop, ZEBRA_LSP_NONE, - num, larray); + else if (labelnum > 0) + nexthop_add_labels(nhop, ZEBRA_LSP_NONE, labelnum, + larray); + } else if (vni) { + mpls_label_t label = MPLS_INVALID_LABEL; + + vni2label(vni, &label); + nexthop_add_labels(nhop, ZEBRA_LSP_EVPN, 1, &label); } nhop->weight = weight; @@ -877,7 +895,7 @@ static bool nexthop_group_parse_nhh(struct nexthop *nhop, { return (nexthop_group_parse_nexthop( nhop, nhh->addr, nhh->intf, nhh->onlink, nhh->nhvrf_name, - nhh->labels, NULL, nhh->weight, nhh->backup_str)); + nhh->labels, nhh->vni, NULL, nhh->weight, nhh->backup_str)); } DEFPY(ecmp_nexthops, ecmp_nexthops_cmd, @@ -889,6 +907,7 @@ DEFPY(ecmp_nexthops, ecmp_nexthops_cmd, [{ \ nexthop-vrf NAME$vrf_name \ |label WORD \ + |vni (1-16777215) \ |weight (1-255) \ |backup-idx WORD \ }]", @@ -903,6 +922,8 @@ DEFPY(ecmp_nexthops, ecmp_nexthops_cmd, "The nexthop-vrf Name\n" "Specify label(s) for this nexthop\n" "One or more labels in the range (16-1048575) separated by '/'\n" + "Specify VNI(s) for this nexthop\n" + "VNI in the range (1-16777215)\n" "Weight to be used by the nexthop for purposes of ECMP\n" "Weight value to be used\n" "Specify backup nexthop indexes in another group\n" @@ -927,8 +948,8 @@ DEFPY(ecmp_nexthops, ecmp_nexthops_cmd, } legal = nexthop_group_parse_nexthop(&nhop, addr, intf, !!onlink, - vrf_name, label, &lbl_ret, weight, - backup_idx); + vrf_name, label, vni, &lbl_ret, + weight, backup_idx); if (nhop.type == NEXTHOP_TYPE_IPV6 && IN6_IS_ADDR_LINKLOCAL(&nhop.gate.ipv6)) { @@ -1058,9 +1079,8 @@ void nexthop_group_write_nexthop(struct vty *vty, const struct nexthop *nh) if (nh->nh_label && nh->nh_label->num_labels > 0) { char buf[200]; - mpls_label2str(nh->nh_label->num_labels, - nh->nh_label->label, - buf, sizeof(buf), 0); + mpls_label2str(nh->nh_label->num_labels, nh->nh_label->label, + buf, sizeof(buf), nh->nh_label_type, 0); vty_out(vty, " label %s", buf); } @@ -1117,7 +1137,7 @@ void nexthop_group_json_nexthop(json_object *j, const struct nexthop *nh) char buf[200]; mpls_label2str(nh->nh_label->num_labels, nh->nh_label->label, - buf, sizeof(buf), 0); + buf, sizeof(buf), nh->nh_label_type, 0); json_object_string_add(j, "label", buf); } @@ -1155,6 +1175,9 @@ static void nexthop_group_write_nexthop_internal(struct vty *vty, if (nh->labels) vty_out(vty, " label %s", nh->labels); + if (nh->vni) + vty_out(vty, " vni %u", nh->vni); + if (nh->weight) vty_out(vty, " weight %u", nh->weight); diff --git a/lib/nexthop_group.h b/lib/nexthop_group.h index 0ea0b7c185..4d560fc438 100644 --- a/lib/nexthop_group.h +++ b/lib/nexthop_group.h @@ -170,6 +170,8 @@ nexthop_group_active_nexthop_num(const struct nexthop_group *nhg); extern uint8_t nexthop_group_active_nexthop_num_no_recurse(const struct nexthop_group *nhg); +extern bool nexthop_group_has_label(const struct nexthop_group *nhg); + #ifdef __cplusplus } #endif diff --git a/lib/routemap.c b/lib/routemap.c index f56e6a6122..4b9033594c 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -36,6 +36,8 @@ #include "json.h" #include "jhash.h" +#include "lib/routemap_clippy.c" + DEFINE_MTYPE_STATIC(LIB, ROUTE_MAP, "Route map"); DEFINE_MTYPE(LIB, ROUTE_MAP_NAME, "Route map name"); DEFINE_MTYPE_STATIC(LIB, ROUTE_MAP_INDEX, "Route map index"); @@ -613,7 +615,8 @@ static unsigned int route_map_dep_hash_make_key(const void *p); static void route_map_clear_all_references(char *rmap_name); static void route_map_rule_delete(struct route_map_rule_list *, struct route_map_rule *); -static bool rmap_debug; + +uint32_t rmap_debug; /* New route map allocation. Please note route map's name must be specified. */ @@ -681,7 +684,7 @@ static struct route_map *route_map_add(const char *name) if (!map->ipv6_prefix_table) map->ipv6_prefix_table = route_table_init(); - if (rmap_debug) + if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP)) zlog_debug("Add route-map %s", name); return map; } @@ -701,7 +704,7 @@ static void route_map_free_map(struct route_map *map) while ((index = map->head) != NULL) route_map_index_delete(index, 0); - if (rmap_debug) + if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP)) zlog_debug("Deleting route-map %s", map->name); list = &route_map_master; @@ -1132,7 +1135,7 @@ void route_map_index_delete(struct route_map_index *index, int notify) QOBJ_UNREG(index); - if (rmap_debug) + if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP)) zlog_debug("Deleting route-map %s sequence %d", index->map->name, index->pref); @@ -1243,7 +1246,7 @@ route_map_index_add(struct route_map *map, enum route_map_type type, int pref) route_map_notify_dependencies(map->name, RMAP_EVENT_CALL_ADDED); } - if (rmap_debug) + if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP)) zlog_debug("Route-map %s add sequence %d, type: %s", map->name, pref, route_map_type_str(type)); @@ -2580,13 +2583,13 @@ route_map_result_t route_map_apply_ext(struct route_map *map, &match_ret); if (index) { index->applied++; - if (rmap_debug) + if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP)) zlog_debug( "Best match route-map: %s, sequence: %d for pfx: %pFX, result: %s", map->name, index->pref, prefix, route_map_cmd_result_str(match_ret)); } else { - if (rmap_debug) + if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP)) zlog_debug( "No best match sequence for pfx: %pFX in route-map: %s, result: %s", prefix, map->name, @@ -2612,7 +2615,7 @@ route_map_result_t route_map_apply_ext(struct route_map *map, /* Apply this index. */ match_ret = route_map_apply_match(&index->match_list, prefix, match_object); - if (rmap_debug) { + if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP)) { zlog_debug( "Route-map: %s, sequence: %d, prefix: %pFX, result: %s", map->name, index->pref, prefix, @@ -2725,7 +2728,7 @@ route_map_result_t route_map_apply_ext(struct route_map *map, } route_map_apply_end: - if (rmap_debug) + if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP)) zlog_debug("Route-map: %s, prefix: %pFX, result: %s", (map ? map->name : "null"), prefix, route_map_result_str(ret)); @@ -2780,7 +2783,7 @@ static void route_map_clear_reference(struct hash_bucket *bucket, void *arg) tmp_dep_data.rname = arg; dep_data = hash_release(dep->dep_rmap_hash, &tmp_dep_data); if (dep_data) { - if (rmap_debug) + if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP)) zlog_debug("Clearing reference for %s to %s count: %d", dep->dep_name, tmp_dep_data.rname, dep_data->refcnt); @@ -2800,7 +2803,7 @@ static void route_map_clear_all_references(char *rmap_name) { int i; - if (rmap_debug) + if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP)) zlog_debug("Clearing references for %s", rmap_name); for (i = 1; i < ROUTE_MAP_DEP_MAX; i++) { @@ -2876,7 +2879,7 @@ static int route_map_dep_update(struct hash *dephash, const char *dep_name, case RMAP_EVENT_LLIST_ADDED: case RMAP_EVENT_CALL_ADDED: case RMAP_EVENT_FILTER_ADDED: - if (rmap_debug) + if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP)) zlog_debug("Adding dependency for filter %s in route-map %s", dep_name, rmap_name); dep = (struct route_map_dep *)hash_get( @@ -2905,7 +2908,7 @@ static int route_map_dep_update(struct hash *dephash, const char *dep_name, case RMAP_EVENT_LLIST_DELETED: case RMAP_EVENT_CALL_DELETED: case RMAP_EVENT_FILTER_DELETED: - if (rmap_debug) + if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP)) zlog_debug("Deleting dependency for filter %s in route-map %s", dep_name, rmap_name); dep = (struct route_map_dep *)hash_get(dephash, dname, NULL); @@ -2959,7 +2962,7 @@ static int route_map_dep_update(struct hash *dephash, const char *dep_name, } if (dep) { - if (rmap_debug) + if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP)) hash_iterate(dep->dep_rmap_hash, route_map_print_dependency, dname); } @@ -3031,7 +3034,7 @@ static void route_map_process_dependency(struct hash_bucket *bucket, void *data) dep_data = bucket->data; rmap_name = dep_data->rname; - if (rmap_debug) + if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP)) zlog_debug("Notifying %s of dependency", rmap_name); if (route_map_master.event_hook) (*route_map_master.event_hook)(rmap_name); @@ -3079,7 +3082,7 @@ void route_map_notify_dependencies(const char *affected_name, if (!dep->this_hash) dep->this_hash = upd8_hash; - if (rmap_debug) + if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP)) zlog_debug("Filter %s updated", dep->dep_name); hash_iterate(dep->dep_rmap_hash, route_map_process_dependency, (void *)event); @@ -3157,24 +3160,34 @@ DEFUN (rmap_show_unused, return vty_show_unused_route_map(vty); } -DEFUN (debug_rmap, +DEFPY (debug_rmap, debug_rmap_cmd, - "debug route-map", + "debug route-map [detail]$detail", DEBUG_STR - "Debug option set for route-maps\n") + "Debug option set for route-maps\n" + "Detailed output\n") { - rmap_debug = true; + if (!detail) + SET_FLAG(rmap_debug, DEBUG_ROUTEMAP); + else + SET_FLAG(rmap_debug, DEBUG_ROUTEMAP | DEBUG_ROUTEMAP_DETAIL); + return CMD_SUCCESS; } -DEFUN (no_debug_rmap, +DEFPY (no_debug_rmap, no_debug_rmap_cmd, - "no debug route-map", + "no debug route-map [detail]$detail", NO_STR DEBUG_STR - "Debug option set for route-maps\n") + "Debug option set for route-maps\n" + "Detailed output\n") { - rmap_debug = false; + if (!detail) + UNSET_FLAG(rmap_debug, DEBUG_ROUTEMAP); + else + UNSET_FLAG(rmap_debug, DEBUG_ROUTEMAP | DEBUG_ROUTEMAP_DETAIL); + return CMD_SUCCESS; } @@ -3189,7 +3202,7 @@ static struct cmd_node rmap_debug_node = { void route_map_show_debug(struct vty *vty) { - if (rmap_debug) + if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP)) vty_out(vty, "debug route-map\n"); } @@ -3198,7 +3211,7 @@ static int rmap_config_write_debug(struct vty *vty) { int write = 0; - if (rmap_debug) { + if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP)) { vty_out(vty, "debug route-map\n"); write++; } @@ -3400,7 +3413,7 @@ void route_map_init(void) 8, route_map_dep_hash_make_key, route_map_dep_hash_cmp, "Route Map Dep Hash"); - rmap_debug = false; + UNSET_FLAG(rmap_debug, DEBUG_ROUTEMAP); route_map_cli_init(); diff --git a/lib/routemap.h b/lib/routemap.h index 9c78e15735..ddcb8f2ddb 100644 --- a/lib/routemap.h +++ b/lib/routemap.h @@ -37,6 +37,10 @@ DECLARE_MTYPE(ROUTE_MAP_NAME); DECLARE_MTYPE(ROUTE_MAP_RULE); DECLARE_MTYPE(ROUTE_MAP_COMPILED); +#define DEBUG_ROUTEMAP 0x01 +#define DEBUG_ROUTEMAP_DETAIL 0x02 +extern uint32_t rmap_debug; + /* Route map's type. */ enum route_map_type { RMAP_PERMIT, RMAP_DENY, RMAP_ANY }; diff --git a/lib/subdir.am b/lib/subdir.am index ba576a80ed..8d00668c8c 100644 --- a/lib/subdir.am +++ b/lib/subdir.am @@ -158,6 +158,7 @@ clippy_scan += \ lib/nexthop_group.c \ lib/northbound_cli.c \ lib/plist.c \ + lib/routemap.c \ lib/routemap_cli.c \ lib/thread.c \ lib/vty.c \ diff --git a/lib/yang_translator.c b/lib/yang_translator.c index 67b7f9aa70..de5dc4d434 100644 --- a/lib/yang_translator.c +++ b/lib/yang_translator.c @@ -127,10 +127,15 @@ static void yang_mapping_add(struct yang_translator *translator, int dir, } } +static void yang_tmodule_delete(struct yang_tmodule *tmodule) +{ + XFREE(MTYPE_YANG_TRANSLATOR_MODULE, tmodule); +} + struct yang_translator *yang_translator_load(const char *path) { struct yang_translator *translator; - struct yang_tmodule *tmodule; + struct yang_tmodule *tmodule = NULL; const char *family; struct lyd_node *dnode; struct ly_set *set; @@ -160,6 +165,7 @@ struct yang_translator *yang_translator_load(const char *path) flog_warn(EC_LIB_YANG_TRANSLATOR_LOAD, "%s: module translator \"%s\" is loaded already", __func__, family); + yang_dnode_free(dnode); return NULL; } @@ -282,15 +288,11 @@ struct yang_translator *yang_translator_load(const char *path) error: yang_dnode_free(dnode); yang_translator_unload(translator); + yang_tmodule_delete(tmodule); return NULL; } -static void yang_tmodule_delete(struct yang_tmodule *tmodule) -{ - XFREE(MTYPE_YANG_TRANSLATOR_MODULE, tmodule); -} - void yang_translator_unload(struct yang_translator *translator) { for (size_t i = 0; i < YANG_TRANSLATE_MAX; i++) diff --git a/lib/zclient.c b/lib/zclient.c index 413ae2c9f3..57c038a03f 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -1035,6 +1035,7 @@ int zapi_nexthop_encode(struct stream *s, const struct zapi_nexthop *api_nh, */ if (api_nh->label_num > 0) { stream_putc(s, api_nh->label_num); + stream_putc(s, api_nh->label_type); stream_put(s, &api_nh->labels[0], api_nh->label_num * sizeof(mpls_label_t)); } @@ -1397,6 +1398,7 @@ int zapi_nexthop_decode(struct stream *s, struct zapi_nexthop *api_nh, /* MPLS labels for BGP-LU or Segment Routing */ if (CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_LABEL)) { STREAM_GETC(s, api_nh->label_num); + STREAM_GETC(s, api_nh->label_type); if (api_nh->label_num > MPLS_MAX_LABELS) { flog_err( EC_LIB_ZAPI_ENCODE, @@ -1948,6 +1950,7 @@ int zapi_nexthop_from_nexthop(struct zapi_nexthop *znh, znh->labels[i] = nh->nh_label->label[i]; znh->label_num = i; + znh->label_type = nh->nh_label_type; SET_FLAG(znh->flags, ZAPI_NEXTHOP_FLAG_LABEL); } diff --git a/lib/zclient.h b/lib/zclient.h index 8c4ce1b777..55957e4bee 100644 --- a/lib/zclient.h +++ b/lib/zclient.h @@ -427,6 +427,7 @@ struct zapi_nexthop { /* MPLS labels for BGP-LU or Segment Routing */ uint8_t label_num; + enum lsp_types_t label_type; mpls_label_t labels[MPLS_MAX_LABELS]; struct ethaddr rmac; diff --git a/lib/zebra.h b/lib/zebra.h index b2f5e5a848..8b783c514b 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -75,15 +75,6 @@ #include <endian.h> #endif -/* machine dependent includes */ -#ifdef HAVE_LINUX_VERSION_H -#include <linux/version.h> -#endif /* HAVE_LINUX_VERSION_H */ - -#ifdef HAVE_ASM_TYPES_H -#include <asm/types.h> -#endif /* HAVE_ASM_TYPES_H */ - /* misc include group */ #include <stdarg.h> @@ -338,6 +329,14 @@ struct in_pktinfo { #define strmatch(a,b) (!strcmp((a), (b))) +#if BYTE_ORDER == LITTLE_ENDIAN +#define htonll(x) (((uint64_t)htonl((x)&0xFFFFFFFF) << 32) | htonl((x) >> 32)) +#define ntohll(x) (((uint64_t)ntohl((x)&0xFFFFFFFF) << 32) | ntohl((x) >> 32)) +#else +#define htonll(x) (x) +#define ntohll(x) (x) +#endif + #ifndef INADDR_LOOPBACK #define INADDR_LOOPBACK 0x7f000001 /* Internet address 127.0.0.1. */ #endif @@ -375,17 +374,25 @@ typedef enum { for (safi = SAFI_UNICAST; safi <= SAFI_MPLS_VPN; safi++) /* Default Administrative Distance of each protocol. */ -#define ZEBRA_KERNEL_DISTANCE_DEFAULT 0 -#define ZEBRA_CONNECT_DISTANCE_DEFAULT 0 -#define ZEBRA_STATIC_DISTANCE_DEFAULT 1 -#define ZEBRA_RIP_DISTANCE_DEFAULT 120 -#define ZEBRA_RIPNG_DISTANCE_DEFAULT 120 -#define ZEBRA_OSPF_DISTANCE_DEFAULT 110 -#define ZEBRA_OSPF6_DISTANCE_DEFAULT 110 -#define ZEBRA_ISIS_DISTANCE_DEFAULT 115 -#define ZEBRA_IBGP_DISTANCE_DEFAULT 200 -#define ZEBRA_EBGP_DISTANCE_DEFAULT 20 -#define ZEBRA_TABLE_DISTANCE_DEFAULT 15 +#define ZEBRA_KERNEL_DISTANCE_DEFAULT 0 +#define ZEBRA_CONNECT_DISTANCE_DEFAULT 0 +#define ZEBRA_STATIC_DISTANCE_DEFAULT 1 +#define ZEBRA_RIP_DISTANCE_DEFAULT 120 +#define ZEBRA_RIPNG_DISTANCE_DEFAULT 120 +#define ZEBRA_OSPF_DISTANCE_DEFAULT 110 +#define ZEBRA_OSPF6_DISTANCE_DEFAULT 110 +#define ZEBRA_ISIS_DISTANCE_DEFAULT 115 +#define ZEBRA_IBGP_DISTANCE_DEFAULT 200 +#define ZEBRA_EBGP_DISTANCE_DEFAULT 20 +#define ZEBRA_TABLE_DISTANCE_DEFAULT 15 +#define ZEBRA_EIGRP_DISTANCE_DEFAULT 90 +#define ZEBRA_NHRP_DISTANCE_DEFAULT 10 +#define ZEBRA_LDP_DISTANCE_DEFAULT 150 +#define ZEBRA_BABEL_DISTANCE_DEFAULT 100 +#define ZEBRA_SHARP_DISTANCE_DEFAULT 150 +#define ZEBRA_PBR_DISTANCE_DEFAULT 200 +#define ZEBRA_OPENFABRIC_DISTANCE_DEFAULT 115 +#define ZEBRA_MAX_DISTANCE_DEFAULT 255 /* Flag manipulation macros. */ #define CHECK_FLAG(V,F) ((V) & (F)) @@ -411,9 +418,6 @@ typedef uint32_t route_tag_t; #define ROUTE_TAG_MAX UINT32_MAX #define ROUTE_TAG_PRI PRIu32 -/* Name of hook calls */ -#define ZEBRA_ON_RIB_PROCESS_HOOK_CALL "on_rib_process_dplane_results" - #ifdef __cplusplus } #endif |
