]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #42 from donaldsharp/pim_lib_work2
authorDavid Lamparter <equinox@diac24.net>
Tue, 24 Jan 2017 16:10:09 +0000 (17:10 +0100)
committerGitHub <noreply@github.com>
Tue, 24 Jan 2017 16:10:09 +0000 (17:10 +0100)
Pim-SM + MSDP

24 files changed:
bgpd/bgp_attr.c
bgpd/bgp_damp.c
bgpd/bgp_mplsvpn.c
bgpd/bgp_mplsvpn.h
bgpd/bgp_route.c
bgpd/bgp_route.h
bgpd/bgp_routemap.c
bgpd/bgp_updgrp_packet.c
bgpd/bgp_vty.c
bgpd/bgpd.c
bgpd/rfapi/rfapi.c
bgpd/rfapi/rfapi_encap_tlv.c
bgpd/rfapi/rfapi_import.c
bgpd/rfapi/rfapi_vty.c
configure.ac
cumulus/start-stop-daemon.c
isisd/isis_bpf.c
lib/command.c
lib/wheel.h
vtysh/extract.pl.in
zebra/if_ioctl.c
zebra/kernel_socket.c
zebra/zebra_fpm.c
zebra/zserv.c

index 5c26ecc6ad922746bfb65a967f6dd654d6a7bf2c..7538a50770e697bcbb9f28312f89befe29b5a20c 100644 (file)
@@ -2666,6 +2666,8 @@ bgp_packet_mpattr_start (struct stream *s, afi_t afi, safi_t safi, afi_t nh_afi,
   stream_putw (s, pkt_afi);    /* AFI */
   stream_putc (s, pkt_safi);   /* SAFI */
 
+  if (nh_afi == AFI_MAX)
+    nh_afi = BGP_NEXTHOP_AFI_FROM_NHLEN(attr->extra->mp_nexthop_len);
   /* Nexthop */
   switch (nh_afi)
     {
@@ -2915,7 +2917,8 @@ bgp_packet_attribute (struct bgp *bgp, struct peer *peer,
       size_t mpattrlen_pos = 0;
 
       mpattrlen_pos = bgp_packet_mpattr_start(s, afi, safi,
-                                    (peer_cap_enhe(peer) ? AFI_IP6 : afi),
+                                    (peer_cap_enhe(peer) ? AFI_IP6 :
+                                     AFI_MAX), /* get from NH */
                                     vecarr, attr);
       bgp_packet_mpattr_prefix(s, afi, safi, p, prd, tag,
                                addpath_encode, addpath_tx_id);
index f4a83d720b735982234e631a2adf88f94be0eea5..168dbd0122f653fd1644e4de1efd154db5d0aced 100644 (file)
@@ -700,16 +700,16 @@ bgp_show_dampening_parameters (struct vty *vty, afi_t afi, safi_t safi)
 
   if (CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING))
     {
-      vty_out (vty, "Half-life time: %ld min%s",
-                    damp->half_life / 60, VTY_NEWLINE);
+      vty_out (vty, "Half-life time: %lld min%s",
+               (long long)damp->half_life / 60, VTY_NEWLINE);
       vty_out (vty, "Reuse penalty: %d%s",
-                    damp->reuse_limit, VTY_NEWLINE);
+               damp->reuse_limit, VTY_NEWLINE);
       vty_out (vty, "Suppress penalty: %d%s",
-                    damp->suppress_value, VTY_NEWLINE);
-      vty_out (vty, "Max suppress time: %ld min%s",
-                    damp->max_suppress_time / 60, VTY_NEWLINE);
+               damp->suppress_value, VTY_NEWLINE);
+      vty_out (vty, "Max suppress time: %lld min%s",
+               (long long)damp->max_suppress_time / 60, VTY_NEWLINE);
       vty_out (vty, "Max supress penalty: %u%s",
-                    damp->ceiling, VTY_NEWLINE);
+               damp->ceiling, VTY_NEWLINE);
       vty_out (vty, "%s", VTY_NEWLINE);
     }
   else
index 16f08aad6fb4c4355f56d214566a7a3361960588..bfbddb6c30c6778717776780f8543436dd1a2030 100644 (file)
@@ -41,11 +41,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 #include "bgpd/rfapi/rfapi_backend.h"
 #endif
 
