diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/log.c | 5 | ||||
| -rw-r--r-- | lib/zclient.c | 25 | ||||
| -rw-r--r-- | lib/zclient.h | 6 |
3 files changed, 35 insertions, 1 deletions
@@ -461,7 +461,10 @@ static const struct zebra_desc_table command_types[] = { DESC_ENTRY(ZEBRA_NHRP_NEIGH_UNREGISTER), DESC_ENTRY(ZEBRA_NEIGH_IP_ADD), DESC_ENTRY(ZEBRA_NEIGH_IP_DEL), - DESC_ENTRY(ZEBRA_CONFIGURE_ARP)}; + DESC_ENTRY(ZEBRA_CONFIGURE_ARP), + DESC_ENTRY(ZEBRA_GRE_GET), + DESC_ENTRY(ZEBRA_GRE_UPDATE), + DESC_ENTRY(ZEBRA_GRE_SOURCE_SET)}; #undef DESC_ENTRY static const struct zebra_desc_table unknown = {0, "unknown", '?'}; diff --git a/lib/zclient.c b/lib/zclient.c index b1aea55afa..3ea1789441 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -3931,6 +3931,11 @@ static int zclient_read(struct thread *thread) (*zclient->neighbor_get)(command, zclient, length, vrf_id); break; + case ZEBRA_GRE_UPDATE: + if (zclient->gre_update) + (*zclient->gre_update)(command, zclient, + length, vrf_id); + break; default: break; } @@ -4252,3 +4257,23 @@ int zclient_neigh_ip_decode(struct stream *s, struct zapi_neigh_ip *api) stream_failure: return -1; } + +int zclient_send_zebra_gre_request(struct zclient *client, + struct interface *ifp) +{ + struct stream *s; + + if (!client || client->sock < 0) { + zlog_err("%s : zclient not ready", __func__); + return -1; + } + s = client->obuf; + stream_reset(s); + zclient_create_header(s, + ZEBRA_GRE_GET, + ifp->vrf_id); + stream_putl(s, ifp->ifindex); + stream_putw_at(s, 0, stream_get_endp(s)); + zclient_send_message(client); + return 0; +} diff --git a/lib/zclient.h b/lib/zclient.h index e8fff4b881..8c27916542 100644 --- a/lib/zclient.h +++ b/lib/zclient.h @@ -232,6 +232,9 @@ typedef enum { ZEBRA_NEIGH_IP_ADD, ZEBRA_NEIGH_IP_DEL, ZEBRA_CONFIGURE_ARP, + ZEBRA_GRE_GET, + ZEBRA_GRE_UPDATE, + ZEBRA_GRE_SOURCE_SET, } zebra_message_types_t; enum zebra_error_types { @@ -393,6 +396,7 @@ struct zclient { void (*neighbor_added)(ZAPI_CALLBACK_ARGS); void (*neighbor_removed)(ZAPI_CALLBACK_ARGS); void (*neighbor_get)(ZAPI_CALLBACK_ARGS); + void (*gre_update)(ZAPI_CALLBACK_ARGS); }; /* Zebra API message flag. */ @@ -1228,6 +1232,8 @@ struct zapi_client_close_info { extern int zapi_client_close_notify_decode(struct stream *s, struct zapi_client_close_info *info); +extern int zclient_send_zebra_gre_request(struct zclient *client, + struct interface *ifp); #ifdef __cplusplus } #endif |
