[quagga-dev 3595] [PATCH] address-family ipv6 multicast support for bgpd

Hugo Santos hsantos at av.it.pt
Sat Aug 20 00:43:23 BST 2005


Hi Paul,

After a bit of reading of Quagga source's i've cooked up a first version
to support ipv6 multicast configuration in bgpd thus allowing the
multicast safi to be negotiated and supported (ipv4 multicast was
already supported). This patch is against HEAD and was tested in Debian
Linux/x86 with a Cisco IOS peer.

A new function is added to the vty: ``address-family ipv6 multicast``.
Please review for inclusion in main line code.

If David Lamparter isn't working on it yet, my next patch will enable
multicast safi prefix redistribution.

Any comments are welcome.

Thanks,
Hugo Santos

-------------- next part --------------
Index: bgpd/bgp_vty.c
===================================================================
RCS file: /var/cvsroot/quagga/bgpd/bgp_vty.c,v
retrieving revision 1.25
diff -u -p -w -b -r1.25 bgp_vty.c
--- bgpd/bgp_vty.c	28 Jun 2005 12:44:17 -0000	1.25
+++ bgpd/bgp_vty.c	19 Aug 2005 23:22:50 -0000
@@ -49,7 +49,7 @@ extern struct in_addr router_id_zebra;
 afi_t
 bgp_node_afi (struct vty *vty)
 {
-  if (vty->node == BGP_IPV6_NODE)
+  if (vty->node == BGP_IPV6_NODE || vty->node == BGP_IPV6M_NODE)
     return AFI_IP6;
   return AFI_IP;
 }
@@ -61,7 +61,7 @@ bgp_node_safi (struct vty *vty)
 {
   if (vty->node == BGP_VPNV4_NODE)
     return SAFI_MPLS_VPN;
-  if (vty->node == BGP_IPV4M_NODE)
+  if (vty->node == BGP_IPV4M_NODE || vty->node == BGP_IPV6M_NODE)
     return SAFI_MULTICAST;
   return SAFI_UNICAST;
 }
@@ -3922,22 +3922,31 @@ DEFUN (address_family_ipv4_safi,
   return CMD_SUCCESS;
 }
 
-DEFUN (address_family_ipv6_unicast,
-       address_family_ipv6_unicast_cmd,
-       "address-family ipv6 unicast",
+DEFUN (address_family_ipv6,
+       address_family_ipv6_cmd,
+       "address-family ipv6",
        "Enter Address Family command mode\n"
-       "Address family\n"
-       "unicast\n")
+       "Address family\n")
 {
   vty->node = BGP_IPV6_NODE;
   return CMD_SUCCESS;
 }
 
-ALIAS (address_family_ipv6_unicast,
-       address_family_ipv6_cmd,
-       "address-family ipv6",
+DEFUN (address_family_ipv6_safi,
+       address_family_ipv6_safi_cmd,
+       "address-family ipv6 (unicast|multicast)",
        "Enter Address Family command mode\n"
-       "Address family\n")
+       "Address family\n"
+       "Address Family modifier\n"
+       "Address Family modifier\n")
+{
+  if (strncmp (argv[0], "m", 1) == 0)
+    vty->node = BGP_IPV6M_NODE;
+  else
+    vty->node = BGP_IPV6_NODE;
+
+  return CMD_SUCCESS;
+}
 
 DEFUN (address_family_vpnv4,
        address_family_vpnv4_cmd,
@@ -3964,7 +3973,8 @@ DEFUN (exit_address_family,
   if (vty->node == BGP_IPV4_NODE
       || vty->node == BGP_IPV4M_NODE
       || vty->node == BGP_VPNV4_NODE
-      || vty->node == BGP_IPV6_NODE)
+      || vty->node == BGP_IPV6_NODE
+      || vty->node == BGP_IPV6M_NODE)
     vty->node = BGP_NODE;
   return CMD_SUCCESS;
 }
@@ -8559,6 +8569,13 @@ struct cmd_node bgp_ipv6_unicast_node = 
   1,
 };
 
