#include "buffer.h"
#include "log.h"
#include "routemap.h"
+#include "libfrr.h"
DEFINE_MTYPE_STATIC(LIB, ACCESS_LIST, "Access List")
DEFINE_MTYPE_STATIC(LIB, ACCESS_LIST_STR, "Access List Str")
return 0;
/* Print the name of the protocol */
- vty_out(vty, "%s:%s", zlog_protoname(), VTY_NEWLINE);
+ vty_out(vty, "%s:%s", frr_protoname, VTY_NEWLINE);
for (access = master->num.head; access; access = access->next)
{
const char frr_vtydir[] = DAEMON_VTY_DIR;
const char frr_moduledir[] = MODULE_PATH;
+char frr_protoname[] = "NONE";
+char frr_protonameinst[] = "NONE";
+
char config_default[256];
static char pidfile_default[256];
static char vtypath_default[256];
frr_sysconfdir, di->name);
snprintf(pidfile_default, sizeof(pidfile_default), "%s/%s.pid",
frr_vtydir, di->name);
+
+ strlcpy(frr_protoname, di->logname, sizeof(frr_protoname));
+ strlcpy(frr_protonameinst, di->logname, sizeof(frr_protonameinst));
}
void frr_opt_add(const char *optstr, const struct option *longopts,
srandom(time(NULL));
+ if (di->instance)
+ snprintf(frr_protonameinst, sizeof(frr_protonameinst),
+ "%s[%u]", di->logname, di->instance);
+
openzlog (di->progname, di->logname, di->instance,
LOG_CONS|LOG_NDELAY|LOG_PID, LOG_DAEMON);
#if defined(HAVE_CUMULUS)
extern const char frr_vtydir[];
extern const char frr_moduledir[];
+extern char frr_protoname[];
+extern char frr_protonameinst[];
+
#endif /* _ZEBRA_FRR_H */
zlog_default = NULL;
}
-const char *
-zlog_protoname (void)
-{
- return zlog_default ? zlog_default->protoname : "NONE";
-}
-
/* Called from command.c. */
void
zlog_set_level (zlog_dest_t dest, int log_level)
/* Close zlog function. */
extern void closezlog (void);
-extern const char *zlog_protoname (void);
-
/* GCC have printf type attribute check. */
#ifdef __GNUC__
#define PRINTF_ATTRIBUTE(a,b) __attribute__ ((__format__ (__printf__, a, b)))
#include "log.h"
#include "routemap.h"
#include "lib/json.h"
+#include "libfrr.h"
#include "plist_int.h"
struct prefix_list_entry *pentry;
/* Print the name of the protocol */
- vty_out(vty, "%s: ", zlog_protoname());
+ vty_out(vty, "%s: ", frr_protoname);
if (dtype == normal_display)
{
#include "routemap.h"
#include "command.h"
#include "log.h"
-#include "log_int.h"
#include "hash.h"
+#include "libfrr.h"
DEFINE_MTYPE_STATIC(LIB, ROUTE_MAP, "Route map")
DEFINE_MTYPE( LIB, ROUTE_MAP_NAME, "Route map name")
struct route_map_index *index;
struct route_map_rule *rule;
- /* Print the name of the protocol */
- if (zlog_default)
- {
- vty_out (vty, "%s", zlog_protoname());
- if (zlog_default->instance)
- vty_out (vty, " %d", zlog_default->instance);
- }
- vty_out (vty, ":%s", VTY_NEWLINE);
+ vty_out (vty, "%s:%s", frr_protonameinst, VTY_NEWLINE);
for (index = map->head; index; index = index->next)
{
}
else
{
- vty_out (vty, "%s", zlog_protoname());
- if (zlog_default && zlog_default->instance)
- vty_out (vty, " %d", zlog_default->instance);
- vty_out (vty, ": 'route-map %s' not found%s", name, VTY_NEWLINE);
+ vty_out (vty, "%s: 'route-map %s' not found%s", frr_protonameinst,
+ name, VTY_NEWLINE);
return CMD_SUCCESS;
}
}
#include "vty.h"
#include "privs.h"
#include "network.h"
+#include "libfrr.h"
#include <arpa/telnet.h>
#include <termios.h>
ret = cmd_execute_command (vline, vty, NULL, 0);
/* Get the name of the protocol if any */
- protocolname = zlog_protoname();
+ protocolname = frr_protoname;
#ifdef CONSUMED_TIME_CHECK
GETRUSAGE(&after);