]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Nest: Added const to ea_show just to declare that this shouldn't really change anything
authorMaria Matejka <mq@ucw.cz>
Sat, 17 Aug 2019 11:36:36 +0000 (13:36 +0200)
committerMaria Matejka <mq@ucw.cz>
Sat, 17 Aug 2019 11:56:12 +0000 (13:56 +0200)
13 files changed:
nest/protocol.h
nest/route.h
nest/rt-attr.c
proto/babel/babel.c
proto/bgp/attrs.c
proto/bgp/bgp.h
proto/ospf/ospf.c
proto/radv/radv.c
proto/rip/rip.c
sysdep/bsd/krt-sys.h
sysdep/linux/netlink.c
sysdep/unix/krt.c
sysdep/unix/krt.h

index 4d8584f2b7b29c17e4cc7c51299099ace30536d8..661c4d2d5078c6b9a8710ae619d6ea1eb5d57816 100644 (file)
@@ -59,7 +59,7 @@ struct protocol {
   void (*cleanup)(struct proto *);             /* Called after shutdown when protocol became hungry/down */
   void (*get_status)(struct proto *, byte *buf); /* Get instance status (for `show protocols' command) */
   void (*get_route_info)(struct rte *, byte *buf, struct ea_list *attrs); /* Get route information (for `show route' command) */
-  int (*get_attr)(struct eattr *, byte *buf, int buflen);      /* ASCIIfy dynamic attribute (returns GA_*) */
+  int (*get_attr)(const struct eattr *, byte *buf, int buflen);        /* ASCIIfy dynamic attribute (returns GA_*) */
   void (*show_proto_info)(struct proto *);     /* Show protocol info (for `show protocols all' command) */
   void (*copy_config)(struct proto_config *, struct proto_config *);   /* Copy config from given protocol instance */
 };
index cbc84934a886634c64cb28936ca4dcc6784ec8b8..8f7c9a92ee2f10c753c88de03dff9452f6006d87 100644 (file)
@@ -582,7 +582,7 @@ void ea_merge(ea_list *from, ea_list *to); /* Merge sub-lists to allocated buffe
 int ea_same(ea_list *x, ea_list *y);   /* Test whether two ea_lists are identical */
 uint ea_hash(ea_list *e);      /* Calculate 16-bit hash value */
 ea_list *ea_append(ea_list *to, ea_list *what);
-void ea_format_bitfield(struct eattr *a, byte *buf, int bufsize, const char **names, int min, int max);
+void ea_format_bitfield(const struct eattr *a, byte *buf, int bufsize, const char **names, int min, int max);
 
 static inline eattr *
 ea_set_attr(ea_list **to, struct linpool *pool, uint id, uint flags, uint type, uintptr_t val)
index be70689ba06282ad45c2abe6065ac66e51db7103..9184446a2943ed48a4c54a4fcab8293017c612e3 100644 (file)
@@ -741,7 +741,7 @@ ea_free(ea_list *o)
 }
 
 static int
