]> git.puffer.fish Git - mirror/frr.git/commitdiff
*: Consistently support 32-bit route tags
authorChristian Franke <chris@opensourcerouting.org>
Sat, 1 Oct 2016 18:42:34 +0000 (20:42 +0200)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 8 Oct 2016 01:05:05 +0000 (21:05 -0400)
This patch improves zebra,ripd,ripngd,ospfd and bgpd so that they can
make use of 32-bit route tags in the case of zebra,ospf,bgp or 16-bit
route-tags in the case of ripd,ripngd.

It is based on the following patch:

    commit d25764028829a3a30cdbabe85f32408a63cccadf
    Author: Paul Jakma <paul.jakma@hpe.com>
    Date:   Fri Jul 1 14:23:45 2016 +0100

    *: Widen width of Zserv routing tag field.

But also contains the changes which make this actually useful for all
the daemons.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
34 files changed:
bgpd/bgp_attr.h
bgpd/bgp_route.c
bgpd/bgp_route.h
bgpd/bgp_routemap.c
bgpd/bgp_zebra.c
lib/routemap.c
lib/routemap.h
lib/zclient.c
lib/zclient.h
lib/zebra.h
ospfd/ospf_asbr.c
ospfd/ospf_asbr.h
ospfd/ospf_dump.c
ospfd/ospf_lsa.c
ospfd/ospf_routemap.c
ospfd/ospf_vty.c
ospfd/ospf_zebra.c
ospfd/ospfd.h
pimd/pim_zebra.c
ripd/rip_routemap.c
ripd/ripd.c
ripd/ripd.h
ripngd/ripng_route.h
ripngd/ripng_routemap.c
ripngd/ripngd.c
ripngd/ripngd.h
zebra/rib.h
zebra/zebra_mpls_vty.c
zebra/zebra_routemap.c
zebra/zebra_routemap.h
zebra/zebra_static.c
zebra/zebra_static.h
zebra/zebra_vty.c
zebra/zserv.c

index 002bdfa08197e4ef43c3de2aa79ce9f7e470905b..d4f45ba60a24f82e38d8a290d3ec12e776b89db1 100644 (file)
@@ -118,7 +118,7 @@ struct attr_extra
   u_char mp_nexthop_prefer_global;
 
   /* route tag */
-  u_short tag;
+  route_tag_t tag;
 
   uint16_t                     encap_tunneltype;       /* grr */
   struct bgp_attr_encap_subtlv *encap_subtlvs;         /* rfc5512 */
index bace5ab31e8091e2422484d981b8f06c6cadc44e..923acfda67a113d0154507c8fac4990258d99c4c 100644 (file)
@@ -5820,7 +5820,7 @@ ALIAS (no_ipv6_aggregate_address_summary_only,
 void
 bgp_redistribute_add (struct bgp *bgp, struct prefix *p, const struct in_addr *nexthop,
                      const struct in6_addr *nexthop6, unsigned int ifindex,
-                     u_int32_t metric, u_char type, u_short instance, u_short tag)
+                     u_int32_t metric, u_char type, u_short instance, route_tag_t tag)
 {
   struct bgp_info *new;
   struct bgp_info *bi;
@@ -7185,7 +7185,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
           if (json_paths)
             json_object_int_add(json_path, "tag", attr->extra->tag);
           else
-            vty_out (vty, ", tag %d", attr->extra->tag);
+            vty_out (vty, ", tag %"ROUTE_TAG_PRI, attr->extra->tag);
         }
        
       if (! CHECK_FLAG (binfo->flags, BGP_INFO_VALID))
index 3d65b4b0a90696255b82b98552496e16b6e1360f..0dce5da5724a850d93ea1cef3d1a5e103160954a 100644 (file)
@@ -271,7 +271,7 @@ extern int bgp_maximum_prefix_overflow (struct peer *, afi_t, safi_t, int);
 
 extern void bgp_redistribute_add (struct bgp *, struct prefix *, const struct in_addr *,
                                  const struct in6_addr *, unsigned int ifindex,
-                                 u_int32_t, u_char, u_short, u_short);
+                                 u_int32_t, u_char, u_short, route_tag_t);
 extern void bgp_redistribute_delete (struct bgp *, struct prefix *, u_char, u_short);
 extern void bgp_redistribute_withdraw (struct bgp *, afi_t, int, u_short);
 
index beab1969b6896db2fdb74e0c4dd11441962a001f..acb7449a0955f0cf0091cfd260903abb1e0616f4 100644 (file)
@@ -1070,7 +1070,7 @@ static route_map_result_t
 route_match_tag (void *rule, struct prefix *prefix,
                  route_map_object_t type, void *object)
 {
-  u_short *tag;
+  route_tag_t *tag;
   struct bgp_info *bgp_info;
 
   if (type == RMAP_BGP)
@@ -1088,46 +1088,13 @@ route_match_tag (void *rule, struct prefix *prefix,
 }
 
 
-/*  Route map `match tag' match statement. `arg' is TAG value */
-static void *
-route_match_tag_compile (const char *arg)
-{
-  u_short *tag;
-  u_short tmp;
-
-  /* tag value shoud be integer. */
-  if (! all_digit (arg))
-    return NULL;
-
-  tmp = atoi(arg);
-  if (tmp < 1)
-    return NULL;
-
-  tag = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (u_short));
-
-  if (!tag)
-    return tag;
-
-  *tag = tmp;
-
-  return tag;
-}
-
-
-/* Free route map's compiled 'match tag' value. */
-static void
-route_match_tag_free (void *rule)
-{
-  XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
-}
-
 /* Route map commands for tag matching. */
-struct route_map_rule_cmd route_match_tag_cmd =
+static struct route_map_rule_cmd route_match_tag_cmd =
 {
   "tag",
   route_match_tag,
-  route_match_tag_compile,
-  route_match_tag_free,
+  route_map_rule_tag_compile,
+  route_map_rule_tag_free,
 };
 
 
@@ -1924,7 +1891,7 @@ static route_map_result_t
 route_set_tag (void *rule, struct prefix *prefix,
                route_map_object_t type, void *object)
 {
-  u_short *tag;
+  route_tag_t *tag;
   struct bgp_info *bgp_info;
   struct attr_extra *ae;
 
@@ -1942,47 +1909,13 @@ route_set_tag (void *rule, struct prefix *prefix,
   return RMAP_OKAY;
 }
 
-/* Route map `tag' compile function.  Given string is converted to u_short. */
-static void *
-route_set_tag_compile (const char *arg)
-{
-  u_short *tag;
-  u_short tmp;
-
-  /* tag value shoud be integer. */
-  if (! all_digit (arg))
-    return NULL;
-
-  tmp = atoi(arg);
-
-  if (tmp < 1)
-      return NULL;
-
-  tag = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (u_short));
-
-  if (!tag)
-    return tag;
-
-  *tag = tmp;
-
-  return tag;
-}
-
-/* Free route map's tag value. */
-static void
-route_set_tag_free (void *rule)
-{
-  XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
-}
-
-
 /* Route map commands for tag set. */
-struct route_map_rule_cmd route_set_tag_cmd =
+static struct route_map_rule_cmd route_set_tag_cmd =
 {
   "tag",
   route_set_tag,
-  route_set_tag_compile,
-  route_set_tag_free,
+  route_map_rule_tag_compile,
+  route_map_rule_tag_free,
 };
 
 
