From cd2d3db3b765fdaab245196ae34930180c4edb03 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 31 May 2011 18:39:33 +0200 Subject: osmo-pcap-client: Set the filter string on the pcap device.. --- src/osmo_client_vty.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/osmo_client_vty.c') diff --git a/src/osmo_client_vty.c b/src/osmo_client_vty.c index 056ab18..0b30eb7 100644 --- a/src/osmo_client_vty.c +++ b/src/osmo_client_vty.c @@ -82,14 +82,23 @@ DEFUN(cfg_client_device, DEFUN(cfg_client_filter, cfg_client_filter_cmd, - "pcap filter NAME", + "pcap filter .NAME", PCAP_STRING "filter string in pcap syntax\n" "filter\n") { - if (osmo_client_filter(pcap_client, argv[0]) != 0) { + char *filter = argv_concat(argv, argc, 0); + if (!filter) { + vty_out(vty, "Failed to allocate buffer.%s", VTY_NEWLINE); + return CMD_WARNING; + } + + + if (osmo_client_filter(pcap_client, filter) != 0) { vty_out(vty, "Failed to set the device.%s", VTY_NEWLINE); + talloc_free(filter); return CMD_WARNING; } + talloc_free(filter); return CMD_SUCCESS; } -- cgit v1.2.3