diff options
author | Philippe Guibert <philippe.guibert@6wind.com> | 2018-03-07 15:46:00 +0100 |
---|---|---|
committer | Philippe Guibert <philippe.guibert@6wind.com> | 2018-04-16 14:40:43 +0200 |
commit | 425bdd6bf10123c2027ed602536490aeb5fb72a0 (patch) | |
tree | c4247c9a59e7a103f1b26d62763912e558a5e74d /lib/zclient.h | |
parent | lib: add ZEBRA IPSET defines (diff) | |
download | frr-425bdd6bf10123c2027ed602536490aeb5fb72a0.tar.xz frr-425bdd6bf10123c2027ed602536490aeb5fb72a0.zip |
zebra: handling notifications upon ipset creation/destruction done
Once ipset entries are injected in the kernel, the relevant daemon is
informed with a zebra message sent back.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'lib/zclient.h')
-rw-r--r-- | lib/zclient.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/zclient.h b/lib/zclient.h index 3c6e1b320..b8896f6b9 100644 --- a/lib/zclient.h +++ b/lib/zclient.h @@ -144,6 +144,8 @@ typedef enum { ZEBRA_IPSET_DESTROY, ZEBRA_IPSET_ENTRY_ADD, ZEBRA_IPSET_ENTRY_DELETE, + ZEBRA_IPSET_NOTIFY_OWNER, + ZEBRA_IPSET_ENTRY_NOTIFY_OWNER, } zebra_message_types_t; struct redist_proto { @@ -234,6 +236,12 @@ struct zclient { uint16_t length, vrf_id_t vrf_id); void (*label_chunk)(int command, struct zclient *zclient, uint16_t length, vrf_id_t vrf_id); + int (*ipset_notify_owner)(int command, struct zclient *zclient, + uint16_t length, vrf_id_t vrf_id); + int (*ipset_entry_notify_owner)(int command, + struct zclient *zclient, + uint16_t length, + vrf_id_t vrf_id); }; /* Zebra API message flag. */ @@ -389,6 +397,18 @@ enum zapi_rule_notify_owner { ZAPI_RULE_REMOVED, }; +enum zapi_ipset_notify_owner { + ZAPI_IPSET_FAIL_INSTALL, + ZAPI_IPSET_INSTALLED, + ZAPI_IPSET_REMOVED, +}; + +enum zapi_ipset_entry_notify_owner { + ZAPI_IPSET_ENTRY_FAIL_INSTALL, + ZAPI_IPSET_ENTRY_INSTALLED, + ZAPI_IPSET_ENTRY_REMOVED, +}; + /* Zebra MAC types */ #define ZEBRA_MACIP_TYPE_STICKY 0x01 /* Sticky MAC*/ #define ZEBRA_MACIP_TYPE_GW 0x02 /* gateway (SVI) mac*/ @@ -628,6 +648,17 @@ 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); +bool zapi_ipset_notify_decode(struct stream *s, + uint32_t *unique, + enum zapi_ipset_notify_owner *note); + +#define ZEBRA_IPSET_NAME_SIZE 32 + +bool zapi_ipset_entry_notify_decode(struct stream *s, + uint32_t *unique, + char *ipset_name, + enum zapi_ipset_entry_notify_owner *note); + extern struct nexthop *nexthop_from_zapi_nexthop(struct zapi_nexthop *znh); extern bool zapi_nexthop_update_decode(struct stream *s, struct zapi_route *nhr); |