@@ -3605,7 +3538,7 @@ ALIAS (no_match_interface,
 
 DEFUN (match_tag,
        match_tag_cmd,
-       "match tag <1-65535>",
+       "match tag <1-4294967295>",
        MATCH_STR
        "Match tag of route\n"
        "Tag value\n")
@@ -3631,7 +3564,7 @@ DEFUN (no_match_tag,
 
 ALIAS (no_match_tag,
        no_match_tag_val_cmd,
-       "no match tag <1-65535>",
+       "no match tag <1-4294967295>",
        NO_STR
        MATCH_STR
        "Match tag of route\n"
@@ -4313,7 +4246,7 @@ ALIAS (no_set_aggregator_as,
 
 DEFUN (set_tag,
        set_tag_cmd,
-       "set tag <1-65535>",
+       "set tag <1-4294967295>",
        SET_STR
        "Tag value for routing protocol\n"
        "Tag value\n")
@@ -4336,7 +4269,7 @@ DEFUN (no_set_tag,
 
 ALIAS (no_set_tag,
        no_set_tag_val_cmd,
-       "no set tag <1-65535>",
+       "no set tag <1-4294967295>",
        NO_STR
        SET_STR
        "Tag value for routing protocol\n"
index d524c41a2874b97e82813a7aee0a346b6bc760d3..789dba53f8d7b38048f881e9bf9fe26622d33b83 100644 (file)
@@ -640,7 +640,7 @@ zebra_read_ipv4 (int command, struct zclient *zclient, zebra_size_t length,
     api.metric = 0;
 
   if (CHECK_FLAG (api.message, ZAPI_MESSAGE_TAG))
-    api.tag = stream_getw (s);
+    api.tag = stream_getl (s);
   else
     api.tag = 0;
 
@@ -649,7 +649,7 @@ zebra_read_ipv4 (int command, struct zclient *zclient, zebra_size_t length,
       if (bgp_debug_zebra((struct prefix *)&p))
        {
          char buf[2][INET_ADDRSTRLEN];
-         zlog_debug("Rx IPv4 route add VRF %u %s[%d] %s/%d nexthop %s metric %u tag %d",
+         zlog_debug("Rx IPv4 route add VRF %u %s[%d] %s/%d nexthop %s metric %u tag %"ROUTE_TAG_PRI,
                      vrf_id,
                     zebra_route_string(api.type), api.instance,
                     inet_ntop(AF_INET, &p.prefix, buf[0], sizeof(buf[0])),
@@ -681,7 +681,7 @@ zebra_read_ipv4 (int command, struct zclient *zclient, zebra_size_t length,
        {
          char buf[2][INET_ADDRSTRLEN];
          zlog_debug("Rx IPv4 route delete VRF %u %s[%d] %s/%d "
-                    "nexthop %s metric %u tag %d",
+                    "nexthop %s metric %u tag %"ROUTE_TAG_PRI,
                      vrf_id,
                     zebra_route_string(api.type), api.instance,
                     inet_ntop(AF_INET, &p.prefix, buf[0], sizeof(buf[0])),
@@ -757,7 +757,7 @@ zebra_read_ipv6 (int command, struct zclient *zclient, zebra_size_t length,
     api.metric = 0;
 
   if (CHECK_FLAG (api.message, ZAPI_MESSAGE_TAG))
-    api.tag = stream_getw (s);
+    api.tag = stream_getl (s);
   else
     api.tag = 0;
 
@@ -770,7 +770,7 @@ zebra_read_ipv6 (int command, struct zclient *zclient, zebra_size_t length,
       if (bgp_debug_zebra((struct prefix *)&p))
        {
          char buf[2][INET6_ADDRSTRLEN];
-         zlog_debug("Rx IPv6 route add VRF %u %s[%d] %s/%d nexthop %s metric %u tag %d",
+         zlog_debug("Rx IPv6 route add VRF %u %s[%d] %s/%d nexthop %s metric %u tag %"ROUTE_TAG_PRI,
                      vrf_id,
                     zebra_route_string(api.type), api.instance,
                     inet_ntop(AF_INET6, &p.prefix, buf[0], sizeof(buf[0])),
@@ -801,7 +801,7 @@ zebra_read_ipv6 (int command, struct zclient *zclient, zebra_size_t length,
        {
          char buf[2][INET6_ADDRSTRLEN];
          zlog_debug("Rx IPv6 route delete VRF %u %s[%d] %s/%d "
-                    "nexthop %s metric %u tag %d",
+                    "nexthop %s metric %u tag %"ROUTE_TAG_PRI,
                      vrf_id,
                     zebra_route_string(api.type), api.instance,
                     inet_ntop(AF_INET6, &p.prefix, buf[0], sizeof(buf[0])),
@@ -1211,7 +1211,7 @@ bgp_zebra_announce (struct prefix *p, struct bgp_info *info, struct bgp *bgp,
   u_int32_t nhcount, metric;
   struct bgp_info local_info;
   struct bgp_info *info_cp = &local_info;
-  u_short tag;
+  route_tag_t tag;
 
   /* Don't try to install if we're not connected to Zebra or Zebra doesn't
    * know of this instance.
@@ -1376,7 +1376,7 @@ bgp_zebra_announce (struct prefix *p, struct bgp_info *info, struct bgp *bgp,
       if (bgp_debug_zebra(p))
         {
           int i;
-          zlog_debug("Tx IPv4 route %s VRF %u %s/%d metric %u tag %d"
+          zlog_debug("Tx IPv4 route %s VRF %u %s/%d metric %u tag %"ROUTE_TAG_PRI
                      " count %d", (valid_nh_count ? "add":"delete"),
                      bgp->vrf_id,
                      inet_ntop(AF_INET, &p->u.prefix4, buf[0], sizeof(buf[0])),
@@ -1557,7 +1557,7 @@ bgp_zebra_announce (struct prefix *p, struct bgp_info *info, struct bgp *bgp,
           if (bgp_debug_zebra(p))
             {
               int i;
-              zlog_debug("Tx IPv4 route %s VRF %u %s/%d metric %u tag %d",
+              zlog_debug("Tx IPv4 route %s VRF %u %s/%d metric %u tag %"ROUTE_TAG_PRI,
                          valid_nh_count ? "add" : "delete", bgp->vrf_id,
                          inet_ntop(AF_INET, &p->u.prefix4, buf[0], sizeof(buf[0])),
                          p->prefixlen, api.metric, api.tag);
@@ -1579,7 +1579,7 @@ bgp_zebra_announce (struct prefix *p, struct bgp_info *info, struct bgp *bgp,
           if (bgp_debug_zebra(p))
             {
               int i;
-              zlog_debug("Tx IPv6 route %s VRF %u %s/%d metric %u tag %d",
+              zlog_debug("Tx IPv6 route %s VRF %u %s/%d metric %u tag %"ROUTE_TAG_PRI,
                          valid_nh_count ? "add" : "delete", bgp->vrf_id,
                          inet_ntop(AF_INET6, &p->u.prefix6, buf[0], sizeof(buf[0])),
                          p->prefixlen, api.metric, api.tag);
@@ -1683,7 +1683,7 @@ bgp_zebra_withdraw (struct prefix *p, struct bgp_info *info, safi_t safi)
       if (bgp_debug_zebra(p))
        {
          char buf[2][INET_ADDRSTRLEN];
-         zlog_debug("Tx IPv4 route delete VRF %u %s/%d metric %u tag %d",
+         zlog_debug("Tx IPv4 route delete VRF %u %s/%d metric %u tag %"ROUTE_TAG_PRI,
                      peer->bgp->vrf_id,
                     inet_ntop(AF_INET, &p->u.prefix4, buf[0], sizeof(buf[0])),
                     p->prefixlen, api.metric, api.tag);
@@ -1723,7 +1723,7 @@ bgp_zebra_withdraw (struct prefix *p, struct bgp_info *info, safi_t safi)
       if (bgp_debug_zebra(p))
        {
          char buf[2][INET6_ADDRSTRLEN];
-         zlog_debug("Tx IPv6 route delete VRF %u %s/%d metric %u tag %d",
+         zlog_debug("Tx IPv6 route delete VRF %u %s/%d metric %u tag %"ROUTE_TAG_PRI,
                      peer->bgp->vrf_id,
                     inet_ntop(AF_INET6, &p->u.prefix6, buf[0], sizeof(buf[0])),
                     p->prefixlen, api.metric, api.tag);
index e0a7080bbf73cc5227095a0e3dacf827183b5336..6f93087ae9f1bed22987ac8026c0e9c2877c9600 100644 (file)
@@ -1829,6 +1829,32 @@ route_map_init_dep_hashes (void)
                                        route_map_dep_hash_cmp);
 }
 
+/* Common route map rules */
+
+void *
+route_map_rule_tag_compile (const char *arg)
+{
+  unsigned long int tmp;
+  char *endptr;
+  route_tag_t *tag;
+
+  errno = 0;
+  tmp = strtoul(arg, &endptr, 0);
+  if (arg[0] == '\0' || *endptr != '\0' || errno || tmp > ROUTE_TAG_MAX)
+    return NULL;
+
+  tag = XMALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(*tag));
+  *tag = tmp;
+
+  return tag;
+}
+
+void
+route_map_rule_tag_free (void *rule)
+{
+  XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
+}
+
 /* Initialization of route map vector. */
 void
 route_map_init_vty (void)
index 427a552e7f820de2e17c731004a9ff20169306e2..0f888897b25ef8302758726722796ffcf1353c2a 100644 (file)
@@ -235,4 +235,7 @@ extern void route_map_upd8_dependency (route_map_event_t type, const char *arg,
 extern void route_map_notify_dependencies (const char *affected_name,
                                           route_map_event_t event);
 
+extern void *route_map_rule_tag_compile (const char *arg);
+extern void route_map_rule_tag_free (void *rule);
+
 #endif /* _ZEBRA_ROUTEMAP_H */
index 24d9b589df01a422269380f157c7148ea8a83072..fa8150c5a1042b77e002f499546926cd425d03bd 100644 (file)
@@ -722,7 +722,7 @@ zclient_connect (struct thread *t)
   * If ZAPI_MESSAGE_METRIC is set, the metric value is written as an 8
   * byte value.
   *
-  * If ZAPI_MESSAGE_TAG is set, the tag value is written as a 2 byte value
+  * If ZAPI_MESSAGE_TAG is set, the tag value is written as a 4 byte value
   *
   * If ZAPI_MESSAGE_MTU is set, the mtu value is written as a 4 byte value
   *
@@ -785,7 +785,7 @@ zapi_ipv4_route (u_char cmd, struct zclient *zclient, struct prefix_ipv4 *p,
   if (CHECK_FLAG (api->message, ZAPI_MESSAGE_METRIC))
     stream_putl (s, api->metric);
   if (CHECK_FLAG (api->message, ZAPI_MESSAGE_TAG))
-    stream_putw (s, api->tag);
+    stream_putl (s, api->tag);
   if (CHECK_FLAG (api->message, ZAPI_MESSAGE_MTU))
     stream_putl (s, api->mtu);
 
@@ -852,7 +852,7 @@ zapi_ipv4_route_ipv6_nexthop (u_char cmd, struct zclient *zclient,
   if (CHECK_FLAG (api->message, ZAPI_MESSAGE_METRIC))
     stream_putl (s, api->metric);
   if (CHECK_FLAG (api->message, ZAPI_MESSAGE_TAG))
-    stream_putw (s, api->tag);
+    stream_putl (s, api->tag);
   if (CHECK_FLAG (api->message, ZAPI_MESSAGE_MTU))
     stream_putl (s, api->mtu);
 
@@ -918,7 +918,7 @@ zapi_ipv6_route (u_char cmd, struct zclient *zclient, struct prefix_ipv6 *p,
   if (CHECK_FLAG (api->message, ZAPI_MESSAGE_METRIC))
     stream_putl (s, api->metric);
   if (CHECK_FLAG (api->message, ZAPI_MESSAGE_TAG))
-    stream_putw (s, api->tag);
+    stream_putl (s, api->tag);
   if (CHECK_FLAG (api->message, ZAPI_MESSAGE_MTU))
     stream_putl (s, api->mtu);
 
index 4edbd7636ef45a3dff5acc6853d696b102c2e257..f122b233b9569da196fd479afe4a0e2a375a2871 100644 (file)
@@ -150,7 +150,7 @@ struct zapi_ipv4
 
   u_int32_t metric;
 
-  u_short tag;
+  route_tag_t tag;
 
   u_int32_t mtu;
 
@@ -238,7 +238,7 @@ struct zapi_ipv6
 
   u_int32_t metric;
 
-  u_short tag;
+  route_tag_t tag;
 
   u_int32_t mtu;
 
index e625b4051bd85e7c8e3e8ad389c6f47b6d7366e8..08c50c68bc9e9437630bb5e5916df410cc434f1e 100644 (file)
@@ -528,4 +528,8 @@ typedef u_int16_t zebra_command_t;
 /* VRF ID type. */
 typedef u_int16_t vrf_id_t;
 
+typedef uint32_t route_tag_t;
+#define ROUTE_TAG_MAX UINT32_MAX
+#define ROUTE_TAG_PRI PRIu32
+
 #endif /* _ZEBRA_H */
index 21f99af1284efaab390b79474fd6d620a7d5ead9..284c564688f71184490468caf0e24b174fd6b203 100644 (file)
@@ -137,7 +137,7 @@ ospf_route_map_set_compare (struct route_map_set_values *values1,
 struct external_info *
 ospf_external_info_add (u_char type, u_short instance, struct prefix_ipv4 p,
                        ifindex_t ifindex, struct in_addr nexthop,
-                        u_short tag)
+                        route_tag_t tag)
 {
   struct external_info *new;
   struct route_node *rn;
index 25a53aad4fe65304d1ff5aebec6771a6289d487c..e2fa367455b0d53de1a6ce0c55fc1884b89d9066 100644 (file)
@@ -47,7 +47,7 @@ struct external_info
   struct in_addr nexthop;
 
   /* Additional Route tag. */
-  u_int32_t tag;
+  route_tag_t tag;
 
   struct route_map_set_values route_map_set;
 #define ROUTEMAP_METRIC(E)      (E)->route_map_set.metric
@@ -65,7 +65,7 @@ extern struct external_info *ospf_external_info_add (u_char, u_short,
                                               struct prefix_ipv4,
                                              ifindex_t,
                                              struct in_addr,
-                                             u_short);
+                                             route_tag_t);
 extern void ospf_external_info_delete (u_char, u_short, struct prefix_ipv4);
 extern struct external_info *ospf_external_info_lookup (u_char, u_short,
                                                  struct prefix_ipv4 *);
index a53c72685387d520c229e52a99aeb13e23caf79c..8fa2258f4f650cee7e0b77747a271631a43b3617 100644 (file)
@@ -493,7 +493,7 @@ ospf_as_external_lsa_dump (struct stream *s, u_int16_t length)
                 IS_EXTERNAL_METRIC (al->e[i].tos) ? "E" : "-",
                 al->e[i].tos & 0x7f, GET_METRIC (al->e[i].metric));
       zlog_debug ("    Forwarding address %s", inet_ntoa (al->e[i].fwd_addr));
-      zlog_debug ("    External Route Tag %d", al->e[i].route_tag);
+      zlog_debug ("    External Route Tag %"ROUTE_TAG_PRI, al->e[i].route_tag);
     }
 }
 
index b96ed452c149b84723f3569daeb31ca417799f3d..916d4d01c9ec4816bccf87e7dd7c2190dd11e606 100644 (file)
@@ -1673,7 +1673,7 @@ ospf_external_lsa_body_set (struct stream *s, struct external_info *ei,
   /* Put forwarding address. */
   stream_put_ipv4 (s, fwd_addr.s_addr);
   
-  /* Put route tag -- only first 16bits are used for compatibility */
+  /* Put route tag */
   stream_putl (s, ei->tag);
 }
 
index b2f1c6712686db762e8e24b0016b4a262de69a44..6bd853bf89b49d8ad5e816350d95a45e50ae9122 100644 (file)
@@ -443,7 +443,7 @@ static route_map_result_t
 route_match_tag (void *rule, struct prefix *prefix,
                  route_map_object_t type, void *object)
 {
-  u_short *tag;
+  route_tag_t *tag;
   struct external_info *ei;
 
   if (type == RMAP_OSPF)
@@ -457,45 +457,13 @@ route_match_tag (void *rule, struct prefix *prefix,
   return RMAP_NOMATCH;
 }
 
-/*  Route map `match tag' match statement. `arg' is TAG value */
-static void *
-route_match_tag_compile (const char *arg)
-{
-  u_short *tag;
-  u_short tmp;
-
-  /* tag value shoud be integer. */
-  if (! all_digit (arg))
-    return NULL;
-
-  tmp = atoi(arg);
-  if (tmp < 1)
-    return NULL;
-
-  tag = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (u_short));
-
-  if (!tag)
-    return tag;
-
-  *tag = tmp;
-
-  return tag;
-}
-
-/* Free route map's compiled 'match tag' value. */
-static void
-route_match_tag_free (void *rule)
-{
-  XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
-}
-
 /* Route map commands for tag matching. */
-struct route_map_rule_cmd route_match_tag_cmd =
+static struct route_map_rule_cmd route_match_tag_cmd =
 {
   "tag",
   route_match_tag,
-  route_match_tag_compile,
-  route_match_tag_free,
+  route_map_rule_tag_compile,
+  route_map_rule_tag_free,
 };
 
 
@@ -633,7 +601,7 @@ static route_map_result_t
 route_set_tag (void *rule, struct prefix *prefix,
                route_map_object_t type, void *object)
 {
-  u_short *tag;
+  route_tag_t *tag;
   struct external_info *ei;
 
   if (type == RMAP_OSPF)
@@ -648,46 +616,13 @@ route_set_tag (void *rule, struct prefix *prefix,
   return RMAP_OKAY;
 }
 
-/* Route map `tag' compile function.  Given string is converted to u_short. */
-static void *
-route_set_tag_compile (const char *arg)
-{
-  u_short *tag;
-  u_short tmp;
-
-  /* tag value shoud be integer. */
-  if (! all_digit (arg))
-    return NULL;
-
-  tmp = atoi(arg);
-
-  if (tmp < 1)
-      return NULL;
-
-  tag = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (u_short));
-
-  if (!tag)
-    return tag;
-
-  *tag = tmp;
-
-  return tag;
-}
-
-/* Free route map's tag value. */
-static void
-route_set_tag_free (void *rule)
-{
-  XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
-}
-
 /* Route map commands for tag set. */
-struct route_map_rule_cmd route_set_tag_cmd =
+static struct route_map_rule_cmd route_set_tag_cmd =
 {
   "tag",
   route_set_tag,
-  route_set_tag_compile,
-  route_set_tag_free,
+  route_map_rule_tag_compile,
+  route_map_rule_tag_free,
 };
 
 DEFUN (match_ip_nexthop,
@@ -877,7 +812,7 @@ ALIAS (no_match_interface,
 
 DEFUN (match_tag,
        match_tag_cmd,
-       "match tag <1-65535>",
+       "match tag <1-4294967295>",
        MATCH_STR
        "Match tag of route\n"
        "Tag value\n")
@@ -900,7 +835,7 @@ DEFUN (no_match_tag,
 
 ALIAS (no_match_tag,
        no_match_tag_val_cmd,
-       "no match tag <1-65535>",
+       "no match tag <1-4294967295>",
        NO_STR
        MATCH_STR
        "Match tag of route\n"
@@ -977,7 +912,7 @@ ALIAS (no_set_metric_type,
 
 DEFUN (set_tag,
        set_tag_cmd,
-       "set tag <1-65535>",
+       "set tag <1-4294967295>",
        SET_STR
        "Tag value for routing protocol\n"
        "Tag value\n")
@@ -1000,7 +935,7 @@ DEFUN (no_set_tag,
 
 ALIAS (no_set_tag,
        no_set_tag_val_cmd,
-       "no set tag <1-65535>",
+       "no set tag <1-4294967295>",
        NO_STR
        SET_STR
        "Tag value for routing protocol\n"
index d9a4289edf960867b88f38e8407b928f301eccee..e76d9d7065b39e77cbe6638325cfe48343f63b26 100644 (file)
@@ -5350,8 +5350,8 @@ show_as_external_lsa_detail (struct vty *vty, struct ospf_lsa *lsa)
       vty_out (vty, "        Forward Address: %s%s",
               inet_ntoa (al->e[0].fwd_addr), VTY_NEWLINE);
 
-      vty_out (vty, "        External Route Tag: %lu%s%s",
-              (u_long)ntohl (al->e[0].route_tag), VTY_NEWLINE, VTY_NEWLINE);
+      vty_out (vty, "        External Route Tag: %"ROUTE_TAG_PRI"%s%s",
+              (route_tag_t)ntohl (al->e[0].route_tag), VTY_NEWLINE, VTY_NEWLINE);
     }
 
   return 0;
@@ -5376,8 +5376,8 @@ show_as_external_lsa_stdvty (struct ospf_lsa *lsa)
   zlog_debug( "        Forward Address: %s%s",
             inet_ntoa (al->e[0].fwd_addr), "\n");
 
-  zlog_debug( "        External Route Tag: %u%s%s",
-            ntohl (al->e[0].route_tag), "\n", "\n");
+  zlog_debug( "        External Route Tag: %"ROUTE_TAG_PRI"%s%s",
+            (route_tag_t)ntohl (al->e[0].route_tag), "\n", "\n");
 
   return 0;
 }
@@ -5404,8 +5404,8 @@ show_as_nssa_lsa_detail (struct vty *vty, struct ospf_lsa *lsa)
       vty_out (vty, "        NSSA: Forward Address: %s%s",
               inet_ntoa (al->e[0].fwd_addr), VTY_NEWLINE);
 
-      vty_out (vty, "        External Route Tag: %u%s%s",
-              ntohl (al->e[0].route_tag), VTY_NEWLINE, VTY_NEWLINE);
+      vty_out (vty, "        External Route Tag: %"ROUTE_TAG_PRI"%s%s",
+              (route_tag_t)ntohl (al->e[0].route_tag), VTY_NEWLINE, VTY_NEWLINE);
     }
 
   return 0;
@@ -9067,11 +9067,11 @@ show_ip_ospf_route_external (struct vty *vty, struct route_table *rt)
        switch (er->path_type)
          {
          case OSPF_PATH_TYPE1_EXTERNAL:
-           vty_out (vty, "N E1 %-18s    [%d] tag: %u%s", buf1,
+           vty_out (vty, "N E1 %-18s    [%d] tag: %"ROUTE_TAG_PRI"%s", buf1,
                     er->cost, er->u.ext.tag, VTY_NEWLINE);
            break;
          case OSPF_PATH_TYPE2_EXTERNAL:
-           vty_out (vty, "N E2 %-18s    [%d/%d] tag: %u%s", buf1, er->cost,
+           vty_out (vty, "N E2 %-18s    [%d/%d] tag: %"ROUTE_TAG_PRI"%s", buf1, er->cost,
                     er->u.ext.type2_cost, er->u.ext.tag, VTY_NEWLINE);
            break;
          }
index 4458e95ba0efefcc0afff357fb5b6c40d40b6e67..b0ff5d0e3c7973fbfe619f1567c2b1ac170676d4 100644 (file)
@@ -379,10 +379,10 @@ ospf_zebra_add (struct prefix_ipv4 *p, struct ospf_route *or)
       if (distance)
         SET_FLAG (message, ZAPI_MESSAGE_DISTANCE);
 
-      /* Check if path type is ASE and use only 16bit tags */
+      /* Check if path type is ASE */
       if (((or->path_type == OSPF_PATH_TYPE1_EXTERNAL) ||
           (or->path_type == OSPF_PATH_TYPE2_EXTERNAL)) &&
-           (or->u.ext.tag > 0) && (or->u.ext.tag < UINT16_MAX))
+           (or->u.ext.tag > 0) && (or->u.ext.tag <= ROUTE_TAG_MAX))
         SET_FLAG (message, ZAPI_MESSAGE_TAG);
 
       /* Make packet. */
@@ -479,7 +479,7 @@ ospf_zebra_add (struct prefix_ipv4 *p, struct ospf_route *or)
         }
 
       if (CHECK_FLAG (message, ZAPI_MESSAGE_TAG))
-         stream_putw (s, (u_short)or->u.ext.tag);
+         stream_putl (s, or->u.ext.tag);
 
       stream_putw_at (s, 0, stream_get_endp (s));
 
@@ -1093,7 +1093,7 @@ ospf_zebra_read_ipv4 (int command, struct zclient *zclient,
   if (CHECK_FLAG (api.message, ZAPI_MESSAGE_METRIC))
     api.metric = stream_getl (s);
   if (CHECK_FLAG (api.message, ZAPI_MESSAGE_TAG))
-    api.tag = stream_getw (s);
+    api.tag = stream_getl (s);
   else
     api.tag = 0;
 
index bc4acf993b74b472ca4184318d35dc60686d6e8d..93b5ab766a652c5e22514ea0c9581bb678c65407 100644 (file)
@@ -269,7 +269,7 @@ struct ospf
   struct list *redist[ZEBRA_ROUTE_MAX + 1];
 
   /* Redistribute tag info. */
-  u_short dtag[ZEBRA_ROUTE_MAX + 1]; //Pending: cant configure as of now
+  route_tag_t dtag[ZEBRA_ROUTE_MAX + 1]; //Pending: cant configure as of now
 
   int default_metric;          /* Default metric for redistribute. */
 
index 1a8d5f22bc8d46d0a4b9f85bbac6897874942a4e..1822de22997d6870f1851232a39fca364876b6db 100644 (file)
@@ -610,7 +610,7 @@ static int redist_read_ipv4_route(int command, struct zclient *zclient,
     0;
 
   if (CHECK_FLAG (api.message, ZAPI_MESSAGE_TAG))
-    api.tag = stream_getw (s);
+    api.tag = stream_getl (s);
   else
     api.tag = 0;
 
index e7263ad7beb5dae5de814f1ad9acd4ca5a3ba716..666ccf08443fae84eb1b6548e9f7a88f3a0a8394 100644 (file)
@@ -463,8 +463,9 @@ static route_map_result_t
 route_match_tag (void *rule, struct prefix *prefix, 
                    route_map_object_t type, void *object)
 {
-  u_short *tag;
+  route_tag_t *tag;
   struct rip_info *rinfo;
+  route_tag_t rinfo_tag;
 
   if (type == RMAP_RIP)
     {
@@ -472,7 +473,8 @@ route_match_tag (void *rule, struct prefix *prefix,
       rinfo = object;
 
       /* The information stored by rinfo is host ordered. */
-      if (rinfo->tag == *tag)
+      rinfo_tag = rinfo->tag;
+      if (rinfo_tag == *tag)
        return RMAP_MATCH;
       else
        return RMAP_NOMATCH;
@@ -480,45 +482,13 @@ route_match_tag (void *rule, struct prefix *prefix,
   return RMAP_NOMATCH;
 }
 
-/* Route map `match tag' match statement. `arg' is TAG value */
-static void *
-route_match_tag_compile (const char *arg)
-{
-  u_short *tag;
-  u_short tmp;
-
-  /* tag value shoud be integer. */
-  if (! all_digit (arg))
-    return NULL;
-
-  tmp = atoi(arg);
-  if (tmp < 1)
-    return NULL;
-
-  tag = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (u_short));
-
-  if (!tag)
-    return tag;
-
-  *tag = tmp;
-
-  return tag;
-}
-
-/* Free route map's compiled `match tag' value. */
-static void
-route_match_tag_free (void *rule)
-{
-  XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
-}
-
 /* Route map commands for tag matching. */
-struct route_map_rule_cmd route_match_tag_cmd =
+static struct route_map_rule_cmd route_match_tag_cmd =
 {
   "tag",
   route_match_tag,
-  route_match_tag_compile,
-  route_match_tag_free
+  route_map_rule_tag_compile,
+  route_map_rule_tag_free,
 };
 
 /* `set metric METRIC' */
@@ -687,7 +657,7 @@ static route_map_result_t
 route_set_tag (void *rule, struct prefix *prefix, 
                      route_map_object_t type, void *object)
 {
-  u_short *tag;
+  route_tag_t *tag;
   struct rip_info *rinfo;
 
   if(type == RMAP_RIP)
@@ -703,33 +673,13 @@ route_set_tag (void *rule, struct prefix *prefix,
   return RMAP_OKAY;
 }
 
-/* Route map `tag' compile function.  Given string is converted
-   to u_short. */
-static void *
-route_set_tag_compile (const char *arg)
-{
-  u_short *tag;
-
-  tag = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (u_short));
-  *tag = atoi (arg);
-
-  return tag;
-}
-
-/* Free route map's compiled `ip nexthop' value. */
-static void
-route_set_tag_free (void *rule)
-{
-  XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
-}
-
 /* Route map commands for tag set. */
 static struct route_map_rule_cmd route_set_tag_cmd =
 {
   "tag",
   route_set_tag,
-  route_set_tag_compile,
-  route_set_tag_free
+  route_map_rule_tag_compile,
+  route_map_rule_tag_free
 };
 
 #define MATCH_STR "Match values from routing table\n"
@@ -950,7 +900,7 @@ ALIAS (no_match_ip_address_prefix_list,
 
 DEFUN (match_tag, 
        match_tag_cmd,
-       "match tag <1-65535>",
+       "match tag <1-4294967295>",
        MATCH_STR
        "Match tag of route\n"
        "Metric value\n")
@@ -973,7 +923,7 @@ DEFUN (no_match_tag,
 
 ALIAS (no_match_tag,
        no_match_tag_val_cmd,
-       "no match tag <1-65535>",
+       "no match tag <1-4294967295>",
        NO_STR
        MATCH_STR
        "Match tag of route\n"
@@ -1080,7 +1030,7 @@ ALIAS (no_set_ip_nexthop,
 
 DEFUN (set_tag,
        set_tag_cmd,
-       "set tag <1-65535>",
+       "set tag <1-4294967295>",
        SET_STR
        "Tag value for routing protocol\n"
        "Tag value\n")
@@ -1103,7 +1053,7 @@ DEFUN (no_set_tag,
 
 ALIAS (no_set_tag,
        no_set_tag_val_cmd,
-       "no set tag <1-65535>",
+       "no set tag <1-4294967295>",
        NO_STR
        SET_STR
        "Tag value for routing protocol\n"
index 22ba2fe998d951889b37a53f76a5b2c7e1df2a9a..220297e8356c8eeb2eaf8841fe2459d7ad9dcbcf 100644 (file)
@@ -760,17 +760,18 @@ rip_packet_dump (struct rip_packet *packet, int size, const char *sndrcv)
                }
             }
          else
-           zlog_debug ("  %s/%d -> %s family %d tag %d metric %ld",
+           zlog_debug ("  %s/%d -> %s family %d tag %"ROUTE_TAG_PRI" metric %ld",
                        inet_ntop (AF_INET, &rte->prefix, pbuf, BUFSIZ),
                        netmask, inet_ntop (AF_INET, &rte->nexthop, nbuf,
                                            BUFSIZ), ntohs (rte->family),
-                       ntohs (rte->tag), (u_long) ntohl (rte->metric));
+                       (route_tag_t)ntohs (rte->tag),
+                       (u_long) ntohl (rte->metric));
        }
       else
        {
-         zlog_debug ("  %s family %d tag %d metric %ld", 
+         zlog_debug ("  %s family %d tag %"ROUTE_TAG_PRI" metric %ld", 
                     inet_ntop (AF_INET, &rte->prefix, pbuf, BUFSIZ),
-                    ntohs (rte->family), ntohs (rte->tag),
+                    ntohs (rte->family), (route_tag_t)ntohs (rte->tag),
                     (u_long)ntohl (rte->metric));
        }
     }
@@ -3551,13 +3552,13 @@ DEFUN (show_ip_rip,
            (rinfo->sub_type == RIP_ROUTE_RTE))
          {
            vty_out (vty, "%-15s ", inet_ntoa (rinfo->from));
-           vty_out (vty, "%3d ", rinfo->tag);
+           vty_out (vty, "%3"ROUTE_TAG_PRI" ", (route_tag_t)rinfo->tag);
            rip_vty_out_uptime (vty, rinfo);
          }
        else if (rinfo->metric == RIP_METRIC_INFINITY)
          {
            vty_out (vty, "self            ");
-           vty_out (vty, "%3d ", rinfo->tag);
+           vty_out (vty, "%3"ROUTE_TAG_PRI" ", (route_tag_t)rinfo->tag);
            rip_vty_out_uptime (vty, rinfo);
          }
        else
@@ -3573,7 +3574,7 @@ DEFUN (show_ip_rip,
              }
            else
              vty_out (vty, "self            ");
-           vty_out (vty, "%3d", rinfo->tag);
+           vty_out (vty, "%3"ROUTE_TAG_PRI, (route_tag_t)rinfo->tag);
          }
 
        vty_out (vty, "%s", VTY_NEWLINE);
index 588da1d5f7b8d394a77309d33cfbf2d6aa15057f..2d5bd98de8795bf13c24dbb8372233cfa272a4a9 100644 (file)
@@ -225,7 +225,7 @@ struct rip_info
   struct in_addr nexthop_out;
   u_char metric_set;
   u_int32_t metric_out;
-  u_short tag_out;
+  u_int16_t tag_out;
   ifindex_t ifindex_out;
 
   struct route_node *rp;
index fe65c8836375659f9f6f12c9eeeebd5a25c75f04..9ff90aa8d0c3a343bb69613ccb0a84cd8e739123 100644 (file)
@@ -35,13 +35,13 @@ struct ripng_aggregate
   u_char metric;               
 
   /* Tag field of RIPng packet.*/
-  u_short tag;         
+  u_int16_t tag;
 
   /* Route-map futures - this variables can be changed. */
   struct in6_addr nexthop_out;
   u_char metric_set;
   u_char metric_out;
-  u_short tag_out;
+  u_int16_t tag_out;
 };
 
 extern void ripng_aggregate_increment (struct route_node *rp,
index 9bda2e260d1f0f743574485bd069cd5e55ea5e3f..ee4f4afcec866d2f1cc8e78b8eff4a47c6e08cbb 100644 (file)
@@ -240,8 +240,9 @@ static route_map_result_t
 route_match_tag (void *rule, struct prefix *prefix, 
                    route_map_object_t type, void *object)
 {
-  u_short *tag;
+  route_tag_t *tag;
   struct ripng_info *rinfo;
+  route_tag_t rinfo_tag;
 
   if (type == RMAP_RIPNG)
     {
@@ -249,7 +250,8 @@ route_match_tag (void *rule, struct prefix *prefix,
       rinfo = object;
 
       /* The information stored by rinfo is host ordered. */
-      if (rinfo->tag == *tag)
+      rinfo_tag = rinfo->tag;
+      if (rinfo_tag == *tag)
        return RMAP_MATCH;
       else
        return RMAP_NOMATCH;
@@ -257,32 +259,12 @@ route_match_tag (void *rule, struct prefix *prefix,
   return RMAP_NOMATCH;
 }
 
-/* Route map `match tag' match statement. `arg' is TAG value */
-static void *
-route_match_tag_compile (const char *arg)
-{
-  u_short *tag;
-
-  tag = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (u_short));
-  *tag = atoi (arg);
-
-  return tag;
-}
-
-/* Free route map's compiled `match tag' value. */
-static void
-route_match_tag_free (void *rule)
-{
-  XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
-}
-
-/* Route map commands for tag matching. */
 static struct route_map_rule_cmd route_match_tag_cmd =
 {
   "tag",
   route_match_tag,
-  route_match_tag_compile,
-  route_match_tag_free
+  route_map_rule_tag_compile,
+  route_map_rule_tag_free,
 };
 
 /* `set metric METRIC' */
@@ -452,7 +434,7 @@ static route_map_result_t
 route_set_tag (void *rule, struct prefix *prefix, 
                      route_map_object_t type, void *object)
 {
-  u_short *tag;
+  route_tag_t *tag;
   struct ripng_info *rinfo;
 
   if(type == RMAP_RIPNG)
@@ -460,7 +442,7 @@ route_set_tag (void *rule, struct prefix *prefix,
       /* Fetch routemap's rule information. */
       tag = rule;
       rinfo = object;
-    
+
       /* Set next hop value. */ 
       rinfo->tag_out = *tag;
     }
@@ -468,33 +450,13 @@ route_set_tag (void *rule, struct prefix *prefix,
   return RMAP_OKAY;
 }
 
-/* Route map `tag' compile function.  Given string is converted
-   to u_short. */
-static void *
-route_set_tag_compile (const char *arg)
-{
-  u_short *tag;
-
-  tag = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (u_short));
-  *tag = atoi (arg);
-
-  return tag;
-}
-
-/* Free route map's compiled `ip nexthop' value. */
-static void
-route_set_tag_free (void *rule)
-{
-  XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
-}
-
 /* Route map commands for tag set. */
 static struct route_map_rule_cmd route_set_tag_cmd =
 {
   "tag",
   route_set_tag,
-  route_set_tag_compile,
-  route_set_tag_free
+  route_map_rule_tag_compile,
+  route_map_rule_tag_free
 };
 
 #define MATCH_STR "Match values from routing table\n"
@@ -564,7 +526,7 @@ ALIAS (no_match_interface,
 
 DEFUN (match_tag,
        match_tag_cmd,
-       "match tag <1-65535>",
+       "match tag <1-4294967295>",
        MATCH_STR
        "Match tag of route\n"
        "Metric value\n")
@@ -587,7 +549,7 @@ DEFUN (no_match_tag,
 
 ALIAS (no_match_tag,
        no_match_tag_val_cmd,
-       "no match tag <1-65535>",
+       "no match tag <1-4294967295>",
        NO_STR
        MATCH_STR
        "Match tag of route\n"
@@ -681,7 +643,7 @@ ALIAS (no_set_ipv6_nexthop_local,
 
 DEFUN (set_tag,
        set_tag_cmd,
-       "set tag <1-65535>",
+       "set tag <1-4294967295>",
        SET_STR
        "Tag value for routing protocol\n"
        "Tag value\n")
@@ -704,7 +666,7 @@ DEFUN (no_set_tag,
 
 ALIAS (no_set_tag,
        no_set_tag_val_cmd,
-       "no set tag <1-65535>",
+       "no set tag <1-4294967295>",
        NO_STR
        SET_STR
        "Tag value for routing protocol\n"
index 7d2c66b0b236ac5f62f3fc446d82e10c1b925115..0c9606e69cc0ef71981b73db9c55fe101fff6f47 100644 (file)
@@ -321,9 +321,9 @@ ripng_packet_dump (struct ripng_packet *packet, int size, const char *sndrcv)
       if (rte->metric == RIPNG_METRIC_NEXTHOP)
        zlog_debug ("  nexthop %s/%d", inet6_ntoa (rte->addr), rte->prefixlen);
       else
-       zlog_debug ("  %s/%d metric %d tag %d", 
+       zlog_debug ("  %s/%d metric %d tag %"ROUTE_TAG_PRI,
                   inet6_ntoa (rte->addr), rte->prefixlen, 
-                  rte->metric, ntohs (rte->tag));
+                  rte->metric, (route_tag_t)ntohs (rte->tag));
     }
 }
 
@@ -337,15 +337,15 @@ ripng_nexthop_rte (struct rte *rte,
 
   /* Logging before checking RTE. */
   if (IS_RIPNG_DEBUG_RECV)
-    zlog_debug ("RIPng nexthop RTE address %s tag %d prefixlen %d",
-              inet6_ntoa (rte->addr), ntohs (rte->tag), rte->prefixlen);
+    zlog_debug ("RIPng nexthop RTE address %s tag %"ROUTE_TAG_PRI" prefixlen %d",
+              inet6_ntoa (rte->addr), (route_tag_t)ntohs (rte->tag), rte->prefixlen);
 
   /* RFC2080 2.1.1 Next Hop: 
    The route tag and prefix length in the next hop RTE must be
    set to zero on sending and ignored on receiption.  */
   if (ntohs (rte->tag) != 0)
-    zlog_warn ("RIPng nexthop RTE with non zero tag value %d from %s",
-              ntohs (rte->tag), inet6_ntoa (from->sin6_addr));
+    zlog_warn ("RIPng nexthop RTE with non zero tag value %"ROUTE_TAG_PRI" from %s",
+              (route_tag_t)ntohs (rte->tag), inet6_ntoa (from->sin6_addr));
 
   if (rte->prefixlen != 0)
     zlog_warn ("RIPng nexthop RTE with non zero prefixlen value %d from %s",
@@ -2017,8 +2017,8 @@ DEFUN (show_ipv6_ripng,
          vty_out (vty, "%*s", 18, " ");
 
          vty_out (vty, "%*s", 28, " ");
-         vty_out (vty, "self      %2d  %3d%s", aggregate->metric,
-                  aggregate->tag,
+         vty_out (vty, "self      %2d  %3"ROUTE_TAG_PRI"%s", aggregate->metric,
+                  (route_tag_t)aggregate->tag,
                   VTY_NEWLINE);
        }
 
@@ -2062,8 +2062,8 @@ DEFUN (show_ipv6_ripng,
          if (len > 0)
            vty_out (vty, "%*s", len, " ");
 
-         vty_out (vty, " %2d  %3d  ",
-                  rinfo->metric, rinfo->tag);
+         vty_out (vty, " %2d  %3"ROUTE_TAG_PRI"  ",
+                  rinfo->metric, (route_tag_t)rinfo->tag);
 
          /* time */
          if ((rinfo->type == ZEBRA_ROUTE_RIPNG) && 
index 5337eb88f31100563c960917aa919bdc048d224c..c4b34b348cf68f1d317e3238644ccb966fd3f67f 100644 (file)
@@ -148,7 +148,7 @@ struct ripng
 struct rte
 {
   struct in6_addr addr;        /* RIPng destination prefix */
-  u_short tag;         /* RIPng tag */
+  u_int16_t tag;               /* RIPng tag */
   u_char prefixlen;    /* Length of the RIPng prefix */
   u_char metric;       /* Metric of the RIPng route */
                        /* The nexthop is stored by the structure
@@ -202,7 +202,7 @@ struct ripng_info
   struct in6_addr nexthop_out;
   u_char metric_set;
   u_char metric_out;
-  u_short tag_out;
+  u_int16_t tag_out;
 
   struct route_node *rp;
 };
index 96301a8af41f1f0c4c3fdecf8c61409a32756116..c95a9ba0c30e332122f3a9b6b6917f336b684dbd 100644 (file)
@@ -23,6 +23,7 @@
 #ifndef _ZEBRA_RIB_H
 #define _ZEBRA_RIB_H
 
+#include "zebra.h"
 #include "linklist.h"
 #include "prefix.h"
 #include "table.h"
@@ -47,6 +48,9 @@ struct rib
   /* Refrence count. */
   unsigned long refcnt;
   
+  /* Tag */
+  route_tag_t tag;
+
   /* Uptime. */
   time_t uptime;
 
@@ -72,9 +76,6 @@ struct rib
   /* Distance. */
   u_char distance;
 
-  /* Tag */
-  u_short tag;
-
   /* Flags of this route.
    * This flag's definition is in lib/zebra.h ZEBRA_FLAG_* and is exposed
    * to clients via Zserv
index e7338a10c23e530c075488b84826de8a72257265..6136e92cdd220a941a876d1c76e645ab42b3f154 100644 (file)
@@ -221,7 +221,7 @@ DEFUN (ip_route_label,
 
 DEFUN (ip_route_tag_label,
        ip_route_tag_label_cmd,
-       "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-65535> label WORD",
+       "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-4294967295> label WORD",
        IP_STR
        "Establish static routes\n"
        "IP destination prefix (e.g. 10.0.0.0/8)\n"
@@ -257,7 +257,7 @@ DEFUN (ip_route_mask_label,
 
 DEFUN (ip_route_mask_tag_label,
        ip_route_mask_tag_label_cmd,
-       "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-65535> label WORD",
+       "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-4294967295> label WORD",
        IP_STR
        "Establish static routes\n"
        "IP destination prefix\n"
@@ -295,7 +295,7 @@ DEFUN (ip_route_distance_label,
 
 DEFUN (ip_route_tag_distance_label,
        ip_route_tag_distance_label_cmd,
-       "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-65535> <1-255> label WORD",
+       "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-4294967295> <1-255> label WORD",
        IP_STR
        "Establish static routes\n"
        "IP destination prefix (e.g. 10.0.0.0/8)\n"
@@ -333,7 +333,7 @@ DEFUN (ip_route_mask_distance_label,
 
 DEFUN (ip_route_mask_tag_distance_label,
        ip_route_mask_tag_distance_label_cmd,
-       "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-65535> <1-255> label WORD",
+       "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-4294967295> <1-255> label WORD",
        IP_STR
        "Establish static routes\n"
        "IP destination prefix\n"
@@ -370,7 +370,7 @@ DEFUN (no_ip_route_label,
 
 DEFUN (no_ip_route_tag_label,
        no_ip_route_tag_label_cmd,
-       "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-65535> label WORD",
+       "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-4294967295> label WORD",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -407,7 +407,7 @@ DEFUN (no_ip_route_mask_label,
 
 DEFUN (no_ip_route_mask_tag_label,
        no_ip_route_mask_tag_label_cmd,
-       "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-65535> label WORD",
+       "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-4294967295> label WORD",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -445,7 +445,7 @@ DEFUN (no_ip_route_distance_label,
 
 DEFUN (no_ip_route_tag_distance_label,
        no_ip_route_tag_distance_label_cmd,
-       "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-65535> <1-255> label WORD",
+       "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-4294967295> <1-255> label WORD",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -484,7 +484,7 @@ DEFUN (no_ip_route_mask_distance_label,
 
 DEFUN (no_ip_route_mask_tag_distance_label,
        no_ip_route_mask_tag_distance_label_cmd,
-       "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-65535> <1-255> label WORD",
+       "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-4294967295> <1-255> label WORD",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -519,7 +519,7 @@ DEFUN (ipv6_route_label,
 
 DEFUN (ipv6_route_tag_label,
        ipv6_route_tag_label_cmd,
-       "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-65535> label WORD",
+       "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295> label WORD",
        IP_STR
        "Establish static routes\n"
        "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
@@ -548,7 +548,7 @@ DEFUN (ipv6_route_ifname_label,
 }
 DEFUN (ipv6_route_ifname_tag_label,
        ipv6_route_ifname_tag_label_cmd,
-       "ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-65535> label WORD",
+       "ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-4294967295> label WORD",
        IP_STR
        "Establish static routes\n"
        "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
@@ -579,7 +579,7 @@ DEFUN (ipv6_route_pref_label,
 
 DEFUN (ipv6_route_pref_tag_label,
        ipv6_route_pref_tag_label_cmd,
-       "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-65535> <1-255> label WORD",
+       "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295> <1-255> label WORD",
        IP_STR
        "Establish static routes\n"
        "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
@@ -611,7 +611,7 @@ DEFUN (ipv6_route_ifname_pref_label,
 
 DEFUN (ipv6_route_ifname_pref_tag_label,
        ipv6_route_ifname_pref_tag_label_cmd,
-       "ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-65535> <1-255> label WORD",
+       "ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-4294967295> <1-255> label WORD",
        IP_STR
        "Establish static routes\n"
        "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
@@ -643,7 +643,7 @@ DEFUN (no_ipv6_route_label,
 
 DEFUN (no_ipv6_route_tag_label,
        no_ipv6_route_tag_label_cmd,
-       "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-65535> label WORD",
+       "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295> label WORD",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -675,7 +675,7 @@ DEFUN (no_ipv6_route_ifname_label,
 
 DEFUN (no_ipv6_route_ifname_tag_label,
        no_ipv6_route_ifname_tag_label_cmd,
-       "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-65535> label WORD",
+       "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-4294967295> label WORD",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -708,7 +708,7 @@ DEFUN (no_ipv6_route_pref_label,
 
 DEFUN (no_ipv6_route_pref_tag_label,
        no_ipv6_route_pref_tag_label_cmd,
-       "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-65535> <1-255> label WORD",
+       "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295> <1-255> label WORD",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -742,7 +742,7 @@ DEFUN (no_ipv6_route_ifname_pref_label,
 
 DEFUN (no_ipv6_route_ifname_pref_tag_label,
        no_ipv6_route_ifname_pref_tag_label_cmd,
-       "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-65535> <1-255> label WORD",
+       "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-4294967295> <1-255> label WORD",
        NO_STR
        IP_STR
        "Establish static routes\n"
index 685f5cc4b9ea20359083b07f39c6af9249173843..9cfae6e7055be31b36be1fe1228b7e5fe25aba2e 100644 (file)
@@ -51,7 +51,7 @@ struct nh_rmap_obj
   vrf_id_t vrf_id;
   u_int32_t source_protocol;
   int metric;
-  u_short tag;
+  route_tag_t tag;
 };
 
 static void zebra_route_map_set_delay_timer(u_int32_t value);
@@ -193,7 +193,7 @@ static route_map_result_t
 route_match_tag (void *rule, struct prefix *prefix,
                 route_map_object_t type, void *object)
 {
-  u_short *tag;
+  route_tag_t *tag;
   struct nh_rmap_obj *nh_data;
 
   if (type == RMAP_ZEBRA)
@@ -207,45 +207,13 @@ route_match_tag (void *rule, struct prefix *prefix,
   return RMAP_NOMATCH;
 }
 
-/* Route map 'match tag' match statement. 'arg' is TAG value */
-static void *
-route_match_tag_compile (const char *arg)
-{
-  u_short *tag;
-  u_short tmp;
-
-  /* tag value shoud be integer. */
-  if (! all_digit (arg))
-    return NULL;
-
-  tmp = atoi(arg);
-  if (tmp < 1)
-    return NULL;
-
-  tag = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (u_short));
-
-  if (!tag)
-    return tag;
-
-  *tag = tmp;
-
-  return tag;
-}
-
-/* Free route map's compiled 'match tag' value. */
-static void
-route_match_tag_free (void *rule)
-{
-  XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
-}
-
 /* Route map commands for tag matching */
-struct route_map_rule_cmd route_match_tag_cmd =
+static struct route_map_rule_cmd route_match_tag_cmd =
 {
-   "tag",
-   route_match_tag,
-   route_match_tag_compile,
-   route_match_tag_free
+  "tag",
+  route_match_tag,
+  route_map_rule_tag_compile,
+  route_map_rule_tag_free,
 };
 
 
@@ -332,7 +300,7 @@ ALIAS (no_match_interface,
 
 DEFUN (match_tag,
        match_tag_cmd,
-       "match tag <1-65535>",
+       "match tag <1-4294967295>",
        MATCH_STR
        "Match tag of route\n"
        "Tag value\n")
@@ -358,7 +326,7 @@ DEFUN (no_match_tag,
 
 ALIAS (no_match_tag,
        no_match_tag_val_cmd,
-       "no match tag <1-65535>",
+       "no match tag <1-4294967295>",
        NO_STR
        MATCH_STR
        "Match tag of route\n")
@@ -1649,7 +1617,7 @@ zebra_route_map_write_delay_timer (struct vty *vty)
 
 route_map_result_t
 zebra_route_map_check (int family, int rib_type, struct prefix *p,
-                      struct nexthop *nexthop, vrf_id_t vrf_id, u_short tag)
+                      struct nexthop *nexthop, vrf_id_t vrf_id, route_tag_t tag)
 {
   struct route_map *rmap = NULL;
   route_map_result_t ret = RMAP_MATCH;
@@ -1692,7 +1660,7 @@ zebra_del_import_table_route_map (afi_t afi, uint32_t table)
 
 route_map_result_t
 zebra_import_table_route_map_check (int family, int rib_type, struct prefix *p,
-                struct nexthop *nexthop, vrf_id_t vrf_id, u_short tag, const char *rmap_name)
+                struct nexthop *nexthop, vrf_id_t vrf_id, route_tag_t tag, const char *rmap_name)
 {
   struct route_map *rmap = NULL;
   route_map_result_t ret = RMAP_DENYMATCH;
index 5eb3740909d2de117da547ce8cf37383f7cfdae9..bf418ccacc4b6b19dca0a94f3cb492b82e788a5b 100644 (file)
@@ -34,13 +34,13 @@ extern route_map_result_t zebra_import_table_route_map_check (int family, int ri
                                                 struct prefix *p,
                                                 struct nexthop *nexthop,
                                                  vrf_id_t vrf_id,
-                                                 u_short tag,
+                                                 route_tag_t tag,
                                                  const char *rmap_name);
 extern route_map_result_t zebra_route_map_check (int family, int rib_type,
                                                 struct prefix *p,
                                                 struct nexthop *nexthop,
                                                  vrf_id_t vrf_id,
-                                                 u_short tag);
+                                                 route_tag_t tag);
 extern route_map_result_t zebra_nht_route_map_check (int family,
                                                     int client_proto,
                                                     struct prefix *p,
index dfe196c4b2f192a4872730cbf127179bcdc09e18..a691048b2cfd6448eae0604c757608cf1ec370e7 100644 (file)
@@ -362,7 +362,7 @@ static_uninstall_route (afi_t afi, safi_t safi, struct prefix *p, struct static_
 int
 static_add_route (afi_t afi, safi_t safi, u_char type, struct prefix *p,
                  union g_addr *gate, ifindex_t ifindex,
-                 const char *ifname, u_char flags, u_short tag,
+                 const char *ifname, u_char flags, route_tag_t tag,
                  u_char distance, struct zebra_vrf *zvrf,
                  struct static_nh_label *snh_label)
 {
@@ -481,7 +481,7 @@ static_add_route (afi_t afi, safi_t safi, u_char type, struct prefix *p,
 int
 static_delete_route (afi_t afi, safi_t safi, u_char type, struct prefix *p,
                     union g_addr *gate, ifindex_t ifindex,
-                    u_short tag, u_char distance, struct zebra_vrf *zvrf,
+                    route_tag_t tag, u_char distance, struct zebra_vrf *zvrf,
                     struct static_nh_label *snh_label)
 {
   struct route_node *rn;
index 8c55ea84c01b8d36436b300d77b1a4466d6cfe8a..5b6f42976142f36e9c07838ec54c4659900169fb 100644 (file)
@@ -45,7 +45,7 @@ struct static_route
   u_char distance;
 
   /* Tag */
-  u_short tag;
+  route_tag_t tag;
 
   /* Flag for this static route's type. */
   u_char type;
@@ -87,13 +87,13 @@ static_uninstall_route (afi_t afi, safi_t safi, struct prefix *p, struct static_
 extern int
 static_add_route (afi_t, safi_t safi, u_char type, struct prefix *p,
                  union g_addr *gate, ifindex_t ifindex,
-                 const char *ifname, u_char flags, u_short tag,
+                 const char *ifname, u_char flags, route_tag_t tag,
                  u_char distance, struct zebra_vrf *zvrf,
                  struct static_nh_label *snh_label);
 
 extern int
 static_delete_route (afi_t, safi_t safi, u_char type, struct prefix *p,
-                    union g_addr *gate, ifindex_t ifindex, u_short tag,
+                    union g_addr *gate, ifindex_t ifindex, route_tag_t tag,
                     u_char distance, struct zebra_vrf *zvrf,
                     struct static_nh_label *snh_label);
 
index 054979fd0f37630025b64275aa8b820e9167d117..0aef681f33f2ce6eb7d4461fe25b8b7307e40a94 100644 (file)
@@ -66,7 +66,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd,
   struct in_addr gate;
   struct in_addr mask;
   u_char flag = 0;
-  u_short tag = 0;
+  route_tag_t tag = 0;
   struct zebra_vrf *zvrf = NULL;
   unsigned int ifindex = 0;
   const char *ifname = NULL;
@@ -104,7 +104,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd,
 
   /* tag */
   if (tag_str)
-    tag = atoi(tag_str);
+    tag = atol(tag_str);
 
   /* VRF id */
   zvrf = zebra_vrf_list_lookup_by_name (vrf_id_str);
@@ -365,7 +365,7 @@ DEFUN (ip_route,
 
 DEFUN (ip_route_tag,
        ip_route_tag_cmd,
-       "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-65535>",
+       "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-4294967295>",
        IP_STR
        "Establish static routes\n"
        "IP destination prefix (e.g. 10.0.0.0/8)\n"
@@ -396,7 +396,7 @@ DEFUN (ip_route_flags,
 
 DEFUN (ip_route_flags_tag,
        ip_route_flags_tag_cmd,
-       "ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535>",
+       "ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295>",
        IP_STR
        "Establish static routes\n"
        "IP destination prefix (e.g. 10.0.0.0/8)\n"
@@ -427,7 +427,7 @@ DEFUN (ip_route_flags2,
 
 DEFUN (ip_route_flags2_tag,
        ip_route_flags2_tag_cmd,
-       "ip route A.B.C.D/M (reject|blackhole) tag <1-65535>",
+       "ip route A.B.C.D/M (reject|blackhole) tag <1-4294967295>",
        IP_STR
        "Establish static routes\n"
        "IP destination prefix (e.g. 10.0.0.0/8)\n"
@@ -459,7 +459,7 @@ DEFUN (ip_route_mask,
 
 DEFUN (ip_route_mask_tag,
        ip_route_mask_tag_cmd,
-       "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-65535>",
+       "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-4294967295>",
        IP_STR
        "Establish static routes\n"
        "IP destination prefix\n"
@@ -493,7 +493,7 @@ DEFUN (ip_route_mask_flags,
 
 DEFUN (ip_route_mask_flags_tag,
        ip_route_mask_flags_tag_cmd,
-       "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535>",
+       "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295>",
        IP_STR
        "Establish static routes\n"
        "IP destination prefix\n"
@@ -526,7 +526,7 @@ DEFUN (ip_route_mask_flags2,
 
 DEFUN (ip_route_mask_flags2_tag,
        ip_route_mask_flags2_tag_cmd,
-       "ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-65535>",
+       "ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-4294967295>",
        IP_STR
        "Establish static routes\n"
        "IP destination prefix\n"
@@ -558,7 +558,7 @@ DEFUN (ip_route_distance,
 
 DEFUN (ip_route_tag_distance,
        ip_route_tag_distance_cmd,
-       "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-65535> <1-255>",
+       "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-4294967295> <1-255>",
        IP_STR
        "Establish static routes\n"
        "IP destination prefix (e.g. 10.0.0.0/8)\n"
@@ -592,7 +592,7 @@ DEFUN (ip_route_flags_distance,
 
 DEFUN (ip_route_flags_tag_distance,
        ip_route_flags_tag_distance_cmd,
-       "ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> <1-255>",
+       "ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295> <1-255>",
        IP_STR
        "Establish static routes\n"
        "IP destination prefix (e.g. 10.0.0.0/8)\n"
@@ -624,7 +624,7 @@ DEFUN (ip_route_flags_distance2,
 
 DEFUN (ip_route_flags_tag_distance2,
        ip_route_flags_tag_distance2_cmd,
-       "ip route A.B.C.D/M (reject|blackhole) tag <1-65535> <1-255>",
+       "ip route A.B.C.D/M (reject|blackhole) tag <1-4294967295> <1-255>",
        IP_STR
        "Establish static routes\n"
        "IP destination prefix (e.g. 10.0.0.0/8)\n"
@@ -656,7 +656,7 @@ DEFUN (ip_route_mask_distance,
 
 DEFUN (ip_route_mask_tag_distance,
        ip_route_mask_tag_distance_cmd,
-       "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-65535> <1-255>",
+       "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-4294967295> <1-255>",
        IP_STR
        "Establish static routes\n"
        "IP destination prefix\n"
@@ -674,7 +674,7 @@ DEFUN (ip_route_mask_tag_distance,
 
 DEFUN (ip_route_mask_flags_tag_distance,
        ip_route_mask_flags_tag_distance_cmd,
-       "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole)  tag <1-65535> <1-255>",
+       "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole)  tag <1-4294967295> <1-255>",
        IP_STR
        "Establish static routes\n"
        "IP destination prefix\n"
@@ -726,7 +726,7 @@ DEFUN (ip_route_mask_flags_distance2,
 
 DEFUN (ip_route_mask_flags_tag_distance2,
        ip_route_mask_flags_tag_distance2_cmd,
-       "ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-65535> <1-255>",
+       "ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-4294967295> <1-255>",
        IP_STR
        "Establish static routes\n"
        "IP destination prefix\n"
@@ -758,7 +758,7 @@ DEFUN (no_ip_route,
 
 DEFUN (no_ip_route_tag,
        no_ip_route_tag_cmd,
-       "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-65535>",
+       "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-4294967295>",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -787,7 +787,7 @@ ALIAS (no_ip_route,
 
 ALIAS (no_ip_route_tag,
        no_ip_route_flags_tag_cmd,
-       "no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535>",
+       "no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295>",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -815,7 +815,7 @@ DEFUN (no_ip_route_flags2,
 
 DEFUN (no_ip_route_flags2_tag,
        no_ip_route_flags2_tag_cmd,
-       "no ip route A.B.C.D/M (reject|blackhole) tag <1-65535>",
+       "no ip route A.B.C.D/M (reject|blackhole) tag <1-4294967295>",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -847,7 +847,7 @@ DEFUN (no_ip_route_mask,
 
 DEFUN (no_ip_route_mask_tag,
        no_ip_route_mask_tag_cmd,
-       "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-65535>",
+       "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-4294967295>",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -878,7 +878,7 @@ ALIAS (no_ip_route_mask,
 
 ALIAS (no_ip_route_mask_tag,
        no_ip_route_mask_flags_tag_cmd,
-       "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535>",
+       "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295>",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -908,7 +908,7 @@ DEFUN (no_ip_route_mask_flags2,
 
 DEFUN (no_ip_route_mask_flags2_tag,
        no_ip_route_mask_flags2_tag_cmd,
-       "no ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-65535>",
+       "no ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-4294967295>",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -941,7 +941,7 @@ DEFUN (no_ip_route_distance,
 
 DEFUN (no_ip_route_tag_distance,
        no_ip_route_tag_distance_cmd,
-       "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-65535> <1-255>",
+       "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-4294967295> <1-255>",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -976,7 +976,7 @@ DEFUN (no_ip_route_flags_distance,
 
 DEFUN (no_ip_route_flags_tag_distance,
        no_ip_route_flags_tag_distance_cmd,
-       "no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> <1-255>",
+       "no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295> <1-255>",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -1010,7 +1010,7 @@ DEFUN (no_ip_route_flags_distance2,
 
 DEFUN (no_ip_route_flags_tag_distance2,
        no_ip_route_flags_tag_distance2_cmd,
-       "no ip route A.B.C.D/M (reject|blackhole) tag <1-65535> <1-255>",
+       "no ip route A.B.C.D/M (reject|blackhole) tag <1-4294967295> <1-255>",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -1044,7 +1044,7 @@ DEFUN (no_ip_route_mask_distance,
 
 DEFUN (no_ip_route_mask_tag_distance,
        no_ip_route_mask_tag_distance_cmd,
-       "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-65535> <1-255>",
+       "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-4294967295> <1-255>",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -1081,7 +1081,7 @@ DEFUN (no_ip_route_mask_flags_distance,
 
 DEFUN (no_ip_route_mask_flags_tag_distance,
        no_ip_route_mask_flags_tag_distance_cmd,
-       "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> <1-255>",
+       "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295> <1-255>",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -1117,7 +1117,7 @@ DEFUN (no_ip_route_mask_flags_distance2,
 
 DEFUN (no_ip_route_mask_flags_tag_distance2,
        no_ip_route_mask_flags_tag_distance2_cmd,
-       "no ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-65535> <1-255>",
+       "no ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-4294967295> <1-255>",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -1151,7 +1151,7 @@ DEFUN (ip_route_vrf,
 
 DEFUN (ip_route_tag_vrf,
        ip_route_tag_vrf_cmd,
-       "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-65535> " VRF_CMD_STR,
+       "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-4294967295> " VRF_CMD_STR,
        IP_STR
        "Establish static routes\n"
        "IP destination prefix (e.g. 10.0.0.0/8)\n"
@@ -1184,7 +1184,7 @@ DEFUN (ip_route_flags_vrf,
 
 DEFUN (ip_route_flags_tag_vrf,
        ip_route_flags_tag_vrf_cmd,
-       "ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> " VRF_CMD_STR,
+       "ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295> " VRF_CMD_STR,
        IP_STR
        "Establish static routes\n"
        "IP destination prefix (e.g. 10.0.0.0/8)\n"
@@ -1217,7 +1217,7 @@ DEFUN (ip_route_flags2_vrf,
 
 DEFUN (ip_route_flags2_tag_vrf,
        ip_route_flags2_tag_vrf_cmd,
-       "ip route A.B.C.D/M (reject|blackhole) tag <1-65535> " VRF_CMD_STR,
+       "ip route A.B.C.D/M (reject|blackhole) tag <1-4294967295> " VRF_CMD_STR,
        IP_STR
        "Establish static routes\n"
        "IP destination prefix (e.g. 10.0.0.0/8)\n"
@@ -1251,7 +1251,7 @@ DEFUN (ip_route_mask_vrf,
 
 DEFUN (ip_route_mask_tag_vrf,
        ip_route_mask_tag_vrf_cmd,
-       "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-65535> " VRF_CMD_STR,
+       "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-4294967295> " VRF_CMD_STR,
        IP_STR
        "Establish static routes\n"
        "IP destination prefix\n"
@@ -1287,7 +1287,7 @@ DEFUN (ip_route_mask_flags_vrf,
 
 DEFUN (ip_route_mask_flags_tag_vrf,
        ip_route_mask_flags_tag_vrf_cmd,
-       "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> " VRF_CMD_STR,
+       "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295> " VRF_CMD_STR,
        IP_STR
        "Establish static routes\n"
        "IP destination prefix\n"
@@ -1322,7 +1322,7 @@ DEFUN (ip_route_mask_flags2_vrf,
 
 DEFUN (ip_route_mask_flags2_tag_vrf,
        ip_route_mask_flags2_tag_vrf_cmd,
-       "ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-65535> " VRF_CMD_STR,
+       "ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-4294967295> " VRF_CMD_STR,
        IP_STR
        "Establish static routes\n"
        "IP destination prefix\n"
@@ -1356,7 +1356,7 @@ DEFUN (ip_route_distance_vrf,
 
 DEFUN (ip_route_tag_distance_vrf,
        ip_route_tag_distance_vrf_cmd,
-       "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-65535> <1-255> " VRF_CMD_STR,
+       "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-4294967295> <1-255> " VRF_CMD_STR,
        IP_STR
        "Establish static routes\n"
        "IP destination prefix (e.g. 10.0.0.0/8)\n"
@@ -1392,7 +1392,7 @@ DEFUN (ip_route_flags_distance_vrf,
 
 DEFUN (ip_route_flags_tag_distance_vrf,
        ip_route_flags_tag_distance_vrf_cmd,
-       "ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> <1-255> " VRF_CMD_STR,
+       "ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295> <1-255> " VRF_CMD_STR,
        IP_STR
        "Establish static routes\n"
        "IP destination prefix (e.g. 10.0.0.0/8)\n"
@@ -1426,7 +1426,7 @@ DEFUN (ip_route_flags_distance2_vrf,
 
 DEFUN (ip_route_flags_tag_distance2_vrf,
        ip_route_flags_tag_distance2_vrf_cmd,
-       "ip route A.B.C.D/M (reject|blackhole) tag <1-65535> <1-255> " VRF_CMD_STR,
+       "ip route A.B.C.D/M (reject|blackhole) tag <1-4294967295> <1-255> " VRF_CMD_STR,
        IP_STR
        "Establish static routes\n"
        "IP destination prefix (e.g. 10.0.0.0/8)\n"
@@ -1460,7 +1460,7 @@ DEFUN (ip_route_mask_distance_vrf,
 
 DEFUN (ip_route_mask_tag_distance_vrf,
        ip_route_mask_tag_distance_vrf_cmd,
-       "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-65535> <1-255> " VRF_CMD_STR,
+       "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-4294967295> <1-255> " VRF_CMD_STR,
        IP_STR
        "Establish static routes\n"
        "IP destination prefix\n"
@@ -1479,7 +1479,7 @@ DEFUN (ip_route_mask_tag_distance_vrf,
 
 DEFUN (ip_route_mask_flags_tag_distance_vrf,
        ip_route_mask_flags_tag_distance_vrf_cmd,
-       "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole)  tag <1-65535> <1-255> " VRF_CMD_STR,
+       "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole)  tag <1-4294967295> <1-255> " VRF_CMD_STR,
        IP_STR
        "Establish static routes\n"
        "IP destination prefix\n"
@@ -1534,7 +1534,7 @@ DEFUN (ip_route_mask_flags_distance2_vrf,
 
 DEFUN (ip_route_mask_flags_tag_distance2_vrf,
        ip_route_mask_flags_tag_distance2_vrf_cmd,
-       "ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-65535> <1-255> " VRF_CMD_STR,
+       "ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-4294967295> <1-255> " VRF_CMD_STR,
        IP_STR
        "Establish static routes\n"
        "IP destination prefix\n"
@@ -1585,7 +1585,7 @@ DEFUN (no_ip_route_flags_vrf,
 
 DEFUN (no_ip_route_tag_vrf,
        no_ip_route_tag_vrf_cmd,
-       "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-65535> " VRF_CMD_STR,
+       "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-4294967295> " VRF_CMD_STR,
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -1603,7 +1603,7 @@ DEFUN (no_ip_route_tag_vrf,
 
 DEFUN (no_ip_route_flags_tag_vrf,
        no_ip_route_flags_tag_vrf_cmd,
-       "no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> " VRF_CMD_STR,
+       "no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295> " VRF_CMD_STR,
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -1637,7 +1637,7 @@ DEFUN (no_ip_route_flags2_vrf,
 
 DEFUN (no_ip_route_flags2_tag_vrf,
        no_ip_route_flags2_tag_vrf_cmd,
-       "no ip route A.B.C.D/M (reject|blackhole) tag <1-65535> " VRF_CMD_STR,
+       "no ip route A.B.C.D/M (reject|blackhole) tag <1-4294967295> " VRF_CMD_STR,
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -1689,7 +1689,7 @@ DEFUN (no_ip_route_mask_flags_vrf,
 
 DEFUN (no_ip_route_mask_tag_vrf,
        no_ip_route_mask_tag_vrf_cmd,
-       "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-65535> " VRF_CMD_STR,
+       "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-4294967295> " VRF_CMD_STR,
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -1708,7 +1708,7 @@ DEFUN (no_ip_route_mask_tag_vrf,
 
 DEFUN (no_ip_route_mask_flags_tag_vrf,
        no_ip_route_mask_flags_tag_vrf_cmd,
-       "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> " VRF_CMD_STR,
+       "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295> " VRF_CMD_STR,
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -1744,7 +1744,7 @@ DEFUN (no_ip_route_mask_flags2_vrf,
 
 DEFUN (no_ip_route_mask_flags2_tag_vrf,
        no_ip_route_mask_flags2_tag_vrf_cmd,
-       "no ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-65535> " VRF_CMD_STR,
+       "no ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-4294967295> " VRF_CMD_STR,
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -1780,7 +1780,7 @@ DEFUN (no_ip_route_distance_vrf,
 
 DEFUN (no_ip_route_tag_distance_vrf,
        no_ip_route_tag_distance_vrf_cmd,
-       "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-65535> <1-255> " VRF_CMD_STR,
+       "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-4294967295> <1-255> " VRF_CMD_STR,
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -1817,7 +1817,7 @@ DEFUN (no_ip_route_flags_distance_vrf,
 
 DEFUN (no_ip_route_flags_tag_distance_vrf,
        no_ip_route_flags_tag_distance_vrf_cmd,
-       "no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> <1-255> " VRF_CMD_STR,
+       "no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295> <1-255> " VRF_CMD_STR,
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -1853,7 +1853,7 @@ DEFUN (no_ip_route_flags_distance2_vrf,
 
 DEFUN (no_ip_route_flags_tag_distance2_vrf,
        no_ip_route_flags_tag_distance2_vrf_cmd,
-       "no ip route A.B.C.D/M (reject|blackhole) tag <1-65535> <1-255> " VRF_CMD_STR,
+       "no ip route A.B.C.D/M (reject|blackhole) tag <1-4294967295> <1-255> " VRF_CMD_STR,
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -1889,7 +1889,7 @@ DEFUN (no_ip_route_mask_distance_vrf,
 
 DEFUN (no_ip_route_mask_tag_distance_vrf,
        no_ip_route_mask_tag_distance_vrf_cmd,
-       "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-65535> <1-255> " VRF_CMD_STR,
+       "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-4294967295> <1-255> " VRF_CMD_STR,
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -1928,7 +1928,7 @@ DEFUN (no_ip_route_mask_flags_distance_vrf,
 
 DEFUN (no_ip_route_mask_flags_tag_distance_vrf,
        no_ip_route_mask_flags_tag_distance_vrf_cmd,
-       "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> <1-255> " VRF_CMD_STR,
+       "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295> <1-255> " VRF_CMD_STR,
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -1966,7 +1966,7 @@ DEFUN (no_ip_route_mask_flags_distance2_vrf,
 
 DEFUN (no_ip_route_mask_flags_tag_distance2_vrf,
        no_ip_route_mask_flags_tag_distance2_vrf_cmd,
-       "no ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-65535> <1-255> " VRF_CMD_STR,
+       "no ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-4294967295> <1-255> " VRF_CMD_STR,
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -2013,7 +2013,7 @@ vty_show_ip_route_detail (struct vty *vty, struct route_node *rn, int mcast)
       vty_out (vty, "\"");
       vty_out (vty, ", distance %u, metric %u", rib->distance, rib->metric);
       if (rib->tag)
-       vty_out (vty, ", tag %d", rib->tag);
+       vty_out (vty, ", tag %"ROUTE_TAG_PRI, rib->tag);
        if (rib->mtu)
         vty_out (vty, ", mtu %u", rib->mtu);
       if (rib->vrf_id != VRF_DEFAULT)
@@ -2685,7 +2685,7 @@ DEFUN (no_ipv6_nht_default_route,
 
 DEFUN (show_ip_route_tag,
        show_ip_route_tag_cmd,
-       "show ip route tag <1-65535>",
+       "show ip route tag <1-4294967295>",
        SHOW_STR
        IP_STR
        "IP routing table\n"
@@ -2696,16 +2696,16 @@ DEFUN (show_ip_route_tag,
   struct route_node *rn;
   struct rib *rib;
   int first = 1;
-  u_short tag = 0;
+  route_tag_t tag = 0;
   vrf_id_t vrf_id = VRF_DEFAULT;
 
-    if (argc > 1)
-      {
-        tag = atoi(argv[1]);
-        VRF_GET_ID (vrf_id, argv[0]);
-      }
-    else
-      tag = atoi(argv[0]);
+  if (argc > 1)
+    {
+      tag = atol(argv[1]);
+      VRF_GET_ID (vrf_id, argv[0]);
+    }
+  else
+    tag = atol(argv[0]);
 
   table = zebra_vrf_table (AFI_IP, SAFI_UNICAST, vrf_id);
   if (! table)
@@ -2730,7 +2730,7 @@ DEFUN (show_ip_route_tag,
 
 ALIAS (show_ip_route_tag,
        show_ip_route_vrf_tag_cmd,
-       "show ip route " VRF_CMD_STR " tag <1-65535>",
+       "show ip route " VRF_CMD_STR " tag <1-4294967295>",
        SHOW_STR
        IP_STR
        "IP routing table\n"
@@ -3317,7 +3317,7 @@ DEFUN (show_ip_route_vrf_all,
 
 DEFUN (show_ip_route_vrf_all_tag,
        show_ip_route_vrf_all_tag_cmd,
-       "show ip route " VRF_ALL_CMD_STR " tag <1-65535>",
+       "show ip route " VRF_ALL_CMD_STR " tag <1-4294967295>",
        SHOW_STR
        IP_STR
        "IP routing table\n"
@@ -3332,10 +3332,10 @@ DEFUN (show_ip_route_vrf_all_tag,
   vrf_iter_t iter;
   int first = 1;
   int vrf_header = 1;
-  u_short tag = 0;
+  route_tag_t tag = 0;
 
   if (argv[0])
-    tag = atoi(argv[0]);
+    tag = atol(argv[0]);
 
   for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
     {
@@ -3706,7 +3706,7 @@ static_config_ipv4 (struct vty *vty, safi_t safi, const char *cmd)
               }
 
             if (si->tag)
-              vty_out (vty, " tag %d", si->tag);
+              vty_out (vty, " tag %"ROUTE_TAG_PRI, si->tag);
 
             if (si->distance != ZEBRA_STATIC_DISTANCE_DEFAULT)
               vty_out (vty, " %d", si->distance);
@@ -3744,7 +3744,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str,
   struct in6_addr gate_addr;
   u_char type = 0;
   u_char flag = 0;
-  u_short tag = 0;
+  route_tag_t tag = 0;
   unsigned int ifindex = 0;
   struct interface *ifp = NULL;
   struct zebra_vrf *zvrf;
@@ -3785,7 +3785,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str,
 
   /* tag */
   if (tag_str)
-    tag = atoi(tag_str);
+    tag = atol(tag_str);
 
   /* When gateway is valid IPv6 addrees, then gate is treated as
      nexthop address other case gate is treated as interface name. */
@@ -3877,7 +3877,7 @@ DEFUN (ipv6_route,
 
 DEFUN (ipv6_route_tag,
        ipv6_route_tag_cmd,
-       "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-65535>",
+       "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295>",
        IP_STR
        "Establish static routes\n"
        "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
@@ -3905,7 +3905,7 @@ DEFUN (ipv6_route_flags,
 
 DEFUN (ipv6_route_flags_tag,
        ipv6_route_flags_tag_cmd,
-       "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-65535>",
+       "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-4294967295>",
        IP_STR
        "Establish static routes\n"
        "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
@@ -3932,7 +3932,7 @@ DEFUN (ipv6_route_ifname,
 }
 DEFUN (ipv6_route_ifname_tag,
        ipv6_route_ifname_tag_cmd,
-       "ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-65535>",
+       "ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-4294967295>",
        IP_STR
        "Establish static routes\n"
        "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
@@ -3960,7 +3960,7 @@ DEFUN (ipv6_route_ifname_flags,
 
 DEFUN (ipv6_route_ifname_flags_tag,
        ipv6_route_ifname_flags_tag_cmd,
-       "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-65535>",
+       "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-4294967295>",
        IP_STR
        "Establish static routes\n"
        "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
@@ -3989,7 +3989,7 @@ DEFUN (ipv6_route_pref,
 
 DEFUN (ipv6_route_pref_tag,
        ipv6_route_pref_tag_cmd,
-       "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-65535> <1-255>",
+       "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295> <1-255>",
        IP_STR
        "Establish static routes\n"
        "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
@@ -4019,7 +4019,7 @@ DEFUN (ipv6_route_flags_pref,
 
 DEFUN (ipv6_route_flags_pref_tag,
        ipv6_route_flags_pref_tag_cmd,
-       "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-65535> <1-255>",
+       "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-4294967295> <1-255>",
        IP_STR
        "Establish static routes\n"
        "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
@@ -4049,7 +4049,7 @@ DEFUN (ipv6_route_ifname_pref,
 
 DEFUN (ipv6_route_ifname_pref_tag,
        ipv6_route_ifname_pref_tag_cmd,
-       "ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-65535> <1-255>",
+       "ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-4294967295> <1-255>",
        IP_STR
        "Establish static routes\n"
        "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
@@ -4079,7 +4079,7 @@ DEFUN (ipv6_route_ifname_flags_pref,
 
 DEFUN (ipv6_route_ifname_flags_pref_tag,
        ipv6_route_ifname_flags_pref_tag_cmd,
-       "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-65535> <1-255>",
+       "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-4294967295> <1-255>",
        IP_STR
        "Establish static routes\n"
        "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
@@ -4109,7 +4109,7 @@ DEFUN (no_ipv6_route,
 
 DEFUN (no_ipv6_route_tag,
        no_ipv6_route_tag_cmd,
-       "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-65535>",
+       "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295>",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -4139,7 +4139,7 @@ DEFUN (no_ipv6_route_flags,
 
 DEFUN (no_ipv6_route_flags_tag,
        no_ipv6_route_flags_tag_cmd,
-       "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-65535>",
+       "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-4294967295>",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -4169,7 +4169,7 @@ DEFUN (no_ipv6_route_ifname,
 
 DEFUN (no_ipv6_route_ifname_tag,
        no_ipv6_route_ifname_tag_cmd,
-       "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-65535>",
+       "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-4294967295>",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -4199,7 +4199,7 @@ DEFUN (no_ipv6_route_ifname_flags,
 
 DEFUN (no_ipv6_route_ifname_flags_tag,
        no_ipv6_route_ifname_flags_tag_cmd,
-       "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-65535>",
+       "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-4294967295>",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -4230,7 +4230,7 @@ DEFUN (no_ipv6_route_pref,
 
 DEFUN (no_ipv6_route_pref_tag,
        no_ipv6_route_pref_tag_cmd,
-       "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-65535> <1-255>",
+       "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295> <1-255>",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -4263,7 +4263,7 @@ DEFUN (no_ipv6_route_flags_pref,
 
 DEFUN (no_ipv6_route_flags_pref_tag,
        no_ipv6_route_flags_pref_tag_cmd,
-       "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-65535> <1-255>",
+       "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-4294967295> <1-255>",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -4296,7 +4296,7 @@ DEFUN (no_ipv6_route_ifname_pref,
 
 DEFUN (no_ipv6_route_ifname_pref_tag,
        no_ipv6_route_ifname_pref_tag_cmd,
-       "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-65535> <1-255>",
+       "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-4294967295> <1-255>",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -4328,7 +4328,7 @@ DEFUN (no_ipv6_route_ifname_flags_pref,
 
 DEFUN (no_ipv6_route_ifname_flags_pref_tag,
        no_ipv6_route_ifname_flags_pref_tag_cmd,
-       "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-65535> <1-255>",
+       "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-4294967295> <1-255>",
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -4359,7 +4359,7 @@ DEFUN (ipv6_route_vrf,
 
 DEFUN (ipv6_route_tag_vrf,
        ipv6_route_tag_vrf_cmd,
-       "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-65535> " VRF_CMD_STR,
+       "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295> " VRF_CMD_STR,
        IP_STR
        "Establish static routes\n"
        "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
@@ -4389,7 +4389,7 @@ DEFUN (ipv6_route_flags_vrf,
 
 DEFUN (ipv6_route_flags_tag_vrf,
        ipv6_route_flags_tag_vrf_cmd,
-       "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-65535> " VRF_CMD_STR,
+       "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-4294967295> " VRF_CMD_STR,
        IP_STR
        "Establish static routes\n"
        "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
@@ -4418,7 +4418,7 @@ DEFUN (ipv6_route_ifname_vrf,
 }
 DEFUN (ipv6_route_ifname_tag_vrf,
        ipv6_route_ifname_tag_vrf_cmd,
-       "ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-65535> " VRF_CMD_STR,
+       "ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-4294967295> " VRF_CMD_STR,
        IP_STR
        "Establish static routes\n"
        "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
@@ -4448,7 +4448,7 @@ DEFUN (ipv6_route_ifname_flags_vrf,
 
 DEFUN (ipv6_route_ifname_flags_tag_vrf,
        ipv6_route_ifname_flags_tag_vrf_cmd,
-       "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-65535> " VRF_CMD_STR,
+       "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-4294967295> " VRF_CMD_STR,
        IP_STR
        "Establish static routes\n"
        "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
@@ -4479,7 +4479,7 @@ DEFUN (ipv6_route_pref_vrf,
 
 DEFUN (ipv6_route_pref_tag_vrf,
        ipv6_route_pref_tag_vrf_cmd,
-       "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-65535> <1-255> " VRF_CMD_STR,
+       "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295> <1-255> " VRF_CMD_STR,
        IP_STR
        "Establish static routes\n"
        "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
@@ -4511,7 +4511,7 @@ DEFUN (ipv6_route_flags_pref_vrf,
 
 DEFUN (ipv6_route_flags_pref_tag_vrf,
        ipv6_route_flags_pref_tag_vrf_cmd,
-       "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-65535> <1-255> " VRF_CMD_STR,
+       "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-4294967295> <1-255> " VRF_CMD_STR,
        IP_STR
        "Establish static routes\n"
        "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
@@ -4543,7 +4543,7 @@ DEFUN (ipv6_route_ifname_pref_vrf,
 
 DEFUN (ipv6_route_ifname_pref_tag_vrf,
        ipv6_route_ifname_pref_tag_vrf_cmd,
-       "ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-65535> <1-255> " VRF_CMD_STR,
+       "ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-4294967295> <1-255> " VRF_CMD_STR,
        IP_STR
        "Establish static routes\n"
        "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
@@ -4575,7 +4575,7 @@ DEFUN (ipv6_route_ifname_flags_pref_vrf,
 
 DEFUN (ipv6_route_ifname_flags_pref_tag_vrf,
        ipv6_route_ifname_flags_pref_tag_vrf_cmd,
-       "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-65535> <1-255> " VRF_CMD_STR,
+       "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-4294967295> <1-255> " VRF_CMD_STR,
        IP_STR
        "Establish static routes\n"
        "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
@@ -4607,7 +4607,7 @@ DEFUN (no_ipv6_route_vrf,
 
 DEFUN (no_ipv6_route_tag_vrf,
        no_ipv6_route_tag_vrf_cmd,
-       "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-65535> " VRF_CMD_STR,
+       "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295> " VRF_CMD_STR,
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -4639,7 +4639,7 @@ DEFUN (no_ipv6_route_flags_vrf,
 
 DEFUN (no_ipv6_route_flags_tag_vrf,
        no_ipv6_route_flags_tag_vrf_cmd,
-       "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-65535> " VRF_CMD_STR,
+       "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-4294967295> " VRF_CMD_STR,
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -4671,7 +4671,7 @@ DEFUN (no_ipv6_route_ifname_vrf,
 
 DEFUN (no_ipv6_route_ifname_tag_vrf,
        no_ipv6_route_ifname_tag_vrf_cmd,
-       "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-65535> " VRF_CMD_STR,
+       "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-4294967295> " VRF_CMD_STR,
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -4703,7 +4703,7 @@ DEFUN (no_ipv6_route_ifname_flags_vrf,
 
 DEFUN (no_ipv6_route_ifname_flags_tag_vrf,
        no_ipv6_route_ifname_flags_tag_vrf_cmd,
-       "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-65535> " VRF_CMD_STR,
+       "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-4294967295> " VRF_CMD_STR,
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -4736,7 +4736,7 @@ DEFUN (no_ipv6_route_pref_vrf,
 
 DEFUN (no_ipv6_route_pref_tag_vrf,
        no_ipv6_route_pref_tag_vrf_cmd,
-       "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-65535> <1-255> " VRF_CMD_STR,
+       "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295> <1-255> " VRF_CMD_STR,
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -4771,7 +4771,7 @@ DEFUN (no_ipv6_route_flags_pref_vrf,
 
 DEFUN (no_ipv6_route_flags_pref_tag_vrf,
        no_ipv6_route_flags_pref_tag_vrf_cmd,
-       "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-65535> <1-255> " VRF_CMD_STR,
+       "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-4294967295> <1-255> " VRF_CMD_STR,
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -4806,7 +4806,7 @@ DEFUN (no_ipv6_route_ifname_pref_vrf,
 
 DEFUN (no_ipv6_route_ifname_pref_tag_vrf,
        no_ipv6_route_ifname_pref_tag_vrf_cmd,
-       "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-65535> <1-255> " VRF_CMD_STR,
+       "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-4294967295> <1-255> " VRF_CMD_STR,
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -4840,7 +4840,7 @@ DEFUN (no_ipv6_route_ifname_flags_pref_vrf,
 
 DEFUN (no_ipv6_route_ifname_flags_pref_tag_vrf,
        no_ipv6_route_ifname_flags_pref_tag_vrf_cmd,
-       "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-65535> <1-255> " VRF_CMD_STR,
+       "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-4294967295> <1-255> " VRF_CMD_STR,
        NO_STR
        IP_STR
        "Establish static routes\n"
@@ -4961,7 +4961,7 @@ ALIAS (show_ipv6_route,
 
 DEFUN (show_ipv6_route_tag,
        show_ipv6_route_tag_cmd,
-       "show ipv6 route tag <1-65535>",
+       "show ipv6 route tag <1-4294967295>",
        SHOW_STR
        IP_STR
        "IPv6 routing table\n"
@@ -4972,16 +4972,16 @@ DEFUN (show_ipv6_route_tag,
   struct route_node *rn;
   struct rib *rib;
   int first = 1;
-  u_short tag = 0;
+  route_tag_t tag = 0;
   vrf_id_t vrf_id = VRF_DEFAULT;
 
   if (argc > 1)
     {
       VRF_GET_ID (vrf_id, argv[0]);
-      tag = atoi(argv[1]);
+      tag = atol(argv[1]);
     }
   else
-    tag = atoi(argv[0]);
+    tag = atol(argv[0]);
 
   table = zebra_vrf_table (AFI_IP6, SAFI_UNICAST, vrf_id);
   if (! table)
@@ -5006,7 +5006,7 @@ DEFUN (show_ipv6_route_tag,
 
 ALIAS (show_ipv6_route_tag,
        show_ipv6_route_vrf_tag_cmd,
-       "show ipv6 route " VRF_CMD_STR " tag <1-65535>",
+       "show ipv6 route " VRF_CMD_STR " tag <1-4294967295>",
        SHOW_STR
        IP_STR
        "IPv6 routing table\n"
@@ -5403,7 +5403,7 @@ DEFUN (show_ipv6_route_vrf_all,
 
 DEFUN (show_ipv6_route_vrf_all_tag,
        show_ipv6_route_vrf_all_tag_cmd,
-       "show ipv6 route " VRF_ALL_CMD_STR " tag <1-65535>",
+       "show ipv6 route " VRF_ALL_CMD_STR " tag <1-4294967295>",
        SHOW_STR
        IP_STR
        "IPv6 routing table\n"
@@ -5418,10 +5418,10 @@ DEFUN (show_ipv6_route_vrf_all_tag,
   vrf_iter_t iter;
   int first = 1;
   int vrf_header = 1;
-  u_short tag = 0;
+  route_tag_t tag = 0;
 
   if (argv[0])
-    tag = atoi(argv[0]);
+    tag = atol(argv[0]);
 
   for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
     {
@@ -5773,7 +5773,7 @@ static_config_ipv6 (struct vty *vty)
               vty_out (vty, " %s", "blackhole");
 
             if (si->tag)
-              vty_out (vty, " tag %d", si->tag);
+              vty_out (vty, " tag %"ROUTE_TAG_PRI, si->tag);
 
             if (si->distance != ZEBRA_STATIC_DISTANCE_DEFAULT)
               vty_out (vty, " %d", si->distance);
index 135cd88a10a73ad20a0b9d9abfe43fc3ec1f0051..530410c2685787b77bdb33c462155d9d18f9a45c 100644 (file)
@@ -732,7 +732,7 @@ zsend_redistribute_route (int cmd, struct zserv *client, struct prefix *p,
   if (rib->tag)
     {
       SET_FLAG(zapi_flags, ZAPI_MESSAGE_TAG);
-      stream_putw(s, rib->tag);
+      stream_putl(s, rib->tag);
     }
 
   /* MTU */
@@ -1114,7 +1114,7 @@ zread_ipv4_add (struct zserv *client, u_short length, struct zebra_vrf *zvrf)
     
   /* Tag */
   if (CHECK_FLAG (message, ZAPI_MESSAGE_TAG))
-    rib->tag = stream_getw (s);
+    rib->tag = stream_getl (s);
   else
     rib->tag = 0;
 
@@ -1213,7 +1213,7 @@ zread_ipv4_delete (struct zserv *client, u_short length, struct zebra_vrf *zvrf)
     
   /* tag */
   if (CHECK_FLAG (api.message, ZAPI_MESSAGE_TAG))
-    api.tag = stream_getw (s);
+    api.tag = stream_getl (s);
   else
     api.tag = 0;
 
@@ -1343,7 +1343,7 @@ zread_ipv4_route_ipv6_nexthop_add (struct zserv *client, u_short length, struct
 
   /* Tag */
   if (CHECK_FLAG (message, ZAPI_MESSAGE_TAG))
-    rib->tag = stream_getw (s);
+    rib->tag = stream_getl (s);
   else
     rib->tag = 0;
 
@@ -1464,7 +1464,7 @@ zread_ipv6_add (struct zserv *client, u_short length, struct zebra_vrf *zvrf)
     
   /* Tag */
   if (CHECK_FLAG (message, ZAPI_MESSAGE_TAG))
-    rib->tag = stream_getw (s);
+    rib->tag = stream_getl (s);
   else
     rib->tag = 0;
 
@@ -1553,7 +1553,7 @@ zread_ipv6_delete (struct zserv *client, u_short length, struct zebra_vrf *zvrf)
     
   /* tag */
   if (CHECK_FLAG (api.message, ZAPI_MESSAGE_TAG))
-    api.tag = stream_getw (s);
+    api.tag = stream_getl (s);
   else
     api.tag = 0;