+struct cmd_node bgp_ipv6_multicast_node =
+{
+  BGP_IPV6M_NODE,
+  "%s(config-router-af)# ",
+  1,
+};
+
 struct cmd_node bgp_vpnv4_node =
 {
   BGP_VPNV4_NODE,
@@ -8576,6 +8593,7 @@ bgp_vty_init (void)
   install_node (&bgp_ipv4_unicast_node, NULL);
   install_node (&bgp_ipv4_multicast_node, NULL);
   install_node (&bgp_ipv6_unicast_node, NULL);
+  install_node (&bgp_ipv6_multicast_node, NULL);
   install_node (&bgp_vpnv4_node, NULL);
 
   /* Install default VTY commands to new nodes.  */
@@ -8583,6 +8601,7 @@ bgp_vty_init (void)
   install_default (BGP_IPV4_NODE);
   install_default (BGP_IPV4M_NODE);
   install_default (BGP_IPV6_NODE);
+  install_default (BGP_IPV6M_NODE);
   install_default (BGP_VPNV4_NODE);
   
   /* "bgp multiple-instance" commands. */
@@ -8716,6 +8735,7 @@ bgp_vty_init (void)
   install_element (BGP_IPV4_NODE, &neighbor_activate_cmd);
   install_element (BGP_IPV4M_NODE, &neighbor_activate_cmd);
   install_element (BGP_IPV6_NODE, &neighbor_activate_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_activate_cmd);
   install_element (BGP_VPNV4_NODE, &neighbor_activate_cmd);
 
   /* "no neighbor activate" commands. */
@@ -8723,6 +8743,7 @@ bgp_vty_init (void)
   install_element (BGP_IPV4_NODE, &no_neighbor_activate_cmd);
   install_element (BGP_IPV4M_NODE, &no_neighbor_activate_cmd);
   install_element (BGP_IPV6_NODE, &no_neighbor_activate_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_activate_cmd);
   install_element (BGP_VPNV4_NODE, &no_neighbor_activate_cmd);
 
   /* "neighbor peer-group set" commands. */
@@ -8730,6 +8751,7 @@ bgp_vty_init (void)
   install_element (BGP_IPV4_NODE, &neighbor_set_peer_group_cmd);
   install_element (BGP_IPV4M_NODE, &neighbor_set_peer_group_cmd);
   install_element (BGP_IPV6_NODE, &neighbor_set_peer_group_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_set_peer_group_cmd);
   install_element (BGP_VPNV4_NODE, &neighbor_set_peer_group_cmd);
   
   /* "no neighbor peer-group unset" commands. */
@@ -8737,6 +8759,7 @@ bgp_vty_init (void)
   install_element (BGP_IPV4_NODE, &no_neighbor_set_peer_group_cmd);
   install_element (BGP_IPV4M_NODE, &no_neighbor_set_peer_group_cmd);
   install_element (BGP_IPV6_NODE, &no_neighbor_set_peer_group_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_set_peer_group_cmd);
   install_element (BGP_VPNV4_NODE, &no_neighbor_set_peer_group_cmd);
   
   /* "neighbor softreconfiguration inbound" commands.*/
@@ -8748,6 +8771,8 @@ bgp_vty_init (void)
   install_element (BGP_IPV4M_NODE, &no_neighbor_soft_reconfiguration_cmd);
   install_element (BGP_IPV6_NODE, &neighbor_soft_reconfiguration_cmd);
   install_element (BGP_IPV6_NODE, &no_neighbor_soft_reconfiguration_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_soft_reconfiguration_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_soft_reconfiguration_cmd);
   install_element (BGP_VPNV4_NODE, &neighbor_soft_reconfiguration_cmd);
   install_element (BGP_VPNV4_NODE, &no_neighbor_soft_reconfiguration_cmd);
 
@@ -8840,6 +8865,28 @@ bgp_vty_init (void)
   install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged8_cmd);
   install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged9_cmd);
   install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged10_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged1_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged2_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged3_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged4_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged5_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged6_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged7_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged8_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged9_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged10_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged1_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged2_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged3_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged4_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged5_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged6_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged7_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged8_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged9_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged10_cmd);
   install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged_cmd);
   install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged1_cmd);
   install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged2_cmd);
@@ -8881,6 +8928,8 @@ bgp_vty_init (void)
   install_element (BGP_IPV4M_NODE, &no_neighbor_nexthop_self_cmd);
   install_element (BGP_IPV6_NODE, &neighbor_nexthop_self_cmd);
   install_element (BGP_IPV6_NODE, &no_neighbor_nexthop_self_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_nexthop_self_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_nexthop_self_cmd);
   install_element (BGP_VPNV4_NODE, &neighbor_nexthop_self_cmd);
   install_element (BGP_VPNV4_NODE, &no_neighbor_nexthop_self_cmd);
 
