diff options
| author | Don Slice <dslice@cumulusnetworks.com> | 2017-02-01 13:10:56 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-04-06 10:29:19 -0400 |
| commit | 5aba114af433e92403859beaa48e133baf93ffc2 (patch) | |
| tree | 275d6610f550d97bf8268deead50df044acf5656 /zebra/zebra_mpls.h | |
| parent | f31e084c7c0e6699926ad72bc4f9a8ca2663f50b (diff) | |
zebra: fec register
Implement interface that allows a client to register a FEC for obtaining
a label binding (in-label). Update client whenever the label binding is
updated and cleanup when client goes away.
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_mpls.h')
| -rw-r--r-- | zebra/zebra_mpls.h | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/zebra/zebra_mpls.h b/zebra/zebra_mpls.h index 9ff230e5ee..4636a28c10 100644 --- a/zebra/zebra_mpls.h +++ b/zebra/zebra_mpls.h @@ -162,6 +162,9 @@ struct zebra_fec_t_ /* Flags. */ u_int32_t flags; #define FEC_FLAG_CONFIGURED (1 << 0) + + /* Clients interested in this FEC. */ + struct list *client_list; }; /* Function declarations. */ @@ -181,6 +184,29 @@ mpls_label2str (u_int8_t num_labels, mpls_label_t *labels, char *buf, int len); /* + * Registration from a client for the label binding for a FEC. If a binding + * already exists, it is informed to the client. + */ +int +zebra_mpls_fec_register (struct zebra_vrf *zvrf, struct prefix *p, + struct zserv *client); + +/* + * Deregistration from a client for the label binding for a FEC. The FEC + * itself is deleted if no other registered clients exist and there is no + * label bound to the FEC. + */ +int +zebra_mpls_fec_unregister (struct zebra_vrf *zvrf, struct prefix *p, + struct zserv *client); + +/* + * Cleanup any FECs registered by this client. + */ +int +zebra_mpls_cleanup_fecs_for_client (struct zebra_vrf *zvrf, struct zserv *client); + +/* * Return FEC (if any) to which this label is bound. * Note: Only works for per-prefix binding and when the label is not * implicit-null. @@ -197,14 +223,16 @@ int zebra_mpls_label_already_bound (struct zebra_vrf *zvrf, mpls_label_t label); /* - * Add static FEC to label binding. + * Add static FEC to label binding. If there are clients registered for this + * FEC, notify them. */ int zebra_mpls_static_fec_add (struct zebra_vrf *zvrf, struct prefix *p, mpls_label_t in_label); /* - * Remove static FEC to label binding. + * Remove static FEC to label binding. If there are no clients registered + * for this FEC, delete the FEC; else notify clients. */ int zebra_mpls_static_fec_del (struct zebra_vrf *zvrf, struct prefix *p); |
