First small part of lib cleanup. Mainly "constification" of arguments and
adding FIXME's.
diff --git a/lib/prefix.c b/lib/prefix.c
index 5a3e71b..d9751e3 100644
--- a/lib/prefix.c
+++ b/lib/prefix.c
@@ -66,7 +66,7 @@
 
 /* If n includes p prefix then return 1 else return 0. */
 int
-prefix_match (struct prefix *n, struct prefix *p)
+prefix_match (const struct prefix *n, const struct prefix *p)
 {
   int offset;
   int shift;
@@ -94,7 +94,7 @@
 
 /* Copy prefix from src to dest. */
 void
-prefix_copy (struct prefix *dest, struct prefix *src)
+prefix_copy (struct prefix *dest, const struct prefix *src)
 {
   dest->family = src->family;
   dest->prefixlen = src->prefixlen;
@@ -127,7 +127,7 @@
  * as '==' (which is different from prefix_cmp).
  */
 int
-prefix_same (struct prefix *p1, struct prefix *p2)
+prefix_same (const struct prefix *p1, const struct prefix *p2)
 {
   if (p1->family == p2->family && p1->prefixlen == p2->prefixlen)
     {
@@ -154,7 +154,7 @@
  * from prefix_same).
  */
 int
-prefix_cmp (struct prefix *p1, struct prefix *p2)
+prefix_cmp (const struct prefix *p1, const struct prefix *p2)
 {
   int offset;
   int shift;
@@ -181,8 +181,8 @@
 }
 
 /* Return prefix family type string. */
-char *
-prefix_family_str (struct prefix *p)
+const char *
+prefix_family_str (const struct prefix *p)
 {
   if (p->family == AF_INET)
     return "inet";
@@ -213,7 +213,7 @@
 
 /* When string format is invalid return 0. */
 int
-str2prefix_ipv4 (char *str, struct prefix_ipv4 *p)
+str2prefix_ipv4 (const char *str, struct prefix_ipv4 *p)
 {
   int ret;
   int plen;
@@ -335,7 +335,7 @@
 
 /* If prefix is 0.0.0.0/0 then return 1 else return 0. */
 int
-prefix_ipv4_any (struct prefix_ipv4 *p)
+prefix_ipv4_any (const struct prefix_ipv4 *p)
 {
   return (p->prefix.s_addr == 0 && p->prefixlen == 0);
 }
@@ -362,7 +362,7 @@
 
 /* If given string is valid return pin6 else return NULL */
 int
-str2prefix_ipv6 (char *str, struct prefix_ipv6 *p)
+str2prefix_ipv6 (const char *str, struct prefix_ipv6 *p)
 {
   char *pnt;
   char *cp;
@@ -399,7 +399,8 @@
   return ret;
 }
 
-/* Convert struct in6_addr netmask into integer. */
+/* Convert struct in6_addr netmask into integer.
+ * FIXME return u_char as ip_maskleni() does. */
 int
 ip6_masklen (struct in6_addr netmask)
 {
@@ -470,7 +471,7 @@
 }
 
 void
-str2in6_addr (char *str, struct in6_addr *addr)
+str2in6_addr (const char *str, struct in6_addr *addr)
 {
   int i;
   unsigned int x;
@@ -503,10 +504,11 @@
   return;
 }
 
-/* Utility function of convert between struct prefix <=> union sockunion */
+/* Utility function of convert between struct prefix <=> union sockunion.
+ * FIXME This function isn't used anywhere. */
 struct prefix *
-sockunion2prefix (union sockunion *dest,
-		  union sockunion *mask)
+sockunion2prefix (const union sockunion *dest,
+		  const union sockunion *mask)
 {
   if (dest->sa.sa_family == AF_INET)
     {
@@ -533,9 +535,9 @@
   return NULL;
 }
 
-/* Utility function of convert between struct prefix <=> union sockunion */
+/* Utility function of convert between struct prefix <=> union sockunion. */
 struct prefix *
-sockunion2hostprefix (union sockunion *su)
+sockunion2hostprefix (const union sockunion *su)
 {
   if (su->sa.sa_family == AF_INET)
     {
@@ -563,7 +565,7 @@
 }
 
 int
-prefix_blen (struct prefix *p)
+prefix_blen (const struct prefix *p)
 {
   switch (p->family) 
     {
@@ -581,7 +583,7 @@
 
 /* Generic function for conversion string to struct prefix. */
 int
-str2prefix (char *str, struct prefix *p)
+str2prefix (const char *str, struct prefix *p)
 {
   int ret;
 
@@ -601,7 +603,7 @@
 }
 
 int
-prefix2str (struct prefix *p, char *str, int size)
+prefix2str (const struct prefix *p, char *str, int size)
 {
   char buf[BUFSIZ];
 
@@ -627,9 +629,10 @@
 }
 
 /* Utility function.  Check the string only contains digit
-   character. */
+ * character.
+ * FIXME str.[c|h] would be better place for this function. */
 int
-all_digit (char *str)
+all_digit (const char *str)
 {
   for (; *str != '\0'; str++)
     if (!isdigit ((int) *str))
@@ -668,7 +671,8 @@
    ex.) "1.1.0.0" "255.255.0.0" => "1.1.0.0/16"
    ex.) "1.0.0.0" NULL => "1.0.0.0/8"                   */
 int
-netmask_str2prefix_str (char *net_str, char *mask_str, char *prefix_str)
+netmask_str2prefix_str (const char *net_str, const char *mask_str,
+			char *prefix_str)
 {
   struct in_addr network;
   struct in_addr mask;