Fix most compiler warnings in default GCC build.

Fix lots of warnings. Some const and type-pun breaks strict-aliasing
warnings left but much reduced.

* bgp_advertise.h: (struct bgp_advertise_fifo) is functionally identical to
  (struct fifo), so just use that.  Makes it clearer the beginning of
  (struct bgp_advertise) is compatible with with (struct fifo), which seems
  to be enough for gcc.
  Add a BGP_ADV_FIFO_HEAD macro to contain the right cast to try shut up
  type-punning breaks strict aliasing warnings.
* bgp_packet.c: Use BGP_ADV_FIFO_HEAD.
  (bgp_route_refresh_receive) fix an interesting logic error in
  (!ok || (ret != BLAH)) where ret is only well-defined if ok.
* bgp_vty.c: Peer commands should use bgp_vty_return to set their return.
* jhash.{c,h}: Can take const on * args without adding issues & fix warnings.
* libospf.h: LSA sequence numbers use the unsigned range of values, and
  constants need to be set to unsigned, or it causes warnings in ospf6d.
* md5.h: signedness of caddr_t is implementation specific, change to an
  explicit (uint_8 *), fix sign/unsigned comparison warnings.
* vty.c: (vty_log_fixed) const on level is well-intentioned, but not going
  to fly given iov_base.
* workqueue.c: ALL_LIST_ELEMENTS_RO tests for null pointer, which is always
  true for address of static variable.  Correct but pointless warning in
  this case, but use a 2nd pointer to shut it up.
* ospf6_route.h: Add a comment about the use of (struct prefix) to stuff 2
  different 32 bit IDs into in (struct ospf6_route), and the resulting
  type-pun strict-alias breakage warnings this causes.  Need to use 2
  different fields to fix that warning?

general:

* remove unused variables, other than a few cases where they serve a
  sufficiently useful documentary purpose (e.g.  for code that needs
  fixing), or they're required dummies.  In those cases, try mark them as
  unused.
* Remove dead code that can't be reached.
* Quite a few 'no ...' forms of vty commands take arguments, but do not
  check the argument matches the command being negated.  E.g., should
  'distance X <prefix>' succeed if previously 'distance Y <prefix>' was set?
  Or should it be required that the distance match the previously configured
  distance for the prefix?
  Ultimately, probably better to be strict about this.  However, changing
  from slack to strict might expose problems in command aliases and tools.
* Fix uninitialised use of variables.
* Fix sign/unsigned comparison warnings by making signedness of types consistent.
* Mark functions as static where their use is restricted to the same compilation
  unit.
* Add required headers
* Move constants defined in headers into code.
* remove dead, unused functions that have no debug purpose.
diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c
index 5b1d13a..6218e67 100644
--- a/bgpd/bgp_nexthop.c
+++ b/bgpd/bgp_nexthop.c
@@ -789,9 +789,9 @@
   uint16_t length;
   u_char marker;
   u_char version;
-  uint16_t command;
-  int nbytes;
-  struct in_addr raddr;
+  uint16_t command __attribute__((unused));
+  int nbytes __attribute__((unused));
+  struct in_addr raddr __attribute__((unused));
   uint32_t metric;
   int i;
   u_char nexthop_num;
@@ -801,6 +801,7 @@
   s = zlookup->ibuf;
   stream_reset (s);
 
+  /* nbytes not being checked */
   nbytes = stream_read (s, zlookup->sock, 2);
   length = stream_getw (s);
 
@@ -814,9 +815,11 @@
                __func__, zlookup->sock, marker, version);
       return NULL;
     }
-    
+  
+  /* XXX: not checking command */
   command = stream_getw (s);
   
+  /* XXX: not doing anything with raddr */
   raddr.s_addr = stream_get_ipv4 (s);
   metric = stream_getl (s);
   nexthop_num = stream_getc (s);
@@ -901,8 +904,6 @@
   struct stream *s;
   uint16_t length;
   u_char version, marker;
-  uint16_t  command;
-  int nbytes;
   struct in6_addr raddr;
   uint32_t metric;
   int i;
@@ -913,10 +914,11 @@
   s = zlookup->ibuf;
   stream_reset (s);
 
-  nbytes = stream_read (s, zlookup->sock, 2);
+  /* XXX: ignoring nbytes, see also zread_lookup */
+  stream_read (s, zlookup->sock, 2);
   length = stream_getw (s);
 
-  nbytes = stream_read (s, zlookup->sock, length - 2);
+  stream_read (s, zlookup->sock, length - 2);
   marker = stream_getc (s);
   version = stream_getc (s);
   
@@ -926,9 +928,11 @@
                __func__, zlookup->sock, marker, version);
       return NULL;
     }
-    
-  command = stream_getw (s);
   
+  /* XXX: ignoring command */  
+  stream_getw (s);
+  
+  /* XXX: not actually doing anything with raddr */
   stream_get (&raddr, s, 16);
 
   metric = stream_getl (s);
@@ -1014,10 +1018,10 @@
 {
   struct stream *s;
   int ret;
-  u_int16_t length, command;
+  u_int16_t length, command __attribute__((unused));
   u_char version, marker;
-  int nbytes;
-  struct in_addr addr;
+  int nbytes __attribute__((unused));
+  struct in_addr addr __attribute__((unused));
   struct in_addr nexthop;
   u_int32_t metric = 0;
   u_char nexthop_num;
@@ -1063,6 +1067,7 @@
   stream_reset (s);
 
   /* Fetch length. */
+  /* XXX: not using nbytes */
   nbytes = stream_read (s, zlookup->sock, 2);
   length = stream_getw (s);
 
@@ -1077,9 +1082,11 @@
                __func__, zlookup->sock, marker, version);
       return 0;
     }
-    
+  
+  /* XXX: not using command */
   command = stream_getw (s);
   
+  /* XXX: not using addr */
   addr.s_addr = stream_get_ipv4 (s);
   metric = stream_getl (s);
   nexthop_num = stream_getc (s);