summaryrefslogtreecommitdiffstats
path: root/openbsc/src/vty/vty.c
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/src/vty/vty.c
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/src/vty/vty.c')
-rw-r--r--openbsc/src/vty/vty.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/openbsc/src/vty/vty.c b/openbsc/src/vty/vty.c
index 7a6ad977d..e5b5b48f0 100644
--- a/openbsc/src/vty/vty.c
+++ b/openbsc/src/vty/vty.c
@@ -13,12 +13,13 @@
#include <arpa/telnet.h>
-#include "cardshell.h"
#include <vty/vty.h>
#include <vty/command.h>
#include <vty/buffer.h>
#include <osmocore/talloc.h>
+#define SYSCONFDIR "/usr/local/etc"
+
/* our callback, located in telnet_interface.c */
void vty_event(enum event event, int sock, struct vty *vty);
@@ -468,6 +469,7 @@ static void vty_hist_add(struct vty *vty)
vty->hp = vty->hindex;
}
+#define TELNET_OPTION_DEBUG
/* Get telnet window size. */
static int
vty_telnet_option (struct vty *vty, unsigned char *buf, int nbytes)
@@ -1631,8 +1633,12 @@ void vty_init_vtysh()
extern void *tall_bsc_ctx;
/* Install vty's own commands like `who' command. */
-void vty_init()
+void vty_init(const char *name, const char *version, const char *copyright)
{
+ host.prog_name = name;
+ host.prog_version = version;
+ host.prog_copyright = copyright;
+
tall_vty_ctx = talloc_named_const(NULL, 0, "vty");
tall_vty_vec_ctx = talloc_named_const(tall_vty_ctx, 0, "vty_vector");
tall_vty_cmd_ctx = talloc_named_const(tall_vty_ctx, 0, "vty_command");