diff options
author | Dario Lombardo <lomato@gmail.com> | 2016-03-04 10:53:56 +0100 |
---|---|---|
committer | Roland Knall <rknall@gmail.com> | 2016-03-24 12:07:28 +0000 |
commit | a6921c79ab84b1729ed47372118cdf1b0b38875a (patch) | |
tree | e41a9f1e342079f0b467528aac2a6b332efef563 /extcap/ssh-base.c | |
parent | 2e98866171ca5a9622085447b2a400937ea91286 (diff) | |
download | wireshark-a6921c79ab84b1729ed47372118cdf1b0b38875a.tar.gz |
extcap: add ciscodump.
Ciscodump is a new extcap that allows packet capture
on Cisco routers (IOS 12.4 and later) through SSH.
Change-Id: Ic9c5be01d3bd0112116f7fc9fa10e26c1552b007
Reviewed-on: https://code.wireshark.org/review/13886
Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'extcap/ssh-base.c')
-rw-r--r-- | extcap/ssh-base.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/extcap/ssh-base.c b/extcap/ssh-base.c index 10fefd2577..830485df3d 100644 --- a/extcap/ssh-base.c +++ b/extcap/ssh-base.c @@ -26,6 +26,7 @@ #include <extcap/extcap-base.h> #include <log.h> +#include <string.h> #define verbose_print(...) { if (verbose) printf(__VA_ARGS__); } @@ -132,6 +133,22 @@ failure: return NULL; } +int ssh_channel_printf(ssh_channel channel, const char* fmt, ...) +{ + gchar* buf; + va_list arg; + int ret = EXIT_SUCCESS; + + va_start(arg, fmt); + buf = g_strdup_vprintf(fmt, arg); + if (ssh_channel_write(channel, buf, (guint32)strlen(buf)) == SSH_ERROR) + ret = EXIT_FAILURE; + va_end(arg); + g_free(buf); + + return ret; +} + void ssh_cleanup(ssh_session* sshs, ssh_channel* channel) { if (*channel) { |