-#define BGP_VPNVX_HELP_STR       \
-  "Address Family \n"   \
-  "Address Family \n"
-
-static int
+extern int
 argv_find_and_parse_vpnvx(struct cmd_token **argv, int argc, int *index, afi_t *afi)
 {
   int ret = 0;
@@ -222,7 +218,7 @@ bgp_nlri_parse_vpn (struct peer *peer, struct attr *attr,
 
       if (prefixlen < VPN_PREFIXLEN_MIN_BYTES*8)
        {
-         zlog_err ("%s [Error] Update packet error / VPNv4 (prefix length %d less than VPNv4 min length)",
+         zlog_err ("%s [Error] Update packet error / VPN (prefix length %d less than VPN min length)",
                    peer->host, prefixlen);
          return -1;
        }
@@ -230,7 +226,7 @@ bgp_nlri_parse_vpn (struct peer *peer, struct attr *attr,
       /* sanity check against packet data */
       if ((pnt + psize) > lim)
         {
-          zlog_err ("%s [Error] Update packet error / VPNv4 (prefix length %d exceeds packet size %u)",
+          zlog_err ("%s [Error] Update packet error / VPN (prefix length %d exceeds packet size %u)",
                     peer->host,
                     prefixlen, (uint)(lim-pnt));
           return -1;
@@ -239,7 +235,7 @@ bgp_nlri_parse_vpn (struct peer *peer, struct attr *attr,
       /* sanity check against storage for the IP address portion */
       if ((psize - VPN_PREFIXLEN_MIN_BYTES) > (ssize_t) sizeof(p.u))
         {
-          zlog_err ("%s [Error] Update packet error / VPNv4 (psize %d exceeds storage size %zu)",
+          zlog_err ("%s [Error] Update packet error / VPN (psize %d exceeds storage size %zu)",
                     peer->host,
                     prefixlen - VPN_PREFIXLEN_MIN_BYTES*8, sizeof(p.u));
           return -1;
@@ -248,7 +244,7 @@ bgp_nlri_parse_vpn (struct peer *peer, struct attr *attr,
       /* Sanity check against max bitlen of the address family */
       if ((psize - VPN_PREFIXLEN_MIN_BYTES) > prefix_blen (&p))
         {
-          zlog_err ("%s [Error] Update packet error / VPNv4 (psize %d exceeds family (%u) max byte len %u)",
+          zlog_err ("%s [Error] Update packet error / VPN (psize %d exceeds family (%u) max byte len %u)",
                     peer->host,
                     prefixlen - VPN_PREFIXLEN_MIN_BYTES*8, 
                     p.family, prefix_blen (&p));
@@ -319,7 +315,7 @@ bgp_nlri_parse_vpn (struct peer *peer, struct attr *attr,
   /* Packet length consistency check. */
   if (pnt != lim)
     {
-      zlog_err ("%s [Error] Update packet error / VPNv4 (%zu data remaining after parsing)",
+      zlog_err ("%s [Error] Update packet error / VPN (%zu data remaining after parsing)",
                 peer->host, lim - pnt);
       return -1;
     }
@@ -1009,6 +1005,7 @@ DEFUN (show_bgp_ip_vpn_rd,
   return CMD_SUCCESS;
 }
 
+#ifdef KEEP_OLD_VPN_COMMANDS
 DEFUN (show_ip_bgp_vpn_all,
        show_ip_bgp_vpn_all_cmd,
        "show [ip] bgp <vpnv4|vpnv6>",
@@ -1377,6 +1374,7 @@ DEFUN (show_ip_bgp_vpn_rd_neighbor_advertised_routes,
     }
   return CMD_SUCCESS;
 }
+#endif /* KEEP_OLD_VPN_COMMANDS */
 
 void
 bgp_mplsvpn_init (void)
@@ -1389,6 +1387,7 @@ bgp_mplsvpn_init (void)
   install_element (BGP_VPNV6_NODE, &no_vpnv6_network_cmd);
 
   install_element (VIEW_NODE, &show_bgp_ip_vpn_rd_cmd);
+#ifdef KEEP_OLD_VPN_COMMANDS
   install_element (VIEW_NODE, &show_ip_bgp_vpn_all_cmd);
   install_element (VIEW_NODE, &show_ip_bgp_vpn_rd_cmd);
   install_element (VIEW_NODE, &show_ip_bgp_vpn_all_tags_cmd);
@@ -1397,4 +1396,5 @@ bgp_mplsvpn_init (void)
   install_element (VIEW_NODE, &show_ip_bgp_vpn_rd_neighbor_routes_cmd);
   install_element (VIEW_NODE, &show_ip_bgp_vpn_all_neighbor_advertised_routes_cmd);
   install_element (VIEW_NODE, &show_ip_bgp_vpn_rd_neighbor_advertised_routes_cmd);
+#endif /* KEEP_OLD_VPN_COMMANDS */
 }
index f75b9890573f116047b720c01baf22e494f2fbf0..336b736169950ab0aa397011374117ec1ae9f62d 100644 (file)
@@ -55,6 +55,10 @@ typedef enum {
      (label) == MPLS_LABEL_IPV6_EXPLICIT_NULL || \
      (label) == MPLS_LABEL_IMPLICIT_NULL)
 
+#define BGP_VPNVX_HELP_STR       \
+  "Address Family \n"   \
+  "Address Family \n"
+
 struct rd_as
 {
   u_int16_t type;
@@ -94,4 +98,7 @@ extern int str2prefix_rd (const char *, struct prefix_rd *);
 extern int str2tag (const char *, u_char *);
 extern char *prefix_rd2str (struct prefix_rd *, char *, size_t);
 
+extern int
+argv_find_and_parse_vpnvx(struct cmd_token **argv, int argc, int *index, afi_t *afi);
+
 #endif /* _QUAGGA_BGP_MPLSVPN_H */
index b63889f7799ad319e2e59fa921eed952a267b70f..5fdda66258a65ea305ab97034786844d321a466a 100644 (file)
@@ -1429,9 +1429,10 @@ subgroup_announce_check (struct bgp_info *ri, struct update_subgroup *subgrp,
     SET_FLAG(attr->rmap_change_flags, BATTR_REFLECTED);
 
 #define NEXTHOP_IS_V6 (\
-    (safi != SAFI_ENCAP && \
+    (safi != SAFI_ENCAP && safi != SAFI_MPLS_VPN &&\
      (p->family == AF_INET6 || peer_cap_enhe(peer))) || \
-    (safi == SAFI_ENCAP && attr->extra->mp_nexthop_len == 16))
+    ((safi == SAFI_ENCAP || safi == SAFI_MPLS_VPN) &&\
+     attr->extra->mp_nexthop_len >= IPV6_MAX_BYTELEN))
 
   /* IPv6/MP starts with 1 nexthop. The link-local address is passed only if
    * the peer (group) is configured to receive link-local nexthop unchanged
@@ -9151,13 +9152,14 @@ DEFUN (show_ip_bgp_ipv4_neighbor_prefix_counts,
   return bgp_peer_counts (vty, peer, AFI_IP, SAFI_UNICAST, uj);
 }
 
-DEFUN (show_ip_bgp_vpnv4_neighbor_prefix_counts,
-       show_ip_bgp_vpnv4_neighbor_prefix_counts_cmd,
-       "show [ip] bgp vpnv4 all neighbors <A.B.C.D|X:X::X:X|WORD> prefix-counts [json]",
+#ifdef KEEP_OLD_VPN_COMMANDS
+DEFUN (show_ip_bgp_vpn_neighbor_prefix_counts,
+       show_ip_bgp_vpn_neighbor_prefix_counts_cmd,
+       "show [ip] bgp <vpnv4|vpnv6> all neighbors <A.B.C.D|X:X::X:X|WORD> prefix-counts [json]",
        SHOW_STR
        IP_STR
        BGP_STR
-       "Address Family\n"
+       BGP_VPNVX_HELP_STR
        "Display information about all VPNv4 NLRIs\n"
        "Detailed information on TCP and BGP neighbor connections\n"
        "Neighbor to display information about\n"
@@ -9177,13 +9179,13 @@ DEFUN (show_ip_bgp_vpnv4_neighbor_prefix_counts,
   return bgp_peer_counts (vty, peer, AFI_IP, SAFI_MPLS_VPN, uj);
 }
 
-DEFUN (show_ip_bgp_vpnv4_all_route_prefix,
-       show_ip_bgp_vpnv4_all_route_prefix_cmd,
-       "show [ip] bgp vpnv4 all <A.B.C.D|A.B.C.D/M> [json]",
+DEFUN (show_ip_bgp_vpn_all_route_prefix,
+       show_ip_bgp_vpn_all_route_prefix_cmd,
+       "show [ip] bgp <vpnv4|vpnv6> all <A.B.C.D|A.B.C.D/M> [json]",
        SHOW_STR
        IP_STR
        BGP_STR
-       "Address Family\n"
+       BGP_VPNVX_HELP_STR
        "Display information about all VPNv4 NLRIs\n"
        "Network in the BGP routing table to display\n"
        "Network in the BGP routing table to display\n"
@@ -9195,6 +9197,7 @@ DEFUN (show_ip_bgp_vpnv4_all_route_prefix,
   network = argv_find (argv, argc, "A.B.C.D/M", &idx) ? argv[idx]->arg : NULL;
   return bgp_show_route (vty, NULL, network, AFI_IP, SAFI_MPLS_VPN, NULL, 0, BGP_PATH_ALL, use_json(argc, argv));
 }
+#endif /* KEEP_OLD_VPN_COMMANDS */
 
 static void
 show_adj_route (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi,
@@ -10532,7 +10535,9 @@ bgp_route_init (void)
   install_element (VIEW_NODE, &show_ip_bgp_neighbor_received_prefix_filter_cmd);
   install_element (VIEW_NODE, &show_ip_bgp_dampening_params_cmd);
   install_element (VIEW_NODE, &show_ip_bgp_ipv4_dampening_parameters_cmd);
-  install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_route_prefix_cmd);
+#ifdef KEEP_OLD_VPN_COMMANDS
+  install_element (VIEW_NODE, &show_ip_bgp_vpn_all_route_prefix_cmd);
+#endif /* KEEP_OLD_VPN_COMMANDS */
 
  /* BGP dampening clear commands */
   install_element (ENABLE_NODE, &clear_ip_bgp_dampening_cmd);
@@ -10544,7 +10549,9 @@ bgp_route_init (void)
   install_element (ENABLE_NODE, &show_ip_bgp_neighbor_prefix_counts_cmd);
   install_element (ENABLE_NODE, &show_ip_bgp_instance_neighbor_prefix_counts_cmd);
   install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbor_prefix_counts_cmd);
-  install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_neighbor_prefix_counts_cmd);
+#ifdef KEEP_OLD_VPN_COMMANDS
+  install_element (ENABLE_NODE, &show_ip_bgp_vpn_neighbor_prefix_counts_cmd);
+#endif /* KEEP_OLD_VPN_COMMANDS */
   install_element (ENABLE_NODE, &show_bgp_ipv6_neighbor_prefix_counts_cmd);
   install_element (ENABLE_NODE, &show_bgp_instance_ipv6_neighbor_prefix_counts_cmd);
 
index 63b18aa2d8fb7dfa1456c42f248849dcb1ba1791..3c7aa83a0e4da84276c201ad8c79a54c796cec24 100644 (file)
@@ -179,6 +179,10 @@ struct bgp_static
   u_char tag[3];
 };
 
+#define BGP_NEXTHOP_AFI_FROM_NHLEN(nhlen) \
+  ((nhlen) < IPV4_MAX_BYTELEN  ? 0 : \
+   ((nhlen) < IPV6_MAX_BYTELEN ? AFI_IP : AFI_IP6))
+
 #define BGP_ATTR_NEXTHOP_AFI_IP6(attr) \
   (! CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_NEXT_HOP)) && \
    (attr)->extra && ((attr)->extra->mp_nexthop_len == 16 || \
index 4f7f51fbbb8776f4080e34d64795a6215a26fd3b..50524baa0125ecbd85b794d4f0d87c65535ab1e6 100644 (file)
@@ -2340,7 +2340,7 @@ struct route_map_rule_cmd route_set_ipv6_nexthop_peer_cmd =
   route_set_ipv6_nexthop_peer_free
 };
 
-/* `set vpnv4 nexthop A.B.C.D' */
+/* `set ip vpn nexthop A.B.C.D' */
 
 static route_map_result_t
 route_set_vpnv4_nexthop (void *rule, struct prefix *prefix,
@@ -2382,8 +2382,49 @@ route_set_vpnv4_nexthop_compile (const char *arg)
   return address;
 }
 
+/* `set ipv6 vpn nexthop A.B.C.D' */
+
+static route_map_result_t
+route_set_vpnv6_nexthop (void *rule, struct prefix *prefix,
+                        route_map_object_t type, void *object)
+{
+  struct in6_addr *address;
+  struct bgp_info *bgp_info;
+
+  if (type == RMAP_BGP)
+    {
+      /* Fetch routemap's rule information. */
+      address = rule;
+      bgp_info = object;
+
+      /* Set next hop value. */
+      memcpy (&(bgp_attr_extra_get (bgp_info->attr))->mp_nexthop_global, address, sizeof(struct in6_addr));
+      (bgp_attr_extra_get (bgp_info->attr))->mp_nexthop_len = BGP_ATTR_NHLEN_VPNV6_GLOBAL;
+    }
+
+  return RMAP_OKAY;
+}
+
+static void *
+route_set_vpnv6_nexthop_compile (const char *arg)
+{
+  int ret;
+  struct in6_addr *address;
+
+  address = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (struct in6_addr));
+  ret = inet_pton (AF_INET6, arg, address);
+
+  if (ret == 0)
+    {
+      XFREE (MTYPE_ROUTE_MAP_COMPILED, address);
+      return NULL;
+    }
+
+  return address;
+}
+
 static void
-route_set_vpnv4_nexthop_free (void *rule)
+route_set_vpn_nexthop_free (void *rule)
 {
   XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
 }
@@ -2391,10 +2432,19 @@ route_set_vpnv4_nexthop_free (void *rule)
 /* Route map commands for ip nexthop set. */
 struct route_map_rule_cmd route_set_vpnv4_nexthop_cmd =
 {
-  "vpnv4 next-hop",
+  "ip vpn next-hop",
   route_set_vpnv4_nexthop,
   route_set_vpnv4_nexthop_compile,
-  route_set_vpnv4_nexthop_free
+  route_set_vpn_nexthop_free
+};
+
+/* Route map commands for ip nexthop set. */
+struct route_map_rule_cmd route_set_vpnv6_nexthop_cmd =
+{
+  "ipv6 vpn next-hop",
+  route_set_vpnv6_nexthop,
+  route_set_vpnv6_nexthop_compile,
+  route_set_vpn_nexthop_free
 };
 
 /* `set originator-id' */
@@ -3881,37 +3931,124 @@ DEFUN (no_set_ipv6_nexthop_global,
                              "ipv6 next-hop global", argv[idx_ipv6]->arg);
 }
 
-DEFUN (set_vpnv4_nexthop,
-       set_vpnv4_nexthop_cmd,
-       "set vpnv4 next-hop A.B.C.D",
+#ifdef KEEP_OLD_VPN_COMMANDS
+DEFUN (set_vpn_nexthop,
+       set_vpn_nexthop_cmd,
+       "set <vpnv4|vpnv6> next-hop [A.B.C.D|X:X::X:X]",
        SET_STR
        "VPNv4 information\n"
-       "VPNv4 next-hop address\n"
-       "IP address of next hop\n")
+       "VPNv6 information\n"
+       "VPN next-hop address\n"
+       "IP address of next hop\n"
+       "IPv6 address of next hop\n")
 {
-  int idx_ipv4 = 3;
-  return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index),
-                          "vpnv4 next-hop", argv[idx_ipv4]->arg);
-}
+  int idx_ip = 3;
+  afi_t afi;
+  int idx = 0;
 
+  if (argv_find_and_parse_vpnvx (argv, argc, &idx, &afi))
+    {
+      if (afi == AFI_IP)
+        return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index),
+                              "ip vpn next-hop", argv[idx_ip]->arg);
+      else
+        return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index),
+                              "ipv6 vpn next-hop", argv[idx_ip]->arg);
+    }
+  return CMD_SUCCESS;
+}
 
-DEFUN (no_set_vpnv4_nexthop,
-       no_set_vpnv4_nexthop_cmd,
-       "no set vpnv4 next-hop [A.B.C.D]",
+DEFUN (no_set_vpn_nexthop,
+       no_set_vpn_nexthop_cmd,
+       "no set vpn next-hop [A.B.C.D|X:X::X:X]",
        NO_STR
        SET_STR
-       "VPNv4 information\n"
-       "VPNv4 next-hop address\n"
-       "IP address of next hop\n")
+       "VPN information\n"
+       "VPN next-hop address\n"
+       "IP address of next hop\n"
+       "IPv6 address of next hop\n")
 {
-  int idx_ipv4 = 4;
-  if (argc <= idx_ipv4)
-    return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
-                               "vpnv4 next-hop", NULL);
-  return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
-                             "vpnv4 next-hop", argv[idx_ipv4]->arg);
+  int idx_ip = 4;
+  char *arg;
+  afi_t afi;
+  int idx = 0;
+
+  if (argc <= idx_ip)
+    arg = NULL;
+  else
+    arg = argv[idx_ip]->arg;
+  if (argv_find_and_parse_vpnvx (argv, argc, &idx, &afi))
+    {
+      if (afi == AFI_IP)
+        return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+                                   "ip vpn next-hop", arg);
+      else
+        return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+                                   "ipv6 vpn next-hop", argv[idx_ip]->arg);
+    }
+  return CMD_SUCCESS;
+}
+#endif /* KEEP_OLD_VPN_COMMANDS */
+
+DEFUN (set_ipx_vpn_nexthop,
+       set_ipx_vpn_nexthop_cmd,
+       "set <ipv4|ipv6> vpn next-hop [A.B.C.D|X:X::X:X]",
+       SET_STR
+       "IPv4 information\n"
+       "IPv6 information\n"
+       "VPN information\n"
+       "VPN next-hop address\n"
+       "IP address of next hop\n"
+       "IPv6 address of next hop\n")
+{
+  int idx_ip = 4;
+  afi_t afi;
+  int idx = 0;
+
+  if (argv_find_and_parse_afi (argv, argc, &idx, &afi))
+    {
+      if (afi == AFI_IP)
+        return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index),
+                              "ip vpn next-hop", argv[idx_ip]->arg);
+      else
+        return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index),
+                              "ipv6 vpn next-hop", argv[idx_ip]->arg);
+    }
+  return CMD_SUCCESS;
 }
 
