diff options
| author | Mark Stapp <mstapp@nvidia.com> | 2021-09-29 09:19:21 -0400 | 
|---|---|---|
| committer | Mark Stapp <mstapp@nvidia.com> | 2021-10-01 07:48:45 -0400 | 
| commit | edfee30d6406ac9a350e95657054ec067ced0f59 (patch) | |
| tree | 089002899efa1383909e77dd2ed69e43f10fff79 | |
| parent | d0bf22a10bbda51bba86d4c51fe9055deb91664b (diff) | |
bgpd: add some const
Add const to a couple of arguments in bgp_label utilities,
and in a show function.
Signed-off-by: Mark Stapp <mstapp@nvidia.com>
| -rw-r--r-- | bgpd/bgp_label.h | 4 | ||||
| -rw-r--r-- | bgpd/bgp_route.c | 7 | ||||
| -rw-r--r-- | bgpd/bgp_route.h | 2 | 
3 files changed, 7 insertions, 6 deletions
diff --git a/bgpd/bgp_label.h b/bgpd/bgp_label.h index d227cf7241..cafcc8e9c7 100644 --- a/bgpd/bgp_label.h +++ b/bgpd/bgp_label.h @@ -65,7 +65,7 @@ static inline int bgp_is_withdraw_label(mpls_label_t *label)  	return 0;  } -static inline int bgp_is_valid_label(mpls_label_t *label) +static inline int bgp_is_valid_label(const mpls_label_t *label)  {  	uint8_t *t = (uint8_t *)label;  	if (!t) @@ -99,7 +99,7 @@ static inline void bgp_unregister_for_label(struct bgp_dest *dest)  }  /* Label stream to value */ -static inline uint32_t label_pton(mpls_label_t *label) +static inline uint32_t label_pton(const mpls_label_t *label)  {  	uint8_t *t = (uint8_t *)label;  	return ((((unsigned int)t[0]) << 12) | (((unsigned int)t[1]) << 4) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index fc97178450..abf480e806 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -10689,7 +10689,7 @@ static int bgp_show_community(struct vty *vty, struct bgp *bgp,  static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,  			  struct bgp_table *table, enum bgp_show_type type, -			  void *output_arg, char *rd, int is_last, +			  void *output_arg, const char *rd, int is_last,  			  unsigned long *output_cum, unsigned long *total_cum,  			  unsigned long *json_header_depth, uint16_t show_flags,  			  enum rpki_states rpki_target_state) @@ -11237,7 +11237,8 @@ static void bgp_show_all_instances_routes_vty(struct vty *vty, afi_t afi,  /* Header of detailed BGP route information */  void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp, -				 struct bgp_dest *dest, struct prefix_rd *prd, +				 struct bgp_dest *dest, +				 const struct prefix_rd *prd,  				 afi_t afi, safi_t safi, json_object *json)  {  	struct bgp_path_info *pi; @@ -11447,7 +11448,7 @@ void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp,  	}  } -static void bgp_show_path_info(struct prefix_rd *pfx_rd, +static void bgp_show_path_info(const struct prefix_rd *pfx_rd,  			       struct bgp_dest *bgp_node, struct vty *vty,  			       struct bgp *bgp, afi_t afi, safi_t safi,  			       json_object *json, enum bgp_path_type pathtype, diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h index 7609f7196d..86ba5f3803 100644 --- a/bgpd/bgp_route.h +++ b/bgpd/bgp_route.h @@ -780,7 +780,7 @@ extern bool bgp_zebra_has_route_changed(struct bgp_path_info *selected);  extern void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp,  					struct bgp_dest *dest, -					struct prefix_rd *prd, afi_t afi, +					const struct prefix_rd *prd, afi_t afi,  					safi_t safi, json_object *json);  extern void route_vty_out_detail(struct vty *vty, struct bgp *bgp,  				 struct bgp_dest *bn,  | 
