diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2018-03-09 18:05:03 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-09 18:05:03 +0100 |
| commit | 58e7db106d5907cb129fcc316f02ce0bf34e3885 (patch) | |
| tree | 2d7e276495810fae9059b4e84694d994360b14a2 /lib/zclient.c | |
| parent | c67667e74cfbb4e4f2edd3b70609cf9716d5c432 (diff) | |
| parent | b6c5d34354c7153bebd2c51e89fd2e32f0dc343c (diff) | |
Merge pull request #1813 from donaldsharp/pbr_setup
Pbr setup
Diffstat (limited to 'lib/zclient.c')
| -rw-r--r-- | lib/zclient.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/lib/zclient.c b/lib/zclient.c index f853824bbb..fa3a5f6691 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -1058,6 +1058,8 @@ int zapi_route_encode(u_char cmd, struct stream *s, struct zapi_route *api) stream_putl(s, api->tag); if (CHECK_FLAG(api->message, ZAPI_MESSAGE_MTU)) stream_putl(s, api->mtu); + if (CHECK_FLAG(api->message, ZAPI_MESSAGE_TABLEID)) + stream_putl(s, api->tableid); /* Put length at the first point of the stream. */ stream_putw_at(s, 0, stream_get_endp(s)); @@ -1207,6 +1209,8 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api) STREAM_GETL(s, api->tag); if (CHECK_FLAG(api->message, ZAPI_MESSAGE_MTU)) STREAM_GETL(s, api->mtu); + if (CHECK_FLAG(api->message, ZAPI_MESSAGE_TABLEID)) + STREAM_GETL(s, api->tableid); stream_failure: return 0; @@ -1233,6 +1237,35 @@ stream_failure: return false; } +bool zapi_rule_notify_decode(struct stream *s, uint32_t *seqno, + uint32_t *priority, uint32_t *unique, + ifindex_t *ifindex, + enum zapi_rule_notify_owner *note) +{ + uint32_t prio, seq, uni; + ifindex_t ifi; + + STREAM_GET(note, s, sizeof(*note)); + + STREAM_GETL(s, seq); + STREAM_GETL(s, prio); + STREAM_GETL(s, uni); + STREAM_GETL(s, ifi); + + if (zclient_debug) + zlog_debug("%s: %u %u %u %u", __PRETTY_FUNCTION__, + seq, prio, uni, ifi); + *seqno = seq; + *priority = prio; + *unique = uni; + *ifindex = ifi; + + return true; + +stream_failure: + return false; +} + struct nexthop *nexthop_from_zapi_nexthop(struct zapi_nexthop *znh) { struct nexthop *n = nexthop_new(); @@ -2377,6 +2410,10 @@ static int zclient_read(struct thread *thread) (*zclient->route_notify_owner)(command, zclient, length, vrf_id); break; + case ZEBRA_RULE_NOTIFY_OWNER: + if (zclient->rule_notify_owner) + (*zclient->rule_notify_owner)(command, zclient, length, + vrf_id); default: break; } |
