aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/vty
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-05-16 19:20:24 +0200
committerHarald Welte <laforge@gnumonks.org>2010-05-16 19:20:24 +0200
commit1353f961ef285c23776199419989f5b5039565a1 (patch)
treee528d3a637096a0a83a8349c1fd94877f47fac1d /openbsc/include/vty
parent3071d6aa7d84a2412f64de555f0880f9c008b9fa (diff)
VTY: pass program name, version and copyright to vty_init()
This enables us to make the VTY completely independent of any compile-time program-specific information, i.e. one step closer to using VTY as a shared library from multiple programs.
Diffstat (limited to 'openbsc/include/vty')
-rw-r--r--openbsc/include/vty/command.h7
-rw-r--r--openbsc/include/vty/vty.h2
2 files changed, 7 insertions, 2 deletions
diff --git a/openbsc/include/vty/command.h b/openbsc/include/vty/command.h
index 38d90b460..ec594ed1b 100644
--- a/openbsc/include/vty/command.h
+++ b/openbsc/include/vty/command.h
@@ -57,6 +57,10 @@ struct host {
/* Banner configuration. */
const char *motd;
char *motdfile;
+
+ const char *prog_name;
+ const char *prog_version;
+ const char *prog_copyright;
};
/* There are some command levels which called from command node. */
@@ -377,7 +381,8 @@ extern struct cmd_element config_list_cmd;
char *host_config_file();
void host_config_set(const char *);
-void print_version(const char *);
+/* This is called from main when a daemon is invoked with -v or --version. */
+void print_version(int print_copyright);
extern void *tall_vty_cmd_ctx;
diff --git a/openbsc/include/vty/vty.h b/openbsc/include/vty/vty.h
index 0441fc5f7..23430d5e7 100644
--- a/openbsc/include/vty/vty.h
+++ b/openbsc/include/vty/vty.h
@@ -128,7 +128,7 @@ static inline char *vty_newline(struct vty *vty)
}
/* Prototypes. */
-void vty_init (void);
+void vty_init(const char *name, const char *version, const char *copyright);
int vty_read_config_file(const char *file_name);
void vty_init_vtysh (void);
void vty_reset (void);