@@ -8893,6 +8942,8 @@ bgp_vty_init (void)
   install_element (BGP_IPV4M_NODE, &no_neighbor_remove_private_as_cmd);
   install_element (BGP_IPV6_NODE, &neighbor_remove_private_as_cmd);
   install_element (BGP_IPV6_NODE, &no_neighbor_remove_private_as_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_remove_private_as_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_remove_private_as_cmd);
   install_element (BGP_VPNV4_NODE, &neighbor_remove_private_as_cmd);
   install_element (BGP_VPNV4_NODE, &no_neighbor_remove_private_as_cmd);
 
@@ -8913,6 +8964,10 @@ bgp_vty_init (void)
   install_element (BGP_IPV6_NODE, &neighbor_send_community_type_cmd);
   install_element (BGP_IPV6_NODE, &no_neighbor_send_community_cmd);
   install_element (BGP_IPV6_NODE, &no_neighbor_send_community_type_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_send_community_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_send_community_type_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_send_community_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_send_community_type_cmd);
   install_element (BGP_VPNV4_NODE, &neighbor_send_community_cmd);
   install_element (BGP_VPNV4_NODE, &neighbor_send_community_type_cmd);
   install_element (BGP_VPNV4_NODE, &no_neighbor_send_community_cmd);
@@ -8927,6 +8982,8 @@ bgp_vty_init (void)
   install_element (BGP_IPV4M_NODE, &no_neighbor_route_reflector_client_cmd);
   install_element (BGP_IPV6_NODE, &neighbor_route_reflector_client_cmd);
   install_element (BGP_IPV6_NODE, &no_neighbor_route_reflector_client_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_route_reflector_client_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_route_reflector_client_cmd);
   install_element (BGP_VPNV4_NODE, &neighbor_route_reflector_client_cmd);
   install_element (BGP_VPNV4_NODE, &no_neighbor_route_reflector_client_cmd);
 
@@ -8939,6 +8996,8 @@ bgp_vty_init (void)
   install_element (BGP_IPV4M_NODE, &no_neighbor_route_server_client_cmd);
   install_element (BGP_IPV6_NODE, &neighbor_route_server_client_cmd);
   install_element (BGP_IPV6_NODE, &no_neighbor_route_server_client_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_route_server_client_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_route_server_client_cmd);
   install_element (BGP_VPNV4_NODE, &neighbor_route_server_client_cmd);
   install_element (BGP_VPNV4_NODE, &no_neighbor_route_server_client_cmd);
 
@@ -8963,6 +9022,8 @@ bgp_vty_init (void)
   install_element (BGP_IPV4M_NODE, &no_neighbor_capability_orf_prefix_cmd);
   install_element (BGP_IPV6_NODE, &neighbor_capability_orf_prefix_cmd);
   install_element (BGP_IPV6_NODE, &no_neighbor_capability_orf_prefix_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_capability_orf_prefix_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_capability_orf_prefix_cmd);
 
   /* "neighbor capability dynamic" commands.*/
   install_element (BGP_NODE, &neighbor_capability_dynamic_cmd);
@@ -9010,6 +9071,10 @@ bgp_vty_init (void)
   install_element (BGP_IPV6_NODE, &neighbor_default_originate_rmap_cmd);
   install_element (BGP_IPV6_NODE, &no_neighbor_default_originate_cmd);
   install_element (BGP_IPV6_NODE, &no_neighbor_default_originate_rmap_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_default_originate_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_default_originate_rmap_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_default_originate_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_default_originate_rmap_cmd);
 
   /* "neighbor port" commands. */
   install_element (BGP_NODE, &neighbor_port_cmd);
@@ -9059,6 +9124,8 @@ bgp_vty_init (void)
   install_element (BGP_IPV4M_NODE, &no_neighbor_distribute_list_cmd);
   install_element (BGP_IPV6_NODE, &neighbor_distribute_list_cmd);
   install_element (BGP_IPV6_NODE, &no_neighbor_distribute_list_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_distribute_list_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_distribute_list_cmd);
   install_element (BGP_VPNV4_NODE, &neighbor_distribute_list_cmd);
   install_element (BGP_VPNV4_NODE, &no_neighbor_distribute_list_cmd);
 
@@ -9071,6 +9138,8 @@ bgp_vty_init (void)
   install_element (BGP_IPV4M_NODE, &no_neighbor_prefix_list_cmd);
   install_element (BGP_IPV6_NODE, &neighbor_prefix_list_cmd);
   install_element (BGP_IPV6_NODE, &no_neighbor_prefix_list_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_prefix_list_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_prefix_list_cmd);
   install_element (BGP_VPNV4_NODE, &neighbor_prefix_list_cmd);
   install_element (BGP_VPNV4_NODE, &no_neighbor_prefix_list_cmd);
 
