diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/command.c | 9 | ||||
| -rw-r--r-- | lib/prefix.h | 8 | ||||
| -rw-r--r-- | lib/routemap.h | 5 | ||||
| -rw-r--r-- | lib/zclient.c | 16 | ||||
| -rw-r--r-- | lib/zclient.h | 3 |
5 files changed, 29 insertions, 12 deletions
diff --git a/lib/command.c b/lib/command.c index e00d84a051..560d4a09f8 100644 --- a/lib/command.c +++ b/lib/command.c @@ -255,6 +255,9 @@ static bool cmd_hash_cmp(const void *a, const void *b) /* Install top node of command vector. */ void install_node(struct cmd_node *node) { +#define CMD_HASH_STR_SIZE 256 + char hash_name[CMD_HASH_STR_SIZE]; + vector_set_index(cmdvec, node->node, node); node->cmdgraph = graph_new(); node->cmd_vector = vector_init(VECTOR_MIN_SIZE); @@ -263,8 +266,10 @@ void install_node(struct cmd_node *node) cmd_token_new(START_TKN, CMD_ATTR_NORMAL, NULL, NULL); graph_new_node(node->cmdgraph, token, (void (*)(void *)) & cmd_token_del); - node->cmd_hash = hash_create_size(16, cmd_hash_key, cmd_hash_cmp, - "Command Hash"); + + snprintf(hash_name, sizeof(hash_name), "Command Hash: %s", node->name); + node->cmd_hash = + hash_create_size(16, cmd_hash_key, cmd_hash_cmp, hash_name); } /* Return prompt character of specified node. */ diff --git a/lib/prefix.h b/lib/prefix.h index 217a23d561..c47e701dfd 100644 --- a/lib/prefix.h +++ b/lib/prefix.h @@ -481,11 +481,6 @@ extern void prefix_ipv4_free(struct prefix_ipv4 **p); extern int str2prefix_ipv4(const char *, struct prefix_ipv4 *); extern void apply_mask_ipv4(struct prefix_ipv4 *); -#define PREFIX_COPY(DST, SRC) \ - *((struct prefix *)(DST)) = *((const struct prefix *)(SRC)) -#define PREFIX_COPY_IPV4(DST, SRC) \ - *((struct prefix_ipv4 *)(DST)) = *((const struct prefix_ipv4 *)(SRC)) - extern int prefix_ipv4_any(const struct prefix_ipv4 *); extern void apply_classful_mask_ipv4(struct prefix_ipv4 *); @@ -503,9 +498,6 @@ extern void prefix_ipv6_free(struct prefix_ipv6 **p); extern int str2prefix_ipv6(const char *, struct prefix_ipv6 *); extern void apply_mask_ipv6(struct prefix_ipv6 *); -#define PREFIX_COPY_IPV6(DST, SRC) \ - *((struct prefix_ipv6 *)(DST)) = *((const struct prefix_ipv6 *)(SRC)) - extern int ip6_masklen(struct in6_addr); extern void masklen2ip6(const int, struct in6_addr *); diff --git a/lib/routemap.h b/lib/routemap.h index 4d76ae1536..4a40ec08b9 100644 --- a/lib/routemap.h +++ b/lib/routemap.h @@ -194,6 +194,11 @@ struct route_map_index { }; DECLARE_QOBJ_TYPE(route_map_index); +/* route map maximum length. Not strictly the maximum xpath length but cannot be + * greater + */ +#define RMAP_NAME_MAXLEN XPATH_MAXLEN + /* Route map list structure. */ struct route_map { /* Name of route map. */ diff --git a/lib/zclient.c b/lib/zclient.c index 4a70881b57..ffae1332af 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -2269,10 +2269,13 @@ stream_failure: } struct interface *zebra_interface_link_params_read(struct stream *s, - vrf_id_t vrf_id) + vrf_id_t vrf_id, + bool *changed) { struct if_link_params *iflp; + struct if_link_params iflp_copy; ifindex_t ifindex; + bool params_changed = false; STREAM_GETL(s, ifindex); @@ -2285,12 +2288,23 @@ struct interface *zebra_interface_link_params_read(struct stream *s, return NULL; } + if (ifp->link_params == NULL) + params_changed = true; + if ((iflp = if_link_params_get(ifp)) == NULL) return NULL; + memcpy(&iflp_copy, iflp, sizeof(iflp_copy)); + if (link_params_set_value(s, iflp) != 0) goto stream_failure; + if (memcmp(&iflp_copy, iflp, sizeof(iflp_copy))) + params_changed = true; + + if (changed) + *changed = params_changed; + return ifp; stream_failure: diff --git a/lib/zclient.h b/lib/zclient.h index 48de3425be..a25c5800b7 100644 --- a/lib/zclient.h +++ b/lib/zclient.h @@ -1043,7 +1043,8 @@ extern struct interface *zebra_interface_vrf_update_read(struct stream *s, extern int zebra_router_id_update_read(struct stream *s, struct prefix *rid); extern struct interface *zebra_interface_link_params_read(struct stream *s, - vrf_id_t vrf_id); + vrf_id_t vrf_id, + bool *changed); extern size_t zebra_interface_link_params_write(struct stream *, struct interface *); extern enum zclient_send_status |