+DEFUN (no_set_ipx_vpn_nexthop,
+       no_set_ipx_vpn_nexthop_cmd,
+       "no set <ipv4|ipv6> vpn next-hop [A.B.C.D|X:X::X:X]",
+       NO_STR
+       SET_STR
+       "IPv4 information\n"
+       "IPv6 information\n"
+       "VPN information\n"
+       "VPN next-hop address\n"
+       "IP address of next hop\n"
+       "IPv6 address of next hop\n")
+{
+  int idx_ip = 5;
+  char *arg;
+  afi_t afi;
+  int idx = 0;
+
+  if (argc <= idx_ip)
+    arg = NULL;
+  else
+    arg = argv[idx_ip]->arg;
+  if (argv_find_and_parse_afi (argv, argc, &idx, &afi))
+    {
+      if (afi == AFI_IP)
+        return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+                                   "ip vpn next-hop", arg);
+      else
+        return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+                                   "ipv6 vpn next-hop", argv[idx_ip]->arg);
+    }
+  return CMD_SUCCESS;
+}
 
 DEFUN (set_originator_id,
        set_originator_id_cmd,
@@ -4022,6 +4159,7 @@ bgp_route_map_init (void)
   route_map_install_set (&route_set_community_cmd);
   route_map_install_set (&route_set_community_delete_cmd);
   route_map_install_set (&route_set_vpnv4_nexthop_cmd);
+  route_map_install_set (&route_set_vpnv6_nexthop_cmd);
   route_map_install_set (&route_set_originator_id_cmd);
   route_map_install_set (&route_set_ecommunity_rt_cmd);
   route_map_install_set (&route_set_ecommunity_soo_cmd);
@@ -4075,8 +4213,12 @@ bgp_route_map_init (void)
   install_element (RMAP_NODE, &no_set_ecommunity_rt_cmd);
   install_element (RMAP_NODE, &set_ecommunity_soo_cmd);
   install_element (RMAP_NODE, &no_set_ecommunity_soo_cmd);
-  install_element (RMAP_NODE, &set_vpnv4_nexthop_cmd);
-  install_element (RMAP_NODE, &no_set_vpnv4_nexthop_cmd);
+#ifdef KEEP_OLD_VPN_COMMANDS
+  install_element (RMAP_NODE, &set_vpn_nexthop_cmd);
+  install_element (RMAP_NODE, &no_set_vpn_nexthop_cmd);
+#endif /* KEEP_OLD_VPN_COMMANDS */
+  install_element (RMAP_NODE, &set_ipx_vpn_nexthop_cmd);
+  install_element (RMAP_NODE, &no_set_ipx_vpn_nexthop_cmd);
   install_element (RMAP_NODE, &set_originator_id_cmd);
   install_element (RMAP_NODE, &no_set_originator_id_cmd);
 
index cb05cf0a808af99e8d23d1dcf4409c750c44ae1f..79c11358feab631a7e9bb4592cfedf5f7048de74 100644 (file)
@@ -418,10 +418,20 @@ bpacket_reformat_for_peer (struct bpacket *pkt, struct peer_af *paf)
   if (CHECK_FLAG (vec->flags, BPKT_ATTRVEC_FLAGS_UPDATED))
     {
       u_int8_t nhlen;
+      afi_t    nhafi = AFI_MAX; /* NH AFI is based on nhlen! */
       int route_map_sets_nh;
       nhlen = stream_getc_from (s, vec->offset);
-
-      if (paf->afi == AFI_IP && !peer_cap_enhe(peer))
+      if (paf->afi == AFI_IP || paf->afi == AFI_IP6)
+        {
+          nhafi = BGP_NEXTHOP_AFI_FROM_NHLEN(nhlen);
+          if (peer_cap_enhe(peer))
+            nhafi = AFI_IP6;
+          if (paf->safi == SAFI_MPLS_VPN &&     /* if VPN && not global */
+              nhlen != BGP_ATTR_NHLEN_VPNV6_GLOBAL_AND_LL)
+            nhafi = AFI_MAX;                    /* no change allowed */
+        }
+
+      if (nhafi == AFI_IP)
        {
          struct in_addr v4nh, *mod_v4nh;
           int nh_modified = 0;
@@ -462,23 +472,24 @@ bpacket_reformat_for_peer (struct bpacket *pkt, struct peer_af *paf)
                    (bgp_multiaccess_check_v4 (v4nh, peer) == 0) &&
                    !CHECK_FLAG(vec->flags,
                                BPKT_ATTRVEC_FLAGS_RMAP_NH_UNCHANGED) &&
-                   !peer_af_flag_check (peer, paf->afi, paf->safi,
+                   !peer_af_flag_check (peer, nhafi, paf->safi,
                                          PEER_FLAG_NEXTHOP_UNCHANGED))
             {
+              /* NOTE: not handling case where NH has new AFI */
                mod_v4nh = &peer->nexthop.v4;
                nh_modified = 1;
             }
 
-          if (nh_modified)
-            stream_put_in_addr_at (s, vec->offset + 1, mod_v4nh);
+          if (nh_modified)      /* allow for VPN RD */
+            stream_put_in_addr_at (s, vec->offset + 1 + nhlen - 4, mod_v4nh);
 
           if (bgp_debug_update(peer, NULL, NULL, 0))
-            zlog_debug ("u%" PRIu64 ":s%" PRIu64 " %s send UPDATE w/ nexthop %s",
-                    PAF_SUBGRP(paf)->update_group->id, PAF_SUBGRP(paf)->id,
-                    peer->host, inet_ntoa (*mod_v4nh));
-
+            zlog_debug ("u%" PRIu64 ":s%" PRIu64 " %s send UPDATE w/ nexthop %s%s",
+                        PAF_SUBGRP(paf)->update_group->id, PAF_SUBGRP(paf)->id,
+                        peer->host, inet_ntoa (*mod_v4nh),
+                        (nhlen == 12 ? " and RD" : ""));
        }
-      else if (paf->afi == AFI_IP6 || peer_cap_enhe(peer))
+      else if (nhafi == AFI_IP6)
        {
           struct in6_addr v6nhglobal, *mod_v6nhg;
           struct in6_addr v6nhlocal, *mod_v6nhl;
@@ -515,17 +526,18 @@ bpacket_reformat_for_peer (struct bpacket *pkt, struct peer_af *paf)
           else if (peer->sort == BGP_PEER_EBGP &&
                    !CHECK_FLAG(vec->flags,
                                BPKT_ATTRVEC_FLAGS_RMAP_NH_UNCHANGED) &&
-                   !peer_af_flag_check (peer, paf->afi, paf->safi,
+                   !peer_af_flag_check (peer, nhafi, paf->safi,
                                          PEER_FLAG_NEXTHOP_UNCHANGED))
             {
+              /* NOTE: not handling case where NH has new AFI */
                mod_v6nhg = &peer->nexthop.v6_global;
                gnh_modified = 1;
             }
 
 
-         if (nhlen == 32)
+         if (nhlen == 32 || nhlen == 48) /* 48 == VPN */
            {
-              stream_get_from (&v6nhlocal, s, vec->offset + 1 + 16, 16);
+              stream_get_from (&v6nhlocal, s, vec->offset + 1 + (nhlen-IPV6_MAX_BYTELEN), IPV6_MAX_BYTELEN);
               if (IN6_IS_ADDR_UNSPECIFIED (&v6nhlocal))
                 {
                    mod_v6nhl = &peer->nexthop.v6_local;
@@ -534,25 +546,27 @@ bpacket_reformat_for_peer (struct bpacket *pkt, struct peer_af *paf)
            }
 
           if (gnh_modified)
-            stream_put_in6_addr_at (s, vec->offset + 1, mod_v6nhg);
+            stream_put_in6_addr_at (s, vec->offset + 1 + (nhlen-IPV6_MAX_BYTELEN), mod_v6nhg);
           if (lnh_modified)
-            stream_put_in6_addr_at (s, vec->offset + 1 + 16, mod_v6nhl);
+            stream_put_in6_addr_at (s, vec->offset + 1 + (nhlen-IPV6_MAX_BYTELEN), mod_v6nhl);
 
           if (bgp_debug_update(peer, NULL, NULL, 0))
             {
-              if (nhlen == 32)
-                zlog_debug ("u%" PRIu64 ":s%" PRIu64 " %s send UPDATE w/ mp_nexthops %s, %s",
+              if (nhlen == 32 || nhlen == 48)
+                zlog_debug ("u%" PRIu64 ":s%" PRIu64 " %s send UPDATE w/ mp_nexthops %s, %s%s",
                             PAF_SUBGRP(paf)->update_group->id,
                             PAF_SUBGRP(paf)->id,
                             peer->host,
                             inet_ntop (AF_INET6, mod_v6nhg, buf, BUFSIZ),
-                            inet_ntop (AF_INET6, mod_v6nhl, buf2, BUFSIZ));
+                            inet_ntop (AF_INET6, mod_v6nhl, buf2, BUFSIZ),
+                            (nhlen == 48 ? " and RD" : ""));
               else
-                zlog_debug ("u%" PRIu64 ":s%" PRIu64 " %s send UPDATE w/ mp_nexthop %s",
+                zlog_debug ("u%" PRIu64 ":s%" PRIu64 " %s send UPDATE w/ mp_nexthop %s%s",
                             PAF_SUBGRP(paf)->update_group->id,
                             PAF_SUBGRP(paf)->id,
                             peer->host,
-                            inet_ntop (AF_INET6, mod_v6nhg, buf, BUFSIZ));
+                            inet_ntop (AF_INET6, mod_v6nhg, buf, BUFSIZ),
+                            (nhlen == 24 ? " and RD" : ""));
             }
        }
     }
@@ -747,7 +761,8 @@ subgroup_update_packet (struct update_subgroup *subgrp)
 
          if (stream_empty (snlri))
            mpattrlen_pos = bgp_packet_mpattr_start (snlri, afi, safi,
-                                         (peer_cap_enhe(peer) ? AFI_IP6 : afi),
+                                         (peer_cap_enhe(peer) ? AFI_IP6 :
+                                          AFI_MAX), /* get from NH */
                                          &vecarr, adv->baa->attr);
           bgp_packet_mpattr_prefix (snlri, afi, safi, &rn->p, prd, tag,
                                     addpath_encode, addpath_tx_id);
index 6d23af03e4c2aaa8df71e6db4763d83e2dafafb2..2e001b3a9d6c6bd2a9dcf483e2eaf2af48363c61 100644 (file)
@@ -5564,6 +5564,7 @@ DEFUN (address_family_ipv6_safi,
   return CMD_SUCCESS;
 }
 
+#ifdef KEEP_OLD_VPN_COMMANDS
 DEFUN (address_family_vpnv4,
        address_family_vpnv4_cmd,
        "address-family vpnv4 [unicast]",
@@ -5585,6 +5586,29 @@ DEFUN (address_family_vpnv6,
   vty->node = BGP_VPNV6_NODE;
   return CMD_SUCCESS;
 }
+#endif /* KEEP_OLD_VPN_COMMANDS */
+
+DEFUN (address_family_ipv4_vpn,
+       address_family_ipv4_vpn_cmd,
+       "address-family ipv4 vpn",
+       "Enter Address Family command mode\n"
+       "Address Family\n"
+       "Subsequent Address Family modifier\n")
+{
+  vty->node = BGP_VPNV4_NODE;
+  return CMD_SUCCESS;
+}
+
+DEFUN (address_family_ipv6_vpn,
+       address_family_ipv6_vpn_cmd,
+       "address-family ipv6 vpn",
+       "Enter Address Family command mode\n"
+       "Address Family\n"
+       "Subsequent Address Family modifier\n")
+{
+  vty->node = BGP_VPNV6_NODE;
+  return CMD_SUCCESS;
+}
 
 DEFUN (address_family_encap,
        address_family_encap_cmd,
@@ -7407,7 +7431,8 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
 
       /* BGP Version. */
       json_object_int_add(json_neigh, "bgpVersion", 4);
-      json_object_string_add(json_neigh, "remoteRouterId", inet_ntop (AF_INET, &p->remote_id, buf1, BUFSIZ));
+      json_object_string_add(json_neigh, "remoteRouterId",
+                             inet_ntop (AF_INET, &p->remote_id, buf1, sizeof(buf1)));
 
       /* Confederation */
       if (CHECK_FLAG (bgp->config, BGP_CONFIG_CONFEDERATION) && bgp_confederation_peers_check (bgp, p->as))
@@ -7474,7 +7499,8 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
 
       /* BGP Version. */
       vty_out (vty, "  BGP version 4");
-      vty_out (vty, ", remote router ID %s%s", inet_ntop (AF_INET, &p->remote_id, buf1, BUFSIZ),
+      vty_out (vty, ", remote router ID %s%s",
+               inet_ntop (AF_INET, &p->remote_id, buf1, sizeof(buf1)),
                VTY_NEWLINE);
 
       /* Confederation */
@@ -8276,9 +8302,12 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
     {
       if (use_json)
         {
-          json_object_string_add(json_neigh, "nexthop", inet_ntop (AF_INET, &p->nexthop.v4, buf1, BUFSIZ));
-          json_object_string_add(json_neigh, "nexthopGlobal", inet_ntop (AF_INET6, &p->nexthop.v6_global, buf1, BUFSIZ));
-          json_object_string_add(json_neigh, "nexthopLocal", inet_ntop (AF_INET6, &p->nexthop.v6_local, buf1, BUFSIZ));
+          json_object_string_add(json_neigh, "nexthop",
+                                 inet_ntop (AF_INET, &p->nexthop.v4, buf1, sizeof(buf1)));
+          json_object_string_add(json_neigh, "nexthopGlobal",
+                                 inet_ntop (AF_INET6, &p->nexthop.v6_global, buf1, sizeof(buf1)));
+          json_object_string_add(json_neigh, "nexthopLocal",
+                                 inet_ntop (AF_INET6, &p->nexthop.v6_local, buf1, sizeof(buf1)));
           if (p->shared_network)
             json_object_string_add(json_neigh, "bgpConnection", "sharedNetwork");
           else
@@ -8287,17 +8316,17 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
       else
         {
           vty_out (vty, "Nexthop: %s%s",
-                  inet_ntop (AF_INET, &p->nexthop.v4, buf1, BUFSIZ),
-                  VTY_NEWLINE);
+                   inet_ntop (AF_INET, &p->nexthop.v4, buf1, sizeof(buf1)),
+                   VTY_NEWLINE);
           vty_out (vty, "Nexthop global: %s%s",
-                  inet_ntop (AF_INET6, &p->nexthop.v6_global, buf1, BUFSIZ),
-                  VTY_NEWLINE);
+                   inet_ntop (AF_INET6, &p->nexthop.v6_global, buf1, sizeof(buf1)),
+                   VTY_NEWLINE);
           vty_out (vty, "Nexthop local: %s%s",
-                  inet_ntop (AF_INET6, &p->nexthop.v6_local, buf1, BUFSIZ),
-                  VTY_NEWLINE);
+                   inet_ntop (AF_INET6, &p->nexthop.v6_local, buf1, sizeof(buf1)),
+                   VTY_NEWLINE);
           vty_out (vty, "BGP connection: %s%s",
-                  p->shared_network ? "shared network" : "non shared network",
-                  VTY_NEWLINE);
+                   p->shared_network ? "shared network" : "non shared network",
+                   VTY_NEWLINE);
         }
     }
 
@@ -10684,9 +10713,12 @@ bgp_vty_init (void)
   install_element (BGP_NODE, &address_family_ipv4_safi_cmd);
   install_element (BGP_NODE, &address_family_ipv6_cmd);
   install_element (BGP_NODE, &address_family_ipv6_safi_cmd);
+#ifdef KEEP_OLD_VPN_COMMANDS
   install_element (BGP_NODE, &address_family_vpnv4_cmd);
-
   install_element (BGP_NODE, &address_family_vpnv6_cmd);
+#endif /* KEEP_OLD_VPN_COMMANDS */
+  install_element (BGP_NODE, &address_family_ipv4_vpn_cmd);
+  install_element (BGP_NODE, &address_family_ipv6_vpn_cmd);
 
   install_element (BGP_NODE, &address_family_encap_cmd);
   install_element (BGP_NODE, &address_family_encapv6_cmd);
index c08107f0d931393c2285e8bde0c4f79eee2d1125..61d20956595abe729cfa91d1bbdc4a626608700f 100644 (file)
@@ -7182,9 +7182,9 @@ bgp_config_write_family_header (struct vty *vty, afi_t afi, safi_t safi,
       else if (safi == SAFI_MULTICAST)
        vty_out (vty, "ipv4 multicast");
       else if (safi == SAFI_MPLS_VPN)
-       vty_out (vty, "vpnv4");
+       vty_out (vty, "ipv4 vpn");
       else if (safi == SAFI_ENCAP)
-       vty_out (vty, "encap");
+       vty_out (vty, "ipv4 encap");
     }
   else if (afi == AFI_IP6)
     {
@@ -7193,9 +7193,9 @@ bgp_config_write_family_header (struct vty *vty, afi_t afi, safi_t safi,
       else if (safi == SAFI_MULTICAST)
         vty_out (vty, "ipv6 multicast");
       else if (safi == SAFI_MPLS_VPN)
-       vty_out (vty, "vpnv6");
+       vty_out (vty, "ipv6 vpn");
       else if (safi == SAFI_ENCAP)
-        vty_out (vty, "encapv6");
+        vty_out (vty, "ipv6 encap");
     }
 
   vty_out (vty, "%s", VTY_NEWLINE);
index 6d86d48b6e938391304dd70a277409a239aec5aa..61da18a3084db6d33513a8ea01208a4d1f07828b 100644 (file)
@@ -768,7 +768,6 @@ add_vnc_route (
           bgp_attr_extra_free (&attr);
           return;
         }
-      nexthop = un_addr;    /* UN used as MPLS NLRI nexthop */
     }
 
   if (local_pref)
index d8713a26b23aa5ea501f5948d2ab82e0744bb27c..171ea8f24dc53dc0f7123261754e8d1b7bc4f4f6 100644 (file)
@@ -131,8 +131,7 @@ rfapi_tunneltype_option_to_tlv (
       break;
 
     case BGP_ENCAP_TYPE_MPLS:
-      _RTTO_MAYBE_ADD_ENDPOINT_ADDRESS (mpls);
-      bgp_encap_type_mpls_to_tlv (&tto->bgpinfo.mpls, attr);
+      /* nothing to do for MPLS */
       break;
 
     case BGP_ENCAP_TYPE_MPLS_IN_GRE:
index 716a1fb537416c1af349c45ea0155e6784e4c770..e6fdb7180e0cbb9e8a3430c52d040c90f7b5853b 100644 (file)
@@ -113,7 +113,7 @@ rfapiDebugBacktrace (void)
 
   for (i = 0; i < size && i < RFAPI_DEBUG_BACKTRACE_NENTRIES; ++i)
     {
-      vnc_zlog_debug_verbose ("backtrace[%2lu]: %s", i, syms[i]);
+      vnc_zlog_debug_verbose ("backtrace[%2zu]: %s", i, syms[i]);
     }
 
   free (syms);
@@ -423,10 +423,7 @@ rfapiGetVncTunnelUnAddr (struct attr *attr, struct prefix *p)
   rfapiGetTunnelType (attr, &tun_type);
   if (p && tun_type == BGP_ENCAP_TYPE_MPLS) 
     {
-      /* MPLS carries UN address in next hop */
-      rfapiNexthop2Prefix (attr, p);
-      if (p->family != 0)
-        return 0;
+      return ENOENT;            /* no UN for MPLS */
     }
   if (attr && attr->extra)
     {
index d96225d405f7ce9ce931502bbca878fb23e8d8c6..3e179b7f7283241e2f625212144c4dd7f6e5123c 100644 (file)
@@ -490,14 +490,7 @@ rfapi_vty_out_vncinfo (
   if (bi->extra != NULL)
     vty_out (vty, " label=%u", decode_label (bi->extra->tag));
 
-  if (rfapiGetVncLifetime (bi->attr, &lifetime))
-    {
-      if (safi == SAFI_MPLS_VPN || safi == SAFI_ENCAP)
-        {
-          vty_out (vty, " life=none");
-        }
-    }
-  else
+  if (!rfapiGetVncLifetime (bi->attr, &lifetime))
     {
       vty_out (vty, " life=%d", lifetime);
     }
index e190588700c54ce7ab9848e0f0b39c6491c8e14f..6ce5d0cc2ce683497207ce66f5298e66b781c1ec 100755 (executable)
@@ -283,6 +283,8 @@ AC_ARG_ENABLE(rr-semantics,
   AS_HELP_STRING([--disable-rr-semantics], [disable the v6 Route Replace semantics]))
 AC_ARG_ENABLE([protobuf],
   AS_HELP_STRING([--enable-protobuf], [Enable experimental protobuf support]))
+AC_ARG_ENABLE([oldvpn_commands],
+  AS_HELP_STRING([--enable-old-vpn-commands], [Keep old vpn commands]))
 
 AC_CHECK_HEADERS(json-c/json.h)
 AC_CHECK_LIB(json-c, json_object_get, LIBS="$LIBS -ljson-c")
@@ -388,6 +390,13 @@ if test "$enable_protobuf" = "yes"; then
    fi
 fi
 
+#
+# Logic for old vpn commans support.
+#
+if test "$enable_old_vpn_commands" = "yes"; then
+   AC_DEFINE(KEEP_OLD_VPN_COMMANDS,, [Define for compiling with old vpn commands])
+fi
+
 # Fail if the user explicity enabled protobuf support and we couldn't
 # find the compiler or libraries.
 if test "x$have_protobuf" = "xno" && test "x$enable_protobuf" = "xyes"; then
index 4d447d9051bbefc5c0063b412106b72633094bbc..a195e9e2fc5265affb3305a850d7d021090a8e26 100644 (file)
@@ -223,6 +223,7 @@ clear(struct pid_list **list)
        *list = NULL;
 }
 
+#ifdef linux
 static const char *
 next_dirname(const char *s)
 {
@@ -242,7 +243,6 @@ next_dirname(const char *s)
        return cur;
 }
 
-#ifdef linux
 static void
 add_namespace(const char *path)
 {
index 8775e12a24fc6e2969806931f1a3236ae38e068e..3a5eaf558514fde56db242cfbf950d81d2f1804a 100644 (file)
@@ -78,7 +78,10 @@ open_bpf_dev (struct isis_circuit *circuit)
   int i = 0, fd;
   char bpfdev[128];
   struct ifreq ifr;
-  u_int blen, immediate, seesent;
+  u_int blen, immediate;
+#ifdef BIOCSSEESENT
+  u_int seesent;
+#endif
   struct timeval timeout;
   struct bpf_program bpf_prog;
 
index 6294e994e70c7ca451cbc3d13ab45e9c4b9204fc..b5dae5f28e13bec5216cfaf0d193da1cad60c82c 100644 (file)
@@ -541,8 +541,12 @@ completions_to_vec (struct list *completions)
     for (i = 0; i < vector_active (comps) && !exists; i++)
     {
       struct cmd_token *curr = vector_slot (comps, i);
+#ifdef VTYSH_DEBUG
       exists = !strcmp (curr->text, token->text) &&
                !strcmp (curr->desc, token->desc);
+#else
+      exists = !strcmp (curr->text, token->text);
+#endif /* VTYSH_DEBUG */
     }
 
     if (!exists)
index ddb79988b4b4f18aa56e5ef0d70a6bd379ec254a..79d21e124bd52c1ff1d932d8a706b760a9110a7a 100644 (file)
@@ -40,9 +40,49 @@ struct timer_wheel
   void (*slot_run) (void *);
 };
 
+/*
+ * Creates a timer wheel
+ *
+ * master - Thread master structure for the process
+ * period - The Time in seconds that the timer wheel will
+ *          take before it starts issuing commands again
+ *          for items in each slot
+ * slots  - The number of slots to have in this particular
+ *          timer wheel
+ * slot_key - A hashing function of some sort that will allow
+ *            the timer wheel to put items into individual slots
+ * slot_run - The function to run over each item in a particular slot
+ *
+ * Creates a timer wheel that will wake up 'slots' times over the entire
+ * wheel.  Each time the timer wheel wakes up it will iterate through
+ * and run the slot_run function for each item stored in that particular
+ * slot.
+ *
+ * The timer code is 'intelligent' in that it notices if anything is
+ * in a particular slot and can schedule the next timer to skip
+ * the empty slot.
+ *
+ * The general purpose of a timer wheel is to reduce events in a system.
+ * A perfect example of usage for this is say hello packets that need
+ * to be sent out to all your neighbors.  Suppose a large routing protocol
+ * has to send keepalive packets every Y seconds to each of it's peers.
+ * At scale we can have a very large number of peers, X.
+ * This means that we will have X timing events every Y seconds.
+ * If you replace these events with a timer wheel that has Z slots
+ * you will have at most Y/Z timer events if each slot has a work item
+ * in it.
+ *
+ * When X is large the number of events in a system can quickly escalate
+ * and cause significant amount of time handling thread events instead
+ * of running your code.
+ */
 struct timer_wheel *wheel_init (struct thread_master *master, int period, size_t slots,
                                unsigned int (*slot_key) (void *),
                                void (*slot_run) (void *));
+
+/*
+ * Delete the specified timer wheel created
+ */
 void wheel_delete (struct timer_wheel *);
 
 /*
@@ -51,17 +91,25 @@ void wheel_delete (struct timer_wheel *);
 int wheel_stop (struct timer_wheel *wheel);
 
 /*
- * Start the wheel from running again
+ * Start the wheel running again
  */
 int wheel_start (struct timer_wheel *wheel);
 
 /*
+ * wheel - The Timer wheel being modified
+ * item - The generic data structure that will be handed
+ *        to the slot_run function.
+ *
  * Add item to a slot setup by the slot_key,
  * possibly change next time pop.
  */
 int wheel_add_item (struct timer_wheel *wheel, void *item);
 
 /*
+ * wheel - The Timer wheel being modified.
+ * item - The item to remove from one of the slots in
+ *        the timer wheel.
+ *
  * Remove a item to a slot setup by the slot_key,
  * possibly change next time pop.
  */
index a9ed3fc3d11b2a0c0446ecea808908c5ed990b0b..d38ea60a0368dc036241af1e95f0bc3a80317218 100755 (executable)
@@ -57,11 +57,15 @@ $ignore{'"address-family ipv4"'} = "ignore";
 $ignore{'"address-family ipv4 <unicast|multicast>"'} = "ignore";
 $ignore{'"address-family ipv6"'} = "ignore";
 $ignore{'"address-family ipv6 <unicast|multicast>"'} = "ignore";
+$ignore{'"address-family ipv4 vpn"'} = "ignore";
 $ignore{'"address-family vpnv4"'} = "ignore";
 $ignore{'"address-family vpnv4 unicast"'} = "ignore";
 $ignore{'"address-family ipv4 vrf NAME"'} = "ignore";
 $ignore{'"address-family <encap|encapv4>"'} = "ignore";
 $ignore{'"address-family encapv6"'} = "ignore";
+$ignore{'"address-family ipv4 encap"'} = "ignore";
+$ignore{'"address-family ipv6 encap"'} = "ignore";
+$ignore{'"address-family ipv6 vpn"'} = "ignore";
 $ignore{'"address-family vpnv6"'} = "ignore";
 $ignore{'"address-family vpnv6 unicast"'} = "ignore";
 $ignore{'"exit-address-family"'} = "ignore";
index 36b0a6c7959d0efb8a00d01fd2a20f584f5511db..a4498a84f6fb07959341c72aafd4f5fbd47d9210 100644 (file)
@@ -105,7 +105,7 @@ interface_list_ioctl (void)
 #ifdef OPEN_BSD
   for (n = 0; n < ifconf.ifc_len; )
     {
-      int size;
+      unsigned int size;
 
       ifreq = (struct ifreq *)((caddr_t) ifconf.ifc_req + n);
       ifp = if_get_by_name_len(ifreq->ifr_name,
index 6d81c9d0525db2e4f9082a734f3e61983e7cb683..fd059dfee791f9f1f4a1901530c39546f18128d7 100644 (file)
@@ -927,7 +927,7 @@ rtm_read (struct rt_msghdr *rtm)
         int ret;
         if (! IS_ZEBRA_DEBUG_RIB)
           return;
-        ret = rib_lookup_ipv4_route (&p, &gate, VRF_DEFAULT);
+        ret = rib_lookup_ipv4_route ((struct prefix_ipv4 *)&p, &gate, VRF_DEFAULT);
         prefix2str (&p, buf, sizeof(buf));
         switch (rtm->rtm_type)
         {
@@ -951,7 +951,7 @@ rtm_read (struct rt_msghdr *rtm)
               case ZEBRA_RIB_FOUND_EXACT: /* RIB RR == FIB RR */
                 zlog_debug ("%s: %s %s: done Ok",
                   __func__, lookup (rtm_type_str, rtm->rtm_type), buf);
-                rib_lookup_and_dump (&p, VRF_DEFAULT);
+                rib_lookup_and_dump ((struct prefix_ipv4 *)&p, VRF_DEFAULT);
                 return;
                 break;
             }
@@ -964,18 +964,18 @@ rtm_read (struct rt_msghdr *rtm)
               case ZEBRA_RIB_FOUND_EXACT:
                 zlog_debug ("%s: %s %s: desync: RR is still in RIB, while already not in FIB",
                   __func__, lookup (rtm_type_str, rtm->rtm_type), buf);
-                rib_lookup_and_dump (&p, VRF_DEFAULT);
+                rib_lookup_and_dump ((struct prefix_ipv4 *)&p, VRF_DEFAULT);
                 break;
               case ZEBRA_RIB_FOUND_CONNECTED:
               case ZEBRA_RIB_FOUND_NOGATE:
                 zlog_debug ("%s: %s %s: desync: RR is still in RIB, plus gate differs",
                   __func__, lookup (rtm_type_str, rtm->rtm_type), buf);
-                rib_lookup_and_dump (&p, VRF_DEFAULT);
+                rib_lookup_and_dump ((struct prefix_ipv4 *)&p, VRF_DEFAULT);
                 break;
               case ZEBRA_RIB_NOTFOUND: /* RIB RR == FIB RR */
                 zlog_debug ("%s: %s %s: done Ok",
                   __func__, lookup (rtm_type_str, rtm->rtm_type), buf);
-                rib_lookup_and_dump (&p, VRF_DEFAULT);
+                rib_lookup_and_dump ((struct prefix_ipv4 *)&p, VRF_DEFAULT);
                 return;
                 break;
             }
index 8b337152b4936266496d2b429671aba079195b69..d91cda9fb04b0d9dc7da0bad71d1cb25af1bd53f 100644 (file)
@@ -883,7 +883,9 @@ zfpm_encode_route (rib_dest_t *dest, struct rib *rib, char *in_buf,
                   size_t in_buf_len, fpm_msg_type_e *msg_type)
 {
   size_t len;
+#ifdef HAVE_NETLINK
   int cmd;
+#endif
   len = 0;
 
   *msg_type = FPM_MSG_TYPE_NONE;
index b069c996c0fe86b00f91cf8c76d48c38cc5106f5..5a46de9ce9dfb3022e93b3a2e95ce689629bd0ff 100644 (file)
@@ -2388,7 +2388,7 @@ zebra_find_client (u_char proto)
   return NULL;
 }
 
-
+#ifdef HAVE_NETLINK
 /* Display default rtm_table for all clients. */
 DEFUN (show_table,
        show_table_cmd,
@@ -2421,6 +2421,7 @@ DEFUN (no_config_table,
   zebrad.rtm_table_default = 0;
   return CMD_SUCCESS;
 }
+#endif
 
 DEFUN (ip_forwarding,
        ip_forwarding_cmd,