@@ -9083,6 +9152,8 @@ bgp_vty_init (void)
   install_element (BGP_IPV4M_NODE, &no_neighbor_filter_list_cmd);
   install_element (BGP_IPV6_NODE, &neighbor_filter_list_cmd);
   install_element (BGP_IPV6_NODE, &no_neighbor_filter_list_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_filter_list_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_filter_list_cmd);
   install_element (BGP_VPNV4_NODE, &neighbor_filter_list_cmd);
   install_element (BGP_VPNV4_NODE, &no_neighbor_filter_list_cmd);
 
@@ -9095,6 +9166,8 @@ bgp_vty_init (void)
   install_element (BGP_IPV4M_NODE, &no_neighbor_route_map_cmd);
   install_element (BGP_IPV6_NODE, &neighbor_route_map_cmd);
   install_element (BGP_IPV6_NODE, &no_neighbor_route_map_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_route_map_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_route_map_cmd);
   install_element (BGP_VPNV4_NODE, &neighbor_route_map_cmd);
   install_element (BGP_VPNV4_NODE, &no_neighbor_route_map_cmd);
 
@@ -9107,6 +9180,8 @@ bgp_vty_init (void)
   install_element (BGP_IPV4M_NODE, &no_neighbor_unsuppress_map_cmd);
   install_element (BGP_IPV6_NODE, &neighbor_unsuppress_map_cmd);
   install_element (BGP_IPV6_NODE, &no_neighbor_unsuppress_map_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_unsuppress_map_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_unsuppress_map_cmd);
   install_element (BGP_VPNV4_NODE, &neighbor_unsuppress_map_cmd);
   install_element (BGP_VPNV4_NODE, &no_neighbor_unsuppress_map_cmd);  
 
@@ -9163,6 +9238,19 @@ bgp_vty_init (void)
   install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd);
   install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_restart_cmd);
   install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_maximum_prefix_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_maximum_prefix_threshold_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_maximum_prefix_warning_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_maximum_prefix_threshold_warning_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_maximum_prefix_restart_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_maximum_prefix_threshold_restart_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_val_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_threshold_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_warning_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_restart_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd);
   install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_cmd);
   install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_threshold_cmd);
   install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_warning_cmd);
@@ -9190,6 +9278,9 @@ bgp_vty_init (void)
   install_element (BGP_IPV6_NODE, &neighbor_allowas_in_cmd);
   install_element (BGP_IPV6_NODE, &neighbor_allowas_in_arg_cmd);
   install_element (BGP_IPV6_NODE, &no_neighbor_allowas_in_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_allowas_in_cmd);
+  install_element (BGP_IPV6M_NODE, &neighbor_allowas_in_arg_cmd);
+  install_element (BGP_IPV6M_NODE, &no_neighbor_allowas_in_cmd);
   install_element (BGP_VPNV4_NODE, &neighbor_allowas_in_cmd);
   install_element (BGP_VPNV4_NODE, &neighbor_allowas_in_arg_cmd);
   install_element (BGP_VPNV4_NODE, &no_neighbor_allowas_in_cmd);
@@ -9199,7 +9290,7 @@ bgp_vty_init (void)
   install_element (BGP_NODE, &address_family_ipv4_safi_cmd);
 #ifdef HAVE_IPV6
   install_element (BGP_NODE, &address_family_ipv6_cmd);
-  install_element (BGP_NODE, &address_family_ipv6_unicast_cmd);
+  install_element (BGP_NODE, &address_family_ipv6_safi_cmd);
 #endif /* HAVE_IPV6 */
   install_element (BGP_NODE, &address_family_vpnv4_cmd);
   install_element (BGP_NODE, &address_family_vpnv4_unicast_cmd);
@@ -9208,6 +9299,7 @@ bgp_vty_init (void)
   install_element (BGP_IPV4_NODE, &exit_address_family_cmd);
   install_element (BGP_IPV4M_NODE, &exit_address_family_cmd);
   install_element (BGP_IPV6_NODE, &exit_address_family_cmd);
+  install_element (BGP_IPV6M_NODE, &exit_address_family_cmd);
   install_element (BGP_VPNV4_NODE, &exit_address_family_cmd);
 
   /* "clear ip bgp commands" */
