aboutsummaryrefslogtreecommitdiffstats
path: root/extcap/ciscodump.c
diff options
context:
space:
mode:
Diffstat (limited to 'extcap/ciscodump.c')
-rw-r--r--extcap/ciscodump.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/extcap/ciscodump.c b/extcap/ciscodump.c
index b125353251..778d83a2b6 100644
--- a/extcap/ciscodump.c
+++ b/extcap/ciscodump.c
@@ -17,6 +17,7 @@
#include <wsutil/strtoi.h>
#include <wsutil/filesystem.h>
#include <wsutil/privileges.h>
+#include <wsutil/please_report_bug.h>
#include <extcap/ssh-base.h>
#include <writecap/pcapio.h>
@@ -518,7 +519,7 @@ static int list_config(char *interface, unsigned int remote_port)
int main(int argc, char *argv[])
{
- char* init_progfile_dir_error;
+ char* err_msg;
int result;
int option_idx = 0;
ssh_params_t* ssh_params = ssh_params_new();
@@ -530,10 +531,6 @@ int main(int argc, char *argv[])
char* help_url;
char* help_header = NULL;
-#ifdef _WIN32
- WSADATA wsaData;
-#endif /* _WIN32 */
-
/*
* Get credential information for later use.
*/
@@ -543,11 +540,11 @@ int main(int argc, char *argv[])
* Attempt to get the pathname of the directory containing the
* executable file.
*/
- init_progfile_dir_error = init_progfile_dir(argv[0]);
- if (init_progfile_dir_error != NULL) {
+ err_msg = init_progfile_dir(argv[0]);
+ if (err_msg != NULL) {
g_warning("Can't get pathname of directory containing the captype program: %s.",
- init_progfile_dir_error);
- g_free(init_progfile_dir_error);
+ err_msg);
+ g_free(err_msg);
}
help_url = data_file_url("ciscodump.html");
@@ -688,13 +685,13 @@ int main(int argc, char *argv[])
goto end;
}
-#ifdef _WIN32
- result = WSAStartup(MAKEWORD(2, 2), &wsaData);
- if (result != 0) {
- g_warning("ERROR: WSAStartup failed with error: %d", result);
+ err_msg = ws_init_sockets();
+ if (err_msg != NULL) {
+ g_warning("ERROR: %s", err_msg);
+ g_free(err_msg);
+ g_warning("%s", please_report_bug());
goto end;
}
-#endif /* _WIN32 */
if (extcap_conf->capture) {
if (!ssh_params->host) {