Merge pull request #6615 from opensourcerouting/build-assorted-20200619

build: assorted fixes (protobuf, frr-format)
This commit is contained in:
Donald Sharp 2020-06-19 06:18:20 -04:00 committed by GitHub
commit 8dc1d92588
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 50 additions and 46 deletions

View File

@ -20,15 +20,16 @@
* 02110-1301 USA. * 02110-1301 USA.
*/ */
#include "zebra.h"
#include "northbound.h" #include "northbound.h"
#include "prefix.h" #include "prefix.h"
#include "zebra.h"
#include "lib/command.h" #include "lib/command.h"
#include "lib/filter.h" #include "lib/filter.h"
#include "lib/northbound_cli.h" #include "lib/northbound_cli.h"
#include "lib/plist.h" #include "lib/plist.h"
#include "lib/plist_int.h" #include "lib/plist_int.h"
#include "lib/printfrr.h"
#ifndef VTYSH_EXTRACT_PL #ifndef VTYSH_EXTRACT_PL
#include "lib/filter_cli_clippy.c" #include "lib/filter_cli_clippy.c"
@ -197,10 +198,10 @@ DEFPY(
if (seq_str == NULL) { if (seq_str == NULL) {
/* Use XPath to find the next sequence number. */ /* Use XPath to find the next sequence number. */
sseq = acl_get_seq(vty, xpath); sseq = acl_get_seq(vty, xpath);
snprintf(xpath_entry, sizeof(xpath_entry), snprintfrr(xpath_entry, sizeof(xpath_entry),
"%s/entry[sequence='%" PRId64 "']", xpath, sseq); "%s/entry[sequence='%" PRId64 "']", xpath, sseq);
} else } else
snprintf(xpath_entry, sizeof(xpath_entry), snprintfrr(xpath_entry, sizeof(xpath_entry),
"%s/entry[sequence='%s']", xpath, seq_str); "%s/entry[sequence='%s']", xpath, seq_str);
nb_cli_enqueue_change(vty, xpath_entry, NB_OP_CREATE, NULL); nb_cli_enqueue_change(vty, xpath_entry, NB_OP_CREATE, NULL);
@ -270,7 +271,7 @@ DEFPY(
if (sseq == -1) if (sseq == -1)
return CMD_WARNING; return CMD_WARNING;
snprintf(xpath_entry, sizeof(xpath_entry), snprintfrr(xpath_entry, sizeof(xpath_entry),
"%s/entry[sequence='%" PRId64 "']", xpath, sseq); "%s/entry[sequence='%" PRId64 "']", xpath, sseq);
nb_cli_enqueue_change(vty, xpath_entry, NB_OP_DESTROY, NULL); nb_cli_enqueue_change(vty, xpath_entry, NB_OP_DESTROY, NULL);
@ -312,10 +313,10 @@ DEFPY(
if (seq_str == NULL) { if (seq_str == NULL) {
/* Use XPath to find the next sequence number. */ /* Use XPath to find the next sequence number. */
sseq = acl_get_seq(vty, xpath); sseq = acl_get_seq(vty, xpath);
snprintf(xpath_entry, sizeof(xpath_entry), snprintfrr(xpath_entry, sizeof(xpath_entry),
"%s/entry[sequence='%" PRId64 "']", xpath, sseq); "%s/entry[sequence='%" PRId64 "']", xpath, sseq);
} else } else
snprintf(xpath_entry, sizeof(xpath_entry), snprintfrr(xpath_entry, sizeof(xpath_entry),
"%s/entry[sequence='%s']", xpath, seq_str); "%s/entry[sequence='%s']", xpath, seq_str);
nb_cli_enqueue_change(vty, xpath_entry, NB_OP_CREATE, NULL); nb_cli_enqueue_change(vty, xpath_entry, NB_OP_CREATE, NULL);
@ -376,7 +377,7 @@ DEFPY(
/* If the user provided sequence number, then just go for it. */ /* If the user provided sequence number, then just go for it. */
if (seq_str != NULL) { if (seq_str != NULL) {
snprintf( snprintfrr(
xpath, sizeof(xpath), xpath, sizeof(xpath),
"/frr-filter:lib/access-list-legacy[number='%s']/entry[sequence='%s']", "/frr-filter:lib/access-list-legacy[number='%s']/entry[sequence='%s']",
number_str, seq_str); number_str, seq_str);
@ -421,7 +422,7 @@ DEFPY(
if (sseq == -1) if (sseq == -1)
return CMD_WARNING; return CMD_WARNING;
snprintf(xpath_entry, sizeof(xpath_entry), snprintfrr(xpath_entry, sizeof(xpath_entry),
"%s/entry[sequence='%" PRId64 "']", xpath, sseq); "%s/entry[sequence='%" PRId64 "']", xpath, sseq);
nb_cli_enqueue_change(vty, xpath_entry, NB_OP_DESTROY, NULL); nb_cli_enqueue_change(vty, xpath_entry, NB_OP_DESTROY, NULL);
@ -577,10 +578,10 @@ DEFPY(
if (seq_str == NULL) { if (seq_str == NULL) {
/* Use XPath to find the next sequence number. */ /* Use XPath to find the next sequence number. */
sseq = acl_get_seq(vty, xpath); sseq = acl_get_seq(vty, xpath);
snprintf(xpath_entry, sizeof(xpath_entry), snprintfrr(xpath_entry, sizeof(xpath_entry),
"%s/entry[sequence='%" PRId64 "']", xpath, sseq); "%s/entry[sequence='%" PRId64 "']", xpath, sseq);
} else } else
snprintf(xpath_entry, sizeof(xpath_entry), snprintfrr(xpath_entry, sizeof(xpath_entry),
"%s/entry[sequence='%s']", xpath, seq_str); "%s/entry[sequence='%s']", xpath, seq_str);
nb_cli_enqueue_change(vty, xpath_entry, NB_OP_CREATE, NULL); nb_cli_enqueue_change(vty, xpath_entry, NB_OP_CREATE, NULL);
@ -648,7 +649,7 @@ DEFPY(
if (sseq == -1) if (sseq == -1)
return CMD_WARNING; return CMD_WARNING;
snprintf(xpath_entry, sizeof(xpath_entry), snprintfrr(xpath_entry, sizeof(xpath_entry),
"%s/entry[sequence='%" PRId64 "']", xpath, sseq); "%s/entry[sequence='%" PRId64 "']", xpath, sseq);
nb_cli_enqueue_change(vty, xpath_entry, NB_OP_DESTROY, NULL); nb_cli_enqueue_change(vty, xpath_entry, NB_OP_DESTROY, NULL);
@ -748,10 +749,10 @@ DEFPY(
if (seq_str == NULL) { if (seq_str == NULL) {
/* Use XPath to find the next sequence number. */ /* Use XPath to find the next sequence number. */
sseq = acl_get_seq(vty, xpath); sseq = acl_get_seq(vty, xpath);
snprintf(xpath_entry, sizeof(xpath_entry), snprintfrr(xpath_entry, sizeof(xpath_entry),
"%s/entry[sequence='%" PRId64 "']", xpath, sseq); "%s/entry[sequence='%" PRId64 "']", xpath, sseq);
} else } else
snprintf(xpath_entry, sizeof(xpath_entry), snprintfrr(xpath_entry, sizeof(xpath_entry),
"%s/entry[sequence='%s']", xpath, seq_str); "%s/entry[sequence='%s']", xpath, seq_str);
nb_cli_enqueue_change(vty, xpath_entry, NB_OP_CREATE, NULL); nb_cli_enqueue_change(vty, xpath_entry, NB_OP_CREATE, NULL);
@ -820,7 +821,7 @@ DEFPY(
if (sseq == -1) if (sseq == -1)
return CMD_WARNING; return CMD_WARNING;
snprintf(xpath_entry, sizeof(xpath_entry), snprintfrr(xpath_entry, sizeof(xpath_entry),
"%s/entry[sequence='%" PRId64 "']", xpath, sseq); "%s/entry[sequence='%" PRId64 "']", xpath, sseq);
nb_cli_enqueue_change(vty, xpath_entry, NB_OP_DESTROY, NULL); nb_cli_enqueue_change(vty, xpath_entry, NB_OP_DESTROY, NULL);
@ -923,10 +924,10 @@ DEFPY(
if (seq_str == NULL) { if (seq_str == NULL) {
/* Use XPath to find the next sequence number. */ /* Use XPath to find the next sequence number. */
sseq = acl_get_seq(vty, xpath); sseq = acl_get_seq(vty, xpath);
snprintf(xpath_entry, sizeof(xpath_entry), snprintfrr(xpath_entry, sizeof(xpath_entry),
"%s/entry[sequence='%" PRId64 "']", xpath, sseq); "%s/entry[sequence='%" PRId64 "']", xpath, sseq);
} else } else
snprintf(xpath_entry, sizeof(xpath_entry), snprintfrr(xpath_entry, sizeof(xpath_entry),
"%s/entry[sequence='%s']", xpath, seq_str); "%s/entry[sequence='%s']", xpath, seq_str);
nb_cli_enqueue_change(vty, xpath_entry, NB_OP_CREATE, NULL); nb_cli_enqueue_change(vty, xpath_entry, NB_OP_CREATE, NULL);
@ -991,7 +992,7 @@ DEFPY(
if (sseq == -1) if (sseq == -1)
return CMD_WARNING; return CMD_WARNING;
snprintf(xpath_entry, sizeof(xpath_entry), snprintfrr(xpath_entry, sizeof(xpath_entry),
"%s/entry[sequence='%" PRId64 "']", xpath, sseq); "%s/entry[sequence='%" PRId64 "']", xpath, sseq);
nb_cli_enqueue_change(vty, xpath_entry, NB_OP_DESTROY, NULL); nb_cli_enqueue_change(vty, xpath_entry, NB_OP_DESTROY, NULL);
@ -1231,7 +1232,7 @@ static int plist_remove(struct vty *vty, const char *iptype, const char *name,
if (pentry == NULL) if (pentry == NULL)
return CMD_WARNING; return CMD_WARNING;
snprintf(xpath_entry, sizeof(xpath_entry), snprintfrr(xpath_entry, sizeof(xpath_entry),
"%s/entry[sequence='%" PRId64 "']", xpath, pentry->seq); "%s/entry[sequence='%" PRId64 "']", xpath, pentry->seq);
nb_cli_enqueue_change(vty, xpath_entry, NB_OP_DESTROY, NULL); nb_cli_enqueue_change(vty, xpath_entry, NB_OP_DESTROY, NULL);
@ -1271,10 +1272,10 @@ DEFPY(
if (seq_str == NULL) { if (seq_str == NULL) {
/* Use XPath to find the next sequence number. */ /* Use XPath to find the next sequence number. */
sseq = acl_get_seq(vty, xpath); sseq = acl_get_seq(vty, xpath);
snprintf(xpath_entry, sizeof(xpath_entry), snprintfrr(xpath_entry, sizeof(xpath_entry),
"%s/entry[sequence='%" PRId64 "']", xpath, sseq); "%s/entry[sequence='%" PRId64 "']", xpath, sseq);
} else } else
snprintf(xpath_entry, sizeof(xpath_entry), snprintfrr(xpath_entry, sizeof(xpath_entry),
"%s/entry[sequence='%s']", xpath, seq_str); "%s/entry[sequence='%s']", xpath, seq_str);
nb_cli_enqueue_change(vty, xpath_entry, NB_OP_CREATE, NULL); nb_cli_enqueue_change(vty, xpath_entry, NB_OP_CREATE, NULL);
@ -1431,10 +1432,10 @@ DEFPY(
if (seq_str == NULL) { if (seq_str == NULL) {
/* Use XPath to find the next sequence number. */ /* Use XPath to find the next sequence number. */
sseq = acl_get_seq(vty, xpath); sseq = acl_get_seq(vty, xpath);
snprintf(xpath_entry, sizeof(xpath_entry), snprintfrr(xpath_entry, sizeof(xpath_entry),
"%s/entry[sequence='%" PRId64 "']", xpath, sseq); "%s/entry[sequence='%" PRId64 "']", xpath, sseq);
} else } else
snprintf(xpath_entry, sizeof(xpath_entry), snprintfrr(xpath_entry, sizeof(xpath_entry),
"%s/entry[sequence='%s']", xpath, seq_str); "%s/entry[sequence='%s']", xpath, seq_str);
nb_cli_enqueue_change(vty, xpath_entry, NB_OP_CREATE, NULL); nb_cli_enqueue_change(vty, xpath_entry, NB_OP_CREATE, NULL);

View File

@ -44,6 +44,7 @@ endif
zebra_zebra_LDADD = lib/libfrr.la $(LIBCAP) zebra_zebra_LDADD = lib/libfrr.la $(LIBCAP)
if HAVE_PROTOBUF3 if HAVE_PROTOBUF3
zebra_zebra_LDADD += mlag/libmlag_pb.la $(PROTOBUF_C_LIBS) zebra_zebra_LDADD += mlag/libmlag_pb.la $(PROTOBUF_C_LIBS)
zebra/zebra_mlag.$(OBJEXT): mlag/mlag.pb-c.h
endif endif
zebra_zebra_SOURCES = \ zebra_zebra_SOURCES = \
zebra/connected.c \ zebra/connected.c \
@ -188,8 +189,10 @@ zebra_zebra_fpm_la_SOURCES += zebra/zebra_fpm_netlink.c
if HAVE_PROTOBUF if HAVE_PROTOBUF
zebra_zebra_fpm_la_LIBADD += fpm/libfrrfpm_pb.la qpb/libfrr_pb.la $(PROTOBUF_C_LIBS) zebra_zebra_fpm_la_LIBADD += fpm/libfrrfpm_pb.la qpb/libfrr_pb.la $(PROTOBUF_C_LIBS)
zebra_zebra_fpm_la_SOURCES += zebra/zebra_fpm_protobuf.c zebra_zebra_fpm_la_SOURCES += zebra/zebra_fpm_protobuf.c
zebra/zebra_fpm_protobuf.lo: fpm/fpm.pb-c.h qpb/qpb.pb-c.h
if DEV_BUILD if DEV_BUILD
zebra_zebra_fpm_la_SOURCES += zebra/zebra_fpm_dt.c zebra_zebra_fpm_la_SOURCES += zebra/zebra_fpm_dt.c
zebra/zebra_fpm_dt.lo: fpm/fpm.pb-c.h qpb/qpb.pb-c.h
endif endif
endif endif

View File

@ -33,6 +33,10 @@
#include "zebra/zapi_msg.h" #include "zebra/zapi_msg.h"
#include "zebra/debug.h" #include "zebra/debug.h"
#ifdef HAVE_PROTOBUF_VERSION_3
#include "mlag/mlag.pb-c.h"
#endif
DEFINE_HOOK(zebra_mlag_private_write_data, DEFINE_HOOK(zebra_mlag_private_write_data,
(uint8_t *data, uint32_t len), (data, len)) (uint8_t *data, uint32_t len), (data, len))
DEFINE_HOOK(zebra_mlag_private_monitor_state, (), ()) DEFINE_HOOK(zebra_mlag_private_monitor_state, (), ())

View File

@ -26,10 +26,6 @@
#include "zclient.h" #include "zclient.h"
#include "zebra/zserv.h" #include "zebra/zserv.h"
#ifdef HAVE_PROTOBUF_VERSION_3
#include "mlag/mlag.pb-c.h"
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif