2004-10-10 Paul Jakma <paul@dishone.st>
* version.h.in: (pid_output*) add const qualifier.
* command.h: Change DEFUN func to take const char *[] rather
than char **, to begin process of fixing compile warnings in lib/.
Nearly all other changes in this commit follow from this change.
* buffer.{c,h}: (buffer_write) pointer-arithmetic is gccism, take
const void * and cast an automatic const char *p to it.
(buffer_putstr) add const
* command.c: (zencrypt) const qualifier
(cmd_execute_command_real) ditto
(cmd_execute_command_strict) ditto
(config_log_file) ditto.
Fix leak of getcwd() returned string.
* memory.{c,h}: Add MTYPE_DISTRIBUTE_IFNAME for struct dist ifname.
* distribute.{c,h}: Update with const qualifier.
(distribute_free) use MTYPE_DISTRIBUTE_IFNAME
(distribute_lookup) Cast to char *, note that it's ok.
(distribute_hash_alloc) use MTYPE_DISTRIBUTE_IFNAME.
(distribute_get) Cast to char *, note that it's ok.
* filter.c: Update with const qualifier.
* if.{c,h}: ditto.
* if_rmap.{c,h}: ditto.
(if_rmap_lookup) Cast to char *, note that it's ok.
(if_rmap_get) ditto.
* log.{c,h}: Update with const qualifier.
* plist.{c,h}: ditto.
* routemap.{c,h}: ditto.
* smux.{c,h}: ditto. Fix some signed/unsigned comparisons.
* sockopt.c: (getsockopt_cmsg_data) add return for error case.
* vty.c: Update with const qualifier.
diff --git a/lib/plist.c b/lib/plist.c
index ef2fffc..3520f82 100644
--- a/lib/plist.c
+++ b/lib/plist.c
@@ -126,7 +126,7 @@
/* Lookup prefix_list from list of prefix_list by name. */
struct prefix_list *
-prefix_list_lookup (afi_t afi, char *name)
+prefix_list_lookup (afi_t afi, const char *name)
{
struct prefix_list *plist;
struct prefix_master *master;
@@ -182,7 +182,7 @@
/* Insert new prefix list to list of prefix_list. Each prefix_list
is sorted by the name. */
static struct prefix_list *
-prefix_list_insert (afi_t afi, char *name)
+prefix_list_insert (afi_t afi, const char *name)
{
unsigned int i;
long number;
@@ -272,7 +272,7 @@
}
static struct prefix_list *
-prefix_list_get (afi_t afi, char *name)
+prefix_list_get (afi_t afi, const char *name)
{
struct prefix_list *plist;
@@ -647,7 +647,7 @@
}
static int
-vty_invalid_prefix_range (struct vty *vty, char *prefix)
+vty_invalid_prefix_range (struct vty *vty, const char *prefix)
{
vty_out (vty, "%% Invalid prefix range for %s, make sure: len < ge-value <= le-value%s",
prefix, VTY_NEWLINE);
@@ -655,9 +655,9 @@
}
static int
-vty_prefix_list_install (struct vty *vty, afi_t afi,
- char *name, char *seq, char *typestr,
- char *prefix, char *ge, char *le)
+vty_prefix_list_install (struct vty *vty, afi_t afi, const char *name,
+ const char *seq, const char *typestr,
+ const char *prefix, const char *ge, const char *le)
{
int ret;
enum prefix_list_type type;
@@ -774,9 +774,9 @@
}
static int
-vty_prefix_list_uninstall (struct vty *vty, afi_t afi,
- char *name, char *seq, char *typestr,
- char *prefix, char *ge, char *le)
+vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name,
+ const char *seq, const char *typestr,
+ const char *prefix, const char *ge, const char *le)
{
int ret;
enum prefix_list_type type;
@@ -878,7 +878,7 @@
}
static int
-vty_prefix_list_desc_unset (struct vty *vty, afi_t afi, char *name)
+vty_prefix_list_desc_unset (struct vty *vty, afi_t afi, const char *name)
{
struct prefix_list *plist;
@@ -982,8 +982,8 @@
}
static int
-vty_show_prefix_list (struct vty *vty, afi_t afi, char *name,
- char *seq, enum display_type dtype)
+vty_show_prefix_list (struct vty *vty, afi_t afi, const char *name,
+ const char *seq, enum display_type dtype)
{
struct prefix_list *plist;
struct prefix_master *master;
@@ -1026,8 +1026,8 @@
}
static int
-vty_show_prefix_list_prefix (struct vty *vty, afi_t afi, char *name,
- char *prefix, enum display_type type)
+vty_show_prefix_list_prefix (struct vty *vty, afi_t afi, const char *name,
+ const char *prefix, enum display_type type)
{
struct prefix_list *plist;
struct prefix_list_entry *pentry;
@@ -1098,7 +1098,8 @@
}
static int
-vty_clear_prefix_list (struct vty *vty, afi_t afi, char *name, char *prefix)
+vty_clear_prefix_list (struct vty *vty, afi_t afi, const char *name,
+ const char *prefix)
{
struct prefix_master *master;
struct prefix_list *plist;