diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2019-12-20 11:06:05 +0100 |
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2021-04-30 10:33:18 +0200 |
| commit | d17af8dd0409f1622b055102146b2887d411ec6c (patch) | |
| tree | 61d7ad5c3caf2433a5e32d71aa07e51a4ff29a50 /lib | |
| parent | b716ab61e2a40da54115a39297e3aca0834bbea7 (diff) | |
lib, zebra: get gre information
the get gre information code is obtained by nhrp, via zebra.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/zclient.c | 30 | ||||
| -rw-r--r-- | lib/zclient.h | 3 |
2 files changed, 33 insertions, 0 deletions
diff --git a/lib/zclient.c b/lib/zclient.c index b1aea55afa..e2f99aebf3 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,28 @@ 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; + ifindex_t idx_local; + int ret; + + 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; +stream_failure: + zlog_err("%s(): error reading response ..", __func__); + return 0; +} diff --git a/lib/zclient.h b/lib/zclient.h index f9e1bdc370..8c27916542 100644 --- a/lib/zclient.h +++ b/lib/zclient.h @@ -396,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. */ @@ -1231,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 |