-get_generic_attr(eattr *a, byte **buf, int buflen UNUSED)
+get_generic_attr(const eattr *a, byte **buf, int buflen UNUSED)
 {
   if (a->id == EA_GEN_IGP_METRIC)
     {
@@ -753,7 +753,7 @@ get_generic_attr(eattr *a, byte **buf, int buflen UNUSED)
 }
 
 void
-ea_format_bitfield(struct eattr *a, byte *buf, int bufsize, const char **names, int min, int max)
+ea_format_bitfield(const struct eattr *a, byte *buf, int bufsize, const char **names, int min, int max)
 {
   byte *bound = buf + bufsize - 32;
   u32 data = a->u.data;
@@ -849,7 +849,7 @@ ea_show_lc_set(struct cli *c, struct adata *ad, byte *pos, byte *buf, byte *end)
  * get_attr() hook, it's consulted first.
  */
 void
-ea_show(struct cli *c, eattr *e)
+ea_show(struct cli *c, const eattr *e)
 {
   struct protocol *p;
   int status = GA_UNKNOWN;
index cb5bb7071dd6a823b82413a44a2298508f991aa7..658cb19820bc7fbcf3866c54a0c2e490a1b8a598 100644 (file)
@@ -1835,7 +1835,7 @@ babel_get_route_info(rte *rte, byte *buf, ea_list *attrs UNUSED)
 }
 
 static int
-babel_get_attr(eattr *a, byte *buf, int buflen UNUSED)
+babel_get_attr(const eattr *a, byte *buf, int buflen UNUSED)
 {
   switch (a->id)
   {
index 8132a2c989fb60a6761882b430c04e3ed7fd2b10..03c449deab96fd83d60fba5ba47f6cd70fc3b8a8 100644 (file)
@@ -72,7 +72,7 @@ struct bgp_attr_desc {
   void (*export)(struct bgp_export_state *s, eattr *a);
   int  (*encode)(struct bgp_write_state *s, eattr *a, byte *buf, uint size);
   void (*decode)(struct bgp_parse_state *s, uint code, uint flags, byte *data, uint len, ea_list **to);
-  void (*format)(eattr *ea, byte *buf, uint size);
+  void (*format)(const eattr *ea, byte *buf, uint size);
 };
 
 static const struct bgp_attr_desc bgp_attr_table[];
@@ -233,7 +233,7 @@ bgp_decode_origin(struct bgp_parse_state *s, uint code UNUSED, uint flags, byte
 }
 
 static void
-bgp_format_origin(eattr *a, byte *buf, uint size UNUSED)
+bgp_format_origin(const eattr *a, byte *buf, uint size UNUSED)
 {
   static const char *bgp_origin_names[] = { "IGP", "EGP", "Incomplete" };
 
@@ -327,7 +327,7 @@ bgp_decode_next_hop(struct bgp_parse_state *s, uint code UNUSED, uint flags UNUS
 
 /* TODO: This function should use AF-specific hook */
 static void
-bgp_format_next_hop(eattr *a, byte *buf, uint size UNUSED)
+bgp_format_next_hop(const eattr *a, byte *buf, uint size UNUSED)
 {
   ip_addr *nh = (void *) a->u.ptr->data;
   uint len = a->u.ptr->length;
@@ -418,7 +418,7 @@ bgp_decode_aggregator(struct bgp_parse_state *s, uint code UNUSED, uint flags, b
 }
 
 static void
-bgp_format_aggregator(eattr *a, byte *buf, uint size UNUSED)
+bgp_format_aggregator(const eattr *a, byte *buf, uint size UNUSED)
 {
   byte *data = a->u.ptr->data;
 
@@ -493,7 +493,7 @@ bgp_decode_cluster_list(struct bgp_parse_state *s, uint code UNUSED, uint flags,
 }
 
 static void
-bgp_format_cluster_list(eattr *a, byte *buf, uint size)
+bgp_format_cluster_list(const eattr *a, byte *buf, uint size)
 {
   /* Truncates cluster lists larger than buflen, probably not a problem */
   int_set_format(a->u.ptr, 0, -1, buf, size);
@@ -676,7 +676,7 @@ bgp_decode_mpls_label_stack(struct bgp_parse_state *s, uint code UNUSED, uint fl
 }
 
 static void
-bgp_format_mpls_label_stack(eattr *a, byte *buf, uint size)
+bgp_format_mpls_label_stack(const eattr *a, byte *buf, uint size)
 {
   u32 *labels = (u32 *) a->u.ptr->data;
   uint lnum = a->u.ptr->length / 4;
@@ -1984,7 +1984,7 @@ bgp_process_as4_attrs(ea_list **attrs, struct linpool *pool)
 }
 
 int
-bgp_get_attr(eattr *a, byte *buf, int buflen)
+bgp_get_attr(const eattr *a, byte *buf, int buflen)
 {
   uint i = EA_ID(a->id);
   const struct bgp_attr_desc *d;
index fefcf9701565f5c808775e0641c91539becd2e3f..64ca92aaf0380848f963afe433b688c746b00ddb 100644 (file)
@@ -522,7 +522,7 @@ int bgp_rte_mergable(rte *pri, rte *sec);
 int bgp_rte_recalculate(rtable *table, net *net, rte *new, rte *old, rte *old_best);
 void bgp_rt_notify(struct proto *P, struct channel *C, net *n, rte *new, rte *old, ea_list *attrs);
 int bgp_import_control(struct proto *, struct rte **, struct ea_list **, struct linpool *);
-int bgp_get_attr(struct eattr *e, byte *buf, int buflen);
+int bgp_get_attr(const struct eattr *e, byte *buf, int buflen);
 void bgp_get_route_info(struct rte *, byte *buf, struct ea_list *attrs);
 
 
index b580ad32937b734c62b88d073cea962e4a73713a..aac43895ec09194d68c722d6d55d07b9c6c8dda6 100644 (file)
@@ -661,7 +661,7 @@ ospf_get_route_info(rte * rte, byte * buf, ea_list * attrs UNUSED)
 }
 
 static int
-ospf_get_attr(eattr * a, byte * buf, int buflen UNUSED)
+ospf_get_attr(const eattr * a, byte * buf, int buflen UNUSED)
 {
   switch (a->id)
   {
index 65e10d58ac34a61fdd6e4615e08e0e387b107ffe..dd05bcf019f3857e813aad592feff525ec70cdfe 100644 (file)
@@ -745,7 +745,7 @@ radv_pref_str(u32 pref)
 
 /* The buffer has some minimal size */
 static int
-radv_get_attr(eattr *a, byte *buf, int buflen UNUSED)
+radv_get_attr(const eattr *a, byte *buf, int buflen UNUSED)
 {
   switch (a->id)
   {
index 85e37cea2ea08b8cc5257a01d8625e7f9c70a592..9fcdcf5ac2c08a50039755dec5c4cad66db01524 100644 (file)
@@ -1164,7 +1164,7 @@ rip_get_route_info(rte *rte, byte *buf, ea_list *attrs UNUSED)
 }
 
 static int
-rip_get_attr(eattr *a, byte *buf, int buflen UNUSED)
+rip_get_attr(const eattr *a, byte *buf, int buflen UNUSED)
 {
   switch (a->id)
   {
index aa6cc72e34d1557e32dbbc9f9593180ecb5cb511..5750188439f099ec6f0086b1907d2df3816b02e2 100644 (file)
@@ -46,7 +46,7 @@ static inline void krt_sys_io_init(void) { }
 static inline void krt_sys_init(struct krt_proto *p UNUSED) { }
 static inline void krt_sys_postconfig(struct krt_config *x UNUSED) { }
 
-static inline int krt_sys_get_attr(eattr *a UNUSED, byte *buf UNUSED, int buflen UNUSED) { return GA_UNKNOWN; }
+static inline int krt_sys_get_attr(const eattr *a UNUSED, byte *buf UNUSED, int buflen UNUSED) { return GA_UNKNOWN; }
 
 
 #endif
index 84591eb2ec4885f4f3bd398447c8f2aaba129330..0b12b4246ec56a47666cd5ba0f92b2b26e499a05 100644 (file)
@@ -2052,7 +2052,7 @@ static const char *krt_features_names[KRT_FEATURES_MAX] = {
 };
 
 int
-krt_sys_get_attr(eattr *a, byte *buf, int buflen UNUSED)
+krt_sys_get_attr(const eattr *a, byte *buf, int buflen UNUSED)
 {
   switch (a->id)
   {
index 1a49542827698fe401e5bd133042a5e3c7db6940..90b531dc72ca2f7193929848254197960831ebee 100644 (file)
@@ -1203,7 +1203,7 @@ krt_copy_config(struct proto_config *dest, struct proto_config *src)
 }
 
 static int
-krt_get_attr(eattr *a, byte *buf, int buflen)
+krt_get_attr(const eattr *a, byte *buf, int buflen)
 {
   switch (a->id)
   {
index b627882d655f42d977c4030c03bdcdc5fe8fb551..111a400f6ee8003e37a6b228085ccd620140f638 100644 (file)
@@ -140,7 +140,7 @@ void krt_sys_copy_config(struct krt_config *, struct krt_config *);
 int  krt_capable(rte *e);
 void krt_do_scan(struct krt_proto *);
 void krt_replace_rte(struct krt_proto *p, net *n, rte *new, rte *old, struct ea_list *eattrs);
-int krt_sys_get_attr(eattr *a, byte *buf, int buflen);
+int krt_sys_get_attr(const eattr *a, byte *buf, int buflen);
 
 
 /* kif sysdep */