Index: lib/command.c
===================================================================
RCS file: /var/cvsroot/quagga/lib/command.c,v
retrieving revision 1.48
diff -u -p -w -b -r1.48 command.c
--- lib/command.c	6 May 2005 21:25:49 -0000	1.48
+++ lib/command.c	19 Aug 2005 23:23:34 -0000
@@ -1966,6 +1966,7 @@ node_parent ( enum node_type node )
     case BGP_IPV4_NODE:
     case BGP_IPV4M_NODE:
     case BGP_IPV6_NODE:
+    case BGP_IPV6M_NODE:
       ret = BGP_NODE;
       break;
     case KEYCHAIN_KEY_NODE:
@@ -2391,6 +2392,7 @@ DEFUN (config_exit,
     case BGP_IPV4_NODE:
     case BGP_IPV4M_NODE:
     case BGP_IPV6_NODE:
+    case BGP_IPV6M_NODE:
       vty->node = BGP_NODE;
       break;
     case KEYCHAIN_KEY_NODE:
@@ -2430,6 +2432,7 @@ DEFUN (config_end,
     case BGP_IPV4_NODE:
     case BGP_IPV4M_NODE:
     case BGP_IPV6_NODE:
+    case BGP_IPV6M_NODE:
     case RMAP_NODE:
     case OSPF_NODE:
     case OSPF6_NODE:
Index: lib/command.h
===================================================================
RCS file: /var/cvsroot/quagga/lib/command.h,v
retrieving revision 1.19
diff -u -p -w -b -r1.19 command.h
--- lib/command.h	6 May 2005 21:25:49 -0000	1.19
+++ lib/command.h	19 Aug 2005 23:23:34 -0000
@@ -81,6 +81,7 @@ enum node_type 
   BGP_IPV4_NODE,		/* BGP IPv4 unicast address family.  */
   BGP_IPV4M_NODE,		/* BGP IPv4 multicast address family.  */
   BGP_IPV6_NODE,		/* BGP IPv6 address family */
+  BGP_IPV6M_NODE,		/* BGP IPv6 multicast address family. */
   OSPF_NODE,			/* OSPF protocol mode */
   OSPF6_NODE,			/* OSPF protocol for IPv6 mode */
   ISIS_NODE,			/* ISIS protocol mode */
Index: lib/vty.c
===================================================================
RCS file: /var/cvsroot/quagga/lib/vty.c,v
retrieving revision 1.44
diff -u -p -w -b -r1.44 vty.c
--- lib/vty.c	28 Apr 2005 01:31:13 -0000	1.44
+++ lib/vty.c	19 Aug 2005 23:23:52 -0000
@@ -685,6 +685,7 @@ vty_end_config (struct vty *vty)
     case BGP_IPV4_NODE:
     case BGP_IPV4M_NODE:
     case BGP_IPV6_NODE:
+    case BGP_IPV6M_NODE:
     case RMAP_NODE:
     case OSPF_NODE:
     case OSPF6_NODE:
Index: vtysh/vtysh.c
===================================================================
RCS file: /var/cvsroot/quagga/vtysh/vtysh.c,v
retrieving revision 1.43
diff -u -p -w -b -r1.43 vtysh.c
--- vtysh/vtysh.c	14 Mar 2005 20:19:02 -0000	1.43
+++ vtysh/vtysh.c	19 Aug 2005 23:25:02 -0000
@@ -310,7 +310,8 @@ vtysh_execute_func (const char *line, in
   if (ret == CMD_SUCCESS || ret == CMD_SUCCESS_DAEMON || ret == CMD_WARNING)
     {
       if ((saved_node == BGP_VPNV4_NODE || saved_node == BGP_IPV4_NODE
-	   || saved_node == BGP_IPV6_NODE || saved_node == BGP_IPV4M_NODE)
+	   || saved_node == BGP_IPV6_NODE || saved_node == BGP_IPV4M_NODE
+	   || saved_node == BGP_IPV6M_NODE)
 	  && (tried == 1))
 	{
 	  vtysh_execute("exit-address-family");
@@ -769,6 +770,12 @@ struct cmd_node bgp_ipv6_node =
   "%s(config-router-af)# "
 };
 
+struct cmd_node bgp_ipv6m_node =
+{
+  BGP_IPV6M_NODE,
+  "%s(config-router-af)# "
+};
+
 struct cmd_node ospf_node =
 {
   OSPF_NODE,
@@ -910,6 +917,18 @@ DEFUNSH (VTYSH_BGPD,
   return CMD_SUCCESS;
 }
 
+DEFUNSH (VTYSH_BGPD,
+	 address_family_ipv6_multicast,
+	 address_family_ipv6_multicast_cmd,
+	 "address-family ipv6 multicast",
+	 "Enter Address Family command mode\n"
+	 "Address family\n"
+	 "Address Family Modifier\n")
+{
+  vty->node = BGP_IPV6M_NODE;
+  return CMD_SUCCESS;
+}
+
 DEFUNSH (VTYSH_RIPD,
 	 key_chain,
 	 key_chain_cmd,
@@ -1078,6 +1097,7 @@ vtysh_exit (struct vty *vty)
     case BGP_IPV4_NODE:
     case BGP_IPV4M_NODE:
     case BGP_IPV6_NODE:
+    case BGP_IPV6M_NODE:
       vty->node = BGP_NODE;
       break;
     case KEYCHAIN_KEY_NODE:
@@ -1112,7 +1132,8 @@ DEFUNSH (VTYSH_BGPD,
   if (vty->node == BGP_IPV4_NODE
       || vty->node == BGP_IPV4M_NODE
       || vty->node == BGP_VPNV4_NODE
-      || vty->node == BGP_IPV6_NODE)
+      || vty->node == BGP_IPV6_NODE
+      || vty->node == BGP_IPV6M_NODE)
     vty->node = BGP_NODE;
   return CMD_SUCCESS;
 }
@@ -2129,6 +2150,7 @@ vtysh_init_vty (void)
   install_node (&bgp_ipv4m_node, NULL);
 /* #ifdef HAVE_IPV6 */
   install_node (&bgp_ipv6_node, NULL);
+  install_node (&bgp_ipv6m_node, NULL);
 /* #endif */
   install_node (&ospf_node, NULL);
 /* #ifdef HAVE_IPV6 */
@@ -2152,6 +2174,7 @@ vtysh_init_vty (void)
   vtysh_install_default (BGP_IPV4_NODE);
   vtysh_install_default (BGP_IPV4M_NODE);
   vtysh_install_default (BGP_IPV6_NODE);
+  vtysh_install_default (BGP_IPV6M_NODE);
   vtysh_install_default (OSPF_NODE);
   vtysh_install_default (RIPNG_NODE);
   vtysh_install_default (OSPF6_NODE);
@@ -2189,6 +2212,8 @@ vtysh_init_vty (void)
   install_element (BGP_IPV4M_NODE, &vtysh_quit_bgpd_cmd);
   install_element (BGP_IPV6_NODE, &vtysh_exit_bgpd_cmd);
   install_element (BGP_IPV6_NODE, &vtysh_quit_bgpd_cmd);
+  install_element (BGP_IPV6M_NODE, &vtysh_exit_bgpd_cmd);
+  install_element (BGP_IPV6M_NODE, &vtysh_quit_bgpd_cmd);
   install_element (ISIS_NODE, &vtysh_exit_isisd_cmd);
   install_element (ISIS_NODE, &vtysh_quit_isisd_cmd);
   install_element (KEYCHAIN_NODE, &vtysh_exit_ripd_cmd);
@@ -2212,6 +2237,7 @@ vtysh_init_vty (void)
   install_element (BGP_IPV4M_NODE, &vtysh_end_all_cmd);
   install_element (BGP_VPNV4_NODE, &vtysh_end_all_cmd);
   install_element (BGP_IPV6_NODE, &vtysh_end_all_cmd);
+  install_element (BGP_IPV6M_NODE, &vtysh_end_all_cmd);
   install_element (ISIS_NODE, &vtysh_end_all_cmd);
   install_element (KEYCHAIN_NODE, &vtysh_end_all_cmd);
   install_element (KEYCHAIN_KEY_NODE, &vtysh_end_all_cmd);
@@ -2245,6 +2271,7 @@ vtysh_init_vty (void)
   install_element (BGP_IPV4_NODE, &exit_address_family_cmd);
   install_element (BGP_IPV4M_NODE, &exit_address_family_cmd);
   install_element (BGP_IPV6_NODE, &exit_address_family_cmd);
+  install_element (BGP_IPV6M_NODE, &exit_address_family_cmd);
   install_element (CONFIG_NODE, &key_chain_cmd);
   install_element (CONFIG_NODE, &route_map_cmd);
   install_element (CONFIG_NODE, &vtysh_line_vty_cmd);


More information about the Quagga-dev mailing list