]> git.puffer.fish Git - mirror/frr.git/commitdiff
2004-06-04 Paul Jakma <paul@dishone.st>
authorpaul <paul>
Fri, 4 Jun 2004 17:58:18 +0000 (17:58 +0000)
committerpaul <paul>
Fri, 4 Jun 2004 17:58:18 +0000 (17:58 +0000)
        * type mismatch fixes

18 files changed:
bgpd/ChangeLog
bgpd/bgp_attr.c
bgpd/bgp_attr.h
bgpd/bgp_community.c
bgpd/bgp_community.h
bgpd/bgp_ecommunity.c
bgpd/bgp_ecommunity.h
bgpd/bgp_mplsvpn.c
bgpd/bgp_mplsvpn.h
bgpd/bgp_open.c
bgpd/bgp_packet.c
bgpd/bgp_packet.h
bgpd/bgp_route.c
bgpd/bgp_routemap.c
lib/ChangeLog
lib/buffer.c
lib/buffer.h
lib/zebra.h

index 9ed186bd0bf79ab99fdc4b335b7b65ac59e2fc9a..7603dc5d9fbc39069412e7106c4b1a36aa3f30de 100644 (file)
@@ -1,3 +1,7 @@
+2004-06-04 Paul Jakma <paul@dishone.st>
+
+       * type mismatch fixes
+         
 2004-05-21  Akihiro Mizutani <mizutani@net-chef.net>
 
        * bgpd.h, bgp_open.[ch], bgp_debug.c, bgp_vty.[ch], bgp_fsm.c:
index 7d48374d969b1094595f92c28058a07c27bdd296..d745d871f02d434fabdc8863a485ab2ad8a7aea4 100644 (file)
@@ -84,13 +84,13 @@ cluster_hash_alloc (struct cluster_list *val)
 
 /* Cluster list related functions. */
 struct cluster_list *
