This is merely a const propagation. There was no problem in there.
list symbols; /* Configured symbols in config order */
int mrtdump_file; /* Configured MRTDump file (sysdep, fd in unix) */
- char *syslog_name; /* Name used for syslog (NULL -> no syslog) */
+ const char *syslog_name; /* Name used for syslog (NULL -> no syslog) */
struct rtable_config *def_tables[NET_MAX]; /* Default routing tables for each network */
struct iface_patt *router_id_from; /* Configured list of router ID iface patterns */
net_addr net;
net_addr *net_ptr;
struct symbol *s;
- char *t;
+ const char *t;
struct rtable_config *r;
struct channel_config *cc;
struct f_inst *x;
lcomm lc;
ip_addr ip;
const net_addr *net;
- char *s;
+ const char *s;
const struct f_tree *t;
const struct f_trie *ti;
const struct adata *ad;
int rcv_ttl; /* TTL of last received datagram */
node n;
void *rbuf_alloc, *tbuf_alloc;
- char *password; /* Password for MD5 authentication */
+ const char *password; /* Password for MD5 authentication */
const char *err; /* Error message */
struct ssh_sock *ssh; /* Used in SK_SSH */
} sock;
int sk_setup_broadcast(sock *s);
int sk_set_ttl(sock *s, int ttl); /* Set transmit TTL for given socket */
int sk_set_min_ttl(sock *s, int ttl); /* Set minimal accepted TTL for given socket */
-int sk_set_md5_auth(sock *s, ip_addr local, ip_addr remote, int pxlen, struct iface *ifa, char *passwd, int setkey);
+int sk_set_md5_auth(sock *s, ip_addr local, ip_addr remote, int pxlen, struct iface *ifa, const char *passwd, int setkey);
int sk_set_ipv6_checksum(sock *s, int offset);
int sk_set_icmp6_filter(sock *s, int p1, int p2);
void sk_log_error(sock *s, const char *p);
* type &btime.
*/
btime
-tm_parse_time(char *x)
+tm_parse_time(const char *x)
{
struct tm tm;
int usec, n1, n2, n3, r;
struct timeformat {
- char *fmt1, *fmt2;
+ const char *fmt1, *fmt2;
btime limit;
};
#define TM_DATETIME_BUFFER_SIZE 32 /* Buffer size required by tm_format_time() */
-btime tm_parse_time(char *x);
+btime tm_parse_time(const char *x);
void tm_format_time(char *x, struct timeformat *fmt, btime t);
int tm_format_real_time(char *x, size_t max, const char *fmt, btime t);
* if no such structure exists.
*/
struct iface *
-if_find_by_name(char *name)
+if_find_by_name(const char *name)
{
struct iface *i;
}
struct iface *
-if_get_by_name(char *name)
+if_get_by_name(const char *name)
{
struct iface *i;
WALK_LIST(p, ifp->ipn_list)
{
- char *t = p->pattern;
+ const char *t = p->pattern;
int pos = p->positive;
if (t)
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);
struct iface_patt_node {
node n;
int positive;
- byte *pattern;
+ const byte *pattern;
net_addr prefix;
};
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 */
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");
}
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)
{
}
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;
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 */
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 */
};
struct proto_spec {
- void *ptr;
+ const void *ptr;
int patt;
};
}
void
-babel_show_interfaces(struct proto *P, char *iff)
+babel_show_interfaces(struct proto *P, const char *iff)
{
struct babel_proto *p = (void *) P;
struct babel_iface *ifa = NULL;
}
void
-babel_show_neighbors(struct proto *P, char *iff)
+babel_show_neighbors(struct proto *P, const char *iff)
{
struct babel_proto *p = (void *) P;
struct babel_iface *ifa = NULL;
void babel_handle_route_request(union babel_msg *msg, struct babel_iface *ifa);
void babel_handle_seqno_request(union babel_msg *msg, struct babel_iface *ifa);
-void babel_show_interfaces(struct proto *P, char *iff);
-void babel_show_neighbors(struct proto *P, char *iff);
+void babel_show_interfaces(struct proto *P, const char *iff);
+void babel_show_neighbors(struct proto *P, const char *iff);
void babel_show_entries(struct proto *P);
void babel_show_routes(struct proto *P);
unsigned disable_after_error; /* Disable the protocol when error is detected */
u32 disable_after_cease; /* Disable it when cease is received, bitfield */
- char *password; /* Password used for MD5 authentication */
+ const char *password; /* Password used for MD5 authentication */
net_addr *remote_range; /* Allowed neighbor range for dynamic BGP */
- char *dynamic_name; /* Name pattern for dynamic BGP */
+ const char *dynamic_name; /* Name pattern for dynamic BGP */
int dynamic_name_digits; /* Minimum number of digits for dynamic names */
int check_link; /* Use iface link state for liveness detection */
int bfd; /* Use BFD for liveness detection */
const char *table_expr;
struct rtable *table_ptr;
const struct filter *filter;
- char *filename;
+ const char *filename;
};
struct mrt_peer_entry {
void
-ospf_sh_neigh(struct proto *P, char *iff)
+ospf_sh_neigh(struct proto *P, const char *iff)
{
struct ospf_proto *p = (struct ospf_proto *) P;
struct ospf_iface *ifa = NULL;
}
void
-ospf_sh_iface(struct proto *P, char *iff)
+ospf_sh_iface(struct proto *P, const char *iff)
{
struct ospf_proto *p = (struct ospf_proto *) P;
struct ospf_iface *ifa = NULL;
void ospf_stop_gr_recovery(struct ospf_proto *p);
-void ospf_sh_neigh(struct proto *P, char *iff);
+void ospf_sh_neigh(struct proto *P, const char *iff);
void ospf_sh(struct proto *P);
-void ospf_sh_iface(struct proto *P, char *iff);
+void ospf_sh_iface(struct proto *P, const char *iff);
void ospf_sh_state(struct proto *P, int verbose, int reachable);
void ospf_sh_lsadb(struct lsadb_show_data *ld);
{
/* Format of domain in search list is <size> <label> <size> <label> ... 0 */
- char *dom = cf->domain;
- char *dom_end = dom; /* Just to */
+ const char *dom = cf->domain;
+ const char *dom_end = dom; /* Just to */
u8 *dlen_save = &cf->dlen_first;
uint len;
u16 lifetime_mult; /* Lifetime specified as multiple of max_ra_int */
u8 dlen_first; /* Length of first label in domain */
u8 dlen_all; /* Both dlen_ filled in radv_process_domain() */
- char *domain; /* Domain for DNS search list, in processed form */
+ const char *domain; /* Domain for DNS search list, in processed form */
};
/*
}
void
-rip_show_interfaces(struct proto *P, char *iff)
+rip_show_interfaces(struct proto *P, const char *iff)
{
struct rip_proto *p = (void *) P;
struct rip_iface *ifa = NULL;
}
void
-rip_show_neighbors(struct proto *P, char *iff)
+rip_show_neighbors(struct proto *P, const char *iff)
{
struct rip_proto *p = (void *) P;
struct rip_iface *ifa = NULL;
void rip_flush_table(struct rip_proto *p, struct rip_neighbor *n);
struct rip_neighbor * rip_get_neighbor(struct rip_proto *p, ip_addr *a, struct rip_iface *ifa);
void rip_update_bfd(struct rip_proto *p, struct rip_neighbor *n);
-void rip_show_interfaces(struct proto *P, char *iff);
-void rip_show_neighbors(struct proto *P, char *iff);
+void rip_show_interfaces(struct proto *P, const char *iff);
+void rip_show_neighbors(struct proto *P, const char *iff);
/* packets.c */
void rip_send_request(struct rip_proto *p, struct rip_iface *ifa);
* operations to implement replace.
*/
static int
-setkey_md5(sockaddr *src, uint slen, sockaddr *dst, uint dlen, char *passwd, uint type)
+setkey_md5(sockaddr *src, uint slen, sockaddr *dst, uint dlen, const char *passwd, uint type)
{
uint passwd_len = passwd ? strlen(passwd) : 0;
* Manipulation with the IPsec SA/SP database
*/
static int
-sk_set_md5_in_sasp_db(sock *s, ip_addr local, ip_addr remote, int pxlen, struct iface *ifa, char *passwd)
+sk_set_md5_in_sasp_db(sock *s, ip_addr local, ip_addr remote, int pxlen, struct iface *ifa, const char *passwd)
{
sockaddr src, dst;
sockaddr_fill(&src, s->af, local, ifa, 0);
#endif
int
-sk_set_md5_auth(sock *s, ip_addr local UNUSED, ip_addr remote UNUSED, int pxlen UNUSED, struct iface *ifa UNUSED, char *passwd, int setkey UNUSED)
+sk_set_md5_auth(sock *s, ip_addr local UNUSED, ip_addr remote UNUSED, int pxlen UNUSED, struct iface *ifa UNUSED, const char *passwd, int setkey UNUSED)
{
#ifdef USE_MD5SIG_SETKEY
if (setkey)
*/
int
-sk_set_md5_auth(sock *s, ip_addr local UNUSED, ip_addr remote, int pxlen, struct iface *ifa, char *passwd, int setkey UNUSED)
+sk_set_md5_auth(sock *s, ip_addr local UNUSED, ip_addr remote, int pxlen, struct iface *ifa, const char *passwd, int setkey UNUSED)
{
struct tcp_md5sig_ext md5;
};
struct rfile *
-rf_open(pool *p, char *name, char *mode)
+rf_open(pool *p, const char *name, const char *mode)
{
FILE *f = fopen(name, mode);
}
static list *
-default_log_list(int initial, char **syslog_name)
+default_log_list(int initial, const char **syslog_name)
{
static list log_list;
init_list(&log_list);
}
void
-log_switch(int initial, list *logs, char *new_syslog_name)
+log_switch(int initial, list *logs, const char *new_syslog_name)
{
struct log_config *l;
}
static int
-unix_read_config(struct config **cp, char *name)
+unix_read_config(struct config **cp, const char *name)
{
struct config *conf = config_alloc(name);
int ret;
}
static struct config *
-cmd_read_config(char *name)
+cmd_read_config(const char *name)
{
struct config *conf;
}
void
-cmd_check_config(char *name)
+cmd_check_config(const char *name)
{
struct config *conf = cmd_read_config(name);
if (!conf)
}
void
-cmd_reconfig(char *name, int type, uint timeout)
+cmd_reconfig(const char *name, int type, uint timeout)
{
if (cli_access_restricted())
return;
void async_config(void);
void async_dump(void);
void async_shutdown(void);
-void cmd_check_config(char *name);
-void cmd_reconfig(char *name, int type, uint timeout);
+void cmd_check_config(const char *name);
+void cmd_reconfig(const char *name, int type, uint timeout);
void cmd_reconfig_confirm(void);
void cmd_reconfig_undo(void);
void cmd_reconfig_status(void);
void io_loop(void);
void io_log_dump(void);
int sk_open_unix(struct birdsock *s, char *name);
-struct rfile *rf_open(struct pool *, char *name, char *mode);
+struct rfile *rf_open(struct pool *, const char *name, const char *mode);
void *rf_file(struct rfile *f);
int rf_fileno(struct rfile *f);
void test_old_bird(char *path);
void main_thread_init(void);
void log_init_debug(char *); /* Initialize debug dump to given file (NULL=stderr, ""=off) */
-void log_switch(int initial, list *l, char *);
+void log_switch(int initial, list *l, const char *);
struct log_config {
node n;
uint mask; /* Classes to log */
void *fh; /* FILE to log to, NULL=syslog */
struct rfile *rf; /* Resource for log file */
- char *filename; /* Log filename */
- char *backup; /* Secondary filename (for log rotation) */
+ const char *filename; /* Log filename */
+ const char *backup; /* Secondary filename (for log rotation) */
off_t pos; /* Position/size of current log */
off_t limit; /* Log size limit */
int terminal_flag;