Small copyright string and hostname related cleanup.

This commit is contained in:
hasso 2004-10-19 20:40:08 +00:00
parent 3fb9cd6ef4
commit 6590f2c3dc
6 changed files with 31 additions and 50 deletions

View File

@ -1,3 +1,11 @@
2004-10-19 Hasso Tepper <hasso at quagga.net>
* version.h.in: Define copyright string QUAGGA_COPYRIGHT.
* print_version.c: Remove. print_version () function moved to
command.[c|h].
* command.c: Use QUAGGA_COPYRIGHT.
* Makefile.am: Remove useless version.c and print_version.c files.
2004-10-19 Andrew J. Schorr <aschorr@telemetry-investments.com> 2004-10-19 Andrew J. Schorr <aschorr@telemetry-investments.com>
* zclient.c: (zebra_interface_address_read) If the destination address * zclient.c: (zebra_interface_address_read) If the destination address

View File

@ -7,8 +7,8 @@ lib_LTLIBRARIES = libzebra.la
libzebra_la_LDFLAGS = -version 0:0:0 libzebra_la_LDFLAGS = -version 0:0:0
libzebra_la_SOURCES = \ libzebra_la_SOURCES = \
version.c network.c pid_output.c getopt.c getopt1.c daemon.c \ network.c pid_output.c getopt.c getopt1.c daemon.c \
print_version.c checksum.c vector.c linklist.c vty.c command.c \ checksum.c vector.c linklist.c vty.c command.c \
sockunion.c prefix.c thread.c if.c memory.c buffer.c table.c hash.c \ sockunion.c prefix.c thread.c if.c memory.c buffer.c table.c hash.c \
filter.c routemap.c distribute.c stream.c str.c log.c plist.c \ filter.c routemap.c distribute.c stream.c str.c log.c plist.c \
zclient.c sockopt.c smux.c md5.c if_rmap.c keychain.c privs.c \ zclient.c sockopt.c smux.c md5.c if_rmap.c keychain.c privs.c \
@ -27,6 +27,3 @@ pkginclude_HEADERS = \
EXTRA_DIST = regex.c regex-gnu.h EXTRA_DIST = regex.c regex-gnu.h
version.c: Makefile
echo '' >version.c
echo 'const char *host_name = "$(host_alias)";' >>version.c

View File

@ -36,13 +36,6 @@ vector cmdvec;
/* Host information structure. */ /* Host information structure. */
struct host host; struct host host;
/* Default motd string. */
const char *default_motd =
"\r\n\
Hello, this is " QUAGGA_PROGNAME " (version " QUAGGA_VERSION ").\r\n\
Copyright 1996-2004 Kunihiro Ishiguro, et al.\r\n\
\r\n";
/* Standard command node structures. */ /* Standard command node structures. */
struct cmd_node auth_node = struct cmd_node auth_node =
{ {
@ -74,6 +67,21 @@ struct cmd_node config_node =
"%s(config)# ", "%s(config)# ",
1 1
}; };
/* Default motd string. */
const char *default_motd =
"\r\n\
Hello, this is " QUAGGA_PROGNAME " (version " QUAGGA_VERSION ").\r\n\
" QUAGGA_COPYRIGHT "\r\n\
\r\n";
void
print_version (const char *progname)
{
printf ("%s version %s (%s)\n", progname, QUAGGA_VERSION, host.name);
printf ("%s\n", QUAGGA_COPYRIGHT);
}
/* Utility function to concatenate argv argument into a single string /* Utility function to concatenate argv argument into a single string
with inserting ' ' character between each argument. */ with inserting ' ' character between each argument. */
@ -2397,10 +2405,8 @@ DEFUN (show_version,
SHOW_STR SHOW_STR
"Displays zebra version\n") "Displays zebra version\n")
{ {
vty_out (vty, "Quagga %s (%s).%s", QUAGGA_VERSION, vty_out (vty, "Quagga %s (%s).%s", QUAGGA_VERSION, host.name, VTY_NEWLINE);
host_name, vty_out (vty, "%s%s", QUAGGA_COPYRIGHT, VTY_NEWLINE);
VTY_NEWLINE);
vty_out (vty, "Copyright 1996-2002, Kunihiro Ishiguro.%s", VTY_NEWLINE);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -2412,7 +2418,7 @@ DEFUN (config_help,
"Description of the interactive help system\n") "Description of the interactive help system\n")
{ {
vty_out (vty, vty_out (vty,
"Zebra VTY provides advanced help feature. When you need help,%s\ "Quagga VTY provides advanced help feature. When you need help,%s\
anytime at the command line please press '?'.%s\ anytime at the command line please press '?'.%s\
%s\ %s\
If nothing matches, the help list will be empty and you must backup%s\ If nothing matches, the help list will be empty and you must backup%s\

View File

@ -309,4 +309,6 @@ int config_help (struct cmd_element *, struct vty *, int, const char *[]);
char *host_config_file (); char *host_config_file ();
void host_config_set (char *); void host_config_set (char *);
void print_version (const char *);
#endif /* _ZEBRA_COMMAND_H */ #endif /* _ZEBRA_COMMAND_H */

View File

@ -1,31 +0,0 @@
/* Print version function.
* Copyright (C) 1997, 98 Kunihiro Ishiguro
*
* This file is part of GNU Zebra.
*
* GNU Zebra 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.
*
* GNU Zebra 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 GNU Zebra; 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 <lib/version.h>
void
print_version (const char *progname)
{
printf ("%s version %s (%s)\n", progname, QUAGGA_VERSION, host_name);
printf ("Copyright 1996-2001, Kunihiro Ishiguro\n");
}

View File

@ -30,9 +30,8 @@
#define QUAGGA_URL "http://www.quagga.net" #define QUAGGA_URL "http://www.quagga.net"
extern char *host_name; #define QUAGGA_COPYRIGHT "Copyright 1996-2004 Kunihiro Ishiguro, et al."
void print_version (const char *);
pid_t pid_output (const char *); pid_t pid_output (const char *);
pid_t pid_output_lock (const char *); pid_t pid_output_lock (const char *);