aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo_client_main.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-05-31 17:42:13 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-05-31 17:42:53 +0200
commit3b9b38ca688b422894470618e8f017ea74dee0e1 (patch)
tree6e26491852ce7981226d2e5883098c8c288336ab /src/osmo_client_main.c
parent47169baa6edc040cd7f36174a86f565a8f403611 (diff)
osmo-pcap-client: Work on the client code, be able to open the device
Add vty code to allow changing the device, this will just attempt to open and close the device. Nothing else is done.
Diffstat (limited to 'src/osmo_client_main.c')
-rw-r--r--src/osmo_client_main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/osmo_client_main.c b/src/osmo_client_main.c
index f00530e..96f01ee 100644
--- a/src/osmo_client_main.c
+++ b/src/osmo_client_main.c
@@ -21,6 +21,7 @@
*/
#include <osmo-pcap/common.h>
+#include <osmo-pcap/osmo_pcap_client.h>
#include <osmocom/core/application.h>
#include <osmocom/core/process.h>
@@ -46,6 +47,7 @@ static const char *config_file = "osmo-pcap-client.cfg";
static int daemonize = 0;
void *tall_bsc_ctx;
+struct osmo_pcap_client *pcap_client;
extern void *tall_msgb_ctx;
extern void *tall_ctr_ctx;
@@ -177,6 +179,14 @@ int main(int argc, char **argv)
telnet_init(tall_bsc_ctx, NULL, 4240);
+ pcap_client = talloc_zero(tall_bsc_ctx, struct osmo_pcap_client);
+ if (!pcap_client) {
+ LOGP(DCLIENT, LOGL_ERROR, "Failed to allocate osmo_pcap_client.\n");
+ exit(1);
+ }
+ pcap_client->fd.fd = -1;
+ vty_client_init(pcap_client);
+
if (daemonize) {
rc = osmo_daemonize();
if (rc < 0) {