diff options
| author | Mark Stapp <mjs@voltanet.io> | 2019-11-08 14:13:33 -0500 | 
|---|---|---|
| committer | Mark Stapp <mjs@voltanet.io> | 2020-03-27 09:37:02 -0400 | 
| commit | e4a1ec7454490af0ea45013cb279eb9b15edef51 (patch) | |
| tree | eb93d94f2b0e726a70dea73eeb8deeb18bb2be57 /lib/nexthop.h | |
| parent | ee8606ee39a50b8a644352be4881a77a5822911d (diff) | |
zebra,lib: use const in more apis
Use const with some args to ipaddr, zebra vxlan, mpls
lsp, and nexthop apis; add some extra checks to some
nexthop-related apis.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'lib/nexthop.h')
| -rw-r--r-- | lib/nexthop.h | 13 | 
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/nexthop.h b/lib/nexthop.h index 6710914e40..8d7580f6b4 100644 --- a/lib/nexthop.h +++ b/lib/nexthop.h @@ -118,13 +118,22 @@ struct nexthop {  	uint8_t weight;  }; + +/* Utility to append one nexthop to another. */ +#define NEXTHOP_APPEND(to, new)           \ +	do {                              \ +		(to)->next = (new);       \ +		(new)->prev = (to);       \ +		(new)->next = NULL;       \ +	} while (0) +  struct nexthop *nexthop_new(void);  void nexthop_free(struct nexthop *nexthop);  void nexthops_free(struct nexthop *nexthop); -void nexthop_add_labels(struct nexthop *, enum lsp_types_t, uint8_t, -			mpls_label_t *); +void nexthop_add_labels(struct nexthop *nexthop, enum lsp_types_t ltype, +			uint8_t num_labels, const mpls_label_t *labels);  void nexthop_del_labels(struct nexthop *);  /*  | 
