diff options
author | Maria Matejka <mq@jmq.cz> | 2020-04-08 22:25:15 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2020-04-09 15:37:14 +0200 |
commit | fd9f0c0640fd02a26b96b4f9d3cbbffbb6544a84 (patch) | |
tree | 3cfac115f49d41f3d62d41c4ddfffe50f2c381a4 /nest | |
parent | a109056145a6bc8a6b498ecb6e309ebc143c8b3c (diff) |
Configuration strings are constant.
This is merely a const propagation. There was no problem in there.
Diffstat (limited to 'nest')
-rw-r--r-- | nest/iface.c | 6 | ||||
-rw-r--r-- | nest/iface.h | 6 | ||||
-rw-r--r-- | nest/password.h | 2 | ||||
-rw-r--r-- | nest/proto.c | 6 | ||||
-rw-r--r-- | nest/protocol.h | 8 |
5 files changed, 14 insertions, 14 deletions
diff --git a/nest/iface.c b/nest/iface.c index 00dfc2ca..46a49f8f 100644 --- a/nest/iface.c +++ b/nest/iface.c @@ -444,7 +444,7 @@ if_find_by_index(unsigned idx) * if no such structure exists. */ struct iface * -if_find_by_name(char *name) +if_find_by_name(const char *name) { struct iface *i; @@ -455,7 +455,7 @@ if_find_by_name(char *name) } struct iface * -if_get_by_name(char *name) +if_get_by_name(const char *name) { struct iface *i; @@ -725,7 +725,7 @@ iface_patt_match(struct iface_patt *ifp, struct iface *i, struct ifa *a) WALK_LIST(p, ifp->ipn_list) { - char *t = p->pattern; + const char *t = p->pattern; int pos = p->positive; if (t) diff --git a/nest/iface.h b/nest/iface.h index 0eb277cd..b9796283 100644 --- a/nest/iface.h +++ b/nest/iface.h @@ -115,8 +115,8 @@ void if_end_update(void); void if_flush_ifaces(struct proto *p); void if_feed_baby(struct proto *); struct iface *if_find_by_index(unsigned); -struct iface *if_find_by_name(char *); -struct iface *if_get_by_name(char *); +struct iface *if_find_by_name(const char *); +struct iface *if_get_by_name(const char *); void if_recalc_all_preferred_addresses(void); @@ -160,7 +160,7 @@ void neigh_init(struct pool *); struct iface_patt_node { node n; int positive; - byte *pattern; + const byte *pattern; net_addr prefix; }; diff --git a/nest/password.h b/nest/password.h index c4017848..8a0da223 100644 --- a/nest/password.h +++ b/nest/password.h @@ -12,7 +12,7 @@ struct password_item { node n; - char *password; /* Key data, null terminated */ + const char *password; /* Key data, null terminated */ uint length; /* Key length, without null */ uint id; /* Key ID */ uint alg; /* MAC algorithm */ diff --git a/nest/proto.c b/nest/proto.c index 6051ba9d..85090424 100644 --- a/nest/proto.c +++ b/nest/proto.c @@ -893,7 +893,7 @@ proto_copy_config(struct proto_config *dest, struct proto_config *src) struct channel_config *cc; node old_node; int old_class; - char *old_name; + const char *old_name; if (dest->protocol != src->protocol) cf_error("Can't copy configuration from a different protocol type"); @@ -2013,7 +2013,7 @@ proto_cmd_mrtdump(struct proto *p, uintptr_t mask, int cnt UNUSED) } static void -proto_apply_cmd_symbol(struct symbol *s, void (* cmd)(struct proto *, uintptr_t, int), uintptr_t arg) +proto_apply_cmd_symbol(const struct symbol *s, void (* cmd)(struct proto *, uintptr_t, int), uintptr_t arg) { if (s->class != SYM_PROTO) { @@ -2026,7 +2026,7 @@ proto_apply_cmd_symbol(struct symbol *s, void (* cmd)(struct proto *, uintptr_t, } static void -proto_apply_cmd_patt(char *patt, void (* cmd)(struct proto *, uintptr_t, int), uintptr_t arg) +proto_apply_cmd_patt(const char *patt, void (* cmd)(struct proto *, uintptr_t, int), uintptr_t arg) { struct proto *p; int cnt = 0; diff --git a/nest/protocol.h b/nest/protocol.h index e4ec7fa2..e97e59dd 100644 --- a/nest/protocol.h +++ b/nest/protocol.h @@ -115,8 +115,8 @@ struct proto_config { struct protocol *protocol; /* Protocol */ struct proto *proto; /* Instance we've created */ struct proto_config *parent; /* Parent proto_config for dynamic protocols */ - char *name; - char *dsc; + const char *name; + const char *dsc; int class; /* SYM_PROTO or SYM_TEMPLATE */ u8 net_type; /* Protocol network type (NET_*), 0 for undefined */ u8 disabled; /* Protocol enabled/disabled by default */ @@ -171,7 +171,7 @@ struct proto { struct rte_src *main_source; /* Primary route source */ struct iface *vrf; /* Related VRF instance, NULL if global */ - char *name; /* Name of this instance (== cf->name) */ + const char *name; /* Name of this instance (== cf->name) */ u32 debug; /* Debugging flags */ u32 mrtdump; /* MRTDump flags */ uint active_channels; /* Number of active channels */ @@ -245,7 +245,7 @@ struct proto { }; struct proto_spec { - void *ptr; + const void *ptr; int patt; }; |