Merge remote-tracking branch 'cmaster-next' into cmaster-next-releng

This commit is contained in:
David Lamparter 2016-11-19 11:58:52 +01:00
commit 6a49d0cc12
9 changed files with 169 additions and 22 deletions

View File

@ -12387,8 +12387,9 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
if (use_json) if (use_json)
{ {
json_object_int_add(json_hold, "connectionsEstablished", p->established); json_object_object_add(json_neigh, "addressFamilyInfo", json_hold);
json_object_int_add(json_hold, "connectionsDropped", p->dropped); json_object_int_add(json_neigh, "connectionsEstablished", p->established);
json_object_int_add(json_neigh, "connectionsDropped", p->dropped);
} }
else else
vty_out (vty, " Connections established %d; dropped %d%s", p->established, p->dropped, vty_out (vty, " Connections established %d; dropped %d%s", p->established, p->dropped,
@ -12397,7 +12398,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
if (! p->last_reset) if (! p->last_reset)
{ {
if (use_json) if (use_json)
json_object_string_add(json_hold, "lastReset", "never"); json_object_string_add(json_neigh, "lastReset", "never");
else else
vty_out (vty, " Last reset never%s", VTY_NEWLINE); vty_out (vty, " Last reset never%s", VTY_NEWLINE);
} }
@ -12411,13 +12412,13 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
uptime = bgp_clock(); uptime = bgp_clock();
uptime -= p->resettime; uptime -= p->resettime;
tm = gmtime(&uptime); tm = gmtime(&uptime);
json_object_int_add(json_hold, "lastResetTimerMsecs", (tm->tm_sec * 1000) + (tm->tm_min * 60000) + (tm->tm_hour * 3600000)); json_object_int_add(json_neigh, "lastResetTimerMsecs", (tm->tm_sec * 1000) + (tm->tm_min * 60000) + (tm->tm_hour * 3600000));
json_object_string_add(json_hold, "lastResetDueTo", peer_down_str[(int) p->last_reset]); json_object_string_add(json_neigh, "lastResetDueTo", peer_down_str[(int) p->last_reset]);
if (p->last_reset_cause_size) if (p->last_reset_cause_size)
{ {
char errorcodesubcode_hexstr[5]; char errorcodesubcode_hexstr[5];
sprintf(errorcodesubcode_hexstr, "%02X%02X", p->notify.code, p->notify.subcode); sprintf(errorcodesubcode_hexstr, "%02X%02X", p->notify.code, p->notify.subcode);
json_object_string_add(json_hold, "lastErrorCodeSubcode", errorcodesubcode_hexstr); json_object_string_add(json_neigh, "lastErrorCodeSubcode", errorcodesubcode_hexstr);
} }
} }
else else
@ -12468,7 +12469,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
if (CHECK_FLAG (p->sflags, PEER_STATUS_PREFIX_OVERFLOW)) if (CHECK_FLAG (p->sflags, PEER_STATUS_PREFIX_OVERFLOW))
{ {
if (use_json) if (use_json)
json_object_boolean_true_add(json_hold, "prefixesConfigExceedMax"); json_object_boolean_true_add(json_neigh, "prefixesConfigExceedMax");
else else
vty_out (vty, " Peer had exceeded the max. no. of prefixes configured.%s", VTY_NEWLINE); vty_out (vty, " Peer had exceeded the max. no. of prefixes configured.%s", VTY_NEWLINE);
@ -12476,8 +12477,8 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
{ {
if (use_json) if (use_json)
{ {
json_object_boolean_true_add(json_hold, "reducePrefixNumFrom"); json_object_boolean_true_add(json_neigh, "reducePrefixNumFrom");
json_object_int_add(json_hold, "restartInTimerMsec", thread_timer_remain_second (p->t_pmax_restart) * 1000); json_object_int_add(json_neigh, "restartInTimerMsec", thread_timer_remain_second (p->t_pmax_restart) * 1000);
} }
else else
vty_out (vty, " Reduce the no. of prefix from %s, will restart in %ld seconds%s", vty_out (vty, " Reduce the no. of prefix from %s, will restart in %ld seconds%s",
@ -12487,16 +12488,13 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
else else
{ {
if (use_json) if (use_json)
json_object_boolean_true_add(json_hold, "reducePrefixNumAndClearIpBgp"); json_object_boolean_true_add(json_neigh, "reducePrefixNumAndClearIpBgp");
else else
vty_out (vty, " Reduce the no. of prefix and clear ip bgp %s to restore peering%s", vty_out (vty, " Reduce the no. of prefix and clear ip bgp %s to restore peering%s",
p->host, VTY_NEWLINE); p->host, VTY_NEWLINE);
} }
} }
if (use_json)
json_object_object_add(json_neigh, "addressFamilyInfo", json_hold);
/* EBGP Multihop and GTSM */ /* EBGP Multihop and GTSM */
if (p->sort != BGP_PEER_IBGP) if (p->sort != BGP_PEER_IBGP)
{ {

View File

@ -1,3 +1,23 @@
/* Bitfields
* Copyright (C) 2016 Cumulus Networks, Inc.
*
* This file is part of Quagga.
*
* Quagga is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2, or (at your option) any
* later version.
*
* Quagga is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Quagga; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
/** /**
* A simple bit array implementation to allocate and free IDs. An example * A simple bit array implementation to allocate and free IDs. An example
* of its usage is in allocating link state IDs for OSPFv3 as OSPFv3 has * of its usage is in allocating link state IDs for OSPFv3 as OSPFv3 has

View File

@ -1,3 +1,23 @@
/* CSV
* Copyright (C) 2013 Cumulus Networks, Inc.
*
* This file is part of Quagga.
*
* Quagga is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2, or (at your option) any
* later version.
*
* Quagga is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Quagga; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@ -1,4 +1,23 @@
/* Copyright 2013 Cumulus Networks, LLC. All rights reserved. */ /* CSV
* Copyright (C) 2013 Cumulus Networks, Inc.
*
* This file is part of Quagga.
*
* Quagga is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2, or (at your option) any
* later version.
*
* Quagga is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Quagga; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef __CSV_H__ #ifndef __CSV_H__
#define __CSV_H__ #define __CSV_H__

View File

@ -1,10 +1,23 @@
/********************************************************************* /* PTM Library
* Copyright 2015 Cumulus Networks, LLC. All rights reserved. * Copyright (C) 2015 Cumulus Networks, Inc.
* *
* library file used by clients for sending commands and parsing response * This file is part of Quagga.
* *
* Quagga is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2, or (at your option) any
* later version.
*
* Quagga is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Quagga; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdbool.h> #include <stdbool.h>

View File

@ -1,9 +1,25 @@
/********************************************************************* /* PTM Library
* Copyright 2015 Cumulus Networks, LLC. All rights reserved. * Copyright (C) 2015 Cumulus Networks, Inc.
* *
* library file used by clients for sending commands and parsing response * This file is part of Quagga.
* *
* Quagga is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2, or (at your option) any
* later version.
*
* Quagga is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Quagga; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/ */
#ifndef __PTM_LIB_H__
#define __PTM_LIB_H__
#define PTMLIB_MSG_SZ 1024 #define PTMLIB_MSG_SZ 1024
#define PTMLIB_MSG_HDR_LEN 37 #define PTMLIB_MSG_HDR_LEN 37
@ -47,3 +63,5 @@ int ptm_lib_find_key_in_msg(void *, const char *, char *);
int ptm_lib_init_msg(ptm_lib_handle_t *, int, int, void *, void **); int ptm_lib_init_msg(ptm_lib_handle_t *, int, int, void *, void **);
int ptm_lib_append_msg(ptm_lib_handle_t *, void *, const char *, const char *); int ptm_lib_append_msg(ptm_lib_handle_t *, void *, const char *, const char *);
int ptm_lib_complete_msg(ptm_lib_handle_t *, void *, char *, int *); int ptm_lib_complete_msg(ptm_lib_handle_t *, void *, char *, int *);
#endif

View File

@ -1,4 +1,24 @@
#!/usr/bin/python3 #!/usr/bin/python3
# Command Checker
# Copyright (C) 2016 Cumulus Networks, Inc.
#
# This file is part of Quagga.
#
# Quagga is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (at your option) any
# later version.
#
# Quagga is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Quagga; see the file COPYING. If not, write to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
# Parses a source file, ensuring that CLI definitions (DEFUNs, ALIASs, etc) # Parses a source file, ensuring that CLI definitions (DEFUNs, ALIASs, etc)
# have install_command called on them at some point. # have install_command called on them at some point.

View File

@ -1,5 +1,24 @@
#!/usr/bin/python #!/usr/bin/python
# Quagga Reloader
# Copyright (C) 2014 Cumulus Networks, Inc.
#
# This file is part of Quagga.
#
# Quagga is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (at your option) any
# later version.
#
# Quagga is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Quagga; see the file COPYING. If not, write to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
""" """
This program This program
- reads a quagga configuration text file - reads a quagga configuration text file

View File

@ -1,3 +1,23 @@
/* Zebra next hop tracking code
* Copyright (C) 2013 Cumulus Networks, Inc.
*
* This file is part of Quagga.
*
* Quagga is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2, or (at your option) any
* later version.
*
* Quagga is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Quagga; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#include <zebra.h> #include <zebra.h>
#include "zebra/rib.h" #include "zebra/rib.h"
#include "zebra/zserv.h" #include "zebra/zserv.h"