-cluster_parse (caddr_t pnt, int length)
+cluster_parse (struct in_addr * pnt, int length)
 {
   struct cluster_list tmp;
   struct cluster_list *cluster;
 
   tmp.length = length;
-  tmp.list = (struct in_addr *) pnt;
+  tmp.list = pnt;
 
   cluster = hash_get (cluster_hash, &tmp, cluster_hash_alloc);
   cluster->refcnt++;
@@ -857,7 +857,8 @@ bgp_attr_community (struct peer *peer, bgp_size_t length,
     attr->community = NULL;
   else
     {
-      attr->community = community_parse (stream_pnt (peer->ibuf), length);
+      attr->community = 
+        community_parse ((u_int32_t *)stream_pnt (peer->ibuf), length);
       stream_forward (peer->ibuf, length);
     }
 
@@ -904,7 +905,8 @@ bgp_attr_cluster_list (struct peer *peer, bgp_size_t length,
       return -1;
     }
 
-  attr->cluster = cluster_parse (stream_pnt (peer->ibuf), length);
+  attr->cluster = cluster_parse ((struct in_addr *)stream_pnt (peer->ibuf), 
+                                 length);
 
   stream_forward (peer->ibuf, length);;
 
@@ -1065,7 +1067,8 @@ bgp_attr_ext_communities (struct peer *peer, bgp_size_t length,
     attr->ecommunity = NULL;
   else
     {
-      attr->ecommunity = ecommunity_parse (stream_pnt (peer->ibuf), length);
+      attr->ecommunity = 
+        ecommunity_parse ((u_int8_t *)stream_pnt (peer->ibuf), length);
       stream_forward (peer->ibuf, length);
     }
   attr->flag |= ATTR_FLAG_BIT (BGP_ATTR_EXT_COMMUNITIES);
@@ -1339,7 +1342,7 @@ bgp_size_t
 bgp_packet_attribute (struct bgp *bgp, struct peer *peer,
                      struct stream *s, struct attr *attr, struct prefix *p,
                      afi_t afi, safi_t safi, struct peer *from,
-                     struct prefix_rd *prd, u_char *tag)
+                     struct prefix_rd *prd, char *tag)
 {
   unsigned long cp;
   struct aspath *aspath;
@@ -1671,7 +1674,7 @@ bgp_packet_attribute (struct bgp *bgp, struct peer *peer,
        }
       else
        {
-         u_char *pnt;
+         u_int8_t *pnt;
          int tbit;
          int ecom_tr_size = 0;
          int i;
@@ -1727,7 +1730,7 @@ bgp_packet_attribute (struct bgp *bgp, struct peer *peer,
 bgp_size_t
 bgp_packet_withdraw (struct peer *peer, struct stream *s, struct prefix *p,
                     afi_t afi, safi_t safi, struct prefix_rd *prd,
-                    u_char *tag)
+                    char *tag)
 {
   unsigned long cp;
   unsigned long attrlen_pnt;
index 2bcbbf37ccb4aa123093524a2ff4a634f8445262..c9acc710c0161fa215081028c9547182c0191464 100644 (file)
@@ -111,9 +111,16 @@ void bgp_attr_unintern (struct attr *);
 void bgp_attr_flush (struct attr *);
 struct attr *bgp_attr_default_set (struct attr *attr, u_char);
 struct attr *bgp_attr_default_intern (u_char);
-struct attr *bgp_attr_aggregate_intern (struct bgp *, u_char, struct aspath *, struct community *, int as_set);
-bgp_size_t bgp_packet_attribute (struct bgp *bgp, struct peer *, struct stream *, struct attr *, struct prefix *, afi_t, safi_t, struct peer *, struct prefix_rd *, u_char *);
-bgp_size_t bgp_packet_withdraw (struct peer *peer, struct stream *s, struct prefix *p, afi_t, safi_t, struct prefix_rd *, u_char *);
+struct attr *bgp_attr_aggregate_intern (struct bgp *, u_char,
+                                        struct aspath *, 
+                                        struct community *, int as_set);
+bgp_size_t bgp_packet_attribute (struct bgp *bgp, struct peer *, 
+                                 struct stream *, struct attr *, 
+                                 struct prefix *, afi_t, safi_t, 
+                                 struct peer *, struct prefix_rd *, char *);
+bgp_size_t bgp_packet_withdraw (struct peer *peer, struct stream *s, 
+                                struct prefix *p, afi_t, safi_t, 
+                                struct prefix_rd *, char *);
 void bgp_dump_routes_attr (struct stream *, struct attr *, struct prefix *);
 unsigned int attrhash_key_make (struct attr *);
 int attrhash_cmp (struct attr *, struct attr *);
index 83b1cc5e7021d7d5749a00c63651d61ca970b446..5467971001d12f52a95a3b115430ffbead4c03b6 100644 (file)
@@ -338,7 +338,7 @@ community_unintern (struct community *com)
 
 /* Create new community attribute. */
 struct community *
-community_parse (char *pnt, u_short length)
+community_parse (u_int32_t *pnt, u_short length)
 {
   struct community tmp;
   struct community *new;
@@ -349,7 +349,7 @@ community_parse (char *pnt, u_short length)
 
   /* Make temporary community for hash look up. */
   tmp.size = length / 4;
-  tmp.val = (u_int32_t *) pnt;
+  tmp.val = pnt;
 
   new = community_uniq_sort (&tmp);
 
index 58b3f9e68c6e16acfe743ddaa41b0eb05fa1c11a..898ca9e86ef24e4394b418922c6f9cd262732470 100644 (file)
@@ -51,7 +51,7 @@ struct community
 void community_init ();
 void community_free (struct community *);
 struct community *community_uniq_sort (struct community *);
-struct community *community_parse (char *, u_short);
+struct community *community_parse (u_int32_t *, u_short);
 struct community *community_intern (struct community *);
 void community_unintern (struct community *);
 char *community_str (struct community *);
index 4adbcf52c904d77316debd188209525e07a2aa1a..b3fc1c3a76c76177963a9aa43bddb5fe7dbc7cdf 100644 (file)
@@ -58,7 +58,7 @@ ecommunity_free (struct ecommunity *ecom)
 static int
 ecommunity_add_val (struct ecommunity *ecom, struct ecommunity_val *eval)
 {
-  u_char *p;
+  u_int8_t *p;
   int ret;
   int c;
 
@@ -119,7 +119,7 @@ ecommunity_uniq_sort (struct ecommunity *ecom)
 
 /* Parse Extended Communites Attribute in BGP packet.  */
 struct ecommunity *
-ecommunity_parse (char *pnt, u_short length)
+ecommunity_parse (u_int8_t *pnt, u_short length)
 {
   struct ecommunity tmp;
   struct ecommunity *new;
@@ -232,7 +232,7 @@ ecommunity_hash_make (struct ecommunity *ecom)
 {
   int c;
   unsigned int key;
-  unsigned char *pnt;
+  u_int8_t *pnt;
 
   key = 0;
   pnt = ecom->val;
@@ -530,13 +530,13 @@ char *
 ecommunity_ecom2str (struct ecommunity *ecom, int format)
 {
   int i;
-  u_char *pnt;
+  u_int8_t *pnt;
   int encode = 0;
   int type = 0;
 #define ECOMMUNITY_STR_DEFAULT_LEN  26
   int str_size;
   int str_pnt;
-  u_char *str_buf;
+  char *str_buf;
   char *prefix;
   int len = 0;
   int first = 1;
index e266471f9266e651f230ff12336d91f33a60ae2a..e7be7865e064c0044dd99a377669940227369775 100644 (file)
@@ -47,7 +47,7 @@ struct ecommunity
   int size;
 
   /* Extended Communities value.  */
-  u_char *val;
+  u_int8_t *val;
 
   /* Human readable format string.  */
   char *str;
@@ -64,7 +64,7 @@ struct ecommunity_val
 void ecommunity_init (void);
 void ecommunity_free (struct ecommunity *);
 struct ecommunity *ecommunity_new (void);
-struct ecommunity *ecommunity_parse (char *, u_short);
+struct ecommunity *ecommunity_parse (u_int8_t *, u_short);
 struct ecommunity *ecommunity_dup (struct ecommunity *);
 struct ecommunity *ecommunity_merge (struct ecommunity *, struct ecommunity *);
 struct ecommunity *ecommunity_intern (struct ecommunity *);
index e820cabf6208eb1c2d2c0517f54aed8426a3319d..90219cfe948230c87cc9c6aec062f9e196f0ee11 100644 (file)
@@ -180,13 +180,13 @@ bgp_nlri_parse_vpnv4 (struct peer *peer, struct attr *attr,
 }
 
 int
-str2prefix_rd (u_char *str, struct prefix_rd *prd)
+str2prefix_rd (char *str, struct prefix_rd *prd)
 {
   int ret;
-  u_char *p;
-  u_char *p2;
+  char *p;
+  char *p2;
   struct stream *s;
-  u_char *half;
+  char *half;
   struct in_addr addr;
 
   s = stream_new (8);
@@ -236,7 +236,7 @@ str2prefix_rd (u_char *str, struct prefix_rd *prd)
 }
 
 int
-str2tag (u_char *str, u_char *tag)
+str2tag (char *str, u_char *tag)
 {
   u_int32_t l;
 
index cd861a8737189c2734f9365cba45797dad182bcf..a5f3eb371a1a72cb6f30cc5397b78f416b15511a 100644 (file)
@@ -40,6 +40,6 @@ struct rd_ip
 void bgp_mplsvpn_init ();
 int bgp_nlri_parse_vpnv4 (struct peer *, struct attr *, struct bgp_nlri *);
 u_int32_t decode_label (u_char *);
-int str2prefix_rd (u_char *, struct prefix_rd *);
-int str2tag (u_char *, u_char *);
+int str2prefix_rd (char *, struct prefix_rd *);
+int str2tag (char *, u_char *);
 char *prefix_rd2str (struct prefix_rd *, char *, size_t);
index ae4a7d4081a58e66f60c0ec99ce255c191f01985..eecea608b3ace966388b1ce5c84998aef41ae861 100644 (file)
@@ -48,8 +48,8 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 void
 bgp_capability_vty_out (struct vty *vty, struct peer *peer)
 {
-  u_char *pnt;
-  u_char *end;
+  char *pnt;
+  char *end;
   struct capability cap;
 
   pnt = peer->notify.data;
index 341a192cd2adad037047091d0c48e97c53bfd1ab..316c44e2f22567331f1738f934745fe82bf3f074 100644 (file)
@@ -124,7 +124,7 @@ static void
 bgp_connect_check (struct peer *peer)
 {
   int status;
-  int slen;
+  socklen_t slen;
   int ret;
 
   /* Anyway I have to reset read and write thread. */
@@ -203,10 +203,10 @@ bgp_update_packet (struct peer *peer, afi_t afi, safi_t safi)
          stream_putw (s, 0);           
          pos = stream_get_putp (s);
          stream_putw (s, 0);
-         total_attr_len = bgp_packet_attribute (NULL, peer, s,
-                                                adv->baa->attr,
-                                                &rn->p, afi, safi,
-                                                binfo->peer, prd, tag);
+         total_attr_len = bgp_packet_attribute (NULL, peer, s, 
+                                                adv->baa->attr,
+                                                &rn->p, afi, safi, 
+                                                binfo->peer, prd, tag);
          stream_putw_at (s, pos, total_attr_len);
        }
 
@@ -1137,8 +1137,8 @@ bgp_open_receive (struct peer *peer, bgp_size_t size)
   struct peer *realpeer;
   struct in_addr remote_id;
   int capability;
-  char notify_data_remote_as[2];
-  char notify_data_remote_id[4];
+  u_int8_t notify_data_remote_as[2];
+  u_int8_t notify_data_remote_id[4];
 
   realpeer = NULL;
   
@@ -1171,22 +1171,22 @@ bgp_open_receive (struct peer *peer, bgp_size_t size)
          if (as)
            {
              if (BGP_DEBUG (normal, NORMAL))
-               zlog_info ("%s bad OPEN, wrong router identifier %s",
-                          peer->host, inet_ntoa (remote_id));
-             bgp_notify_send_with_data (peer, 
-                                        BGP_NOTIFY_OPEN_ERR, 
-                                        BGP_NOTIFY_OPEN_BAD_BGP_IDENT,
-                                        notify_data_remote_id, 4);
+          zlog_info ("%s bad OPEN, wrong router identifier %s",
+                                peer->host, inet_ntoa (remote_id));
+          bgp_notify_send_with_data (peer, 
+                                     BGP_NOTIFY_OPEN_ERR, 
+                                                                  BGP_NOTIFY_OPEN_BAD_BGP_IDENT,
+                                                                  notify_data_remote_id, 4);
            }
          else
            {
              if (BGP_DEBUG (normal, NORMAL))
-               zlog_info ("%s bad OPEN, remote AS is %d, expected %d",
-                          peer->host, remote_as, peer->as);
-             bgp_notify_send_with_data (peer, 
-                                        BGP_NOTIFY_OPEN_ERR, 
-                                        BGP_NOTIFY_OPEN_BAD_PEER_AS,
-                                        notify_data_remote_as, 2);
+          zlog_info ("%s bad OPEN, remote AS is %d, expected %d",
+                     peer->host, remote_as, peer->as);
+        bgp_notify_send_with_data (peer,
+                                   BGP_NOTIFY_OPEN_ERR,
+                                   BGP_NOTIFY_OPEN_BAD_PEER_AS,
+                                   notify_data_remote_as, 2);
            }
          return -1;
        }
@@ -1264,13 +1264,14 @@ bgp_open_receive (struct peer *peer, bgp_size_t size)
   /* Peer BGP version check. */
   if (version != BGP_VERSION_4)
     {
+      u_int8_t maxver = BGP_VERSION_4;
       if (BGP_DEBUG (normal, NORMAL))
        zlog_info ("%s bad protocol version, remote requested %d, local request %d",
                   peer->host, version, BGP_VERSION_4);
       bgp_notify_send_with_data (peer, 
                                 BGP_NOTIFY_OPEN_ERR, 
                                 BGP_NOTIFY_OPEN_UNSUP_VERSION,
-                                "\x04", 1);
+                                &maxver, 1);
       return -1;
     }
 
index c1efc8bd51ab7c81a43d974bb9407dee4219822f..7bbcdb230457e20c30c69c954176f23238e3ad7d 100644 (file)
@@ -40,8 +40,9 @@ int bgp_write (struct thread *);
 
 void bgp_keepalive_send (struct peer *);
 void bgp_open_send (struct peer *);
-void bgp_notify_send (struct peer *, u_char, u_char);
-void bgp_notify_send_with_data (struct peer *, u_char, u_char, u_char *, size_t);
+void bgp_notify_send (struct peer *, u_int8_t, u_int8_t);
+void bgp_notify_send_with_data (struct peer *, u_int8_t, u_int8_t, 
+                                u_int8_t *, size_t);
 void bgp_route_refresh_send (struct peer *, afi_t, safi_t, u_char, u_char, int);
 void bgp_capability_send (struct peer *, afi_t, safi_t, int, int);
 void bgp_default_update_send (struct peer *, struct attr *,
index b8af869b0898f6410d366684cee9083f71b6ebcc..1dd8b57127262204680421043f68e609acfd24e8 100644 (file)
@@ -875,7 +875,8 @@ bgp_process (struct bgp *bgp, struct bgp_node *rn, afi_t afi, safi_t safi)
 }
 
 int
-bgp_maximum_prefix_overflow (struct peer *peer, afi_t afi, safi_t safi, int always)
+bgp_maximum_prefix_overflow (struct peer *peer, afi_t afi, 
+                             safi_t safi, int always)
 {
   if (!CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX))
     return 0;
@@ -895,18 +896,18 @@ bgp_maximum_prefix_overflow (struct peer *peer, afi_t afi, safi_t safi, int alwa
        return 0;
 
       {
-       char ndata[7];
-
-       ndata[0] = (u_char)(afi >>  8);
-       ndata[1] = (u_char) afi;
-       ndata[3] = (u_char)(peer->pmax[afi][safi] >> 24);
-       ndata[4] = (u_char)(peer->pmax[afi][safi] >> 16);
-       ndata[5] = (u_char)(peer->pmax[afi][safi] >> 8);
-       ndata[6] = (u_char)(peer->pmax[afi][safi]);
+       u_int8_t ndata[7];
 
        if (safi == SAFI_MPLS_VPN)
          safi = BGP_SAFI_VPNV4;
-       ndata[2] = (u_char) safi;
+         
+       ndata[0] = (afi >>  8);
+       ndata[1] = afi;
+       ndata[2] = safi;
+       ndata[3] = (peer->pmax[afi][safi] >> 24);
+       ndata[4] = (peer->pmax[afi][safi] >> 16);
+       ndata[5] = (peer->pmax[afi][safi] >> 8);
+       ndata[6] = (peer->pmax[afi][safi]);
 
        SET_FLAG (peer->sflags, PEER_STATUS_PREFIX_OVERFLOW);
        bgp_notify_send_with_data (peer, BGP_NOTIFY_CEASE,
@@ -4371,7 +4372,7 @@ bgp_show_callback (struct vty *vty, int unlock)
   int limit;
   int display;
 
-  rn = vty->output_rn;
+  rn = (struct bgp_node *) vty->output_rn;
   count = 0;
   limit = ((vty->lines == 0) 
           ? 10 : (vty->lines > 0 
@@ -4566,7 +4567,7 @@ bgp_show_callback (struct vty *vty, int unlock)
        if (count >= limit)
          {
            vty->status = VTY_CONTINUE;
-           vty->output_rn = bgp_route_next (rn);;
+           vty->output_rn = (struct route_node *) bgp_route_next (rn);;
            vty->output_func = bgp_show_callback;
            return 0;
          }
@@ -4824,7 +4825,7 @@ bgp_show (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
        if (count >= limit  && vty->type != VTY_SHELL_SERV)
          {
            vty->status = VTY_START;
-           vty->output_rn = bgp_route_next (rn);
+           vty->output_rn = (struct route_node *) bgp_route_next (rn);
            vty->output_func = bgp_show_callback;
            vty->output_type = type;
 
@@ -7395,7 +7396,7 @@ peer_lookup_in_view (struct vty *vty, char *view_name, char *ip_str)
           return NULL;
         }      
     }
-  else  // view_name==NULL
+  else
     {
       bgp = bgp_get_default ();
       if (! bgp)
index ce9ceb5d118be17dcb68d227408aa28236ca93eb..261f6b874e940d0688254416ed44b136717b90e6 100644 (file)
@@ -1950,7 +1950,7 @@ bgp_route_set_delete (struct vty *vty, struct route_map_index *index,
 
 /* Hook function for updating route_map assignment. */
 void
-bgp_route_map_update ()
+bgp_route_map_update (char *unused)
 {
   int i;
   afi_t afi;
index b42f46116d8244b770ecc7dd80976e4ae5946232..05cf29300c2f1e3497aabcbf84ff1f727bd7c361 100644 (file)
@@ -1,3 +1,7 @@
+2004-06-04 Paul Jakma <paul@dishone.st>
+
+        * type mismatch fixes
+        
 2004-05-18 Hasso Tepper <hasso@estpak.ee>
        
        * pqueue.[c|h]: Added as part of ospf6d merge from Zebra repository.
index de51ee3e254da6a35c003aff2e52a25817318409..0fffdfd18e81ee200efab61a36d61bb0f428e6fd 100644 (file)
@@ -149,7 +149,7 @@ buffer_add (struct buffer *b)
 
 /* Write data to buffer. */
 int
-buffer_write (struct buffer *b, u_char *ptr, size_t size)
+buffer_write (struct buffer *b, void *ptr, size_t size)
 {
   struct buffer_data *data;
 
@@ -205,12 +205,12 @@ buffer_putw (struct buffer *b, u_short c)
 
 /* Put string to the buffer. */
 int
-buffer_putstr (struct buffer *b, u_char *c)
+buffer_putstr (struct buffer *b, char *c)
 {
   size_t size;
 
-  size = strlen ((char *)c);
-  buffer_write (b, c, size);
+  size = strlen (c);
+  buffer_write (b, (void *) c, size);
   return 1;
 }
 
index 7449aa77e3c83f31020514c9aa5b3a46e8244da0..eaf4b88df6ca248abcdbf56ff9f81fd40c74e749 100644 (file)
@@ -63,11 +63,11 @@ struct buffer_data
 
 /* Buffer prototypes. */
 struct buffer *buffer_new (size_t);
-int buffer_write (struct buffer *, u_char *, size_t);
+int buffer_write (struct buffer *, void *, size_t);
 void buffer_free (struct buffer *);
 char *buffer_getstr (struct buffer *);
 int buffer_putc (struct buffer *, u_char);
-int buffer_putstr (struct buffer *, u_char *);
+int buffer_putstr (struct buffer *, char *);
 void buffer_reset (struct buffer *);
 int buffer_flush_all (struct buffer *, int);
 int buffer_flush_vty_all (struct buffer *, int, int, int);
index 997237d22e516d9bfdc3eedb33f61671806fc814..30377fdb1943783213fb1fa62fbd617d9825b4d9 100644 (file)
@@ -337,7 +337,7 @@ struct in_pktinfo
 
 /* AFI and SAFI type. */
 typedef u_int16_t afi_t;
-typedef u_char safi_t;
+typedef u_int8_t safi_t;
 
 /* Zebra types. */
 typedef u_int16_t zebra_size_t;