summaryrefslogtreecommitdiff
path: root/zebra/zserv.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zserv.c')
-rw-r--r--zebra/zserv.c134
1 files changed, 78 insertions, 56 deletions
diff --git a/zebra/zserv.c b/zebra/zserv.c
index 72f7382882..15feb78c08 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -54,6 +54,7 @@
#include "zebra/zebra_mpls.h"
#include "zebra/zebra_mroute.h"
#include "zebra/label_manager.h"
+#include "zebra/zebra_vxlan.h"
/* Event list of zebra. */
enum event { ZEBRA_SERV, ZEBRA_READ, ZEBRA_WRITE };
@@ -989,6 +990,8 @@ zserv_fec_register (struct zserv *client, int sock, u_short length)
label_index = stream_getl(s);
l += 4;
}
+ else
+ label_index = MPLS_INVALID_LABEL_INDEX;
zebra_mpls_fec_register (zvrf, &p, label_index, client);
}
@@ -2432,6 +2435,21 @@ zebra_client_read (struct thread *thread)
case ZEBRA_FEC_UNREGISTER:
zserv_fec_unregister (client, sock, length);
break;
+ case ZEBRA_ADVERTISE_ALL_VNI:
+ zebra_vxlan_advertise_all_vni (client, sock, length, zvrf);
+ break;
+ case ZEBRA_REMOTE_VTEP_ADD:
+ zebra_vxlan_remote_vtep_add (client, sock, length, zvrf);
+ break;
+ case ZEBRA_REMOTE_VTEP_DEL:
+ zebra_vxlan_remote_vtep_del (client, sock, length, zvrf);
+ break;
+ case ZEBRA_REMOTE_MACIP_ADD:
+ zebra_vxlan_remote_macip_add (client, sock, length, zvrf);
+ break;
+ case ZEBRA_REMOTE_MACIP_DEL:
+ zebra_vxlan_remote_macip_del (client, sock, length, zvrf);
+ break;
default:
zlog_info ("Zebra received unknown command %d", command);
break;
@@ -2674,57 +2692,61 @@ zebra_show_client_detail (struct vty *vty, struct zserv *client)
vty_out (vty, "Client: %s", zebra_route_string(client->proto));
if (client->instance)
vty_out (vty, " Instance: %d", client->instance);
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
- vty_outln (vty, "------------------------ ");
- vty_outln (vty, "FD: %d ", client->sock);
- vty_outln (vty, "Route Table ID: %d ", client->rtm_table);
+ vty_out (vty, "------------------------ \n");
+ vty_out (vty, "FD: %d \n", client->sock);
+ vty_out (vty, "Route Table ID: %d \n", client->rtm_table);
- vty_outln (vty, "Connect Time: %s ",
+ vty_out (vty, "Connect Time: %s \n",
zserv_time_buf(&client->connect_time, cbuf, ZEBRA_TIME_BUF));
if (client->nh_reg_time)
{
- vty_outln (vty, "Nexthop Registry Time: %s ",
+ vty_out (vty, "Nexthop Registry Time: %s \n",
zserv_time_buf(&client->nh_reg_time, nhbuf, ZEBRA_TIME_BUF));
if (client->nh_last_upd_time)
- vty_outln (vty, "Nexthop Last Update Time: %s ",
+ vty_out (vty, "Nexthop Last Update Time: %s \n",
zserv_time_buf(&client->nh_last_upd_time, mbuf, ZEBRA_TIME_BUF));
else
- vty_outln (vty, "No Nexthop Update sent");
+ vty_out (vty, "No Nexthop Update sent\n");
}
else
- vty_outln (vty, "Not registered for Nexthop Updates");
+ vty_out (vty, "Not registered for Nexthop Updates\n");
- vty_outln (vty, "Last Msg Rx Time: %s ",
+ vty_out (vty, "Last Msg Rx Time: %s \n",
zserv_time_buf(&client->last_read_time, rbuf, ZEBRA_TIME_BUF));
- vty_outln (vty, "Last Msg Tx Time: %s ",
+ vty_out (vty, "Last Msg Tx Time: %s \n",
zserv_time_buf(&client->last_write_time, wbuf, ZEBRA_TIME_BUF));
if (client->last_read_time)
- vty_outln (vty, "Last Rcvd Cmd: %s ",
+ vty_out (vty, "Last Rcvd Cmd: %s \n",
zserv_command_string(client->last_read_cmd));
if (client->last_write_time)
- vty_outln (vty, "Last Sent Cmd: %s ",
+ vty_out (vty, "Last Sent Cmd: %s \n",
zserv_command_string(client->last_write_cmd));
- vty_out (vty, VTYNL);
+ vty_out (vty, "\n");
- vty_outln (vty, "Type Add Update Del ");
- vty_outln (vty, "================================================== ");
- vty_outln (vty, "IPv4 %-12d%-12d%-12d", client->v4_route_add_cnt,
+ vty_out (vty, "Type Add Update Del \n");
+ vty_out (vty, "================================================== \n");
+ vty_out (vty, "IPv4 %-12d%-12d%-12d\n", client->v4_route_add_cnt,
client->v4_route_upd8_cnt, client->v4_route_del_cnt);
- vty_outln (vty, "IPv6 %-12d%-12d%-12d", client->v6_route_add_cnt,
+ vty_out (vty, "IPv6 %-12d%-12d%-12d\n", client->v6_route_add_cnt,
client->v6_route_upd8_cnt, client->v6_route_del_cnt);
- vty_outln (vty, "Redist:v4 %-12d%-12d%-12d", client->redist_v4_add_cnt, 0,
+ vty_out (vty, "Redist:v4 %-12d%-12d%-12d\n", client->redist_v4_add_cnt, 0,
client->redist_v4_del_cnt);
- vty_outln (vty, "Redist:v6 %-12d%-12d%-12d", client->redist_v6_add_cnt, 0,
+ vty_out (vty, "Redist:v6 %-12d%-12d%-12d\n", client->redist_v6_add_cnt, 0,
client->redist_v6_del_cnt);
- vty_outln (vty, "Connected %-12d%-12d%-12d", client->ifadd_cnt, 0,
+ vty_out (vty, "Connected %-12d%-12d%-12d\n", client->ifadd_cnt, 0,
client->ifdel_cnt);
- vty_outln (vty, "BFD peer %-12d%-12d%-12d", client->bfd_peer_add_cnt,
+ vty_out (vty, "BFD peer %-12d%-12d%-12d\n", client->bfd_peer_add_cnt,
client->bfd_peer_upd8_cnt, client->bfd_peer_del_cnt);
- vty_outln (vty, "Interface Up Notifications: %d",client->ifup_cnt);
- vty_outln (vty, "Interface Down Notifications: %d",client->ifdown_cnt);
-
- vty_out (vty, VTYNL);
+ vty_out (vty, "Interface Up Notifications: %d\n",client->ifup_cnt);
+ vty_out (vty, "Interface Down Notifications: %d\n",client->ifdown_cnt);
+ vty_out (vty, "VNI add notifications: %d\n", client->vniadd_cnt);
+ vty_out (vty, "VNI delete notifications: %d\n", client->vnidel_cnt);
+ vty_out (vty, "MAC-IP add notifications: %d\n", client->macipadd_cnt);
+ vty_out (vty, "MAC-IP delete notifications: %d\n", client->macipdel_cnt);
+
+ vty_out (vty, "\n");
return;
}
@@ -2734,7 +2756,7 @@ zebra_show_client_brief (struct vty *vty, struct zserv *client)
char cbuf[ZEBRA_TIME_BUF], rbuf[ZEBRA_TIME_BUF];
char wbuf[ZEBRA_TIME_BUF];
- vty_outln (vty, "%-8s%12s %12s%12s%8d/%-8d%8d/%-8d",
+ vty_out (vty, "%-8s%12s %12s%12s%8d/%-8d%8d/%-8d\n",
zebra_route_string(client->proto),
zserv_time_buf(&client->connect_time, cbuf, ZEBRA_TIME_BUF),
zserv_time_buf(&client->last_read_time, rbuf, ZEBRA_TIME_BUF),
@@ -2769,7 +2791,7 @@ DEFUN (show_table,
SHOW_STR
"default routing table to use for all clients\n")
{
- vty_outln (vty, "table %d",zebrad.rtm_table_default);
+ vty_out (vty, "table %d\n",zebrad.rtm_table_default);
return CMD_SUCCESS;
}
@@ -2809,8 +2831,8 @@ DEFUN (ip_forwarding,
if (ret == 0)
{
- vty_outln (vty, "Can't turn on IP forwarding");
- return CMD_WARNING;
+ vty_out (vty, "Can't turn on IP forwarding\n");
+ return CMD_WARNING_CONFIG_FAILED;
}
return CMD_SUCCESS;
@@ -2831,8 +2853,8 @@ DEFUN (no_ip_forwarding,
if (ret != 0)
{
- vty_outln (vty, "Can't turn off IP forwarding");
- return CMD_WARNING;
+ vty_out (vty, "Can't turn off IP forwarding\n");
+ return CMD_WARNING_CONFIG_FAILED;
}
return CMD_SUCCESS;
@@ -2846,14 +2868,14 @@ DEFUN (show_zebra,
{
struct vrf *vrf;
- vty_outln (vty,
- " Route Route Neighbor LSP LSP");
- vty_outln (vty,
- "VRF Installs Removals Updates Installs Removals");
+ vty_out (vty,
+ " Route Route Neighbor LSP LSP\n");
+ vty_out (vty,
+ "VRF Installs Removals Updates Installs Removals\n");
RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
{
struct zebra_vrf *zvrf = vrf->info;
- vty_outln (vty,"%-25s %10" PRIu64 " %10" PRIu64 " %10" PRIu64 " %10" PRIu64 " %10" PRIu64 "",
+ vty_out (vty,"%-25s %10" PRIu64 " %10" PRIu64 " %10" PRIu64 " %10" PRIu64 " %10" PRIu64 "\n",
vrf->name, zvrf->installs, zvrf->removals,
zvrf->neigh_updates, zvrf->lsp_installs,zvrf->lsp_removals);
}
@@ -2890,15 +2912,15 @@ DEFUN (show_zebra_client_summary,
struct listnode *node;
struct zserv *client;
- vty_outln (vty,
- "Name Connect Time Last Read Last Write IPv4 Routes IPv6 Routes ");
- vty_outln (vty,
- "--------------------------------------------------------------------------------");
+ vty_out (vty,
+ "Name Connect Time Last Read Last Write IPv4 Routes IPv6 Routes \n");
+ vty_out (vty,
+ "--------------------------------------------------------------------------------\n");
for (ALL_LIST_ELEMENTS_RO (zebrad.client_list, node, client))
zebra_show_client_brief(vty, client);
- vty_outln (vty, "Routes column shows (added+updated)/deleted");
+ vty_out (vty, "Routes column shows (added+updated)/deleted\n");
return CMD_SUCCESS;
}
@@ -2907,7 +2929,7 @@ static int
config_write_table (struct vty *vty)
{
if (zebrad.rtm_table_default)
- vty_outln (vty, "table %d",zebrad.rtm_table_default);
+ vty_out (vty, "table %d\n",zebrad.rtm_table_default);
return 0;
}
@@ -2932,9 +2954,9 @@ DEFUN (show_ip_forwarding,
ret = ipforward ();
if (ret == 0)
- vty_outln (vty, "IP forwarding is off");
+ vty_out (vty, "IP forwarding is off\n");
else
- vty_outln (vty, "IP forwarding is on");
+ vty_out (vty, "IP forwarding is on\n");
return CMD_SUCCESS;
}
@@ -2953,16 +2975,16 @@ DEFUN (show_ipv6_forwarding,
switch (ret)
{
case -1:
- vty_outln (vty, "ipv6 forwarding is unknown");
+ vty_out (vty, "ipv6 forwarding is unknown\n");
break;
case 0:
- vty_outln (vty, "ipv6 forwarding is %s", "off");
+ vty_out (vty, "ipv6 forwarding is %s\n", "off");
break;
case 1:
- vty_outln (vty, "ipv6 forwarding is %s", "on");
+ vty_out (vty, "ipv6 forwarding is %s\n", "on");
break;
default:
- vty_outln (vty, "ipv6 forwarding is %s", "off");
+ vty_out (vty, "ipv6 forwarding is %s\n", "off");
break;
}
return CMD_SUCCESS;
@@ -2982,8 +3004,8 @@ DEFUN (ipv6_forwarding,
if (ret == 0)
{
- vty_outln (vty, "Can't turn on IPv6 forwarding");
- return CMD_WARNING;
+ vty_out (vty, "Can't turn on IPv6 forwarding\n");
+ return CMD_WARNING_CONFIG_FAILED;
}
return CMD_SUCCESS;
@@ -3004,8 +3026,8 @@ DEFUN (no_ipv6_forwarding,
if (ret != 0)
{
- vty_outln (vty, "Can't turn off IPv6 forwarding");
- return CMD_WARNING;
+ vty_out (vty, "Can't turn off IPv6 forwarding\n");
+ return CMD_WARNING_CONFIG_FAILED;
}
return CMD_SUCCESS;
@@ -3019,10 +3041,10 @@ config_write_forwarding (struct vty *vty)
router_id_write (vty);
if (!ipforward ())
- vty_outln (vty, "no ip forwarding");
+ vty_out (vty, "no ip forwarding\n");
if (!ipforward_ipv6 ())
- vty_outln (vty, "no ipv6 forwarding");
- vty_outln (vty, "!");
+ vty_out (vty, "no ipv6 forwarding\n");
+ vty_out (vty, "!\n");
return 0;
}