aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo_client_vty.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-05-31 18:39:33 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-05-31 21:19:51 +0200
commitcd2d3db3b765fdaab245196ae34930180c4edb03 (patch)
treecd53bcbe4c3959266f31b195609808a7e8f99335 /src/osmo_client_vty.c
parentbac0c98d22b9db20b4def3976c06618e190218de (diff)
osmo-pcap-client: Set the filter string on the pcap device..
Diffstat (limited to 'src/osmo_client_vty.c')
-rw-r--r--src/osmo_client_vty.c13
1 files changed, 11 insertions, 2 deletions
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;
}