Replace g_strdup_printf() with ws_strdup_printf()

Use macros from inttypes.h.
This commit is contained in:
João Valverde 2021-12-18 18:48:20 +00:00
parent f984def50c
commit 0ccd69e530
186 changed files with 967 additions and 970 deletions

View File

@ -115,7 +115,7 @@ static guint num_legacy_channels = 14;
static gchar * static gchar *
cant_get_airpcap_if_list_error_message(const char *err_str) cant_get_airpcap_if_list_error_message(const char *err_str)
{ {
return g_strdup_printf("Can't get list of Wireless interfaces: %s", err_str); return ws_strdup_printf("Can't get list of Wireless interfaces: %s", err_str);
} }
/* /*
@ -931,7 +931,7 @@ airpcap_get_if_string_number(airpcap_if_info_t* if_info)
} }
else else
{ {
number = g_strdup_printf("%.2u",n); number = ws_strdup_printf("%.2u",n);
} }
return number; return number;

View File

@ -51,7 +51,7 @@ get_interface_list(int *err, char **err_str)
gchar * gchar *
cant_get_if_list_error_message(const char *err_str) cant_get_if_list_error_message(const char *err_str)
{ {
return g_strdup_printf("Can't get list of interfaces: %s", err_str); return ws_strdup_printf("Can't get list of interfaces: %s", err_str);
} }
if_capabilities_t * if_capabilities_t *

View File

@ -231,7 +231,7 @@ add_unix_interface_ifinfo(if_info_t *if_info, const char *name,
* Look for /sys/class/net/{device}/wireless. If it exists, * Look for /sys/class/net/{device}/wireless. If it exists,
* it's a wireless interface. * it's a wireless interface.
*/ */
wireless_path = g_strdup_printf("/sys/class/net/%s/wireless", name); wireless_path = ws_strdup_printf("/sys/class/net/%s/wireless", name);
if (wireless_path != NULL) { if (wireless_path != NULL) {
if (ws_stat64(wireless_path, &statb) == 0) if (ws_stat64(wireless_path, &statb) == 0)
if_info->type = IF_WIRELESS; if_info->type = IF_WIRELESS;
@ -915,7 +915,7 @@ create_data_link_info(int dlt)
if (text != NULL) if (text != NULL)
data_link_info->name = g_strdup(text); data_link_info->name = g_strdup(text);
else else
data_link_info->name = g_strdup_printf("DLT %d", dlt); data_link_info->name = ws_strdup_printf("DLT %d", dlt);
text = pcap_datalink_val_to_description(dlt); text = pcap_datalink_val_to_description(dlt);
data_link_info->description = g_strdup(text); data_link_info->description = g_strdup(text);
return data_link_info; return data_link_info;
@ -947,7 +947,7 @@ get_data_link_types(pcap_t *pch, interface_options *interface_opts,
*/ */
if (nlt == PCAP_ERROR) { if (nlt == PCAP_ERROR) {
*status = CAP_DEVICE_OPEN_ERR_GENERIC; *status = CAP_DEVICE_OPEN_ERR_GENERIC;
*status_str = g_strdup_printf("pcap_list_datalinks() failed: %s", *status_str = ws_strdup_printf("pcap_list_datalinks() failed: %s",
pcap_geterr(pch)); pcap_geterr(pch));
} else { } else {
if (nlt == PCAP_ERROR_PERM_DENIED) if (nlt == PCAP_ERROR_PERM_DENIED)
@ -958,7 +958,7 @@ get_data_link_types(pcap_t *pch, interface_options *interface_opts,
} }
#else /* HAVE_PCAP_CREATE */ #else /* HAVE_PCAP_CREATE */
*status = CAP_DEVICE_OPEN_ERR_GENERIC; *status = CAP_DEVICE_OPEN_ERR_GENERIC;
*status_str = g_strdup_printf("pcap_list_datalinks() failed: %s", *status_str = ws_strdup_printf("pcap_list_datalinks() failed: %s",
pcap_geterr(pch)); pcap_geterr(pch));
#endif /* HAVE_PCAP_CREATE */ #endif /* HAVE_PCAP_CREATE */
return NULL; return NULL;
@ -1197,7 +1197,7 @@ get_if_capabilities_pcap_create(interface_options *interface_opts,
/* Error. */ /* Error. */
if (status == PCAP_ERROR) { if (status == PCAP_ERROR) {
*open_status = CAP_DEVICE_OPEN_ERR_GENERIC; *open_status = CAP_DEVICE_OPEN_ERR_GENERIC;
*open_status_str = g_strdup_printf("pcap_can_set_rfmon() failed: %s", *open_status_str = ws_strdup_printf("pcap_can_set_rfmon() failed: %s",
pcap_geterr(pch)); pcap_geterr(pch));
} else { } else {
if (status == PCAP_ERROR_PERM_DENIED) if (status == PCAP_ERROR_PERM_DENIED)
@ -1218,7 +1218,7 @@ get_if_capabilities_pcap_create(interface_options *interface_opts,
pcap_set_rfmon(pch, 1); pcap_set_rfmon(pch, 1);
} else { } else {
*open_status = CAP_DEVICE_OPEN_ERR_NOT_PERMISSIONS; *open_status = CAP_DEVICE_OPEN_ERR_NOT_PERMISSIONS;
*open_status_str = g_strdup_printf("pcap_can_set_rfmon() returned %d", *open_status_str = ws_strdup_printf("pcap_can_set_rfmon() returned %d",
status); status);
pcap_close(pch); pcap_close(pch);
g_free(caps); g_free(caps);
@ -1230,7 +1230,7 @@ get_if_capabilities_pcap_create(interface_options *interface_opts,
/* Error. */ /* Error. */
if (status == PCAP_ERROR) { if (status == PCAP_ERROR) {
*open_status = CAP_DEVICE_OPEN_ERR_GENERIC; *open_status = CAP_DEVICE_OPEN_ERR_GENERIC;
*open_status_str = g_strdup_printf("pcap_activate() failed: %s", *open_status_str = ws_strdup_printf("pcap_activate() failed: %s",
pcap_geterr(pch)); pcap_geterr(pch));
} else { } else {
if (status == PCAP_ERROR_PERM_DENIED) if (status == PCAP_ERROR_PERM_DENIED)

View File

@ -270,7 +270,7 @@ convert_errbuf_to_utf8(char *errbuf)
static char * static char *
cant_load_winpcap_err(const char *app_name) cant_load_winpcap_err(const char *app_name)
{ {
return g_strdup_printf( return ws_strdup_printf(
"Unable to load Npcap or WinPcap (wpcap.dll); %s will not be able to\n" "Unable to load Npcap or WinPcap (wpcap.dll); %s will not be able to\n"
"capture packets.\n" "capture packets.\n"
"\n" "\n"
@ -771,12 +771,12 @@ cant_get_if_list_error_message(const char *err_str)
*/ */
if (strstr(err_str, "Not enough storage is available to process this command") != NULL || if (strstr(err_str, "Not enough storage is available to process this command") != NULL ||
strstr(err_str, "The operation completed successfully") != NULL) { strstr(err_str, "The operation completed successfully") != NULL) {
return g_strdup_printf("Can't get list of interfaces: %s\n" return ws_strdup_printf("Can't get list of interfaces: %s\n"
"This might be a problem with WinPcap 3.0. You should try updating to\n" "This might be a problem with WinPcap 3.0. You should try updating to\n"
"Npcap. See https://nmap.org/npcap/ for more information.", "Npcap. See https://nmap.org/npcap/ for more information.",
err_str); err_str);
} }
return g_strdup_printf("Can't get list of interfaces: %s", err_str); return ws_strdup_printf("Can't get list of interfaces: %s", err_str);
} }
if_capabilities_t * if_capabilities_t *

View File

@ -266,7 +266,7 @@ capture_get_if_capabilities(const gchar *ifname, gboolean monitor_mode,
default: default:
ws_info("Capture Interface Capabilities returned bad information."); ws_info("Capture Interface Capabilities returned bad information.");
if (err_primary_msg) { if (err_primary_msg) {
*err_primary_msg = g_strdup_printf("Dumpcap returned \"%s\" for monitor-mode capability", *err_primary_msg = ws_strdup_printf("Dumpcap returned \"%s\" for monitor-mode capability",
raw_list[0]); raw_list[0]);
} }
g_free(caps); g_free(caps);

View File

@ -187,9 +187,9 @@ init_pipe_args(int *argc) {
/* take Wireshark's absolute program path and replace "Wireshark" with "dumpcap" */ /* take Wireshark's absolute program path and replace "Wireshark" with "dumpcap" */
#ifdef _WIN32 #ifdef _WIN32
exename = g_strdup_printf("%s\\dumpcap.exe", progfile_dir); exename = ws_strdup_printf("%s\\dumpcap.exe", progfile_dir);
#else #else
exename = g_strdup_printf("%s/dumpcap", progfile_dir); exename = ws_strdup_printf("%s/dumpcap", progfile_dir);
#endif #endif
/* Make that the first argument in the argument list (argv[0]). */ /* Make that the first argument in the argument list (argv[0]). */
@ -349,7 +349,7 @@ sync_pipe_start(capture_options *capture_opts, GPtrArray *capture_comments,
if (interface_opts->extcap_fifo != NULL) if (interface_opts->extcap_fifo != NULL)
{ {
#ifdef _WIN32 #ifdef _WIN32
char *pipe = g_strdup_printf("%s%" PRIuPTR, EXTCAP_PIPE_PREFIX, interface_opts->extcap_pipe_h); char *pipe = ws_strdup_printf("%s%" PRIuPTR, EXTCAP_PIPE_PREFIX, interface_opts->extcap_pipe_h);
argv = sync_pipe_add_arg(argv, &argc, pipe); argv = sync_pipe_add_arg(argv, &argc, pipe);
g_free(pipe); g_free(pipe);
#else #else
@ -501,7 +501,7 @@ sync_pipe_start(capture_options *capture_opts, GPtrArray *capture_comments,
} }
/* Create the signal pipe */ /* Create the signal pipe */
signal_pipe_name = g_strdup_printf(SIGNAL_PIPE_FORMAT, control_id); signal_pipe_name = ws_strdup_printf(SIGNAL_PIPE_FORMAT, control_id);
signal_pipe = CreateNamedPipe(utf_8to16(signal_pipe_name), signal_pipe = CreateNamedPipe(utf_8to16(signal_pipe_name),
PIPE_ACCESS_OUTBOUND, PIPE_TYPE_BYTE, 1, 65535, 65535, 0, NULL); PIPE_ACCESS_OUTBOUND, PIPE_TYPE_BYTE, 1, 65535, 65535, 0, NULL);
g_free(signal_pipe_name); g_free(signal_pipe_name);
@ -715,7 +715,7 @@ sync_pipe_open_command(char* const argv[], int *data_read_fd,
/* (increase this value if you have trouble while fast capture file switches) */ /* (increase this value if you have trouble while fast capture file switches) */
if (! CreatePipe(&sync_pipe[PIPE_READ], &sync_pipe[PIPE_WRITE], &sa, 5120)) { if (! CreatePipe(&sync_pipe[PIPE_READ], &sync_pipe[PIPE_WRITE], &sa, 5120)) {
/* Couldn't create the message pipe between parent and child. */ /* Couldn't create the message pipe between parent and child. */
*msg = g_strdup_printf("Couldn't create sync pipe: %s", *msg = ws_strdup_printf("Couldn't create sync pipe: %s",
win32strerror(GetLastError())); win32strerror(GetLastError()));
return -1; return -1;
} }
@ -729,7 +729,7 @@ sync_pipe_open_command(char* const argv[], int *data_read_fd,
*/ */
*message_read_fd = _open_osfhandle( (intptr_t) sync_pipe[PIPE_READ], _O_BINARY); *message_read_fd = _open_osfhandle( (intptr_t) sync_pipe[PIPE_READ], _O_BINARY);
if (*message_read_fd == -1) { if (*message_read_fd == -1) {
*msg = g_strdup_printf("Couldn't get C file handle for message read pipe: %s", g_strerror(errno)); *msg = ws_strdup_printf("Couldn't get C file handle for message read pipe: %s", g_strerror(errno));
CloseHandle(sync_pipe[PIPE_READ]); CloseHandle(sync_pipe[PIPE_READ]);
CloseHandle(sync_pipe[PIPE_WRITE]); CloseHandle(sync_pipe[PIPE_WRITE]);
return -1; return -1;
@ -739,7 +739,7 @@ sync_pipe_open_command(char* const argv[], int *data_read_fd,
/* (increase this value if you have trouble while fast capture file switches) */ /* (increase this value if you have trouble while fast capture file switches) */
if (! CreatePipe(&data_pipe[PIPE_READ], &data_pipe[PIPE_WRITE], &sa, 5120)) { if (! CreatePipe(&data_pipe[PIPE_READ], &data_pipe[PIPE_WRITE], &sa, 5120)) {
/* Couldn't create the message pipe between parent and child. */ /* Couldn't create the message pipe between parent and child. */
*msg = g_strdup_printf("Couldn't create data pipe: %s", *msg = ws_strdup_printf("Couldn't create data pipe: %s",
win32strerror(GetLastError())); win32strerror(GetLastError()));
ws_close(*message_read_fd); /* Should close sync_pipe[PIPE_READ] */ ws_close(*message_read_fd); /* Should close sync_pipe[PIPE_READ] */
CloseHandle(sync_pipe[PIPE_WRITE]); CloseHandle(sync_pipe[PIPE_WRITE]);
@ -755,7 +755,7 @@ sync_pipe_open_command(char* const argv[], int *data_read_fd,
*/ */
*data_read_fd = _open_osfhandle( (intptr_t) data_pipe[PIPE_READ], _O_BINARY); *data_read_fd = _open_osfhandle( (intptr_t) data_pipe[PIPE_READ], _O_BINARY);
if (*data_read_fd == -1) { if (*data_read_fd == -1) {
*msg = g_strdup_printf("Couldn't get C file handle for data read pipe: %s", g_strerror(errno)); *msg = ws_strdup_printf("Couldn't get C file handle for data read pipe: %s", g_strerror(errno));
CloseHandle(data_pipe[PIPE_READ]); CloseHandle(data_pipe[PIPE_READ]);
CloseHandle(data_pipe[PIPE_WRITE]); CloseHandle(data_pipe[PIPE_WRITE]);
ws_close(*message_read_fd); /* Should close sync_pipe[PIPE_READ] */ ws_close(*message_read_fd); /* Should close sync_pipe[PIPE_READ] */
@ -792,7 +792,7 @@ sync_pipe_open_command(char* const argv[], int *data_read_fd,
/* call dumpcap */ /* call dumpcap */
if(!win32_create_process(argv[0], args->str, NULL, NULL, TRUE, if(!win32_create_process(argv[0], args->str, NULL, NULL, TRUE,
CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi)) { CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi)) {
*msg = g_strdup_printf("Couldn't run %s in child process: %s", *msg = ws_strdup_printf("Couldn't run %s in child process: %s",
args->str, win32strerror(GetLastError())); args->str, win32strerror(GetLastError()));
ws_close(*data_read_fd); /* Should close data_pipe[PIPE_READ] */ ws_close(*data_read_fd); /* Should close data_pipe[PIPE_READ] */
CloseHandle(data_pipe[PIPE_WRITE]); CloseHandle(data_pipe[PIPE_WRITE]);
@ -809,14 +809,14 @@ sync_pipe_open_command(char* const argv[], int *data_read_fd,
/* Create a pipe for the child process to send us messages */ /* Create a pipe for the child process to send us messages */
if (pipe(sync_pipe) < 0) { if (pipe(sync_pipe) < 0) {
/* Couldn't create the message pipe between parent and child. */ /* Couldn't create the message pipe between parent and child. */
*msg = g_strdup_printf("Couldn't create sync pipe: %s", g_strerror(errno)); *msg = ws_strdup_printf("Couldn't create sync pipe: %s", g_strerror(errno));
return -1; return -1;
} }
/* Create a pipe for the child process to send us data */ /* Create a pipe for the child process to send us data */
if (pipe(data_pipe) < 0) { if (pipe(data_pipe) < 0) {
/* Couldn't create the data pipe between parent and child. */ /* Couldn't create the data pipe between parent and child. */
*msg = g_strdup_printf("Couldn't create data pipe: %s", g_strerror(errno)); *msg = ws_strdup_printf("Couldn't create data pipe: %s", g_strerror(errno));
ws_close(sync_pipe[PIPE_READ]); ws_close(sync_pipe[PIPE_READ]);
ws_close(sync_pipe[PIPE_WRITE]); ws_close(sync_pipe[PIPE_WRITE]);
return -1; return -1;
@ -872,7 +872,7 @@ sync_pipe_open_command(char* const argv[], int *data_read_fd,
if (*fork_child == WS_INVALID_PID) { if (*fork_child == WS_INVALID_PID) {
/* We couldn't even create the child process. */ /* We couldn't even create the child process. */
*msg = g_strdup_printf("Couldn't create child process: %s", g_strerror(errno)); *msg = ws_strdup_printf("Couldn't create child process: %s", g_strerror(errno));
ws_close(*data_read_fd); ws_close(*data_read_fd);
ws_close(*message_read_fd); ws_close(*message_read_fd);
return -1; return -1;
@ -982,7 +982,7 @@ sync_pipe_run_command_actual(char* const argv[], gchar **data, gchar **primary_m
/* We got an error from the sync pipe. If ret is -1, report /* We got an error from the sync pipe. If ret is -1, report
both the sync pipe I/O error and the wait error. */ both the sync pipe I/O error and the wait error. */
if (ret == -1) { if (ret == -1) {
combined_msg = g_strdup_printf("%s\n\n%s", *primary_msg, wait_msg); combined_msg = ws_strdup_printf("%s\n\n%s", *primary_msg, wait_msg);
g_free(*primary_msg); g_free(*primary_msg);
g_free(wait_msg); g_free(wait_msg);
*primary_msg = combined_msg; *primary_msg = combined_msg;
@ -1085,7 +1085,7 @@ sync_pipe_run_command_actual(char* const argv[], gchar **data, gchar **primary_m
/* /*
* Child process returned an unknown status. * Child process returned an unknown status.
*/ */
*primary_msg = g_strdup_printf("dumpcap process gave an unexpected message type: 0x%02x", *primary_msg = ws_strdup_printf("dumpcap process gave an unexpected message type: 0x%02x",
indicator); indicator);
*secondary_msg = NULL; *secondary_msg = NULL;
ret = -1; ret = -1;
@ -1153,11 +1153,11 @@ sync_interface_set_80211_chan(const gchar *iface, const char *freq, const gchar
argv = sync_pipe_add_arg(argv, &argc, iface); argv = sync_pipe_add_arg(argv, &argc, iface);
if (center_freq2) if (center_freq2)
opt = g_strdup_printf("%s,%s,%s,%s", freq, type, center_freq1, center_freq2); opt = ws_strdup_printf("%s,%s,%s,%s", freq, type, center_freq1, center_freq2);
else if (center_freq1) else if (center_freq1)
opt = g_strdup_printf("%s,%s,%s", freq, type, center_freq1); opt = ws_strdup_printf("%s,%s,%s", freq, type, center_freq1);
else if (type) else if (type)
opt = g_strdup_printf("%s,%s", freq, type); opt = ws_strdup_printf("%s,%s", freq, type);
else else
opt = g_strdup(freq); opt = g_strdup(freq);
@ -1366,7 +1366,7 @@ sync_interface_stats_open(int *data_read_fd, ws_process_id *fork_child, gchar **
/* We got an error from the sync pipe. If ret is -1, report /* We got an error from the sync pipe. If ret is -1, report
both the sync pipe I/O error and the wait error. */ both the sync pipe I/O error and the wait error. */
if (ret == -1) { if (ret == -1) {
combined_msg = g_strdup_printf("%s\n\n%s", *msg, wait_msg); combined_msg = ws_strdup_printf("%s\n\n%s", *msg, wait_msg);
g_free(*msg); g_free(*msg);
g_free(wait_msg); g_free(wait_msg);
*msg = combined_msg; *msg = combined_msg;
@ -1433,7 +1433,7 @@ sync_interface_stats_open(int *data_read_fd, ws_process_id *fork_child, gchar **
/* /*
* Child process returned an unknown status. * Child process returned an unknown status.
*/ */
*msg = g_strdup_printf("dumpcap process gave an unexpected message type: 0x%02x", *msg = ws_strdup_printf("dumpcap process gave an unexpected message type: 0x%02x",
indicator); indicator);
ret = -1; ret = -1;
} }
@ -1477,7 +1477,7 @@ pipe_read_bytes(int pipe_fd, char *bytes, int required, char **msg)
/* error */ /* error */
error = errno; error = errno;
ws_debug("read from pipe %d: error(%u): %s", pipe_fd, error, g_strerror(error)); ws_debug("read from pipe %d: error(%u): %s", pipe_fd, error, g_strerror(error));
*msg = g_strdup_printf("Error reading from sync pipe: %s", *msg = ws_strdup_printf("Error reading from sync pipe: %s",
g_strerror(error)); g_strerror(error));
return newly; return newly;
} }
@ -1564,7 +1564,7 @@ pipe_read_block(int pipe_fd, char *indicator, int len, char *msg,
/* /*
* Short read, but not an immediate EOF. * Short read, but not an immediate EOF.
*/ */
*err_msg = g_strdup_printf("Premature EOF reading from sync pipe: got only %ld bytes", *err_msg = ws_strdup_printf("Premature EOF reading from sync pipe: got only %ld bytes",
(long)newly); (long)newly);
} }
return -1; return -1;
@ -1591,7 +1591,7 @@ pipe_read_block(int pipe_fd, char *indicator, int len, char *msg,
if (newly < 0) { /* error */ if (newly < 0) { /* error */
ws_debug("read from pipe %d: error(%u): %s", pipe_fd, errno, g_strerror(errno)); ws_debug("read from pipe %d: error(%u): %s", pipe_fd, errno, g_strerror(errno));
} }
*err_msg = g_strdup_printf("Unknown message from dumpcap reading header, try to show it as a string: %s", *err_msg = ws_strdup_printf("Unknown message from dumpcap reading header, try to show it as a string: %s",
msg); msg);
return -1; return -1;
} }
@ -1601,7 +1601,7 @@ pipe_read_block(int pipe_fd, char *indicator, int len, char *msg,
newly = pipe_read_bytes(pipe_fd, msg, required, err_msg); newly = pipe_read_bytes(pipe_fd, msg, required, err_msg);
if(newly != required) { if(newly != required) {
if (newly != -1) { if (newly != -1) {
*err_msg = g_strdup_printf("Unknown message from dumpcap reading data, try to show it as a string: %s", *err_msg = ws_strdup_printf("Unknown message from dumpcap reading data, try to show it as a string: %s",
msg); msg);
} }
return -1; return -1;
@ -1660,7 +1660,7 @@ sync_pipe_input_cb(gint source, gpointer user_data)
/* We got an error from the sync pipe. If ret is -1, report /* We got an error from the sync pipe. If ret is -1, report
both the sync pipe I/O error and the wait error. */ both the sync pipe I/O error and the wait error. */
if (ret == -1) { if (ret == -1) {
combined_msg = g_strdup_printf("%s\n\n%s", primary_msg, wait_msg); combined_msg = ws_strdup_printf("%s\n\n%s", primary_msg, wait_msg);
g_free(primary_msg); g_free(primary_msg);
g_free(wait_msg); g_free(wait_msg);
primary_msg = combined_msg; primary_msg = combined_msg;
@ -1789,7 +1789,7 @@ sync_pipe_wait_for_child(ws_process_id fork_child, gchar **msgp)
*msgp = NULL; /* assume no error */ *msgp = NULL; /* assume no error */
#ifdef _WIN32 #ifdef _WIN32
if (_cwait(&fork_child_status, (intptr_t) fork_child, _WAIT_CHILD) == -1) { if (_cwait(&fork_child_status, (intptr_t) fork_child, _WAIT_CHILD) == -1) {
*msgp = g_strdup_printf("Error from cwait(): %s", g_strerror(errno)); *msgp = ws_strdup_printf("Error from cwait(): %s", g_strerror(errno));
ret = -1; ret = -1;
} else { } else {
/* /*
@ -1799,7 +1799,7 @@ sync_pipe_wait_for_child(ws_process_id fork_child, gchar **msgp)
ret = fork_child_status; ret = fork_child_status;
if ((fork_child_status & 0xC0000000) == ERROR_SEVERITY_ERROR) { if ((fork_child_status & 0xC0000000) == ERROR_SEVERITY_ERROR) {
/* Probably an exception code */ /* Probably an exception code */
*msgp = g_strdup_printf("Child dumpcap process died: %s", *msgp = ws_strdup_printf("Child dumpcap process died: %s",
win32strexception(fork_child_status)); win32strexception(fork_child_status));
ret = -1; ret = -1;
} }
@ -1816,19 +1816,19 @@ sync_pipe_wait_for_child(ws_process_id fork_child, gchar **msgp)
ret = WEXITSTATUS(fork_child_status); ret = WEXITSTATUS(fork_child_status);
} else if (WIFSTOPPED(fork_child_status)) { } else if (WIFSTOPPED(fork_child_status)) {
/* It stopped, rather than exiting. "Should not happen." */ /* It stopped, rather than exiting. "Should not happen." */
*msgp = g_strdup_printf("Child dumpcap process stopped: %s", *msgp = ws_strdup_printf("Child dumpcap process stopped: %s",
sync_pipe_signame(WSTOPSIG(fork_child_status))); sync_pipe_signame(WSTOPSIG(fork_child_status)));
ret = -1; ret = -1;
} else if (WIFSIGNALED(fork_child_status)) { } else if (WIFSIGNALED(fork_child_status)) {
/* It died with a signal. */ /* It died with a signal. */
*msgp = g_strdup_printf("Child dumpcap process died: %s%s", *msgp = ws_strdup_printf("Child dumpcap process died: %s%s",
sync_pipe_signame(WTERMSIG(fork_child_status)), sync_pipe_signame(WTERMSIG(fork_child_status)),
WCOREDUMP(fork_child_status) ? " - core dumped" : ""); WCOREDUMP(fork_child_status) ? " - core dumped" : "");
ret = -1; ret = -1;
} else { } else {
/* What? It had to either have exited, or stopped, or died with /* What? It had to either have exited, or stopped, or died with
a signal; what happened here? */ a signal; what happened here? */
*msgp = g_strdup_printf("Bad status from waitpid(): %#o", *msgp = ws_strdup_printf("Bad status from waitpid(): %#o",
fork_child_status); fork_child_status);
ret = -1; ret = -1;
} }
@ -1863,7 +1863,7 @@ sync_pipe_wait_for_child(ws_process_id fork_child, gchar **msgp)
ret = fetch_dumpcap_pid ? 0 : -1; ret = fetch_dumpcap_pid ? 0 : -1;
} else { } else {
/* Unknown error. */ /* Unknown error. */
*msgp = g_strdup_printf("Error from waitpid(): %s", g_strerror(errno)); *msgp = ws_strdup_printf("Error from waitpid(): %s", g_strerror(errno));
ret = -1; ret = -1;
} }
} }
@ -1982,11 +1982,11 @@ static void create_dummy_signal_pipe() {
if (dummy_signal_pipe != NULL) return; if (dummy_signal_pipe != NULL) return;
if (!dummy_control_id) { if (!dummy_control_id) {
dummy_control_id = g_strdup_printf("%d.dummy", GetCurrentProcessId()); dummy_control_id = ws_strdup_printf("%d.dummy", GetCurrentProcessId());
} }
/* Create the signal pipe */ /* Create the signal pipe */
dummy_signal_pipe_name = g_strdup_printf(SIGNAL_PIPE_FORMAT, dummy_control_id); dummy_signal_pipe_name = ws_strdup_printf(SIGNAL_PIPE_FORMAT, dummy_control_id);
dummy_signal_pipe = CreateNamedPipe(utf_8to16(dummy_signal_pipe_name), dummy_signal_pipe = CreateNamedPipe(utf_8to16(dummy_signal_pipe_name),
PIPE_ACCESS_OUTBOUND, PIPE_TYPE_BYTE, 1, 65535, 65535, 0, NULL); PIPE_ACCESS_OUTBOUND, PIPE_TYPE_BYTE, 1, 65535, 65535, 0, NULL);
g_free(dummy_signal_pipe_name); g_free(dummy_signal_pipe_name);

View File

@ -383,7 +383,7 @@ static int get_phys_handler(struct nl_msg *msg, void *arg)
if (!tb_msg[NL80211_ATTR_WIPHY_NAME]) if (!tb_msg[NL80211_ATTR_WIPHY_NAME])
return NL_SKIP; return NL_SKIP;
ifname = g_strdup_printf("%s.mon", nla_get_string(tb_msg[NL80211_ATTR_WIPHY_NAME])); ifname = ws_strdup_printf("%s.mon", nla_get_string(tb_msg[NL80211_ATTR_WIPHY_NAME]));
iface = get_interface_by_name(cookie->interfaces, ifname); iface = get_interface_by_name(cookie->interfaces, ifname);
if (!iface) { if (!iface) {
@ -674,7 +674,7 @@ static int ws80211_populate_devices(GArray *interfaces)
if (iface_info.type == NL80211_IFTYPE_MONITOR) { if (iface_info.type == NL80211_IFTYPE_MONITOR) {
for (j = 0; j < interfaces->len; j++) { for (j = 0; j < interfaces->len; j++) {
iface = g_array_index(interfaces, struct ws80211_interface *, j); iface = g_array_index(interfaces, struct ws80211_interface *, j);
t2 = g_strdup_printf("phy%d.mon", iface_info.phyidx); t2 = ws_strdup_printf("phy%d.mon", iface_info.phyidx);
if (t2) { if (t2) {
if (!strcmp(t2, iface->ifname)) { if (!strcmp(t2, iface->ifname)) {
g_free(iface->ifname); g_free(iface->ifname);
@ -1182,7 +1182,7 @@ const char *ws80211_get_helper_path(void)
if (reg_ret == ERROR_SUCCESS) { if (reg_ret == ERROR_SUCCESS) {
airpcap_dir_utf16[ad_size-1] = L'\0'; airpcap_dir_utf16[ad_size-1] = L'\0';
g_free(airpcap_conf_path); g_free(airpcap_conf_path);
airpcap_conf_path = g_strdup_printf("%s\\AirpcapConf.exe", utf_16to8(airpcap_dir_utf16)); airpcap_conf_path = ws_strdup_printf("%s\\AirpcapConf.exe", utf_16to8(airpcap_dir_utf16));
if (!g_file_test(airpcap_conf_path, G_FILE_TEST_IS_EXECUTABLE)) { if (!g_file_test(airpcap_conf_path, G_FILE_TEST_IS_EXECUTABLE)) {
g_free(airpcap_conf_path); g_free(airpcap_conf_path);

View File

@ -544,7 +544,7 @@ capture_opts_generate_display_name(const char *friendly_name,
* On UN*X, however, users are more used to interface names, * On UN*X, however, users are more used to interface names,
* and may find it helpful to see them. * and may find it helpful to see them.
*/ */
return g_strdup_printf("%s: %s", friendly_name, name); return ws_strdup_printf("%s: %s", friendly_name, name);
} }
#endif #endif

View File

@ -471,7 +471,7 @@ dumpcap_cmdarg_err(const char *fmt, va_list ap)
if (capture_child) { if (capture_child) {
gchar *msg; gchar *msg;
/* Generate a 'special format' message back to parent */ /* Generate a 'special format' message back to parent */
msg = g_strdup_vprintf(fmt, ap); msg = ws_strdup_vprintf(fmt, ap);
sync_pipe_errmsg_to_parent(2, msg, ""); sync_pipe_errmsg_to_parent(2, msg, "");
g_free(msg); g_free(msg);
} else { } else {
@ -491,7 +491,7 @@ dumpcap_cmdarg_err_cont(const char *fmt, va_list ap)
{ {
if (capture_child) { if (capture_child) {
gchar *msg; gchar *msg;
msg = g_strdup_vprintf(fmt, ap); msg = ws_strdup_vprintf(fmt, ap);
sync_pipe_errmsg_to_parent(2, msg, ""); sync_pipe_errmsg_to_parent(2, msg, "");
g_free(msg); g_free(msg);
} else { } else {
@ -2847,7 +2847,7 @@ capture_loop_open_input(capture_options *capture_opts, loop_data *ld,
break; break;
default: default:
sync_msg_str = g_strdup_printf( sync_msg_str = ws_strdup_printf(
"Unknown sampling method %d specified,\n" "Unknown sampling method %d specified,\n"
"continue without packet sampling", "continue without packet sampling",
interface_opts->sampling_method); interface_opts->sampling_method);
@ -2935,7 +2935,7 @@ capture_loop_open_input(capture_options *capture_opts, loop_data *ld,
If so, "open_capture_device()" returned a warning; print it, If so, "open_capture_device()" returned a warning; print it,
but keep capturing. */ but keep capturing. */
if (open_status != CAP_DEVICE_OPEN_NO_ERR) { if (open_status != CAP_DEVICE_OPEN_NO_ERR) {
sync_msg_str = g_strdup_printf("%s.", open_status_str); sync_msg_str = ws_strdup_printf("%s.", open_status_str);
report_capture_error(sync_msg_str, ""); report_capture_error(sync_msg_str, "");
g_free(sync_msg_str); g_free(sync_msg_str);
} }
@ -3601,7 +3601,7 @@ capture_loop_open_output(capture_options *capture_opts, int *save_file_fd,
* More than one interface; just use the number of interfaces * More than one interface; just use the number of interfaces
* to generate the temporary file name prefix. * to generate the temporary file name prefix.
*/ */
prefix = g_strdup_printf("wireshark_%d_interfaces", global_capture_opts.ifaces->len); prefix = ws_strdup_printf("wireshark_%d_interfaces", global_capture_opts.ifaces->len);
} else { } else {
/* /*
* One interface; use its description, if it has one, to generate * One interface; use its description, if it has one, to generate
@ -3863,7 +3863,7 @@ handle_npcap_bug(char *adapter_name _U_, char *cap_err_str _U_)
} }
windows_info_str = g_string_new(""); windows_info_str = g_string_new("");
get_os_version_info(windows_info_str); get_os_version_info(windows_info_str);
msg = g_strdup_printf("If you have not removed that adapter, this " msg = ws_strdup_printf("If you have not removed that adapter, this "
"is probably a known issue in Npcap resulting from " "is probably a known issue in Npcap resulting from "
"the behavior of the Windows networking stack. " "the behavior of the Windows networking stack. "
"Work is being done in Npcap to improve the " "Work is being done in Npcap to improve the "
@ -4206,7 +4206,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
cap_err_str = pcap_geterr(pcap_src->pcap_h); cap_err_str = pcap_geterr(pcap_src->pcap_h);
if (strcmp(cap_err_str, "The interface went down") == 0 || if (strcmp(cap_err_str, "The interface went down") == 0 ||
strcmp(cap_err_str, "recvfrom: Network is down") == 0) { strcmp(cap_err_str, "recvfrom: Network is down") == 0) {
primary_msg = g_strdup_printf("The network adapter \"%s\" " primary_msg = ws_strdup_printf("The network adapter \"%s\" "
"is no longer running; the " "is no longer running; the "
"capture has stopped.", "capture has stopped.",
interface_opts->display_name); interface_opts->display_name);
@ -4215,7 +4215,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
strcmp(cap_err_str, "read: Device not configured") == 0 || strcmp(cap_err_str, "read: Device not configured") == 0 ||
strcmp(cap_err_str, "read: I/O error") == 0 || strcmp(cap_err_str, "read: I/O error") == 0 ||
strcmp(cap_err_str, "read error: PacketReceivePacket failed") == 0) { strcmp(cap_err_str, "read error: PacketReceivePacket failed") == 0) {
primary_msg = g_strdup_printf("The network adapter \"%s\" " primary_msg = ws_strdup_printf("The network adapter \"%s\" "
"is no longer attached; the " "is no longer attached; the "
"capture has stopped.", "capture has stopped.",
interface_opts->display_name); interface_opts->display_name);
@ -4229,7 +4229,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
* *
* Those should be reported as Npcap issues. * Those should be reported as Npcap issues.
*/ */
primary_msg = g_strdup_printf("The network adapter \"%s\" " primary_msg = ws_strdup_printf("The network adapter \"%s\" "
"is no longer attached; the " "is no longer attached; the "
"capture has stopped.", "capture has stopped.",
interface_opts->display_name); interface_opts->display_name);
@ -4254,7 +4254,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
* sort of problems popping up, but I can't find that * sort of problems popping up, but I can't find that
* discussion. * discussion.
*/ */
primary_msg = g_strdup_printf("The network adapter \"%s\" " primary_msg = ws_strdup_printf("The network adapter \"%s\" "
"is no longer attached; the " "is no longer attached; the "
"capture has stopped.", "capture has stopped.",
interface_opts->display_name); interface_opts->display_name);
@ -4266,7 +4266,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
"remote host on which you are " "remote host on which you are "
"capturing packets."); "capturing packets.");
} else { } else {
primary_msg = g_strdup_printf("Error while capturing packets: %s", primary_msg = ws_strdup_printf("Error while capturing packets: %s",
cap_err_str); cap_err_str);
secondary_msg = g_strdup(please_report_bug()); secondary_msg = g_strdup(please_report_bug());
} }
@ -5194,7 +5194,7 @@ main(int argc, char *argv[])
* signal pipe name. * signal pipe name.
*/ */
if (strcmp(ws_optarg, SIGNAL_PIPE_CTRL_ID_NONE) != 0) { if (strcmp(ws_optarg, SIGNAL_PIPE_CTRL_ID_NONE) != 0) {
sig_pipe_name = g_strdup_printf(SIGNAL_PIPE_FORMAT, ws_optarg); sig_pipe_name = ws_strdup_printf(SIGNAL_PIPE_FORMAT, ws_optarg);
sig_pipe_handle = CreateFile(utf_8to16(sig_pipe_name), sig_pipe_handle = CreateFile(utf_8to16(sig_pipe_name),
GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
@ -5440,7 +5440,7 @@ main(int argc, char *argv[])
caps = get_if_capabilities(interface_opts, &open_status, &open_status_str); caps = get_if_capabilities(interface_opts, &open_status, &open_status_str);
if (caps == NULL) { if (caps == NULL) {
if (capture_child) { if (capture_child) {
char *error_msg = g_strdup_printf("The capabilities of the capture device " char *error_msg = ws_strdup_printf("The capabilities of the capture device "
"\"%s\" could not be obtained (%s)", "\"%s\" could not be obtained (%s)",
interface_opts->name, open_status_str); interface_opts->name, open_status_str);
sync_pipe_errmsg_to_parent(2, error_msg, sync_pipe_errmsg_to_parent(2, error_msg,
@ -5527,14 +5527,14 @@ main(int argc, char *argv[])
g_free(interface_opts->display_name); g_free(interface_opts->display_name);
if (interface_opts->descr != NULL) { if (interface_opts->descr != NULL) {
#ifdef _WIN32 #ifdef _WIN32
interface_opts->display_name = g_strdup_printf("%s", interface_opts->display_name = ws_strdup_printf("%s",
interface_opts->descr); interface_opts->descr);
#else #else
interface_opts->display_name = g_strdup_printf("%s: %s", interface_opts->display_name = ws_strdup_printf("%s: %s",
interface_opts->descr, interface_opts->ifname); interface_opts->descr, interface_opts->ifname);
#endif #endif
} else { } else {
interface_opts->display_name = g_strdup_printf("%s", interface_opts->display_name = ws_strdup_printf("%s",
interface_opts->ifname); interface_opts->ifname);
} }
} }
@ -5602,7 +5602,7 @@ dumpcap_log_writer(const char *domain, enum ws_log_level level,
/* ERROR, CRITICAL, WARNING, MESSAGE messages goto stderr or */ /* ERROR, CRITICAL, WARNING, MESSAGE messages goto stderr or */
/* to parent especially formatted if dumpcap running as child. */ /* to parent especially formatted if dumpcap running as child. */
if (capture_child) { if (capture_child) {
gchar *msg = g_strdup_vprintf(user_format, user_ap); gchar *msg = ws_strdup_vprintf(user_format, user_ap);
sync_pipe_errmsg_to_parent(2, msg, ""); sync_pipe_errmsg_to_parent(2, msg, "");
g_free(msg); g_free(msg);
} else if(ws_log_msg_is_active(domain, level)) { } else if(ws_log_msg_is_active(domain, level)) {
@ -5722,7 +5722,7 @@ report_packet_drops(guint32 received, guint32 pcap_drops, guint32 drops, guint32
guint32 total_drops = pcap_drops + drops + flushed; guint32 total_drops = pcap_drops + drops + flushed;
if (capture_child) { if (capture_child) {
char* tmp = g_strdup_printf("%u:%s", total_drops, name); char* tmp = ws_strdup_printf("%u:%s", total_drops, name);
ws_debug("Packets received/dropped on interface '%s': %u/%u (pcap:%u/dumpcap:%u/flushed:%u/ps_ifdrop:%u)", ws_debug("Packets received/dropped on interface '%s': %u/%u (pcap:%u/dumpcap:%u/flushed:%u/ps_ifdrop:%u)",
name, received, total_drops, pcap_drops, drops, flushed, ps_ifdrop); name, received, total_drops, pcap_drops, drops, flushed, ps_ifdrop);

View File

@ -1183,9 +1183,9 @@ static void camel_stat_init(stat_tap_table_ui* new_stat)
const char *ocs = try_val_to_str(i, camel_opr_code_strings); const char *ocs = try_val_to_str(i, camel_opr_code_strings);
char *col_str; char *col_str;
if (ocs) { if (ocs) {
col_str = g_strdup_printf("Request %s", ocs); col_str = ws_strdup_printf("Request %s", ocs);
} else { } else {
col_str = g_strdup_printf("Unknown op code %d", i); col_str = ws_strdup_printf("Unknown op code %d", i);
} }
items[MESSAGE_TYPE_COLUMN].value.string_value = col_str; items[MESSAGE_TYPE_COLUMN].value.string_value = col_str;

View File

@ -2764,7 +2764,7 @@ static void gsm_map_stat_init(stat_tap_table_ui* new_stat)
if (ocs) { if (ocs) {
col_str = g_strdup(ocs); col_str = g_strdup(ocs);
} else { } else {
col_str = g_strdup_printf("Unknown op code %d", i); col_str = ws_strdup_printf("Unknown op code %d", i);
} }
items[ID_COLUMN].value.uint_value = i; items[ID_COLUMN].value.uint_value = i;

View File

@ -483,7 +483,7 @@ attribute_types_update_cb(void *r, char **err)
*/ */
c = proto_check_field_name(rec->attribute_type); c = proto_check_field_name(rec->attribute_type);
if (c) { if (c) {
*err = g_strdup_printf("Attribute type can't contain '%c'", c); *err = ws_strdup_printf("Attribute type can't contain '%c'", c);
return FALSE; return FALSE;
} }
@ -576,7 +576,7 @@ attribute_types_post_update_cb(void)
dynamic_hf[i].p_id = hf_id; dynamic_hf[i].p_id = hf_id;
dynamic_hf[i].hfinfo.name = attribute_type; dynamic_hf[i].hfinfo.name = attribute_type;
dynamic_hf[i].hfinfo.abbrev = g_strdup_printf("ldap.AttributeValue.%s", attribute_type); dynamic_hf[i].hfinfo.abbrev = ws_strdup_printf("ldap.AttributeValue.%s", attribute_type);
dynamic_hf[i].hfinfo.type = FT_STRING; dynamic_hf[i].hfinfo.type = FT_STRING;
dynamic_hf[i].hfinfo.display = BASE_NONE; dynamic_hf[i].hfinfo.display = BASE_NONE;
dynamic_hf[i].hfinfo.strings = NULL; dynamic_hf[i].hfinfo.strings = NULL;

View File

@ -196,7 +196,7 @@ dissect_file_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
/* XXX - add other hardware exception codes as required */ /* XXX - add other hardware exception codes as required */
default: default:
show_exception(tvb, pinfo, parent_tree, DissectorError, show_exception(tvb, pinfo, parent_tree, DissectorError,
g_strdup_printf("dissector caused an unknown exception: 0x%x", GetExceptionCode())); ws_strdup_printf("dissector caused an unknown exception: 0x%x", GetExceptionCode()));
} }
} }
#endif #endif
@ -261,7 +261,7 @@ dissect_file_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
/* XXX - add other hardware exception codes as required */ /* XXX - add other hardware exception codes as required */
default: default:
show_exception(tvb, pinfo, parent_tree, DissectorError, show_exception(tvb, pinfo, parent_tree, DissectorError,
g_strdup_printf("dissector caused an unknown exception: 0x%x", GetExceptionCode())); ws_strdup_printf("dissector caused an unknown exception: 0x%x", GetExceptionCode()));
} }
} }
#endif #endif

View File

@ -194,22 +194,22 @@ update_ipdum_message_list(void *r, char **err) {
ipdum_message_list_uat_t *rec = (ipdum_message_list_uat_t *)r; ipdum_message_list_uat_t *rec = (ipdum_message_list_uat_t *)r;
if (rec->pos >= 0xffff) { if (rec->pos >= 0xffff) {
*err = g_strdup_printf("Position too big"); *err = ws_strdup_printf("Position too big");
return FALSE; return FALSE;
} }
if (rec->num_of_params >= 0xffff) { if (rec->num_of_params >= 0xffff) {
*err = g_strdup_printf("Number of PDUs too big"); *err = ws_strdup_printf("Number of PDUs too big");
return FALSE; return FALSE;
} }
if (rec->pos >= rec->num_of_params) { if (rec->pos >= rec->num_of_params) {
*err = g_strdup_printf("Position >= Number of PDUs"); *err = ws_strdup_printf("Position >= Number of PDUs");
return FALSE; return FALSE;
} }
if (rec->name == NULL || rec->name[0] == 0) { if (rec->name == NULL || rec->name[0] == 0) {
*err = g_strdup_printf("Name cannot be empty"); *err = ws_strdup_printf("Name cannot be empty");
return FALSE; return FALSE;
} }
@ -414,12 +414,12 @@ update_ipdum_flexray_mapping(void *r, char **err) {
ipdum_flexray_mapping_uat_t *rec = (ipdum_flexray_mapping_uat_t *)r; ipdum_flexray_mapping_uat_t *rec = (ipdum_flexray_mapping_uat_t *)r;
if (rec->cycle > 0xff) { if (rec->cycle > 0xff) {
*err = g_strdup_printf("We currently only support 8 bit Cycles (Cycle: %i Frame ID: %i)", rec->cycle, rec->frame_id); *err = ws_strdup_printf("We currently only support 8 bit Cycles (Cycle: %i Frame ID: %i)", rec->cycle, rec->frame_id);
return FALSE; return FALSE;
} }
if (rec->frame_id > 0xffff) { if (rec->frame_id > 0xffff) {
*err = g_strdup_printf("We currently only support 16 bit Frame IDs (Cycle: %i Frame ID: %i)", rec->cycle, rec->frame_id); *err = ws_strdup_printf("We currently only support 16 bit Frame IDs (Cycle: %i Frame ID: %i)", rec->cycle, rec->frame_id);
return FALSE; return FALSE;
} }
@ -492,12 +492,12 @@ update_ipdum_lin_mapping(void *r, char **err) {
ipdum_lin_mapping_uat_t *rec = (ipdum_lin_mapping_uat_t *)r; ipdum_lin_mapping_uat_t *rec = (ipdum_lin_mapping_uat_t *)r;
if (rec->frame_id > LIN_ID_MASK) { if (rec->frame_id > LIN_ID_MASK) {
*err = g_strdup_printf("LIN Frame IDs are only uint with 6 bits (ID: %i)", rec->frame_id); *err = ws_strdup_printf("LIN Frame IDs are only uint with 6 bits (ID: %i)", rec->frame_id);
return FALSE; return FALSE;
} }
if (rec->bus_id > 0xffff) { if (rec->bus_id > 0xffff) {
*err = g_strdup_printf("LIN Bus IDs are only uint with 16 bits (ID: 0x%x, Bus ID: 0x%x)", rec->frame_id, rec->bus_id); *err = ws_strdup_printf("LIN Bus IDs are only uint with 16 bits (ID: 0x%x, Bus ID: 0x%x)", rec->frame_id, rec->bus_id);
return FALSE; return FALSE;
} }
@ -597,7 +597,7 @@ update_ipdum_pdu_transport_mapping(void *r, char **err) {
ipdum_pdu_transport_mapping_uat_t *rec = (ipdum_pdu_transport_mapping_uat_t *)r; ipdum_pdu_transport_mapping_uat_t *rec = (ipdum_pdu_transport_mapping_uat_t *)r;
if (rec->pdu_id > 0xffffffff) { if (rec->pdu_id > 0xffffffff) {
*err = g_strdup_printf("PDU-Transport IDs are only uint32 (ID: %i)", rec->pdu_id); *err = ws_strdup_printf("PDU-Transport IDs are only uint32 (ID: %i)", rec->pdu_id);
return FALSE; return FALSE;
} }

View File

@ -153,35 +153,35 @@ user_data_fields_update_cb(void *r, char **err)
*err = NULL; *err = NULL;
if (rec->udf_length == 0) { if (rec->udf_length == 0) {
*err = g_strdup_printf("length of user data field can't be 0 Bytes (name: %s offset: %i length: %i)", rec->udf_name, rec->udf_offset, rec->udf_length); *err = ws_strdup_printf("length of user data field can't be 0 Bytes (name: %s offset: %i length: %i)", rec->udf_name, rec->udf_offset, rec->udf_length);
return (*err == NULL); return (*err == NULL);
} }
if (rec->udf_length > 8) { if (rec->udf_length > 8) {
*err = g_strdup_printf("length of user data field can't be greater 8 Bytes (name: %s offset: %i length: %i)", rec->udf_name, rec->udf_offset, rec->udf_length); *err = ws_strdup_printf("length of user data field can't be greater 8 Bytes (name: %s offset: %i length: %i)", rec->udf_name, rec->udf_offset, rec->udf_length);
return (*err == NULL); return (*err == NULL);
} }
if (rec->udf_mask >= G_MAXUINT64) { if (rec->udf_mask >= G_MAXUINT64) {
*err = g_strdup_printf("mask can only be up to 64bits (name: %s)", rec->udf_name); *err = ws_strdup_printf("mask can only be up to 64bits (name: %s)", rec->udf_name);
return (*err == NULL); return (*err == NULL);
} }
if (rec->udf_name == NULL) { if (rec->udf_name == NULL) {
*err = g_strdup_printf("Name of user data field can't be empty"); *err = ws_strdup_printf("Name of user data field can't be empty");
return (*err == NULL); return (*err == NULL);
} }
g_strstrip(rec->udf_name); g_strstrip(rec->udf_name);
if (rec->udf_name[0] == 0) { if (rec->udf_name[0] == 0) {
*err = g_strdup_printf("Name of user data field can't be empty"); *err = ws_strdup_printf("Name of user data field can't be empty");
return (*err == NULL); return (*err == NULL);
} }
/* Check for invalid characters (to avoid asserting out when registering the field). */ /* Check for invalid characters (to avoid asserting out when registering the field). */
c = proto_check_field_name(rec->udf_name); c = proto_check_field_name(rec->udf_name);
if (c) { if (c) {
*err = g_strdup_printf("Name of user data field can't contain '%c'", c); *err = ws_strdup_printf("Name of user data field can't contain '%c'", c);
return (*err == NULL); return (*err == NULL);
} }
@ -236,7 +236,7 @@ static gchar*
calc_hf_key(user_data_field_t udf) calc_hf_key(user_data_field_t udf)
{ {
gchar* ret = NULL; gchar* ret = NULL;
ret = g_strdup_printf("%i-%i-%" PRIu64 "-%s", udf.udf_offset, udf.udf_length, udf.udf_mask, udf.udf_name); ret = ws_strdup_printf("%i-%i-%" PRIu64 "-%s", udf.udf_offset, udf.udf_length, udf.udf_mask, udf.udf_name);
return ret; return ret;
} }
@ -339,14 +339,14 @@ user_data_post_update_cb(void)
if (user_data_fields[i].udf_mask == 0 || user_data_fields[i].udf_length <= 0 || user_data_fields[i].udf_length>8) { if (user_data_fields[i].udf_mask == 0 || user_data_fields[i].udf_length <= 0 || user_data_fields[i].udf_length>8) {
dynamic_hf[i].hfinfo.name = g_strdup(user_data_fields[i].udf_name); dynamic_hf[i].hfinfo.name = g_strdup(user_data_fields[i].udf_name);
dynamic_hf[i].hfinfo.abbrev = g_strdup_printf("autosar-nm.user_data.%s", user_data_fields[i].udf_name); dynamic_hf[i].hfinfo.abbrev = ws_strdup_printf("autosar-nm.user_data.%s", user_data_fields[i].udf_name);
dynamic_hf[i].hfinfo.type = FT_BYTES; dynamic_hf[i].hfinfo.type = FT_BYTES;
dynamic_hf[i].hfinfo.display = BASE_NONE; dynamic_hf[i].hfinfo.display = BASE_NONE;
dynamic_hf[i].hfinfo.bitmask = 0; dynamic_hf[i].hfinfo.bitmask = 0;
dynamic_hf[i].hfinfo.blurb = g_strdup(user_data_fields[i].udf_desc); dynamic_hf[i].hfinfo.blurb = g_strdup(user_data_fields[i].udf_desc);
} else { } else {
dynamic_hf[i].hfinfo.name = g_strdup(user_data_fields[i].udf_value_desc); dynamic_hf[i].hfinfo.name = g_strdup(user_data_fields[i].udf_value_desc);
dynamic_hf[i].hfinfo.abbrev = g_strdup_printf("autosar-nm.user_data.%s.%s", user_data_fields[i].udf_name, user_data_fields[i].udf_value_desc); dynamic_hf[i].hfinfo.abbrev = ws_strdup_printf("autosar-nm.user_data.%s.%s", user_data_fields[i].udf_name, user_data_fields[i].udf_value_desc);
dynamic_hf[i].hfinfo.type = FT_BOOLEAN; dynamic_hf[i].hfinfo.type = FT_BOOLEAN;
dynamic_hf[i].hfinfo.display = 8 * (user_data_fields[i].udf_length); dynamic_hf[i].hfinfo.display = 8 * (user_data_fields[i].udf_length);
/* dynamic_hf[i].hfinfo.bitmask = 0; */ /* dynamic_hf[i].hfinfo.bitmask = 0; */

View File

@ -856,7 +856,7 @@ de_bssgp_cell_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of
proto_tree_add_item(tree, hf_bssgp_ci, tvb, curr_offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_bssgp_ci, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
curr_offset+=2; curr_offset+=2;
if (add_string) { if (add_string) {
char *str = g_strdup_printf("%s, CI %u", add_string, ci); char *str = ws_strdup_printf("%s, CI %u", add_string, ci);
g_strlcpy(add_string, str, string_len); g_strlcpy(add_string, str, string_len);
g_free(str); g_free(str);
} }
@ -2312,7 +2312,7 @@ de_bssgp_rim_routing_inf(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gu
proto_tree_add_item(tree, hf_bssgp_rnc_id, tvb, curr_offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_bssgp_rnc_id, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
if (add_string) { if (add_string) {
char *str = g_strdup_printf(" %s, RNC-ID %u", add_string, rnc_id); char *str = ws_strdup_printf(" %s, RNC-ID %u", add_string, rnc_id);
g_strlcpy(add_string, str, string_len); g_strlcpy(add_string, str, string_len);
g_free(str); g_free(str);
} }
@ -2769,7 +2769,7 @@ de_bssgp_rnc_identifier(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui
curr_offset+=2; curr_offset+=2;
if (add_string) { if (add_string) {
char *str = g_strdup_printf(" %s, RNC-ID %u", add_string, rnc_id); char *str = ws_strdup_printf(" %s, RNC-ID %u", add_string, rnc_id);
g_strlcpy(add_string, str, string_len); g_strlcpy(add_string, str, string_len);
g_free(str); g_free(str);
} }

View File

@ -8207,7 +8207,7 @@ compute_ascii_key(guchar **ascii_key, const gchar *key, const gchar *key_name, g
{ {
g_free(*ascii_key); g_free(*ascii_key);
*ascii_key = NULL; *ascii_key = NULL;
*err = g_strdup_printf("Key %s begins with an invalid hex char (%c)", key, key[i]); *err = ws_strdup_printf("Key %s begins with an invalid hex char (%c)", key, key[i]);
return -1; /* not a valid hex digit */ return -1; /* not a valid hex digit */
} }
(*ascii_key)[j] = (guchar)hex_digit; (*ascii_key)[j] = (guchar)hex_digit;
@ -8230,7 +8230,7 @@ compute_ascii_key(guchar **ascii_key, const gchar *key, const gchar *key_name, g
{ {
g_free(*ascii_key); g_free(*ascii_key);
*ascii_key = NULL; *ascii_key = NULL;
*err = g_strdup_printf("%s %s has an invalid hex char (%c)", key_name, key, key[i-1]); *err = ws_strdup_printf("%s %s has an invalid hex char (%c)", key_name, key, key[i-1]);
return -1; /* not a valid hex digit */ return -1; /* not a valid hex digit */
} }
key_byte = ((guchar)hex_digit) << 4; key_byte = ((guchar)hex_digit) << 4;
@ -8240,7 +8240,7 @@ compute_ascii_key(guchar **ascii_key, const gchar *key, const gchar *key_name, g
{ {
g_free(*ascii_key); g_free(*ascii_key);
*ascii_key = NULL; *ascii_key = NULL;
*err = g_strdup_printf("%s %s has an invalid hex char (%c)", key_name, key, key[i-1]); *err = ws_strdup_printf("%s %s has an invalid hex char (%c)", key_name, key, key[i-1]);
return -1; /* not a valid hex digit */ return -1; /* not a valid hex digit */
} }
key_byte |= (guchar)hex_digit; key_byte |= (guchar)hex_digit;
@ -8250,7 +8250,7 @@ compute_ascii_key(guchar **ascii_key, const gchar *key, const gchar *key_name, g
(*ascii_key)[j] = '\0'; (*ascii_key)[j] = '\0';
} else { } else {
*ascii_key = NULL; *ascii_key = NULL;
*err = g_strdup_printf("%s %s has to start with '0x' or '0X', and represent exactly %d octets", key_name, key, expected_octets); *err = ws_strdup_printf("%s %s has to start with '0x' or '0X', and represent exactly %d octets", key_name, key, expected_octets);
return -1; return -1;
} }
} }

View File

@ -8213,9 +8213,9 @@ static void camel_stat_init(stat_tap_table_ui* new_stat)
const char *ocs = try_val_to_str(i, camel_opr_code_strings); const char *ocs = try_val_to_str(i, camel_opr_code_strings);
char *col_str; char *col_str;
if (ocs) { if (ocs) {
col_str = g_strdup_printf("Request %s", ocs); col_str = ws_strdup_printf("Request %s", ocs);
} else { } else {
col_str = g_strdup_printf("Unknown op code %d", i); col_str = ws_strdup_printf("Unknown op code %d", i);
} }
items[MESSAGE_TYPE_COLUMN].value.string_value = col_str; items[MESSAGE_TYPE_COLUMN].value.string_value = col_str;

View File

@ -525,7 +525,7 @@ dccp_build_filter(packet_info *pinfo)
{ {
if( pinfo->net_src.type == AT_IPv4 && pinfo->net_dst.type == AT_IPv4 ) { if( pinfo->net_src.type == AT_IPv4 && pinfo->net_dst.type == AT_IPv4 ) {
/* DCCP over IPv4 */ /* DCCP over IPv4 */
return g_strdup_printf("(ip.addr eq %s and ip.addr eq %s) and (dccp.port eq %d and dccp.port eq %d)", return ws_strdup_printf("(ip.addr eq %s and ip.addr eq %s) and (dccp.port eq %d and dccp.port eq %d)",
address_to_str(pinfo->pool, &pinfo->net_src), address_to_str(pinfo->pool, &pinfo->net_src),
address_to_str(pinfo->pool, &pinfo->net_dst), address_to_str(pinfo->pool, &pinfo->net_dst),
pinfo->srcport, pinfo->destport ); pinfo->srcport, pinfo->destport );
@ -533,7 +533,7 @@ dccp_build_filter(packet_info *pinfo)
if( pinfo->net_src.type == AT_IPv6 && pinfo->net_dst.type == AT_IPv6 ) { if( pinfo->net_src.type == AT_IPv6 && pinfo->net_dst.type == AT_IPv6 ) {
/* DCCP over IPv6 */ /* DCCP over IPv6 */
return g_strdup_printf("(ipv6.addr eq %s and ipv6.addr eq %s) and (dccp.port eq %d and dccp.port eq %d)", return ws_strdup_printf("(ipv6.addr eq %s and ipv6.addr eq %s) and (dccp.port eq %d and dccp.port eq %d)",
address_to_str(pinfo->pool, &pinfo->net_src), address_to_str(pinfo->pool, &pinfo->net_src),
address_to_str(pinfo->pool, &pinfo->net_dst), address_to_str(pinfo->pool, &pinfo->net_dst),
pinfo->srcport, pinfo->destport ); pinfo->srcport, pinfo->destport );
@ -554,7 +554,7 @@ static gchar *dccp_follow_conv_filter(epan_dissect_t *edt _U_, packet_info *pinf
/* DCCP over IPv4/6 */ /* DCCP over IPv4/6 */
dccpd = get_dccp_conversation_data(conv, pinfo); dccpd = get_dccp_conversation_data(conv, pinfo);
*stream = dccpd->stream; *stream = dccpd->stream;
return g_strdup_printf("dccp.stream eq %u", dccpd->stream); return ws_strdup_printf("dccp.stream eq %u", dccpd->stream);
} }
return NULL; return NULL;
@ -562,7 +562,7 @@ static gchar *dccp_follow_conv_filter(epan_dissect_t *edt _U_, packet_info *pinf
static gchar *dccp_follow_index_filter(guint stream, guint sub_stream _U_) static gchar *dccp_follow_index_filter(guint stream, guint sub_stream _U_)
{ {
return g_strdup_printf("dccp.stream eq %u", stream); return ws_strdup_printf("dccp.stream eq %u", stream);
} }
static gchar *dccp_follow_address_filter(address *src_addr, address *dst_addr, int src_port, int dst_port) static gchar *dccp_follow_address_filter(address *src_addr, address *dst_addr, int src_port, int dst_port)
@ -574,7 +574,7 @@ static gchar *dccp_follow_address_filter(address *src_addr, address *dst_addr, i
address_to_str_buf(src_addr, src_addr_str, sizeof(src_addr_str)); address_to_str_buf(src_addr, src_addr_str, sizeof(src_addr_str));
address_to_str_buf(dst_addr, dst_addr_str, sizeof(dst_addr_str)); address_to_str_buf(dst_addr, dst_addr_str, sizeof(dst_addr_str));
return g_strdup_printf("((ip%s.src eq %s and dccp.srcport eq %d) and " return ws_strdup_printf("((ip%s.src eq %s and dccp.srcport eq %d) and "
"(ip%s.dst eq %s and dccp.dstport eq %d))" "(ip%s.dst eq %s and dccp.dstport eq %d))"
" or " " or "
"((ip%s.src eq %s and dccp.srcport eq %d) and " "((ip%s.src eq %s and dccp.srcport eq %d) and "

View File

@ -2039,11 +2039,11 @@ dcerpcstat_param(register_srt_t* srt, const char* opt_arg, char** err)
&d1,&d2,&d3,&d40,&d41,&d42,&d43,&d44,&d45,&d46,&d47,&major,&minor,&pos) == 13) &d1,&d2,&d3,&d40,&d41,&d42,&d43,&d44,&d45,&d46,&d47,&major,&minor,&pos) == 13)
{ {
if ((major < 0) || (major > 65535)) { if ((major < 0) || (major > 65535)) {
*err = g_strdup_printf("dcerpcstat_init() Major version number %d is invalid - must be positive and <= 65535", major); *err = ws_strdup_printf("dcerpcstat_init() Major version number %d is invalid - must be positive and <= 65535", major);
return pos; return pos;
} }
if ((minor < 0) || (minor > 65535)) { if ((minor < 0) || (minor > 65535)) {
*err = g_strdup_printf("dcerpcstat_init() Minor version number %d is invalid - must be positive and <= 65535", minor); *err = ws_strdup_printf("dcerpcstat_init() Minor version number %d is invalid - must be positive and <= 65535", minor);
return pos; return pos;
} }
ver = major; ver = major;
@ -2079,7 +2079,7 @@ dcerpcstat_param(register_srt_t* srt, const char* opt_arg, char** err)
} }
else else
{ {
*err = g_strdup_printf("<uuid>,<major version>.<minor version>[,<filter>]"); *err = ws_strdup_printf("<uuid>,<major version>.<minor version>[,<filter>]");
} }
return pos; return pos;

View File

@ -1667,7 +1667,7 @@ static gboolean uat_dhcp_record_update_cb(void* r, char** err) {
uat_dhcp_record_t* rec = (uat_dhcp_record_t *)r; uat_dhcp_record_t* rec = (uat_dhcp_record_t *)r;
if ((rec->opt == 0) || (rec->opt >=DHCP_OPT_NUM-1)) { if ((rec->opt == 0) || (rec->opt >=DHCP_OPT_NUM-1)) {
*err = g_strdup_printf("Option must be between 1 and %d", DHCP_OPT_NUM-2); *err = ws_strdup_printf("Option must be between 1 and %d", DHCP_OPT_NUM-2);
return FALSE; return FALSE;
} }
return TRUE; return TRUE;

View File

@ -472,7 +472,7 @@ update_generic_one_identifier_16bit(void *r, char **err) {
generic_one_id_string_t *rec = (generic_one_id_string_t *)r; generic_one_id_string_t *rec = (generic_one_id_string_t *)r;
if (rec->id > 0xffff) { if (rec->id > 0xffff) {
*err = g_strdup_printf("We currently only support 16 bit identifiers (ID: %i Name: %s)", rec->id, rec->name); *err = ws_strdup_printf("We currently only support 16 bit identifiers (ID: %i Name: %s)", rec->id, rec->name);
return FALSE; return FALSE;
} }

View File

@ -1799,12 +1799,12 @@ dtlsdecrypt_uat_fld_protocol_chk_cb(void* r _U_, const char* p, guint len _U_, c
if (!find_dissector(p)) { if (!find_dissector(p)) {
if (proto_get_id_by_filter_name(p) != -1) { if (proto_get_id_by_filter_name(p) != -1) {
*err = g_strdup_printf("While '%s' is a valid dissector filter name, that dissector is not configured" *err = ws_strdup_printf("While '%s' is a valid dissector filter name, that dissector is not configured"
" to support DTLS decryption.\n\n" " to support DTLS decryption.\n\n"
"If you need to decrypt '%s' over DTLS, please contact the Wireshark development team.", p, p); "If you need to decrypt '%s' over DTLS, please contact the Wireshark development team.", p, p);
} else { } else {
char* ssl_str = ssl_association_info("dtls.port", "UDP"); char* ssl_str = ssl_association_info("dtls.port", "UDP");
*err = g_strdup_printf("Could not find dissector for: '%s'\nCommonly used DTLS dissectors include:\n%s", p, ssl_str); *err = ws_strdup_printf("Could not find dissector for: '%s'\nCommonly used DTLS dissectors include:\n%s", p, ssl_str);
g_free(ssl_str); g_free(ssl_str);
} }
return FALSE; return FALSE;

View File

@ -990,7 +990,7 @@ enip_io_conv_filter(packet_info *pinfo)
if (conn->close_frame > 0) if (conn->close_frame > 0)
{ {
buf = g_strdup_printf( buf = ws_strdup_printf(
"((frame.number == %u) || ((frame.number >= %u) && (frame.number <= %u))) && " /* Frames between ForwardOpen and ForwardClose reply */ "((frame.number == %u) || ((frame.number >= %u) && (frame.number <= %u))) && " /* Frames between ForwardOpen and ForwardClose reply */
"((enip.cpf.sai.connid == 0x%08x || enip.cpf.sai.connid == 0x%08x) || " /* O->T and T->O Connection IDs */ "((enip.cpf.sai.connid == 0x%08x || enip.cpf.sai.connid == 0x%08x) || " /* O->T and T->O Connection IDs */
"((cip.cm.conn_serial_num == 0x%04x) && (cip.cm.vendor == 0x%04x) && (cip.cm.orig_serial_num == 0x%08x)))", /* Connection Triad */ "((cip.cm.conn_serial_num == 0x%04x) && (cip.cm.vendor == 0x%04x) && (cip.cm.orig_serial_num == 0x%08x)))", /* Connection Triad */
@ -1001,7 +1001,7 @@ enip_io_conv_filter(packet_info *pinfo)
else else
{ {
/* If Forward Close isn't found, don't limit the (end) frame range */ /* If Forward Close isn't found, don't limit the (end) frame range */
buf = g_strdup_printf( buf = ws_strdup_printf(
"((frame.number == %u) || (frame.number >= %u)) && " /* Frames starting with ForwardOpen */ "((frame.number == %u) || (frame.number >= %u)) && " /* Frames starting with ForwardOpen */
"((enip.cpf.sai.connid == 0x%08x || enip.cpf.sai.connid == 0x%08x) || " /* O->T and T->O Connection IDs */ "((enip.cpf.sai.connid == 0x%08x || enip.cpf.sai.connid == 0x%08x) || " /* O->T and T->O Connection IDs */
"((cip.cm.conn_serial_num == 0x%04x) && (cip.cm.vendor == 0x%04x) && (cip.cm.orig_serial_num == 0x%08x)))", /* Connection Triad */ "((cip.cm.conn_serial_num == 0x%04x) && (cip.cm.vendor == 0x%04x) && (cip.cm.orig_serial_num == 0x%08x)))", /* Connection Triad */
@ -1036,7 +1036,7 @@ enip_exp_conv_filter(packet_info *pinfo)
if (conn->close_frame > 0) if (conn->close_frame > 0)
{ {
buf = g_strdup_printf( buf = ws_strdup_printf(
"((frame.number == %u) || ((frame.number >= %u) && (frame.number <= %u))) && " /* Frames between ForwardOpen and ForwardClose reply */ "((frame.number == %u) || ((frame.number >= %u) && (frame.number <= %u))) && " /* Frames between ForwardOpen and ForwardClose reply */
"((enip.cpf.cai.connid == 0x%08x || enip.cpf.cai.connid == 0x%08x) || " /* O->T and T->O Connection IDs */ "((enip.cpf.cai.connid == 0x%08x || enip.cpf.cai.connid == 0x%08x) || " /* O->T and T->O Connection IDs */
"((cip.cm.conn_serial_num == 0x%04x) && (cip.cm.vendor == 0x%04x) && (cip.cm.orig_serial_num == 0x%08x)))", /* Connection Triad */ "((cip.cm.conn_serial_num == 0x%04x) && (cip.cm.vendor == 0x%04x) && (cip.cm.orig_serial_num == 0x%08x)))", /* Connection Triad */
@ -1047,7 +1047,7 @@ enip_exp_conv_filter(packet_info *pinfo)
else else
{ {
/* If Forward Close isn't found, don't limit the (end) frame range */ /* If Forward Close isn't found, don't limit the (end) frame range */
buf = g_strdup_printf( buf = ws_strdup_printf(
"((frame.number == %u) || (frame.number >= %u)) && " /* Frames between ForwardOpen and ForwardClose */ "((frame.number == %u) || (frame.number >= %u)) && " /* Frames between ForwardOpen and ForwardClose */
"((enip.cpf.cai.connid == 0x%08x || enip.cpf.cai.connid == 0x%08x) || " /* O->T and T->O Connection IDs */ "((enip.cpf.cai.connid == 0x%08x || enip.cpf.cai.connid == 0x%08x) || " /* O->T and T->O Connection IDs */
"((cip.cm.conn_serial_num == 0x%04x) && (cip.cm.vendor == 0x%04x) && (cip.cm.orig_serial_num == 0x%08x)))", /* Connection Triad */ "((cip.cm.conn_serial_num == 0x%04x) && (cip.cm.vendor == 0x%04x) && (cip.cm.orig_serial_num == 0x%08x)))", /* Connection Triad */

View File

@ -6503,7 +6503,7 @@ epl_profile_uat_fld_fileopen_check_cb(void *record _U_, const char *path, guint
if (ws_stat64(path, &st) != 0) if (ws_stat64(path, &st) != 0)
{ {
*err = g_strdup_printf("File '%s' does not exist or access was denied.", path); *err = ws_strdup_printf("File '%s' does not exist or access was denied.", path);
return FALSE; return FALSE;
} }
@ -6520,7 +6520,7 @@ epl_profile_uat_fld_fileopen_check_cb(void *record _U_, const char *path, guint
*err = NULL; *err = NULL;
return TRUE; return TRUE;
#else #else
*err = g_strdup_printf("*.xdd and *.xdc support not compiled in. %s", supported); *err = ws_strdup_printf("*.xdd and *.xdc support not compiled in. %s", supported);
return FALSE; return FALSE;
#endif #endif
} }

View File

@ -298,7 +298,7 @@ add_symbols_of_file(const char *filename)
pos = strcspn(line, ","); pos = strcspn(line, ",");
if ((line[pos] != '\0') && (line[pos+1] !='\0')) /* require at least 1 char in symbol */ if ((line[pos] != '\0') && (line[pos+1] !='\0')) /* require at least 1 char in symbol */
gbl_symbols_array_append(hash, gbl_symbols_array_append(hash,
g_strdup_printf("%." ETCH_MAX_SYMBOL_LENGTH "s", &line[pos+1])); ws_strdup_printf("%." ETCH_MAX_SYMBOL_LENGTH "s", &line[pos+1]));
} }
fclose(pFile); fclose(pFile);
} }
@ -335,7 +335,7 @@ read_hashed_symbols_from_dir(const char *dirname)
if (g_str_has_suffix(file, ".ewh")) { if (g_str_has_suffix(file, ".ewh")) {
filename = filename =
g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", dirname, ws_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", dirname,
name); name);
add_symbols_of_file(filename); add_symbols_of_file(filename);
g_free(filename); g_free(filename);

View File

@ -197,7 +197,7 @@ eth_filter_valid(packet_info *pinfo)
static gchar* static gchar*
eth_build_filter(packet_info *pinfo) eth_build_filter(packet_info *pinfo)
{ {
return g_strdup_printf("eth.addr eq %s and eth.addr eq %s", return ws_strdup_printf("eth.addr eq %s and eth.addr eq %s",
address_to_str(pinfo->pool, &pinfo->dl_src), address_to_str(pinfo->pool, &pinfo->dl_src),
address_to_str(pinfo->pool, &pinfo->dl_dst)); address_to_str(pinfo->pool, &pinfo->dl_dst));
} }

View File

@ -480,7 +480,7 @@ f5_udp_conv_valid(packet_info *pinfo)
* @return A filter string for the F5 IP conversation or NULL if no filter can be * @return A filter string for the F5 IP conversation or NULL if no filter can be
* computed. The caller should free this string with g_free(). * computed. The caller should free this string with g_free().
* *
* @attention This function uses g_strdup_printf() rather than the wmem equivalent because the * @attention This function uses ws_strdup_printf() rather than the wmem equivalent because the
* caller (menu_dissector_filter_cb()) uses g_free to free the filter string. * caller (menu_dissector_filter_cb()) uses g_free to free the filter string.
* (as of WS 1.12). * (as of WS 1.12).
*/ */
@ -496,7 +496,7 @@ f5_ip_conv_filter(packet_info *pinfo)
address_to_str_buf(&pinfo->src, src_addr, WS_INET6_ADDRSTRLEN); address_to_str_buf(&pinfo->src, src_addr, WS_INET6_ADDRSTRLEN);
address_to_str_buf(&pinfo->dst, dst_addr, WS_INET6_ADDRSTRLEN); address_to_str_buf(&pinfo->dst, dst_addr, WS_INET6_ADDRSTRLEN);
if (*src_addr != '\0' && *dst_addr != '\0') { if (*src_addr != '\0' && *dst_addr != '\0') {
buf = g_strdup_printf( buf = ws_strdup_printf(
"(ip.addr eq %s and ip.addr eq %s) or" "(ip.addr eq %s and ip.addr eq %s) or"
" (f5ethtrailer.peeraddr eq %s and f5ethtrailer.peeraddr eq %s)", " (f5ethtrailer.peeraddr eq %s and f5ethtrailer.peeraddr eq %s)",
src_addr, dst_addr, src_addr, dst_addr); src_addr, dst_addr, src_addr, dst_addr);
@ -505,7 +505,7 @@ f5_ip_conv_filter(packet_info *pinfo)
address_to_str_buf(&pinfo->src, src_addr, WS_INET6_ADDRSTRLEN); address_to_str_buf(&pinfo->src, src_addr, WS_INET6_ADDRSTRLEN);
address_to_str_buf(&pinfo->dst, dst_addr, WS_INET6_ADDRSTRLEN); address_to_str_buf(&pinfo->dst, dst_addr, WS_INET6_ADDRSTRLEN);
if (*src_addr != '\0' && *dst_addr != '\0') { if (*src_addr != '\0' && *dst_addr != '\0') {
buf = g_strdup_printf( buf = ws_strdup_printf(
"(ipv6.addr eq %s and ipv6.addr eq %s) or" "(ipv6.addr eq %s and ipv6.addr eq %s) or"
" (f5ethtrailer.peeraddr6 eq %s and f5ethtrailer.peeraddr6 eq %s)", " (f5ethtrailer.peeraddr6 eq %s and f5ethtrailer.peeraddr6 eq %s)",
src_addr, dst_addr, src_addr, dst_addr); src_addr, dst_addr, src_addr, dst_addr);
@ -535,7 +535,7 @@ f5_ip_conv_filter(packet_info *pinfo)
* be filtered properly. In the >=11.0.0 case, if you have TCP on one side and UDP on the other * be filtered properly. In the >=11.0.0 case, if you have TCP on one side and UDP on the other
* and it should "do the right thing". * and it should "do the right thing".
* *
* @attention This function uses g_strdup_printf() rather than the wmem equivalent because the * @attention This function uses ws_strdup_printf() rather than the wmem equivalent because the
* caller (menu_dissector_filter_cb()) uses g_free to free the filter string. * caller (menu_dissector_filter_cb()) uses g_free to free the filter string.
* (as of WS 1.12). * (as of WS 1.12).
*/ */
@ -551,7 +551,7 @@ f5_tcp_conv_filter(packet_info *pinfo)
address_to_str_buf(&pinfo->src, src_addr, WS_INET6_ADDRSTRLEN); address_to_str_buf(&pinfo->src, src_addr, WS_INET6_ADDRSTRLEN);
address_to_str_buf(&pinfo->dst, dst_addr, WS_INET6_ADDRSTRLEN); address_to_str_buf(&pinfo->dst, dst_addr, WS_INET6_ADDRSTRLEN);
if (*src_addr != '\0' && *dst_addr != '\0') { if (*src_addr != '\0' && *dst_addr != '\0') {
buf = g_strdup_printf( buf = ws_strdup_printf(
"(ip.addr eq %s and ip.addr eq %s and tcp.port eq %d and tcp.port eq %d) or" "(ip.addr eq %s and ip.addr eq %s and tcp.port eq %d and tcp.port eq %d) or"
" (f5ethtrailer.peeraddr eq %s and f5ethtrailer.peeraddr eq %s and" " (f5ethtrailer.peeraddr eq %s and f5ethtrailer.peeraddr eq %s and"
" f5ethtrailer.peerport eq %d and f5ethtrailer.peerport eq %d and" " f5ethtrailer.peerport eq %d and f5ethtrailer.peerport eq %d and"
@ -563,7 +563,7 @@ f5_tcp_conv_filter(packet_info *pinfo)
address_to_str_buf(&pinfo->src, src_addr, WS_INET6_ADDRSTRLEN); address_to_str_buf(&pinfo->src, src_addr, WS_INET6_ADDRSTRLEN);
address_to_str_buf(&pinfo->dst, dst_addr, WS_INET6_ADDRSTRLEN); address_to_str_buf(&pinfo->dst, dst_addr, WS_INET6_ADDRSTRLEN);
if (*src_addr != '\0' && *dst_addr != '\0') { if (*src_addr != '\0' && *dst_addr != '\0') {
buf = g_strdup_printf( buf = ws_strdup_printf(
"(ipv6.addr eq %s and ipv6.addr eq %s and tcp.port eq %d and tcp.port eq %d) or" "(ipv6.addr eq %s and ipv6.addr eq %s and tcp.port eq %d and tcp.port eq %d) or"
" (f5ethtrailer.peeraddr6 eq %s and f5ethtrailer.peeraddr6 eq %s and" " (f5ethtrailer.peeraddr6 eq %s and f5ethtrailer.peeraddr6 eq %s and"
" f5ethtrailer.peerport eq %d and f5ethtrailer.peerport eq %d and" " f5ethtrailer.peerport eq %d and f5ethtrailer.peerport eq %d and"
@ -595,7 +595,7 @@ f5_tcp_conv_filter(packet_info *pinfo)
* be filtered properly. In the >=11.0.0 case, if you have TCP on one side and UDP on the other * be filtered properly. In the >=11.0.0 case, if you have TCP on one side and UDP on the other
* and it should "do the right thing". * and it should "do the right thing".
* *
* @attention This function uses g_strdup_printf() rather than the wmem equivalent because the * @attention This function uses ws_strdup_printf() rather than the wmem equivalent because the
* caller (menu_dissector_filter_cb()) uses g_free to free the filter string. * caller (menu_dissector_filter_cb()) uses g_free to free the filter string.
* (as of WS 1.12). * (as of WS 1.12).
*/ */
@ -611,7 +611,7 @@ f5_udp_conv_filter(packet_info *pinfo)
address_to_str_buf(&pinfo->src, src_addr, WS_INET6_ADDRSTRLEN); address_to_str_buf(&pinfo->src, src_addr, WS_INET6_ADDRSTRLEN);
address_to_str_buf(&pinfo->dst, dst_addr, WS_INET6_ADDRSTRLEN); address_to_str_buf(&pinfo->dst, dst_addr, WS_INET6_ADDRSTRLEN);
if (*src_addr != '\0' && *dst_addr != '\0') { if (*src_addr != '\0' && *dst_addr != '\0') {
buf = g_strdup_printf( buf = ws_strdup_printf(
"(ip.addr eq %s and ip.addr eq %s and udp.port eq %d and udp.port eq %d) or" "(ip.addr eq %s and ip.addr eq %s and udp.port eq %d and udp.port eq %d) or"
" (f5ethtrailer.peeraddr eq %s and f5ethtrailer.peeraddr eq %s and" " (f5ethtrailer.peeraddr eq %s and f5ethtrailer.peeraddr eq %s and"
" f5ethtrailer.peerport eq %d and f5ethtrailer.peerport eq %d and" " f5ethtrailer.peerport eq %d and f5ethtrailer.peerport eq %d and"
@ -623,7 +623,7 @@ f5_udp_conv_filter(packet_info *pinfo)
address_to_str_buf(&pinfo->src, src_addr, WS_INET6_ADDRSTRLEN); address_to_str_buf(&pinfo->src, src_addr, WS_INET6_ADDRSTRLEN);
address_to_str_buf(&pinfo->dst, dst_addr, WS_INET6_ADDRSTRLEN); address_to_str_buf(&pinfo->dst, dst_addr, WS_INET6_ADDRSTRLEN);
if (*src_addr != '\0' && *dst_addr != '\0') { if (*src_addr != '\0' && *dst_addr != '\0') {
buf = g_strdup_printf( buf = ws_strdup_printf(
"(ipv6.addr eq %s and ipv6.addr eq %s and udp.port eq %d and udp.port eq %d) or" "(ipv6.addr eq %s and ipv6.addr eq %s and udp.port eq %d and udp.port eq %d) or"
" (f5ethtrailer.peeraddr6 eq %s and f5ethtrailer.peeraddr6 eq %s and" " (f5ethtrailer.peeraddr6 eq %s and f5ethtrailer.peeraddr6 eq %s and"
" f5ethtrailer.peerport eq %d and f5ethtrailer.peerport eq %d and" " f5ethtrailer.peerport eq %d and f5ethtrailer.peerport eq %d and"

View File

@ -1003,7 +1003,7 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void*
/* XXX - add other hardware exception codes as required */ /* XXX - add other hardware exception codes as required */
default: default:
show_exception(tvb, pinfo, parent_tree, DissectorError, show_exception(tvb, pinfo, parent_tree, DissectorError,
g_strdup_printf("dissector caused an unknown exception: 0x%x", GetExceptionCode())); ws_strdup_printf("dissector caused an unknown exception: 0x%x", GetExceptionCode()));
} }
} }
#endif #endif
@ -1071,7 +1071,7 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void*
/* XXX - add other hardware exception codes as required */ /* XXX - add other hardware exception codes as required */
default: default:
show_exception(tvb, pinfo, parent_tree, DissectorError, show_exception(tvb, pinfo, parent_tree, DissectorError,
g_strdup_printf("dissector caused an unknown exception: 0x%x", GetExceptionCode())); ws_strdup_printf("dissector caused an unknown exception: 0x%x", GetExceptionCode()));
} }
} }
#endif #endif

View File

@ -485,15 +485,15 @@ static gchar* freq_to_str(gfloat freq)
{ {
if (freq < 1e3) if (freq < 1e3)
{ {
return g_strdup_printf("%.12g Hz", freq); return ws_strdup_printf("%.12g Hz", freq);
} }
else if (freq < 1e6) else if (freq < 1e6)
{ {
return g_strdup_printf("%.12g kHz", freq / 1e3); return ws_strdup_printf("%.12g kHz", freq / 1e3);
} }
else else
{ {
return g_strdup_printf("%.12g MHz", freq / 1e6); return ws_strdup_printf("%.12g MHz", freq / 1e6);
} }
} }

View File

@ -1839,7 +1839,7 @@ be_cell_id_type(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 off
} }
else else
{ {
char *str = g_strdup_printf("%s/RNC-ID (%u)", add_string, value); char *str = ws_strdup_printf("%s/RNC-ID (%u)", add_string, value);
g_strlcpy(add_string, str, string_len); g_strlcpy(add_string, str, string_len);
g_free(str); g_free(str);
} }
@ -1868,7 +1868,7 @@ be_cell_id_type(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 off
} }
else else
{ {
char *str = g_strdup_printf("%s/CI (%u)", add_string, value); char *str = ws_strdup_printf("%s/CI (%u)", add_string, value);
g_strlcpy(add_string, str, string_len); g_strlcpy(add_string, str, string_len);
g_free(str); g_free(str);
} }

View File

@ -3712,7 +3712,7 @@ static void gsm_a_stat_init(stat_tap_table_ui* new_stat, const char *table_title
if (msg_str) { if (msg_str) {
col_str = g_strdup(msg_str); col_str = g_strdup(msg_str);
} else { } else {
col_str = g_strdup_printf("Unknown message %d", i); col_str = ws_strdup_printf("Unknown message %d", i);
} }
items[IEI_COLUMN].value.uint_value = i; items[IEI_COLUMN].value.uint_value = i;

View File

@ -24156,7 +24156,7 @@ static void gsm_map_stat_init(stat_tap_table_ui* new_stat)
if (ocs) { if (ocs) {
col_str = g_strdup(ocs); col_str = g_strdup(ocs);
} else { } else {
col_str = g_strdup_printf("Unknown op code %d", i); col_str = ws_strdup_printf("Unknown op code %d", i);
} }
items[ID_COLUMN].value.uint_value = i; items[ID_COLUMN].value.uint_value = i;

View File

@ -540,7 +540,7 @@ pdcp_uat_fld_ip_chk_cb(void* r _U_, const char* ipaddr, guint len _U_, const voi
return TRUE; return TRUE;
} }
*err = g_strdup_printf("No valid IP address given"); *err = ws_strdup_printf("No valid IP address given");
return FALSE; return FALSE;
} }
@ -564,7 +564,7 @@ pdcp_uat_fld_teid_chk_cb(void* r _U_, const char* teid, guint len _U_, const voi
} }
} }
*err = g_strdup_printf("No valid TEID given"); *err = ws_strdup_printf("No valid TEID given");
return FALSE; return FALSE;
} }
@ -598,7 +598,7 @@ static gboolean pdcp_lte_update_cb(void *r, char **err)
rec->teid_wildcard = FALSE; rec->teid_wildcard = FALSE;
} else { } else {
if (err) if (err)
*err = g_strdup_printf("No valid TEID given"); *err = ws_strdup_printf("No valid TEID given");
return FALSE; return FALSE;
} }
@ -609,7 +609,7 @@ static gboolean pdcp_lte_update_cb(void *r, char **err)
alloc_address_wmem(wmem_epan_scope(), &rec->ip_address, AT_IPv4, sizeof(ws_in4_addr), &ip4_addr); alloc_address_wmem(wmem_epan_scope(), &rec->ip_address, AT_IPv4, sizeof(ws_in4_addr), &ip4_addr);
} else { } else {
if (err) if (err)
*err = g_strdup_printf("No valid IP address given"); *err = ws_strdup_printf("No valid IP address given");
return FALSE; return FALSE;
} }
@ -689,7 +689,7 @@ static gboolean pdcp_nr_update_cb(void *r, char **err) {
rec->teid_wildcard = FALSE; rec->teid_wildcard = FALSE;
} else { } else {
if (err) if (err)
*err = g_strdup_printf("No valid TEID given"); *err = ws_strdup_printf("No valid TEID given");
return FALSE; return FALSE;
} }
@ -700,7 +700,7 @@ static gboolean pdcp_nr_update_cb(void *r, char **err) {
alloc_address_wmem(wmem_epan_scope(), &rec->ip_address, AT_IPv4, sizeof(ws_in4_addr), &ip4_addr); alloc_address_wmem(wmem_epan_scope(), &rec->ip_address, AT_IPv4, sizeof(ws_in4_addr), &ip4_addr);
} else { } else {
if (err) if (err)
*err = g_strdup_printf("No valid IP address given"); *err = ws_strdup_printf("No valid IP address given");
return FALSE; return FALSE;
} }

View File

@ -198,7 +198,7 @@ header_fields_update_cb(void *r, char **err)
*/ */
c = proto_check_field_name(rec->header_name); c = proto_check_field_name(rec->header_name);
if (c) { if (c) {
*err = g_strdup_printf("Header name can't contain '%c'", c); *err = ws_strdup_printf("Header name can't contain '%c'", c);
return FALSE; return FALSE;
} }
@ -2891,7 +2891,7 @@ header_fields_post_update_cb(void)
dynamic_hf[i].p_id = hf_id; dynamic_hf[i].p_id = hf_id;
dynamic_hf[i].hfinfo.name = header_name; dynamic_hf[i].hfinfo.name = header_name;
dynamic_hf[i].hfinfo.abbrev = g_strdup_printf("http.header.%s", header_name); dynamic_hf[i].hfinfo.abbrev = ws_strdup_printf("http.header.%s", header_name);
dynamic_hf[i].hfinfo.type = FT_STRING; dynamic_hf[i].hfinfo.type = FT_STRING;
dynamic_hf[i].hfinfo.display = BASE_NONE; dynamic_hf[i].hfinfo.display = BASE_NONE;
dynamic_hf[i].hfinfo.strings = NULL; dynamic_hf[i].hfinfo.strings = NULL;

View File

@ -576,7 +576,7 @@ header_fields_update_cb(void *r, char **err)
*/ */
c = proto_check_field_name(rec->header_name); c = proto_check_field_name(rec->header_name);
if (c) { if (c) {
*err = g_strdup_printf("Header name can't contain '%c'", c); *err = ws_strdup_printf("Header name can't contain '%c'", c);
return FALSE; return FALSE;
} }
@ -584,7 +584,7 @@ header_fields_update_cb(void *r, char **err)
if (header_fields_hash != NULL) { if (header_fields_hash != NULL) {
const gint *entry = (const gint *) g_hash_table_lookup(header_fields_hash, rec->header_name); const gint *entry = (const gint *) g_hash_table_lookup(header_fields_hash, rec->header_name);
if (entry != NULL) { if (entry != NULL) {
*err = g_strdup_printf("This header field is already defined in UAT or it is a static header field"); *err = ws_strdup_printf("This header field is already defined in UAT or it is a static header field");
return FALSE; return FALSE;
} }
} }
@ -1101,7 +1101,7 @@ http2_init_protocol(void)
hf_uat[i].p_id = hf_id; hf_uat[i].p_id = hf_id;
hf_uat[i].hfinfo.name = header_name; hf_uat[i].hfinfo.name = header_name;
hf_uat[i].hfinfo.abbrev = g_strdup_printf("http2.headers.%s", header_name); hf_uat[i].hfinfo.abbrev = ws_strdup_printf("http2.headers.%s", header_name);
switch(header_fields[i].header_type) { switch(header_fields[i].header_type) {
case val_uint64: case val_uint64:
hf_uat[i].hfinfo.type = FT_UINT64; hf_uat[i].hfinfo.type = FT_UINT64;
@ -2314,7 +2314,7 @@ http2_follow_conv_filter(epan_dissect_t *edt _U_, packet_info *pinfo, guint *str
*stream = tcpd->stream; *stream = tcpd->stream;
*sub_stream = h2session->current_stream_id; *sub_stream = h2session->current_stream_id;
return g_strdup_printf("tcp.stream eq %u and http2.streamid eq %u", tcpd->stream, h2session->current_stream_id); return ws_strdup_printf("tcp.stream eq %u and http2.streamid eq %u", tcpd->stream, h2session->current_stream_id);
} }
return NULL; return NULL;
@ -2395,7 +2395,7 @@ http2_get_stream_id_ge(guint streamid, guint sub_stream_id, guint *sub_stream_id
static gchar* static gchar*
http2_follow_index_filter(guint stream, guint sub_stream) http2_follow_index_filter(guint stream, guint sub_stream)
{ {
return g_strdup_printf("tcp.stream eq %u and http2.streamid eq %u", stream, sub_stream); return ws_strdup_printf("tcp.stream eq %u and http2.streamid eq %u", stream, sub_stream);
} }
static tap_packet_status static tap_packet_status

View File

@ -322,7 +322,7 @@ static gboolean ieee802154_key_update_cb(void *r, char **err)
if (bytes->len < IEEE802154_CIPHER_SIZE) if (bytes->len < IEEE802154_CIPHER_SIZE)
{ {
*err = g_strdup_printf("Key must be at least %d bytes", IEEE802154_CIPHER_SIZE); *err = ws_strdup_printf("Key must be at least %d bytes", IEEE802154_CIPHER_SIZE);
g_byte_array_free(bytes, TRUE); g_byte_array_free(bytes, TRUE);
return FALSE; return FALSE;
} }
@ -5609,7 +5609,7 @@ static gboolean ieee802154_filter_valid(packet_info *pinfo)
static gchar* ieee802154_build_filter(packet_info *pinfo) static gchar* ieee802154_build_filter(packet_info *pinfo)
{ {
return g_strdup_printf("wpan.%s eq %s and wpan.%s eq %s", return ws_strdup_printf("wpan.%s eq %s and wpan.%s eq %s",
(pinfo->dl_src.type == ieee802_15_4_short_address_type) ? "addr16" : "addr64", (pinfo->dl_src.type == ieee802_15_4_short_address_type) ? "addr16" : "addr64",
address_to_str(pinfo->pool, &pinfo->dl_src), address_to_str(pinfo->pool, &pinfo->dl_src),
(pinfo->dl_dst.type == ieee802_15_4_short_address_type) ? "addr16" : "addr64", (pinfo->dl_dst.type == ieee802_15_4_short_address_type) ? "addr16" : "addr64",

View File

@ -169,14 +169,14 @@ imf_eo_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const
/* Only include the string inside of the "<>" brackets. If there is nothing between /* Only include the string inside of the "<>" brackets. If there is nothing between
the two brackets use the sender_data string */ the two brackets use the sender_data string */
if(start && stop && stop > start && (stop - start) > 2){ if(start && stop && stop > start && (stop - start) > 2){
entry->hostname = g_strdup_printf("%.*s", (int) (stop - start - 1), start + 1); entry->hostname = ws_strdup_printf("%.*s", (int) (stop - start - 1), start + 1);
} else { } else {
entry->hostname = g_strdup(eo_info->sender_data); entry->hostname = g_strdup(eo_info->sender_data);
} }
entry->pkt_num = pinfo->num; entry->pkt_num = pinfo->num;
entry->content_type = g_strdup("EML file"); entry->content_type = g_strdup("EML file");
entry->filename = g_strdup_printf("%s.eml", eo_info->subject_data); entry->filename = ws_strdup_printf("%s.eml", eo_info->subject_data);
entry->payload_len = eo_info->payload_len; entry->payload_len = eo_info->payload_len;
entry->payload_data = (guint8 *)g_memdup2(eo_info->payload_data, eo_info->payload_len); entry->payload_data = (guint8 *)g_memdup2(eo_info->payload_data, eo_info->payload_len);
@ -339,7 +339,7 @@ header_fields_update_cb(void *r, char **err)
*/ */
c = proto_check_field_name(rec->header_name); c = proto_check_field_name(rec->header_name);
if (c) { if (c) {
*err = g_strdup_printf("Header name can't contain '%c'", c); *err = ws_strdup_printf("Header name can't contain '%c'", c);
return FALSE; return FALSE;
} }
@ -983,7 +983,7 @@ header_fields_post_update_cb (void)
dynamic_hf[i].p_id = hf_id; dynamic_hf[i].p_id = hf_id;
dynamic_hf[i].hfinfo.name = header_name; dynamic_hf[i].hfinfo.name = header_name;
dynamic_hf[i].hfinfo.abbrev = g_strdup_printf ("imf.header.%s", header_name); dynamic_hf[i].hfinfo.abbrev = ws_strdup_printf ("imf.header.%s", header_name);
dynamic_hf[i].hfinfo.type = FT_STRING; dynamic_hf[i].hfinfo.type = FT_STRING;
dynamic_hf[i].hfinfo.display = BASE_NONE; dynamic_hf[i].hfinfo.display = BASE_NONE;
dynamic_hf[i].hfinfo.strings = NULL; dynamic_hf[i].hfinfo.strings = NULL;

View File

@ -545,7 +545,7 @@ ip_filter_valid(packet_info *pinfo)
static gchar* static gchar*
ip_build_filter(packet_info *pinfo) ip_build_filter(packet_info *pinfo)
{ {
return g_strdup_printf("ip.addr eq %s and ip.addr eq %s", return ws_strdup_printf("ip.addr eq %s and ip.addr eq %s",
address_to_str(pinfo->pool, &pinfo->net_src), address_to_str(pinfo->pool, &pinfo->net_src),
address_to_str(pinfo->pool, &pinfo->net_dst)); address_to_str(pinfo->pool, &pinfo->net_dst));
} }

View File

@ -320,7 +320,7 @@ compute_ascii_key(gchar **ascii_key, const gchar *key, char **err)
{ {
g_free(*ascii_key); g_free(*ascii_key);
*ascii_key = NULL; *ascii_key = NULL;
*err = g_strdup_printf("Key %s begins with an invalid hex char (%c)", key, key[i]); *err = ws_strdup_printf("Key %s begins with an invalid hex char (%c)", key, key[i]);
return -1; /* not a valid hex digit */ return -1; /* not a valid hex digit */
} }
(*ascii_key)[j] = (guchar)hex_digit; (*ascii_key)[j] = (guchar)hex_digit;
@ -345,7 +345,7 @@ compute_ascii_key(gchar **ascii_key, const gchar *key, char **err)
{ {
g_free(*ascii_key); g_free(*ascii_key);
*ascii_key = NULL; *ascii_key = NULL;
*err = g_strdup_printf("Key %s has an invalid hex char (%c)", *err = ws_strdup_printf("Key %s has an invalid hex char (%c)",
key, key[i-1]); key, key[i-1]);
return -1; /* not a valid hex digit */ return -1; /* not a valid hex digit */
} }
@ -356,7 +356,7 @@ compute_ascii_key(gchar **ascii_key, const gchar *key, char **err)
{ {
g_free(*ascii_key); g_free(*ascii_key);
*ascii_key = NULL; *ascii_key = NULL;
*err = g_strdup_printf("Key %s has an invalid hex char (%c)", key, key[i-1]); *err = ws_strdup_printf("Key %s has an invalid hex char (%c)", key, key[i-1]);
return -1; /* not a valid hex digit */ return -1; /* not a valid hex digit */
} }
key_byte |= (guchar)hex_digit; key_byte |= (guchar)hex_digit;

View File

@ -564,7 +564,7 @@ ipv6_filter_valid(packet_info *pinfo)
static gchar* static gchar*
ipv6_build_filter(packet_info *pinfo) ipv6_build_filter(packet_info *pinfo)
{ {
return g_strdup_printf("ipv6.addr eq %s and ipv6.addr eq %s", return ws_strdup_printf("ipv6.addr eq %s and ipv6.addr eq %s",
address_to_str(pinfo->pool, &pinfo->net_src), address_to_str(pinfo->pool, &pinfo->net_src),
address_to_str(pinfo->pool, &pinfo->net_dst)); address_to_str(pinfo->pool, &pinfo->net_dst));
} }

View File

@ -6292,7 +6292,7 @@ static gboolean ikev1_uat_data_update_cb(void* p, char** err) {
ikev1_uat_data_key_t *ud = (ikev1_uat_data_key_t *)p; ikev1_uat_data_key_t *ud = (ikev1_uat_data_key_t *)p;
if (ud->icookie_len != COOKIE_SIZE) { if (ud->icookie_len != COOKIE_SIZE) {
*err = g_strdup_printf("Length of Initiator's COOKIE must be %d octets (%d hex characters).", COOKIE_SIZE, COOKIE_SIZE * 2); *err = ws_strdup_printf("Length of Initiator's COOKIE must be %d octets (%d hex characters).", COOKIE_SIZE, COOKIE_SIZE * 2);
return FALSE; return FALSE;
} }
@ -6302,7 +6302,7 @@ static gboolean ikev1_uat_data_update_cb(void* p, char** err) {
} }
if (ud->key_len > MAX_KEY_SIZE) { if (ud->key_len > MAX_KEY_SIZE) {
*err = g_strdup_printf("Length of Encryption key limited to %d octets (%d hex characters).", MAX_KEY_SIZE, MAX_KEY_SIZE * 2); *err = ws_strdup_printf("Length of Encryption key limited to %d octets (%d hex characters).", MAX_KEY_SIZE, MAX_KEY_SIZE * 2);
return FALSE; return FALSE;
} }
@ -6377,12 +6377,12 @@ static gboolean ikev2_uat_data_update_cb(void* p, char** err) {
ikev2_uat_data_t *ud = (ikev2_uat_data_t *)p; ikev2_uat_data_t *ud = (ikev2_uat_data_t *)p;
if (ud->key.spii_len != COOKIE_SIZE) { if (ud->key.spii_len != COOKIE_SIZE) {
*err = g_strdup_printf("Length of Initiator's SPI must be %d octets (%d hex characters).", COOKIE_SIZE, COOKIE_SIZE * 2); *err = ws_strdup_printf("Length of Initiator's SPI must be %d octets (%d hex characters).", COOKIE_SIZE, COOKIE_SIZE * 2);
return FALSE; return FALSE;
} }
if (ud->key.spir_len != COOKIE_SIZE) { if (ud->key.spir_len != COOKIE_SIZE) {
*err = g_strdup_printf("Length of Responder's SPI must be %d octets (%d hex characters).", COOKIE_SIZE, COOKIE_SIZE * 2); *err = ws_strdup_printf("Length of Responder's SPI must be %d octets (%d hex characters).", COOKIE_SIZE, COOKIE_SIZE * 2);
return FALSE; return FALSE;
} }
@ -6395,31 +6395,31 @@ static gboolean ikev2_uat_data_update_cb(void* p, char** err) {
} }
if (ud->encr_spec->icv_len && ud->auth_spec->number != IKEV2_AUTH_NONE) { if (ud->encr_spec->icv_len && ud->auth_spec->number != IKEV2_AUTH_NONE) {
*err = g_strdup_printf("Selected encryption_algorithm %s requires selecting NONE integrity algorithm.", *err = ws_strdup_printf("Selected encryption_algorithm %s requires selecting NONE integrity algorithm.",
val_to_str(ud->encr_spec->number, vs_ikev2_encr_algs, "other-%d")); val_to_str(ud->encr_spec->number, vs_ikev2_encr_algs, "other-%d"));
return FALSE; return FALSE;
} }
if (ud->sk_ei_len != ud->encr_spec->key_len) { if (ud->sk_ei_len != ud->encr_spec->key_len) {
*err = g_strdup_printf("Length of SK_ei (%u octets) does not match the key length (%u octets) of the selected encryption algorithm.", *err = ws_strdup_printf("Length of SK_ei (%u octets) does not match the key length (%u octets) of the selected encryption algorithm.",
ud->sk_ei_len, ud->encr_spec->key_len); ud->sk_ei_len, ud->encr_spec->key_len);
return FALSE; return FALSE;
} }
if (ud->sk_er_len != ud->encr_spec->key_len) { if (ud->sk_er_len != ud->encr_spec->key_len) {
*err = g_strdup_printf("Length of SK_er (%u octets) does not match the key length (%u octets) of the selected encryption algorithm.", *err = ws_strdup_printf("Length of SK_er (%u octets) does not match the key length (%u octets) of the selected encryption algorithm.",
ud->sk_er_len, ud->encr_spec->key_len); ud->sk_er_len, ud->encr_spec->key_len);
return FALSE; return FALSE;
} }
if (ud->sk_ai_len != ud->auth_spec->key_len) { if (ud->sk_ai_len != ud->auth_spec->key_len) {
*err = g_strdup_printf("Length of SK_ai (%u octets) does not match the key length (%u octets) of the selected integrity algorithm.", *err = ws_strdup_printf("Length of SK_ai (%u octets) does not match the key length (%u octets) of the selected integrity algorithm.",
ud->sk_ai_len, ud->auth_spec->key_len); ud->sk_ai_len, ud->auth_spec->key_len);
return FALSE; return FALSE;
} }
if (ud->sk_ar_len != ud->auth_spec->key_len) { if (ud->sk_ar_len != ud->auth_spec->key_len) {
*err = g_strdup_printf("Length of SK_ar (%u octets) does not match the key length (%u octets) of the selected integrity algorithm.", *err = ws_strdup_printf("Length of SK_ar (%u octets) does not match the key length (%u octets) of the selected integrity algorithm.",
ud->sk_ar_len, ud->auth_spec->key_len); ud->sk_ar_len, ud->auth_spec->key_len);
return FALSE; return FALSE;
} }

View File

@ -249,44 +249,44 @@ update_config_can_addr_mappings(void *r, char **err) {
config_can_addr_mapping_t *rec = (config_can_addr_mapping_t *)r; config_can_addr_mapping_t *rec = (config_can_addr_mapping_t *)r;
if (rec->source_addr_mask == 0 && rec->target_addr_mask == 0 && rec->ecu_addr_mask == 0) { if (rec->source_addr_mask == 0 && rec->target_addr_mask == 0 && rec->ecu_addr_mask == 0) {
*err = g_strdup_printf("You need to define the ECU Mask OR Source Mask/Target Mask!"); *err = ws_strdup_printf("You need to define the ECU Mask OR Source Mask/Target Mask!");
return FALSE; return FALSE;
} }
if ((rec->source_addr_mask != 0 || rec->target_addr_mask != 0) && rec->ecu_addr_mask != 0) { if ((rec->source_addr_mask != 0 || rec->target_addr_mask != 0) && rec->ecu_addr_mask != 0) {
*err = g_strdup_printf("You can only use Source Address Mask/Target Address Mask OR ECU Address Mask! Not both at the same time!"); *err = ws_strdup_printf("You can only use Source Address Mask/Target Address Mask OR ECU Address Mask! Not both at the same time!");
return FALSE; return FALSE;
} }
if ((rec->source_addr_mask == 0 || rec->target_addr_mask == 0) && rec->ecu_addr_mask == 0) { if ((rec->source_addr_mask == 0 || rec->target_addr_mask == 0) && rec->ecu_addr_mask == 0) {
*err = g_strdup_printf("You can only use Source Address Mask and Target Address Mask in combination!"); *err = ws_strdup_printf("You can only use Source Address Mask and Target Address Mask in combination!");
return FALSE; return FALSE;
} }
if (rec->extended_address) { if (rec->extended_address) {
if ((rec->source_addr_mask & ~CAN_EFF_MASK) != 0) { if ((rec->source_addr_mask & ~CAN_EFF_MASK) != 0) {
*err = g_strdup_printf("Source Address Mask covering bits not allowed for extended IDs (29bit)!"); *err = ws_strdup_printf("Source Address Mask covering bits not allowed for extended IDs (29bit)!");
return FALSE; return FALSE;
} }
if ((rec->target_addr_mask & ~CAN_EFF_MASK) != 0) { if ((rec->target_addr_mask & ~CAN_EFF_MASK) != 0) {
*err = g_strdup_printf("Target Address Mask covering bits not allowed for extended IDs (29bit)!"); *err = ws_strdup_printf("Target Address Mask covering bits not allowed for extended IDs (29bit)!");
return FALSE; return FALSE;
} }
if ((rec->ecu_addr_mask & ~CAN_EFF_MASK) != 0) { if ((rec->ecu_addr_mask & ~CAN_EFF_MASK) != 0) {
*err = g_strdup_printf("ECU Address Mask covering bits not allowed for extended IDs (29bit)!"); *err = ws_strdup_printf("ECU Address Mask covering bits not allowed for extended IDs (29bit)!");
return FALSE; return FALSE;
} }
} else { } else {
if ((rec->source_addr_mask & ~CAN_SFF_MASK) != 0) { if ((rec->source_addr_mask & ~CAN_SFF_MASK) != 0) {
*err = g_strdup_printf("Source Address Mask covering bits not allowed for standard IDs (11bit)!"); *err = ws_strdup_printf("Source Address Mask covering bits not allowed for standard IDs (11bit)!");
return FALSE; return FALSE;
} }
if ((rec->target_addr_mask & ~CAN_SFF_MASK) != 0) { if ((rec->target_addr_mask & ~CAN_SFF_MASK) != 0) {
*err = g_strdup_printf("Target Address Mask covering bits not allowed for standard IDs (11bit)!"); *err = ws_strdup_printf("Target Address Mask covering bits not allowed for standard IDs (11bit)!");
return FALSE; return FALSE;
} }
if ((rec->ecu_addr_mask & ~CAN_SFF_MASK) != 0) { if ((rec->ecu_addr_mask & ~CAN_SFF_MASK) != 0) {
*err = g_strdup_printf("ECU Address Mask covering bits not allowed for standard IDs (11bit)!"); *err = ws_strdup_printf("ECU Address Mask covering bits not allowed for standard IDs (11bit)!");
return FALSE; return FALSE;
} }
} }

View File

@ -307,7 +307,7 @@ k12_update_cb(void* r, char** err)
if ( ! (h->handles[i] = find_dissector(protos[i])) ) { if ( ! (h->handles[i] = find_dissector(protos[i])) ) {
h->handles[i] = data_handle; h->handles[i] = data_handle;
h->handles[i+1] = NULL; h->handles[i+1] = NULL;
*err = g_strdup_printf("Could not find dissector for: '%s'",protos[i]); *err = ws_strdup_printf("Could not find dissector for: '%s'",protos[i]);
g_strfreev(protos); g_strfreev(protos);
return FALSE; return FALSE;
} }
@ -374,7 +374,7 @@ protos_chk_cb(void* r _U_, const char* p, guint len, const void* u1 _U_, const v
for (i = 0; i < num_protos; i++) { for (i = 0; i < num_protos; i++) {
if (!find_dissector(protos[i])) { if (!find_dissector(protos[i])) {
*err = g_strdup_printf("Could not find dissector for: '%s'",protos[i]); *err = ws_strdup_printf("Could not find dissector for: '%s'",protos[i]);
wmem_free(NULL, line); wmem_free(NULL, line);
g_strfreev(protos); g_strfreev(protos);
return FALSE; return FALSE;

View File

@ -6150,24 +6150,24 @@ lbm_uim_seq_analysis_packet(void *ptr, packet_info *pinfo, epan_dissect_t *edt _
if (stream_info->description == NULL) if (stream_info->description == NULL)
{ {
sai->frame_label = g_strdup_printf("(%" PRIu32 ")", stream_info->sqn); sai->frame_label = ws_strdup_printf("(%" PRIu32 ")", stream_info->sqn);
} }
else else
{ {
sai->frame_label = g_strdup_printf("%s (%" PRIu32 ")", stream_info->description, stream_info->sqn); sai->frame_label = ws_strdup_printf("%s (%" PRIu32 ")", stream_info->description, stream_info->sqn);
} }
if (epa.type == lbm_uim_instance_stream) if (epa.type == lbm_uim_instance_stream)
{ {
ctxinst1 = bytes_to_str(pinfo->pool, epa.stream_info.ctxinst.ctxinst, sizeof(epa.stream_info.ctxinst.ctxinst)); ctxinst1 = bytes_to_str(pinfo->pool, epa.stream_info.ctxinst.ctxinst, sizeof(epa.stream_info.ctxinst.ctxinst));
ctxinst2 = bytes_to_str(pinfo->pool, epb.stream_info.ctxinst.ctxinst, sizeof(epb.stream_info.ctxinst.ctxinst)); ctxinst2 = bytes_to_str(pinfo->pool, epb.stream_info.ctxinst.ctxinst, sizeof(epb.stream_info.ctxinst.ctxinst));
sai->comment = g_strdup_printf("%s <-> %s [%" PRIu64 "]", sai->comment = ws_strdup_printf("%s <-> %s [%" PRIu64 "]",
ctxinst1, ctxinst1,
ctxinst2, ctxinst2,
stream_info->channel); stream_info->channel);
} }
else else
{ {
sai->comment = g_strdup_printf("%" PRIu32 ":%s:%" PRIu16 " <-> %" PRIu32 ":%s:%" PRIu16 " [%" PRIu64 "]", sai->comment = ws_strdup_printf("%" PRIu32 ":%s:%" PRIu16 " <-> %" PRIu32 ":%s:%" PRIu16 " [%" PRIu64 "]",
epa.stream_info.dest.domain, epa.stream_info.dest.domain,
address_to_str(pinfo->pool, &(epa.stream_info.dest.addr)), address_to_str(pinfo->pool, &(epa.stream_info.dest.addr)),
epa.stream_info.dest.port, epa.stream_info.dest.port,

View File

@ -697,7 +697,7 @@ attribute_types_update_cb(void *r, char **err)
*/ */
c = proto_check_field_name(rec->attribute_type); c = proto_check_field_name(rec->attribute_type);
if (c) { if (c) {
*err = g_strdup_printf("Attribute type can't contain '%c'", c); *err = ws_strdup_printf("Attribute type can't contain '%c'", c);
return FALSE; return FALSE;
} }
@ -790,7 +790,7 @@ attribute_types_post_update_cb(void)
dynamic_hf[i].p_id = hf_id; dynamic_hf[i].p_id = hf_id;
dynamic_hf[i].hfinfo.name = attribute_type; dynamic_hf[i].hfinfo.name = attribute_type;
dynamic_hf[i].hfinfo.abbrev = g_strdup_printf("ldap.AttributeValue.%s", attribute_type); dynamic_hf[i].hfinfo.abbrev = ws_strdup_printf("ldap.AttributeValue.%s", attribute_type);
dynamic_hf[i].hfinfo.type = FT_STRING; dynamic_hf[i].hfinfo.type = FT_STRING;
dynamic_hf[i].hfinfo.display = BASE_NONE; dynamic_hf[i].hfinfo.display = BASE_NONE;
dynamic_hf[i].hfinfo.strings = NULL; dynamic_hf[i].hfinfo.strings = NULL;

View File

@ -144,13 +144,13 @@ update_interface_config(void *r, char **err) {
interface_config_t *rec = (interface_config_t *)r; interface_config_t *rec = (interface_config_t *)r;
if (rec->interface_id > 0xffffffff) { if (rec->interface_id > 0xffffffff) {
*err = g_strdup_printf("We currently only support 32 bit identifiers (ID: %i Name: %s)", *err = ws_strdup_printf("We currently only support 32 bit identifiers (ID: %i Name: %s)",
rec->interface_id, rec->interface_name); rec->interface_id, rec->interface_name);
return FALSE; return FALSE;
} }
if (rec->bus_id > 0xffff) { if (rec->bus_id > 0xffff) {
*err = g_strdup_printf("We currently only support 16 bit bus identifiers (ID: %i Name: %s Bus-ID: %i)", *err = ws_strdup_printf("We currently only support 16 bit bus identifiers (ID: %i Name: %s Bus-ID: %i)",
rec->interface_id, rec->interface_name, rec->bus_id); rec->interface_id, rec->interface_name, rec->bus_id);
return FALSE; return FALSE;
} }

View File

@ -383,7 +383,7 @@ static gboolean lwm2m_resource_update_cb(void *record, char **error)
/* Check for invalid characters (to avoid asserting out when registering the field). */ /* Check for invalid characters (to avoid asserting out when registering the field). */
c = proto_check_field_name(rec->field_name); c = proto_check_field_name(rec->field_name);
if (c) { if (c) {
*error = g_strdup_printf("Resource Name can't contain '%c'", c); *error = ws_strdup_printf("Resource Name can't contain '%c'", c);
return FALSE; return FALSE;
} }
@ -437,7 +437,7 @@ static void lwm2m_add_resource(lwm2m_resource_t *resource, hf_register_info *hf,
hf->p_id = hf_id; hf->p_id = hf_id;
hf->hfinfo.name = g_strdup(resource->name); hf->hfinfo.name = g_strdup(resource->name);
hf->hfinfo.abbrev = g_strdup_printf("lwm2mtlv.resource.%s", resource_abbrev); hf->hfinfo.abbrev = ws_strdup_printf("lwm2mtlv.resource.%s", resource_abbrev);
g_free (resource_abbrev); g_free (resource_abbrev);
switch (resource->data_type) { switch (resource->data_type) {

View File

@ -327,7 +327,7 @@ megacostat_filtercheck(const char *opt_arg _U_, const char **filter _U_, char**
} }
if (!prefs_get_bool_value(megaco_ctx_track, pref_current) || !prefs_get_bool_value(h248_ctx_track, pref_current)) { if (!prefs_get_bool_value(megaco_ctx_track, pref_current) || !prefs_get_bool_value(h248_ctx_track, pref_current)) {
*err = g_strdup_printf("Track Context option at Protocols -> MEGACO and Protocols -> H248 preferences\n" *err = ws_strdup_printf("Track Context option at Protocols -> MEGACO and Protocols -> H248 preferences\n"
"has to be set to true to enable measurement of service response times.\n"); "has to be set to true to enable measurement of service response times.\n");
} }
} }

View File

@ -660,7 +660,7 @@ static gboolean mqtt_message_decode_update_cb(void *record, char **error)
u->topic_regex = g_regex_new(u->topic_pattern, (GRegexCompileFlags) G_REGEX_OPTIMIZE, (GRegexMatchFlags) 0, NULL); u->topic_regex = g_regex_new(u->topic_pattern, (GRegexCompileFlags) G_REGEX_OPTIMIZE, (GRegexMatchFlags) 0, NULL);
if (!u->topic_regex) if (!u->topic_regex)
{ {
*error = g_strdup_printf("Invalid regex: %s", u->topic_pattern); *error = ws_strdup_printf("Invalid regex: %s", u->topic_pattern);
return FALSE; return FALSE;
} }
} }

View File

@ -2972,7 +2972,7 @@ static void get_name_from_fullpropspec(struct CFullPropSpec *v, char *out, int b
} else if (v->kind == PRSPEC_PROPID) { } else if (v->kind == PRSPEC_PROPID) {
snprintf(dest, bufsize, "%s 0x%08x", guid_str, v->u.propid); snprintf(dest, bufsize, "%s 0x%08x", guid_str, v->u.propid);
} else { } else {
char *str = g_strdup_printf("%s <INVALID>", dest); char *str = ws_strdup_printf("%s <INVALID>", dest);
g_strlcpy(dest, str, bufsize); g_strlcpy(dest, str, bufsize);
g_free(str); g_free(str);
} }

View File

@ -1142,7 +1142,7 @@ dissect_mtp2_bitstream(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
recognized_packet = wmem_list_frame_next(recognized_packet); recognized_packet = wmem_list_frame_next(recognized_packet);
} }
/* insert how many packets were found */ /* insert how many packets were found */
col_info_str = g_strdup_printf("%s: %u Packet%s%s%s", col_info_str = ws_strdup_printf("%s: %u Packet%s%s%s",
"MTP2", "MTP2",
wmem_list_count(result->found_packets), wmem_list_count(result->found_packets),
(wmem_list_count(result->found_packets) > 1 (wmem_list_count(result->found_packets) > 1
@ -1150,7 +1150,7 @@ dissect_mtp2_bitstream(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
:"" :""
), ),
(was_unaligned_packet (was_unaligned_packet
?g_strdup_printf(" [Unaligned Packet%s]", (wmem_list_count(result->found_packets)>1 ?ws_strdup_printf(" [Unaligned Packet%s]", (wmem_list_count(result->found_packets)>1
?"s" ?"s"
:"")) :""))
:"" :""
@ -1169,7 +1169,7 @@ dissect_mtp2_bitstream(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
&& frag_msg_before_fh) && frag_msg_before_fh)
{ {
col_add_str(pinfo->cinfo, COL_PROTOCOL, "MTP2"); col_add_str(pinfo->cinfo, COL_PROTOCOL, "MTP2");
col_info_str = g_strdup_printf("[MTP2 Reassembled in: %u]", frag_msg_before_fh->reassembled_in); col_info_str = ws_strdup_printf("[MTP2 Reassembled in: %u]", frag_msg_before_fh->reassembled_in);
col_add_str(pinfo->cinfo, COL_INFO, col_info_str); col_add_str(pinfo->cinfo, COL_INFO, col_info_str);
g_free(col_info_str); g_free(col_info_str);
} else { } else {

View File

@ -924,7 +924,7 @@ mtp3_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_,
if (sis) { if (sis) {
col_str = g_strdup(sis); col_str = g_strdup(sis);
} else { } else {
col_str = g_strdup_printf("Unknown service indicator %d", m3tr->mtp3_si_code); col_str = ws_strdup_printf("Unknown service indicator %d", m3tr->mtp3_si_code);
} }
item_data = stat_tap_get_field_data(table, element, SI_COLUMN); item_data = stat_tap_get_field_data(table, element, SI_COLUMN);

View File

@ -202,7 +202,7 @@ static gboolean oscore_context_update_cb(void *r, char **err) {
} }
if (bytes->len > OSCORE_KID_MAX_LEN) { if (bytes->len > OSCORE_KID_MAX_LEN) {
*err = g_strdup_printf("Should be %u bytes or less.", OSCORE_KID_MAX_LEN); *err = ws_strdup_printf("Should be %u bytes or less.", OSCORE_KID_MAX_LEN);
g_byte_array_free(bytes, TRUE); g_byte_array_free(bytes, TRUE);
return FALSE; return FALSE;
} }
@ -214,7 +214,7 @@ static gboolean oscore_context_update_cb(void *r, char **err) {
} }
if (bytes->len > OSCORE_KID_MAX_LEN) { if (bytes->len > OSCORE_KID_MAX_LEN) {
*err = g_strdup_printf("Should be %u bytes or less.", OSCORE_KID_MAX_LEN); *err = ws_strdup_printf("Should be %u bytes or less.", OSCORE_KID_MAX_LEN);
g_byte_array_free(bytes, TRUE); g_byte_array_free(bytes, TRUE);
return FALSE; return FALSE;
} }
@ -226,7 +226,7 @@ static gboolean oscore_context_update_cb(void *r, char **err) {
} }
if (bytes->len > OSCORE_KID_CONTEXT_MAX_LEN) { if (bytes->len > OSCORE_KID_CONTEXT_MAX_LEN) {
*err = g_strdup_printf("Should be %u bytes or less.", OSCORE_KID_CONTEXT_MAX_LEN); *err = ws_strdup_printf("Should be %u bytes or less.", OSCORE_KID_CONTEXT_MAX_LEN);
g_byte_array_free(bytes, TRUE); g_byte_array_free(bytes, TRUE);
return FALSE; return FALSE;
} }

View File

@ -218,7 +218,7 @@ static gboolean check_valid_key_string(const char* raw_string, char* checked_str
/* Can't be valid if not long enough. */ /* Can't be valid if not long enough. */
if (length < 32) { if (length < 32) {
if (length > 0) { if (length > 0) {
*error = g_strdup_printf("PDCP LTE: Invalid key string (%s) - should include 32 ASCII hex characters (16 bytes) but only %u chars given", *error = ws_strdup_printf("PDCP LTE: Invalid key string (%s) - should include 32 ASCII hex characters (16 bytes) but only %u chars given",
raw_string, length); raw_string, length);
} }
@ -240,18 +240,18 @@ static gboolean check_valid_key_string(const char* raw_string, char* checked_str
checked_string[written++] = c; checked_string[written++] = c;
} }
else { else {
*error = g_strdup_printf("PDCP-LTE: Invalid char '%c' given in key", c); *error = ws_strdup_printf("PDCP-LTE: Invalid char '%c' given in key", c);
return FALSE; return FALSE;
} }
} }
/* Must have found exactly 32 hex ascii chars for 16-byte key */ /* Must have found exactly 32 hex ascii chars for 16-byte key */
if (n<length) { if (n<length) {
*error = g_strdup_printf("PDCP-LTE: Key (%s) should contain 32 hex characters (16 bytes) but more detected", raw_string); *error = ws_strdup_printf("PDCP-LTE: Key (%s) should contain 32 hex characters (16 bytes) but more detected", raw_string);
return FALSE; return FALSE;
} }
if (written != 32) { if (written != 32) {
*error = g_strdup_printf("PDCP-LTE: Key (%s) should contain 32 hex characters (16 bytes) but %u detected", raw_string, written); *error = ws_strdup_printf("PDCP-LTE: Key (%s) should contain 32 hex characters (16 bytes) but %u detected", raw_string, written);
return FALSE; return FALSE;
} }
else { else {

View File

@ -197,7 +197,7 @@ static gboolean check_valid_key_string(const char* raw_string, char* checked_str
/* Can't be valid if not long enough. */ /* Can't be valid if not long enough. */
if (length < 32) { if (length < 32) {
if (length > 0) { if (length > 0) {
*error = g_strdup_printf("PDCP NR: Invalid key string (%s) - should include 32 ASCII hex characters (16 bytes) but only %u chars given", *error = ws_strdup_printf("PDCP NR: Invalid key string (%s) - should include 32 ASCII hex characters (16 bytes) but only %u chars given",
raw_string, length); raw_string, length);
} }
return FALSE; return FALSE;
@ -218,18 +218,18 @@ static gboolean check_valid_key_string(const char* raw_string, char* checked_str
checked_string[written++] = c; checked_string[written++] = c;
} }
else { else {
*error = g_strdup_printf("PDCP-NR: Invalid char '%c' given in key", c); *error = ws_strdup_printf("PDCP-NR: Invalid char '%c' given in key", c);
return FALSE; return FALSE;
} }
} }
/* Must have found exactly 32 hex ascii chars for 16-byte key */ /* Must have found exactly 32 hex ascii chars for 16-byte key */
if (n<length) { if (n<length) {
*error = g_strdup_printf("PDCP-NR: Key (%s) should contain 32 hex characters (16 bytes) but more detected", raw_string); *error = ws_strdup_printf("PDCP-NR: Key (%s) should contain 32 hex characters (16 bytes) but more detected", raw_string);
return FALSE; return FALSE;
} }
if (written != 32) { if (written != 32) {
*error = g_strdup_printf("PDCP-NR: Key (%s) should contain 32 hex characters (16 bytes) but %u detected", raw_string, written); *error = ws_strdup_printf("PDCP-NR: Key (%s) should contain 32 hex characters (16 bytes) but %u detected", raw_string, written);
return FALSE; return FALSE;
} }
else { else {

View File

@ -1571,7 +1571,7 @@ collect_fields(const PbwDescriptor* message, void* userdata)
hf->p_id = g_new(gint, 1); hf->p_id = g_new(gint, 1);
*(hf->p_id) = -1; *(hf->p_id) = -1;
hf->hfinfo.name = g_strdup(pbw_Descriptor_name(message)); hf->hfinfo.name = g_strdup(pbw_Descriptor_name(message));
hf->hfinfo.abbrev = g_strdup_printf("pbm.%s", pbw_Descriptor_full_name(message)); hf->hfinfo.abbrev = ws_strdup_printf("pbm.%s", pbw_Descriptor_full_name(message));
hf->hfinfo.type = FT_BYTES; hf->hfinfo.type = FT_BYTES;
hf->hfinfo.display = BASE_NONE; hf->hfinfo.display = BASE_NONE;
wmem_list_append(hf_list, hf); wmem_list_append(hf_list, hf);
@ -1590,7 +1590,7 @@ collect_fields(const PbwDescriptor* message, void* userdata)
*(hf->p_id) = -1; *(hf->p_id) = -1;
hf->hfinfo.name = g_strdup(pbw_FieldDescriptor_name(field_desc)); hf->hfinfo.name = g_strdup(pbw_FieldDescriptor_name(field_desc));
hf->hfinfo.abbrev = g_strdup_printf("pbf.%s", pbw_FieldDescriptor_full_name(field_desc)); hf->hfinfo.abbrev = ws_strdup_printf("pbf.%s", pbw_FieldDescriptor_full_name(field_desc));
switch (field_type) { switch (field_type) {
case PROTOBUF_TYPE_DOUBLE: case PROTOBUF_TYPE_DOUBLE:
hf->hfinfo.type = FT_DOUBLE; hf->hfinfo.type = FT_DOUBLE;

View File

@ -3970,7 +3970,7 @@ quic_follow_conv_filter(epan_dissect_t *edt _U_, packet_info *pinfo, guint *stre
if (s) { if (s) {
*stream = conn->number; *stream = conn->number;
*sub_stream = (guint)s->stream_id; *sub_stream = (guint)s->stream_id;
return g_strdup_printf("quic.connection.number eq %u and quic.stream.stream_id eq %u", conn->number, *sub_stream); return ws_strdup_printf("quic.connection.number eq %u and quic.stream.stream_id eq %u", conn->number, *sub_stream);
} }
} }
} }
@ -3981,7 +3981,7 @@ quic_follow_conv_filter(epan_dissect_t *edt _U_, packet_info *pinfo, guint *stre
static gchar * static gchar *
quic_follow_index_filter(guint stream, guint sub_stream) quic_follow_index_filter(guint stream, guint sub_stream)
{ {
return g_strdup_printf("quic.connection.number eq %u and quic.stream.stream_id eq %u", stream, sub_stream); return ws_strdup_printf("quic.connection.number eq %u and quic.stream.stream_id eq %u", stream, sub_stream);
} }
static gchar * static gchar *

View File

@ -2508,7 +2508,7 @@ radius_register_avp_dissector(guint32 vendor_id, guint32 _attribute_id, radius_a
if (!vendor) { if (!vendor) {
vendor = g_new(radius_vendor_info_t, 1); vendor = g_new(radius_vendor_info_t, 1);
vendor->name = g_strdup_printf("%s-%u", vendor->name = ws_strdup_printf("%s-%u",
enterprises_lookup(vendor_id, "Unknown"), enterprises_lookup(vendor_id, "Unknown"),
vendor_id); vendor_id);
vendor->code = vendor_id; vendor->code = vendor_id;
@ -2534,7 +2534,7 @@ radius_register_avp_dissector(guint32 vendor_id, guint32 _attribute_id, radius_a
if (!dictionary_entry) { if (!dictionary_entry) {
dictionary_entry = g_new(radius_attr_info_t, 1); dictionary_entry = g_new(radius_attr_info_t, 1);
dictionary_entry->name = g_strdup_printf("Unknown-Attribute-%u", attribute_id.value); dictionary_entry->name = ws_strdup_printf("Unknown-Attribute-%u", attribute_id.value);
dictionary_entry->code = attribute_id; dictionary_entry->code = attribute_id;
dictionary_entry->encrypt = 0; dictionary_entry->encrypt = 0;
dictionary_entry->type = NULL; dictionary_entry->type = NULL;

View File

@ -422,7 +422,7 @@ rpcstat_param(register_srt_t* srt, const char* opt_arg, char** err)
tap_data->num_procedures = rpc_max_proc+1; tap_data->num_procedures = rpc_max_proc+1;
if (rpc_min_proc == -1) { if (rpc_min_proc == -1) {
*err = g_strdup_printf("Program:%u version:%u isn't supported", rpc_program, rpc_version); *err = ws_strdup_printf("Program:%u version:%u isn't supported", rpc_program, rpc_version);
} }
} }
else else

View File

@ -471,7 +471,7 @@ sctp_chunk_type_update_cb(void *r, char **err)
*/ */
c = proto_check_field_name(rec->type_name); c = proto_check_field_name(rec->type_name);
if (c) { if (c) {
*err = g_strdup_printf("Header name can't contain '%c'", c); *err = ws_strdup_printf("Header name can't contain '%c'", c);
return FALSE; return FALSE;
} }

View File

@ -433,7 +433,7 @@ update_generic_one_identifier_32bit(void *r, char **err) {
generic_one_id_string_t *rec = (generic_one_id_string_t *)r; generic_one_id_string_t *rec = (generic_one_id_string_t *)r;
if (rec->id > 0xffffffff) { if (rec->id > 0xffffffff) {
*err = g_strdup_printf("We currently only support 32 bit identifiers (ID: %i Name: %s)", rec->id, rec->name); *err = ws_strdup_printf("We currently only support 32 bit identifiers (ID: %i Name: %s)", rec->id, rec->name);
return FALSE; return FALSE;
} }
@ -445,11 +445,11 @@ update_generic_one_identifier_32bit(void *r, char **err) {
guchar c = proto_check_field_name(rec->name); guchar c = proto_check_field_name(rec->name);
if (c) { if (c) {
if (c == '.') { if (c == '.') {
*err = g_strdup_printf("Name contains illegal chars '.' (ID: 0x%08x)", rec->id); *err = ws_strdup_printf("Name contains illegal chars '.' (ID: 0x%08x)", rec->id);
} else if (g_ascii_isprint(c)) { } else if (g_ascii_isprint(c)) {
*err = g_strdup_printf("Name contains illegal chars '%c' (ID: 0x%08x)", c, rec->id); *err = ws_strdup_printf("Name contains illegal chars '%c' (ID: 0x%08x)", c, rec->id);
} else { } else {
*err = g_strdup_printf("Name contains invalid byte \\%03o (ID: 0x%08x)", c, rec->id); *err = ws_strdup_printf("Name contains invalid byte \\%03o (ID: 0x%08x)", c, rec->id);
} }
return FALSE; return FALSE;
} }
@ -579,66 +579,66 @@ update_spdu_signal_list(void *r, char **err) {
spdu_signal_list_uat_t *rec = (spdu_signal_list_uat_t *)r; spdu_signal_list_uat_t *rec = (spdu_signal_list_uat_t *)r;
if (rec->pos >= 0xffff) { if (rec->pos >= 0xffff) {
*err = g_strdup_printf("Position too big"); *err = ws_strdup_printf("Position too big");
return FALSE; return FALSE;
} }
if (rec->num_of_params >= 0xffff) { if (rec->num_of_params >= 0xffff) {
*err = g_strdup_printf("Number of Parameters too big"); *err = ws_strdup_printf("Number of Parameters too big");
return FALSE; return FALSE;
} }
if (rec->pos >= rec->num_of_params) { if (rec->pos >= rec->num_of_params) {
*err = g_strdup_printf("Position >= Number of Parameters"); *err = ws_strdup_printf("Position >= Number of Parameters");
return FALSE; return FALSE;
} }
if (rec->name == NULL || rec->name[0] == 0) { if (rec->name == NULL || rec->name[0] == 0) {
*err = g_strdup_printf("Name cannot be empty"); *err = ws_strdup_printf("Name cannot be empty");
return FALSE; return FALSE;
} }
if (rec->filter_string == NULL || rec->filter_string[0] == 0) { if (rec->filter_string == NULL || rec->filter_string[0] == 0) {
*err = g_strdup_printf("Filter String cannot be empty"); *err = ws_strdup_printf("Filter String cannot be empty");
return FALSE; return FALSE;
} }
c = proto_check_field_name(rec->filter_string); c = proto_check_field_name(rec->filter_string);
if (c) { if (c) {
if (c == '.') { if (c == '.') {
*err = g_strdup_printf("Filter String contains illegal chars '.' (ID: 0x%08x)", rec->id); *err = ws_strdup_printf("Filter String contains illegal chars '.' (ID: 0x%08x)", rec->id);
} else if (g_ascii_isprint(c)) { } else if (g_ascii_isprint(c)) {
*err = g_strdup_printf("Filter String contains illegal chars '%c' (ID: 0x%08x)", c, rec->id); *err = ws_strdup_printf("Filter String contains illegal chars '%c' (ID: 0x%08x)", c, rec->id);
} else { } else {
*err = g_strdup_printf("Filter String contains invalid byte \\%03o (ID: 0x%08x)", c, rec->id); *err = ws_strdup_printf("Filter String contains invalid byte \\%03o (ID: 0x%08x)", c, rec->id);
} }
return FALSE; return FALSE;
} }
if (g_strcmp0(rec->data_type, "uint") != 0 && g_strcmp0(rec->data_type, "int") != 0) { if (g_strcmp0(rec->data_type, "uint") != 0 && g_strcmp0(rec->data_type, "int") != 0) {
*err = g_strdup_printf("Currently only uint and int supported!"); *err = ws_strdup_printf("Currently only uint and int supported!");
return FALSE; return FALSE;
} }
if (g_strcmp0(rec->data_type, "int") == 0 && (rec->bitlength_base_type != rec->bitlength_encoded_type)) { if (g_strcmp0(rec->data_type, "int") == 0 && (rec->bitlength_base_type != rec->bitlength_encoded_type)) {
*err = g_strdup_printf("signed ints (int) only support in non-shortened length"); *err = ws_strdup_printf("signed ints (int) only support in non-shortened length");
return FALSE; return FALSE;
} }
if (g_strcmp0(rec->data_type, "int") == 0 && (rec->bitlength_encoded_type != 8) && (rec->bitlength_encoded_type != 16) && (rec->bitlength_encoded_type != 32) && (rec->bitlength_encoded_type != 64)) { if (g_strcmp0(rec->data_type, "int") == 0 && (rec->bitlength_encoded_type != 8) && (rec->bitlength_encoded_type != 16) && (rec->bitlength_encoded_type != 32) && (rec->bitlength_encoded_type != 64)) {
*err = g_strdup_printf("signed ints (int) are only supported in 8, 16, 32, or 64 bit."); *err = ws_strdup_printf("signed ints (int) are only supported in 8, 16, 32, or 64 bit.");
return FALSE; return FALSE;
} }
d = g_ascii_strtod(rec->offset, &tmp); d = g_ascii_strtod(rec->offset, &tmp);
if (!(d == d)) { if (!(d == d)) {
*err = g_strdup_printf("Offset not a double!"); *err = ws_strdup_printf("Offset not a double!");
return FALSE; return FALSE;
} }
d = g_ascii_strtod(rec->scaler, &tmp); d = g_ascii_strtod(rec->scaler, &tmp);
if (!(d == d)) { if (!(d == d)) {
*err = g_strdup_printf("Scaler not a double!"); *err = ws_strdup_printf("Scaler not a double!");
return FALSE; return FALSE;
} }
@ -700,11 +700,11 @@ create_hf_entry(guint i, guint32 id, guint32 pos, gchar *name, gchar *filter_str
dynamic_hf[i].hfinfo.bitmask = 0x0; dynamic_hf[i].hfinfo.bitmask = 0x0;
if (raw) { if (raw) {
dynamic_hf[i].hfinfo.name = g_strdup_printf("%s_raw", name); dynamic_hf[i].hfinfo.name = ws_strdup_printf("%s_raw", name);
dynamic_hf[i].hfinfo.abbrev = g_strdup_printf("%s.%s_raw", SPDU_NAME_FILTER, filter_string); dynamic_hf[i].hfinfo.abbrev = ws_strdup_printf("%s.%s_raw", SPDU_NAME_FILTER, filter_string);
} else { } else {
dynamic_hf[i].hfinfo.name = g_strdup(name); dynamic_hf[i].hfinfo.name = g_strdup(name);
dynamic_hf[i].hfinfo.abbrev = g_strdup_printf("%s.%s", SPDU_NAME_FILTER, filter_string); dynamic_hf[i].hfinfo.abbrev = ws_strdup_printf("%s.%s", SPDU_NAME_FILTER, filter_string);
} }
dynamic_hf[i].hfinfo.bitmask = 0; dynamic_hf[i].hfinfo.bitmask = 0;
dynamic_hf[i].hfinfo.blurb = NULL; dynamic_hf[i].hfinfo.blurb = NULL;
@ -875,17 +875,17 @@ update_spdu_signal_value_name(void *r, char **err) {
spdu_signal_value_name_uat_t *rec = (spdu_signal_value_name_uat_t *)r; spdu_signal_value_name_uat_t *rec = (spdu_signal_value_name_uat_t *)r;
if (rec->value_name == NULL || rec->value_name[0] == 0) { if (rec->value_name == NULL || rec->value_name[0] == 0) {
*err = g_strdup_printf("Value Name cannot be empty"); *err = ws_strdup_printf("Value Name cannot be empty");
return FALSE; return FALSE;
} }
if (rec->value_end < rec->value_start) { if (rec->value_end < rec->value_start) {
*err = g_strdup_printf("Value Range is defined backwards (end < start)!"); *err = ws_strdup_printf("Value Range is defined backwards (end < start)!");
return FALSE; return FALSE;
} }
if (rec->pos >= 0xffff) { if (rec->pos >= 0xffff) {
*err = g_strdup_printf("Position too big"); *err = ws_strdup_printf("Position too big");
return FALSE; return FALSE;
} }
@ -1015,24 +1015,24 @@ update_spdu_someip_mapping(void *r, char **err) {
spdu_someip_mapping_uat_t *rec = (spdu_someip_mapping_uat_t *)r; spdu_someip_mapping_uat_t *rec = (spdu_someip_mapping_uat_t *)r;
if (rec->service_id > 0xffff) { if (rec->service_id > 0xffff) {
*err = g_strdup_printf("We currently only support 16 bit SOME/IP Service IDs (Service-ID: %x Method-ID: %x MsgType: %x Version: %i)", *err = ws_strdup_printf("We currently only support 16 bit SOME/IP Service IDs (Service-ID: %x Method-ID: %x MsgType: %x Version: %i)",
rec->service_id, rec->method_id, rec->message_type, rec->major_version); rec->service_id, rec->method_id, rec->message_type, rec->major_version);
return FALSE; return FALSE;
} }
if (rec->method_id > 0xffff) { if (rec->method_id > 0xffff) {
*err = g_strdup_printf("We currently only support 16 bit SOME/IP Method IDs (Service-ID: %x Method-ID: %x MsgType: %x Version: %i)", *err = ws_strdup_printf("We currently only support 16 bit SOME/IP Method IDs (Service-ID: %x Method-ID: %x MsgType: %x Version: %i)",
rec->service_id, rec->method_id, rec->message_type, rec->major_version); rec->service_id, rec->method_id, rec->message_type, rec->major_version);
return FALSE; return FALSE;
} }
if (rec->major_version > 0xff) { if (rec->major_version > 0xff) {
*err = g_strdup_printf("We currently only support 8 bit SOME/IP major versions (Service-ID: %x Method-ID: %x MsgType: %x Version: %i)", *err = ws_strdup_printf("We currently only support 8 bit SOME/IP major versions (Service-ID: %x Method-ID: %x MsgType: %x Version: %i)",
rec->service_id, rec->method_id, rec->message_type, rec->major_version); rec->service_id, rec->method_id, rec->message_type, rec->major_version);
} }
if (rec->message_type > 0xff) { if (rec->message_type > 0xff) {
*err = g_strdup_printf("We currently only support 8 bit SOME/IP message types (Service-ID: %x Method-ID: %x MsgType: %x Version: %i)", *err = ws_strdup_printf("We currently only support 8 bit SOME/IP message types (Service-ID: %x Method-ID: %x MsgType: %x Version: %i)",
rec->service_id, rec->method_id, rec->message_type, rec->major_version); rec->service_id, rec->method_id, rec->message_type, rec->major_version);
} }
@ -1170,12 +1170,12 @@ update_spdu_flexray_mapping(void *r, char **err) {
spdu_flexray_mapping_uat_t *rec = (spdu_flexray_mapping_uat_t *)r; spdu_flexray_mapping_uat_t *rec = (spdu_flexray_mapping_uat_t *)r;
if (rec->cycle > 0xff) { if (rec->cycle > 0xff) {
*err = g_strdup_printf("We currently only support 8 bit Cycles (Cycle: %i Frame ID: %i)", rec->cycle, rec->flexray_id); *err = ws_strdup_printf("We currently only support 8 bit Cycles (Cycle: %i Frame ID: %i)", rec->cycle, rec->flexray_id);
return FALSE; return FALSE;
} }
if (rec->flexray_id > 0xffff) { if (rec->flexray_id > 0xffff) {
*err = g_strdup_printf("We currently only support 16 bit Frame IDs (Cycle: %i Frame ID: %i)", rec->cycle, rec->flexray_id); *err = ws_strdup_printf("We currently only support 16 bit Frame IDs (Cycle: %i Frame ID: %i)", rec->cycle, rec->flexray_id);
return FALSE; return FALSE;
} }
@ -1243,12 +1243,12 @@ update_spdu_lin_mapping(void *r, char **err) {
spdu_lin_mapping_uat_t *rec = (spdu_lin_mapping_uat_t *)r; spdu_lin_mapping_uat_t *rec = (spdu_lin_mapping_uat_t *)r;
if (rec->frame_id > LIN_ID_MASK) { if (rec->frame_id > LIN_ID_MASK) {
*err = g_strdup_printf("LIN Frame IDs are only uint with 6 bits (ID: %i)", rec->frame_id); *err = ws_strdup_printf("LIN Frame IDs are only uint with 6 bits (ID: %i)", rec->frame_id);
return FALSE; return FALSE;
} }
if (rec->bus_id > 0xffff) { if (rec->bus_id > 0xffff) {
*err = g_strdup_printf("LIN Bus IDs are only uint with 16 bits (ID: 0x%x, Bus ID: 0x%x)", rec->frame_id, rec->bus_id); *err = ws_strdup_printf("LIN Bus IDs are only uint with 16 bits (ID: 0x%x, Bus ID: 0x%x)", rec->frame_id, rec->bus_id);
return FALSE; return FALSE;
} }
@ -1324,7 +1324,7 @@ update_spdu_pdu_transport_mapping(void *r, char **err) {
spdu_pdu_transport_mapping_uat_t *rec = (spdu_pdu_transport_mapping_uat_t *)r; spdu_pdu_transport_mapping_uat_t *rec = (spdu_pdu_transport_mapping_uat_t *)r;
if (rec->pdu_id > 0xffffffff) { if (rec->pdu_id > 0xffffffff) {
*err = g_strdup_printf("PDU-Transport IDs are only uint32 (ID: %i)", rec->pdu_id); *err = ws_strdup_printf("PDU-Transport IDs are only uint32 (ID: %i)", rec->pdu_id);
return FALSE; return FALSE;
} }
@ -1390,7 +1390,7 @@ update_spdu_ipdum_mapping(void *r, char **err) {
spdu_ipdum_mapping_uat_t *rec = (spdu_ipdum_mapping_uat_t *)r; spdu_ipdum_mapping_uat_t *rec = (spdu_ipdum_mapping_uat_t *)r;
if (rec->pdu_id > 0xffffffff) { if (rec->pdu_id > 0xffffffff) {
*err = g_strdup_printf("IPduM IDs are only uint32 (ID: %i)", rec->pdu_id); *err = ws_strdup_printf("IPduM IDs are only uint32 (ID: %i)", rec->pdu_id);
return FALSE; return FALSE;
} }

View File

@ -975,7 +975,7 @@ header_fields_update_cb(void *r, char **err)
*/ */
c = proto_check_field_name(rec->header_name); c = proto_check_field_name(rec->header_name);
if (c) { if (c) {
*err = g_strdup_printf("Header name can't contain '%c'", c); *err = ws_strdup_printf("Header name can't contain '%c'", c);
return FALSE; return FALSE;
} }
@ -1047,7 +1047,7 @@ header_fields_post_update_cb(void)
dynamic_hf[i].p_id = hf_id; dynamic_hf[i].p_id = hf_id;
dynamic_hf[i].hfinfo.name = header_name; dynamic_hf[i].hfinfo.name = header_name;
dynamic_hf[i].hfinfo.abbrev = g_strdup_printf("sip.%s", header_name); dynamic_hf[i].hfinfo.abbrev = ws_strdup_printf("sip.%s", header_name);
dynamic_hf[i].hfinfo.type = FT_STRING; dynamic_hf[i].hfinfo.type = FT_STRING;
dynamic_hf[i].hfinfo.display = BASE_NONE; dynamic_hf[i].hfinfo.display = BASE_NONE;
dynamic_hf[i].hfinfo.strings = NULL; dynamic_hf[i].hfinfo.strings = NULL;
@ -1105,7 +1105,7 @@ authorization_users_update_cb(void *r, char **err)
*/ */
c = proto_check_field_name(rec->username); c = proto_check_field_name(rec->username);
if (c) { if (c) {
*err = g_strdup_printf("Username can't contain '%c'", c); *err = ws_strdup_printf("Username can't contain '%c'", c);
return FALSE; return FALSE;
} }
@ -5875,7 +5875,7 @@ static void sip_stat_init(stat_tap_table_ui* new_stat)
for (i = 1; sip_response_code_vals[i].strptr; i++) { for (i = 1; sip_response_code_vals[i].strptr; i++) {
unsigned response_code = sip_response_code_vals[i].value; unsigned response_code = sip_response_code_vals[i].value;
items[REQ_RESP_METHOD_COLUMN].value.string_value = items[REQ_RESP_METHOD_COLUMN].value.string_value =
g_strdup_printf("%u %s", response_code, sip_response_code_vals[i].strptr); ws_strdup_printf("%u %s", response_code, sip_response_code_vals[i].strptr);
items[REQ_RESP_METHOD_COLUMN].user_data.uint_value = response_code; items[REQ_RESP_METHOD_COLUMN].user_data.uint_value = response_code;
stat_tap_init_table_row(resp_table, i-1, num_fields, items); stat_tap_init_table_row(resp_table, i-1, num_fields, items);
} }
@ -6031,11 +6031,11 @@ static gchar *sip_follow_conv_filter(epan_dissect_t *edt, packet_info *pinfo _U_
int hfid = proto_registrar_get_id_byname("sip.Call-ID"); int hfid = proto_registrar_get_id_byname("sip.Call-ID");
GPtrArray *gp = proto_find_first_finfo(edt->tree, hfid); GPtrArray *gp = proto_find_first_finfo(edt->tree, hfid);
if (gp != NULL && gp->len != 0) { if (gp != NULL && gp->len != 0) {
filter = g_strdup_printf("sip.Call-ID == \"%s\"", (gchar *)fvalue_get(&((field_info *)gp->pdata[0])->value)); filter = ws_strdup_printf("sip.Call-ID == \"%s\"", (gchar *)fvalue_get(&((field_info *)gp->pdata[0])->value));
} }
g_ptr_array_free(gp, TRUE); g_ptr_array_free(gp, TRUE);
} else { } else {
filter = g_strdup_printf("sip.Call-ID"); filter = ws_strdup_printf("sip.Call-ID");
} }
return filter; return filter;

View File

@ -2362,7 +2362,7 @@ dissect_skinny_displayLabel(ptvcursor_t *cursor, packet_info *pinfo, int hfindex
} }
} }
if (show_replaced_str) { if (show_replaced_str) {
si->additionalInfo = g_strdup_printf("\"%s\"", wmem_strbuf_get_str(wmem_new)); si->additionalInfo = ws_strdup_printf("\"%s\"", wmem_strbuf_get_str(wmem_new));
proto_item_append_text(item, " => \"%s\"" , wmem_strbuf_get_str(wmem_new)); proto_item_append_text(item, " => \"%s\"" , wmem_strbuf_get_str(wmem_new));
} }
ptvcursor_advance(cursor, length); ptvcursor_advance(cursor, length);
@ -2522,7 +2522,7 @@ handle_KeypadButtonMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_
{ {
guint32 hdr_data_length = tvb_get_letohl(ptvcursor_tvbuff(cursor), 0); guint32 hdr_data_length = tvb_get_letohl(ptvcursor_tvbuff(cursor), 0);
si->additionalInfo = g_strdup_printf("\"%s\"", si->additionalInfo = ws_strdup_printf("\"%s\"",
try_val_to_str_ext( try_val_to_str_ext(
tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)), tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)),
&KeyPadButton_short_ext &KeyPadButton_short_ext
@ -2838,7 +2838,7 @@ handle_OpenReceiveChannelAckMessage(ptvcursor_t *cursor, packet_info * pinfo _U_
ptvcursor_add(cursor, hf_skinny_portNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_portNumber, 4, ENC_LITTLE_ENDIAN);
srtp_add_address(pinfo, PT_UDP, &ipAddr, portNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL); srtp_add_address(pinfo, PT_UDP, &ipAddr, portNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL);
ipAddr_str = address_to_display(NULL, &ipAddr); ipAddr_str = address_to_display(NULL, &ipAddr);
si->additionalInfo = g_strdup_printf("%s:%d", ipAddr_str, portNumber); si->additionalInfo = ws_strdup_printf("%s:%d", ipAddr_str, portNumber);
wmem_free(NULL, ipAddr_str); wmem_free(NULL, ipAddr_str);
passThroughPartyId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); passThroughPartyId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
si->passThroughPartyId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); si->passThroughPartyId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
@ -3000,7 +3000,7 @@ handle_MediaTransmissionFailureMessage(ptvcursor_t *cursor, packet_info * pinfo
ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN);
srtp_add_address(pinfo, PT_UDP, &remoteIpAddr, remotePortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL); srtp_add_address(pinfo, PT_UDP, &remoteIpAddr, remotePortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL);
remoteIpAddr_str = address_to_display(NULL, &remoteIpAddr); remoteIpAddr_str = address_to_display(NULL, &remoteIpAddr);
si->additionalInfo = g_strdup_printf("%s:%d", remoteIpAddr_str, remotePortNumber); si->additionalInfo = ws_strdup_printf("%s:%d", remoteIpAddr_str, remotePortNumber);
wmem_free(NULL, remoteIpAddr_str); wmem_free(NULL, remoteIpAddr_str);
si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN);
@ -3423,7 +3423,7 @@ handle_OpenMultiMediaReceiveChannelAckMessage(ptvcursor_t *cursor, packet_info *
ptvcursor_add(cursor, hf_skinny_portNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_portNumber, 4, ENC_LITTLE_ENDIAN);
srtp_add_address(pinfo, PT_UDP, &ipAddr, portNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL); srtp_add_address(pinfo, PT_UDP, &ipAddr, portNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL);
ipAddr_str = address_to_display(NULL, &ipAddr); ipAddr_str = address_to_display(NULL, &ipAddr);
si->additionalInfo = g_strdup_printf("%s:%d", ipAddr_str, portNumber); si->additionalInfo = ws_strdup_printf("%s:%d", ipAddr_str, portNumber);
wmem_free(NULL, ipAddr_str); wmem_free(NULL, ipAddr_str);
passThroughPartyId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); passThroughPartyId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
si->passThroughPartyId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); si->passThroughPartyId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
@ -4340,7 +4340,7 @@ handle_PortResMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_
ptvcursor_add(cursor, hf_skinny_portNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_portNumber, 4, ENC_LITTLE_ENDIAN);
srtp_add_address(pinfo, PT_UDP, &ipAddr, portNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL); srtp_add_address(pinfo, PT_UDP, &ipAddr, portNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL);
ipAddr_str = address_to_display(NULL, &ipAddr); ipAddr_str = address_to_display(NULL, &ipAddr);
si->additionalInfo = g_strdup_printf("%s:%d", ipAddr_str, portNumber); si->additionalInfo = ws_strdup_printf("%s:%d", ipAddr_str, portNumber);
wmem_free(NULL, ipAddr_str); wmem_free(NULL, ipAddr_str);
ptvcursor_add(cursor, hf_skinny_RTCPPortNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_RTCPPortNumber, 4, ENC_LITTLE_ENDIAN);
if (hdr_version >= V19_MSG_TYPE) { if (hdr_version >= V19_MSG_TYPE) {
@ -4374,7 +4374,7 @@ handle_QoSResvNotifyMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny
ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN);
srtp_add_address(pinfo, PT_UDP, &remoteIpAddr, remotePortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL); srtp_add_address(pinfo, PT_UDP, &remoteIpAddr, remotePortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL);
remoteIpAddr_str = address_to_display(NULL, &remoteIpAddr); remoteIpAddr_str = address_to_display(NULL, &remoteIpAddr);
si->additionalInfo = g_strdup_printf("%s:%d", remoteIpAddr_str, remotePortNumber); si->additionalInfo = ws_strdup_printf("%s:%d", remoteIpAddr_str, remotePortNumber);
wmem_free(NULL, remoteIpAddr_str); wmem_free(NULL, remoteIpAddr_str);
ptvcursor_add(cursor, hf_skinny_direction, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_direction, 4, ENC_LITTLE_ENDIAN);
} }
@ -4404,7 +4404,7 @@ handle_QoSErrorNotifyMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinn
ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN);
srtp_add_address(pinfo, PT_UDP, &remoteIpAddr, remotePortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL); srtp_add_address(pinfo, PT_UDP, &remoteIpAddr, remotePortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL);
remoteIpAddr_str = address_to_display(NULL, &remoteIpAddr); remoteIpAddr_str = address_to_display(NULL, &remoteIpAddr);
si->additionalInfo = g_strdup_printf("%s:%d", remoteIpAddr_str, remotePortNumber); si->additionalInfo = ws_strdup_printf("%s:%d", remoteIpAddr_str, remotePortNumber);
wmem_free(NULL, remoteIpAddr_str); wmem_free(NULL, remoteIpAddr_str);
ptvcursor_add(cursor, hf_skinny_direction, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_direction, 4, ENC_LITTLE_ENDIAN);
ptvcursor_add(cursor, hf_skinny_errorCode, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_errorCode, 4, ENC_LITTLE_ENDIAN);
@ -4555,7 +4555,7 @@ handle_RegisterAckMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_c
static void static void
handle_StartToneMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) handle_StartToneMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_)
{ {
si->additionalInfo = g_strdup_printf("\"%s\"", si->additionalInfo = ws_strdup_printf("\"%s\"",
try_val_to_str_ext( try_val_to_str_ext(
tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)), tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)),
&DeviceTone_ext &DeviceTone_ext
@ -4684,7 +4684,7 @@ handle_StartMediaTransmissionMessage(ptvcursor_t *cursor, packet_info * pinfo _U
ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN);
srtp_add_address(pinfo, PT_UDP, &remoteIpAddr, remotePortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL); srtp_add_address(pinfo, PT_UDP, &remoteIpAddr, remotePortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL);
remoteIpAddr_str = address_to_display(NULL, &remoteIpAddr); remoteIpAddr_str = address_to_display(NULL, &remoteIpAddr);
si->additionalInfo = g_strdup_printf("%s:%d", remoteIpAddr_str, remotePortNumber); si->additionalInfo = ws_strdup_printf("%s:%d", remoteIpAddr_str, remotePortNumber);
wmem_free(NULL, remoteIpAddr_str); wmem_free(NULL, remoteIpAddr_str);
ptvcursor_add(cursor, hf_skinny_milliSecondPacketSize, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_milliSecondPacketSize, 4, ENC_LITTLE_ENDIAN);
compressionType = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); compressionType = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
@ -4879,7 +4879,7 @@ handle_CallInfoMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv
ptvcursor_advance(cursor, 4); ptvcursor_advance(cursor, 4);
ptvcursor_pop_subtree(cursor); /* end bitfield: partyPIRestrictionBits */ ptvcursor_pop_subtree(cursor); /* end bitfield: partyPIRestrictionBits */
if (si->callingParty && si->calledParty) { if (si->callingParty && si->calledParty) {
si->additionalInfo = g_strdup_printf("\"%s -> %s\"", si->callingParty, si->calledParty); si->additionalInfo = ws_strdup_printf("\"%s -> %s\"", si->callingParty, si->calledParty);
} }
} }
@ -5215,7 +5215,7 @@ handle_StartMulticastMediaReceptionMessage(ptvcursor_t *cursor, packet_info * pi
ptvcursor_add(cursor, hf_skinny_multicastPortNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_multicastPortNumber, 4, ENC_LITTLE_ENDIAN);
srtp_add_address(pinfo, PT_UDP, &multicastIpAddr, multicastPortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL); srtp_add_address(pinfo, PT_UDP, &multicastIpAddr, multicastPortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL);
multicastIpAddr_str = address_to_display(NULL, &multicastIpAddr); multicastIpAddr_str = address_to_display(NULL, &multicastIpAddr);
si->additionalInfo = g_strdup_printf("%s:%d", multicastIpAddr_str, multicastPortNumber); si->additionalInfo = ws_strdup_printf("%s:%d", multicastIpAddr_str, multicastPortNumber);
wmem_free(NULL, multicastIpAddr_str); wmem_free(NULL, multicastIpAddr_str);
ptvcursor_add(cursor, hf_skinny_milliSecondPacketSize, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_milliSecondPacketSize, 4, ENC_LITTLE_ENDIAN);
compressionType = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); compressionType = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
@ -5278,7 +5278,7 @@ handle_StartMulticastMediaTransmissionMessage(ptvcursor_t *cursor, packet_info *
ptvcursor_add(cursor, hf_skinny_multicastPortNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_multicastPortNumber, 4, ENC_LITTLE_ENDIAN);
srtp_add_address(pinfo, PT_UDP, &multicastIpAddr, multicastPortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL); srtp_add_address(pinfo, PT_UDP, &multicastIpAddr, multicastPortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL);
multicastIpAddr_str = address_to_display(NULL, &multicastIpAddr); multicastIpAddr_str = address_to_display(NULL, &multicastIpAddr);
si->additionalInfo = g_strdup_printf("%s:%d", multicastIpAddr_str, multicastPortNumber); si->additionalInfo = ws_strdup_printf("%s:%d", multicastIpAddr_str, multicastPortNumber);
wmem_free(NULL, multicastIpAddr_str); wmem_free(NULL, multicastIpAddr_str);
ptvcursor_add(cursor, hf_skinny_milliSecondPacketSize, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_milliSecondPacketSize, 4, ENC_LITTLE_ENDIAN);
compressionType = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); compressionType = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
@ -5461,7 +5461,7 @@ handle_OpenReceiveChannelMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, s
ptvcursor_add(cursor, hf_skinny_sourcePortNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_sourcePortNumber, 4, ENC_LITTLE_ENDIAN);
srtp_add_address(pinfo, PT_UDP, &sourceIpAddr, sourcePortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL); srtp_add_address(pinfo, PT_UDP, &sourceIpAddr, sourcePortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL);
sourceIpAddr_str = address_to_display(NULL, &sourceIpAddr); sourceIpAddr_str = address_to_display(NULL, &sourceIpAddr);
si->additionalInfo = g_strdup_printf("%s:%d", sourceIpAddr_str, sourcePortNumber); si->additionalInfo = ws_strdup_printf("%s:%d", sourceIpAddr_str, sourcePortNumber);
wmem_free(NULL, sourceIpAddr_str); wmem_free(NULL, sourceIpAddr_str);
} }
if (hdr_version >= V16_MSG_TYPE) { if (hdr_version >= V16_MSG_TYPE) {
@ -5708,7 +5708,7 @@ handle_SelectSoftKeysMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinn
static void static void
handle_CallStateMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_) handle_CallStateMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_info_t * skinny_conv _U_)
{ {
si->additionalInfo = g_strdup_printf("\"%s\"", si->additionalInfo = ws_strdup_printf("\"%s\"",
try_val_to_str_ext( try_val_to_str_ext(
tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)), tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)),
&DCallState_ext &DCallState_ext
@ -5909,7 +5909,7 @@ handle_DialedNumberMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_
guint32 dialedNumber_len; guint32 dialedNumber_len;
dialedNumber_len = tvb_strnlen(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor), 24)+1; dialedNumber_len = tvb_strnlen(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor), 24)+1;
if (dialedNumber_len > 1) { if (dialedNumber_len > 1) {
si->additionalInfo = g_strdup_printf("\"%s\"", tvb_format_stringzpad(pinfo->pool, ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor), dialedNumber_len)); si->additionalInfo = ws_strdup_printf("\"%s\"", tvb_format_stringzpad(pinfo->pool, ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor), dialedNumber_len));
} }
ptvcursor_add(cursor, hf_skinny_dialedNumber, 24, ENC_ASCII|ENC_NA); ptvcursor_add(cursor, hf_skinny_dialedNumber, 24, ENC_ASCII|ENC_NA);
si->lineId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); si->lineId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
@ -5921,7 +5921,7 @@ handle_DialedNumberMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_
guint32 dialedNumber_len; guint32 dialedNumber_len;
dialedNumber_len = tvb_strnlen(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor), VariableDirnumSize)+1; dialedNumber_len = tvb_strnlen(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor), VariableDirnumSize)+1;
if (dialedNumber_len > 1) { if (dialedNumber_len > 1) {
si->additionalInfo = g_strdup_printf("\"%s\"", tvb_format_stringzpad(pinfo->pool, ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor), dialedNumber_len)); si->additionalInfo = ws_strdup_printf("\"%s\"", tvb_format_stringzpad(pinfo->pool, ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor), dialedNumber_len));
} }
ptvcursor_add(cursor, hf_skinny_dialedNumber, VariableDirnumSize, ENC_ASCII|ENC_NA); ptvcursor_add(cursor, hf_skinny_dialedNumber, VariableDirnumSize, ENC_ASCII|ENC_NA);
si->lineId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); si->lineId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
@ -6499,7 +6499,7 @@ handle_OpenMultiMediaReceiveChannelMessage(ptvcursor_t *cursor, packet_info * pi
ptvcursor_add(cursor, hf_skinny_sourcePortNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_sourcePortNumber, 4, ENC_LITTLE_ENDIAN);
srtp_add_address(pinfo, PT_UDP, &sourceIpAddr, sourcePortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL); srtp_add_address(pinfo, PT_UDP, &sourceIpAddr, sourcePortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL);
sourceIpAddr_str = address_to_display(NULL, &sourceIpAddr); sourceIpAddr_str = address_to_display(NULL, &sourceIpAddr);
si->additionalInfo = g_strdup_printf("%s:%d", sourceIpAddr_str, sourcePortNumber); si->additionalInfo = ws_strdup_printf("%s:%d", sourceIpAddr_str, sourcePortNumber);
wmem_free(NULL, sourceIpAddr_str); wmem_free(NULL, sourceIpAddr_str);
} }
if (hdr_version >= V16_MSG_TYPE) { if (hdr_version >= V16_MSG_TYPE) {
@ -7519,7 +7519,7 @@ handle_CallInfoV2Message(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_co
} }
} }
if (si->callingParty && si->calledParty) { if (si->callingParty && si->calledParty) {
si->additionalInfo = g_strdup_printf("\"%s -> %s\"", si->callingParty, si->calledParty); si->additionalInfo = ws_strdup_printf("\"%s -> %s\"", si->callingParty, si->calledParty);
} }
} }
@ -7589,7 +7589,7 @@ handle_QoSListenMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_con
ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN);
srtp_add_address(pinfo, PT_UDP, &remoteIpAddr, remotePortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL); srtp_add_address(pinfo, PT_UDP, &remoteIpAddr, remotePortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL);
remoteIpAddr_str = address_to_display(NULL, &remoteIpAddr); remoteIpAddr_str = address_to_display(NULL, &remoteIpAddr);
si->additionalInfo = g_strdup_printf("%s:%d", remoteIpAddr_str, remotePortNumber); si->additionalInfo = ws_strdup_printf("%s:%d", remoteIpAddr_str, remotePortNumber);
wmem_free(NULL, remoteIpAddr_str); wmem_free(NULL, remoteIpAddr_str);
ptvcursor_add(cursor, hf_skinny_resvStyle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_resvStyle, 4, ENC_LITTLE_ENDIAN);
ptvcursor_add(cursor, hf_skinny_maxRetryNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_maxRetryNumber, 4, ENC_LITTLE_ENDIAN);
@ -7636,7 +7636,7 @@ handle_QoSPathMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_conv_
ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN);
srtp_add_address(pinfo, PT_UDP, &remoteIpAddr, remotePortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL); srtp_add_address(pinfo, PT_UDP, &remoteIpAddr, remotePortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL);
remoteIpAddr_str = address_to_display(NULL, &remoteIpAddr); remoteIpAddr_str = address_to_display(NULL, &remoteIpAddr);
si->additionalInfo = g_strdup_printf("%s:%d", remoteIpAddr_str, remotePortNumber); si->additionalInfo = ws_strdup_printf("%s:%d", remoteIpAddr_str, remotePortNumber);
wmem_free(NULL, remoteIpAddr_str); wmem_free(NULL, remoteIpAddr_str);
ptvcursor_add(cursor, hf_skinny_resvStyle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_resvStyle, 4, ENC_LITTLE_ENDIAN);
ptvcursor_add(cursor, hf_skinny_maxRetryNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_maxRetryNumber, 4, ENC_LITTLE_ENDIAN);
@ -7682,7 +7682,7 @@ handle_QoSTeardownMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_c
ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN);
srtp_add_address(pinfo, PT_UDP, &remoteIpAddr, remotePortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL); srtp_add_address(pinfo, PT_UDP, &remoteIpAddr, remotePortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL);
remoteIpAddr_str = address_to_display(NULL, &remoteIpAddr); remoteIpAddr_str = address_to_display(NULL, &remoteIpAddr);
si->additionalInfo = g_strdup_printf("%s:%d", remoteIpAddr_str, remotePortNumber); si->additionalInfo = ws_strdup_printf("%s:%d", remoteIpAddr_str, remotePortNumber);
wmem_free(NULL, remoteIpAddr_str); wmem_free(NULL, remoteIpAddr_str);
ptvcursor_add(cursor, hf_skinny_direction, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_direction, 4, ENC_LITTLE_ENDIAN);
} }
@ -7712,7 +7712,7 @@ handle_UpdateDSCPMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_co
ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN);
srtp_add_address(pinfo, PT_UDP, &remoteIpAddr, remotePortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL); srtp_add_address(pinfo, PT_UDP, &remoteIpAddr, remotePortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL);
remoteIpAddr_str = address_to_display(NULL, &remoteIpAddr); remoteIpAddr_str = address_to_display(NULL, &remoteIpAddr);
si->additionalInfo = g_strdup_printf("%s:%d", remoteIpAddr_str, remotePortNumber); si->additionalInfo = ws_strdup_printf("%s:%d", remoteIpAddr_str, remotePortNumber);
wmem_free(NULL, remoteIpAddr_str); wmem_free(NULL, remoteIpAddr_str);
ptvcursor_add(cursor, hf_skinny_DSCPValue, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_DSCPValue, 4, ENC_LITTLE_ENDIAN);
} }
@ -7742,7 +7742,7 @@ handle_QoSModifyMessage(ptvcursor_t *cursor, packet_info * pinfo _U_, skinny_con
ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_remotePortNumber, 4, ENC_LITTLE_ENDIAN);
srtp_add_address(pinfo, PT_UDP, &remoteIpAddr, remotePortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL); srtp_add_address(pinfo, PT_UDP, &remoteIpAddr, remotePortNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL);
remoteIpAddr_str = address_to_display(NULL, &remoteIpAddr); remoteIpAddr_str = address_to_display(NULL, &remoteIpAddr);
si->additionalInfo = g_strdup_printf("%s:%d", remoteIpAddr_str, remotePortNumber); si->additionalInfo = ws_strdup_printf("%s:%d", remoteIpAddr_str, remotePortNumber);
wmem_free(NULL, remoteIpAddr_str); wmem_free(NULL, remoteIpAddr_str);
ptvcursor_add(cursor, hf_skinny_direction, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_direction, 4, ENC_LITTLE_ENDIAN);
ptvcursor_add(cursor, hf_skinny_compressionType, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_compressionType, 4, ENC_LITTLE_ENDIAN);
@ -7823,7 +7823,7 @@ handle_StartMediaTransmissionAckMessage(ptvcursor_t *cursor, packet_info * pinfo
ptvcursor_add(cursor, hf_skinny_portNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_portNumber, 4, ENC_LITTLE_ENDIAN);
srtp_add_address(pinfo, PT_UDP, &transmitIpAddr, portNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL); srtp_add_address(pinfo, PT_UDP, &transmitIpAddr, portNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL);
transmitIpAddr_str = address_to_display(NULL, &transmitIpAddr); transmitIpAddr_str = address_to_display(NULL, &transmitIpAddr);
si->additionalInfo = g_strdup_printf("%s:%d", transmitIpAddr_str, portNumber); si->additionalInfo = ws_strdup_printf("%s:%d", transmitIpAddr_str, portNumber);
wmem_free(NULL, transmitIpAddr_str); wmem_free(NULL, transmitIpAddr_str);
si->mediaTransmissionStatus = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); si->mediaTransmissionStatus = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
ptvcursor_add(cursor, hf_skinny_mediaTransmissionStatus, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_mediaTransmissionStatus, 4, ENC_LITTLE_ENDIAN);
@ -7857,7 +7857,7 @@ handle_StartMultiMediaTransmissionAckMessage(ptvcursor_t *cursor, packet_info *
ptvcursor_add(cursor, hf_skinny_portNumber, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_portNumber, 4, ENC_LITTLE_ENDIAN);
srtp_add_address(pinfo, PT_UDP, &transmitIpAddr, portNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL); srtp_add_address(pinfo, PT_UDP, &transmitIpAddr, portNumber, 0, "SKINNY", pinfo->num, false, NULL, NULL, NULL);
transmitIpAddr_str = address_to_display(NULL, &transmitIpAddr); transmitIpAddr_str = address_to_display(NULL, &transmitIpAddr);
si->additionalInfo = g_strdup_printf("%s:%d", transmitIpAddr_str, portNumber); si->additionalInfo = ws_strdup_printf("%s:%d", transmitIpAddr_str, portNumber);
wmem_free(NULL, transmitIpAddr_str); wmem_free(NULL, transmitIpAddr_str);
si->multimediaTransmissionStatus = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); si->multimediaTransmissionStatus = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
ptvcursor_add(cursor, hf_skinny_multimediaTransmissionStatus, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_multimediaTransmissionStatus, 4, ENC_LITTLE_ENDIAN);

View File

@ -321,7 +321,7 @@ dissect_skinny_displayLabel(ptvcursor_t *cursor, packet_info *pinfo, int hfindex
} }
} }
if (show_replaced_str) { if (show_replaced_str) {
si->additionalInfo = g_strdup_printf("\"%s\"", wmem_strbuf_get_str(wmem_new)); si->additionalInfo = ws_strdup_printf("\"%s\"", wmem_strbuf_get_str(wmem_new));
proto_item_append_text(item, " => \"%s\"" , wmem_strbuf_get_str(wmem_new)); proto_item_append_text(item, " => \"%s\"" , wmem_strbuf_get_str(wmem_new));
} }
ptvcursor_advance(cursor, length); ptvcursor_advance(cursor, length);

View File

@ -1306,7 +1306,7 @@ smb_eo_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const
if (new_file->is_out_of_memory) { if (new_file->is_out_of_memory) {
entry->content_type = entry->content_type =
g_strdup_printf("%s (%"PRIu64"?/%"PRIu64") %s [mem!!]", ws_strdup_printf("%s (%"PRIu64"?/%"PRIu64") %s [mem!!]",
aux_smb_fid_type_string, aux_smb_fid_type_string,
new_file->data_gathered, new_file->data_gathered,
new_file->file_length, new_file->file_length,
@ -1319,7 +1319,7 @@ smb_eo_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const
} }
entry->content_type = entry->content_type =
g_strdup_printf("%s (%"PRIu64"/%"PRIu64") %s [%5.2f%%]", ws_strdup_printf("%s (%"PRIu64"/%"PRIu64") %s [%5.2f%%]",
aux_smb_fid_type_string, aux_smb_fid_type_string,
new_file->data_gathered, new_file->data_gathered,
new_file->file_length, new_file->file_length,
@ -1341,7 +1341,7 @@ smb_eo_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const
/* Modify the current_entry object_type string */ /* Modify the current_entry object_type string */
if (current_file->is_out_of_memory) { if (current_file->is_out_of_memory) {
current_entry->content_type = current_entry->content_type =
g_strdup_printf("%s (%"PRIu64"?/%"PRIu64") %s [mem!!]", ws_strdup_printf("%s (%"PRIu64"?/%"PRIu64") %s [mem!!]",
aux_smb_fid_type_string, aux_smb_fid_type_string,
current_file->data_gathered, current_file->data_gathered,
current_file->file_length, current_file->file_length,
@ -1349,7 +1349,7 @@ smb_eo_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const
} else { } else {
percent = (gfloat) (100*current_file->data_gathered/current_file->file_length); percent = (gfloat) (100*current_file->data_gathered/current_file->file_length);
current_entry->content_type = current_entry->content_type =
g_strdup_printf("%s (%"PRIu64"/%"PRIu64") %s [%5.2f%%]", ws_strdup_printf("%s (%"PRIu64"/%"PRIu64") %s [%5.2f%%]",
aux_smb_fid_type_string, aux_smb_fid_type_string,
current_file->data_gathered, current_file->data_gathered,
current_file->file_length, current_file->file_length,

View File

@ -191,13 +191,13 @@ update_interface_config(void *r, char **err) {
interface_config_t *rec = (interface_config_t *)r; interface_config_t *rec = (interface_config_t *)r;
if (rec->interface_id > 0xffffffff) { if (rec->interface_id > 0xffffffff) {
*err = g_strdup_printf("We currently only support 32 bit identifiers (ID: %i Name: %s)", *err = ws_strdup_printf("We currently only support 32 bit identifiers (ID: %i Name: %s)",
rec->interface_id, rec->interface_name); rec->interface_id, rec->interface_name);
return FALSE; return FALSE;
} }
if (rec->bus_id > 0xffff) { if (rec->bus_id > 0xffff) {
*err = g_strdup_printf("We currently only support 16 bit bus identifiers (ID: %i Name: %s Bus-ID: %i)", *err = ws_strdup_printf("We currently only support 16 bit bus identifiers (ID: %i Name: %s Bus-ID: %i)",
rec->interface_id, rec->interface_name, rec->bus_id); rec->interface_id, rec->interface_name, rec->bus_id);
return FALSE; return FALSE;
} }

View File

@ -622,11 +622,11 @@ check_filter_string(gchar *filter_string, guint32 id) {
c = proto_check_field_name(filter_string); c = proto_check_field_name(filter_string);
if (c) { if (c) {
if (c == '.') { if (c == '.') {
err = g_strdup_printf("Filter String contains illegal chars '.' (ID: %i )", id); err = ws_strdup_printf("Filter String contains illegal chars '.' (ID: %i )", id);
} else if (g_ascii_isprint(c)) { } else if (g_ascii_isprint(c)) {
err = g_strdup_printf("Filter String contains illegal chars '%c' (ID: %i)", c, id); err = ws_strdup_printf("Filter String contains illegal chars '%c' (ID: %i)", c, id);
} else { } else {
err = g_strdup_printf("Filter String contains invalid byte \\%03o (ID: %i)", c, id); err = ws_strdup_printf("Filter String contains invalid byte \\%03o (ID: %i)", c, id);
} }
} }
@ -660,7 +660,7 @@ update_generic_one_identifier_16bit(void *r, char **err) {
generic_one_id_string_t *rec = (generic_one_id_string_t *)r; generic_one_id_string_t *rec = (generic_one_id_string_t *)r;
if (rec->id > 0xffff) { if (rec->id > 0xffff) {
*err = g_strdup_printf("We currently only support 16 bit identifiers (ID: %i Name: %s)", rec->id, rec->name); *err = ws_strdup_printf("We currently only support 16 bit identifiers (ID: %i Name: %s)", rec->id, rec->name);
return FALSE; return FALSE;
} }
@ -712,12 +712,12 @@ update_generic_two_identifier_16bit(void *r, char **err) {
generic_two_id_string_t *rec = (generic_two_id_string_t *)r; generic_two_id_string_t *rec = (generic_two_id_string_t *)r;
if ( rec->id > 0xffff ) { if ( rec->id > 0xffff ) {
*err = g_strdup_printf("We currently only support 16 bit identifiers (ID: %i Name: %s)", rec->id, rec->name); *err = ws_strdup_printf("We currently only support 16 bit identifiers (ID: %i Name: %s)", rec->id, rec->name);
return FALSE; return FALSE;
} }
if ( rec->id2 > 0xffff ) { if ( rec->id2 > 0xffff ) {
*err = g_strdup_printf("We currently only support 16 bit identifiers (ID: %i ID2: %i Name: %s)", rec->id, rec->id2, rec->name); *err = ws_strdup_printf("We currently only support 16 bit identifiers (ID: %i ID2: %i Name: %s)", rec->id, rec->id2, rec->name);
return FALSE; return FALSE;
} }
@ -1012,48 +1012,48 @@ update_someip_parameter_list(void *r, char **err) {
guchar c; guchar c;
if (rec->service_id > 0xffff) { if (rec->service_id > 0xffff) {
*err = g_strdup_printf("We currently only support 16 bit Service IDs (Service-ID: %i Name: %s)", rec->service_id, rec->name); *err = ws_strdup_printf("We currently only support 16 bit Service IDs (Service-ID: %i Name: %s)", rec->service_id, rec->name);
return FALSE; return FALSE;
} }
if (rec->method_id > 0xffff) { if (rec->method_id > 0xffff) {
*err = g_strdup_printf("We currently only support 16 bit Method IDs (Service-ID: %i Method-ID: %i Name: %s)", rec->service_id, rec->method_id, rec->name); *err = ws_strdup_printf("We currently only support 16 bit Method IDs (Service-ID: %i Method-ID: %i Name: %s)", rec->service_id, rec->method_id, rec->name);
return FALSE; return FALSE;
} }
if (rec->version > 0xff) { if (rec->version > 0xff) {
*err = g_strdup_printf("We currently only support 8 bit Version (Service-ID: %i Method-ID: %i Version: %d Name: %s)", rec->service_id, rec->method_id, rec->version, rec->name); *err = ws_strdup_printf("We currently only support 8 bit Version (Service-ID: %i Method-ID: %i Version: %d Name: %s)", rec->service_id, rec->method_id, rec->version, rec->name);
return FALSE; return FALSE;
} }
if (rec->message_type > 0xff) { if (rec->message_type > 0xff) {
*err = g_strdup_printf("We currently only support 8 bit Message Type (Service-ID: %i Method-ID: %i Version: %d Message Type: %x Name: %s)", rec->service_id, rec->method_id, rec->version, rec->message_type, rec->name); *err = ws_strdup_printf("We currently only support 8 bit Message Type (Service-ID: %i Method-ID: %i Version: %d Message Type: %x Name: %s)", rec->service_id, rec->method_id, rec->version, rec->message_type, rec->name);
return FALSE; return FALSE;
} }
if (rec->name == NULL || rec->name[0] == 0) { if (rec->name == NULL || rec->name[0] == 0) {
*err = g_strdup_printf("Name cannot be empty"); *err = ws_strdup_printf("Name cannot be empty");
return FALSE; return FALSE;
} }
if (rec->pos >= rec->num_of_params) { if (rec->pos >= rec->num_of_params) {
*err = g_strdup_printf("Position >= Number of Parameters"); *err = ws_strdup_printf("Position >= Number of Parameters");
return FALSE; return FALSE;
} }
if (rec->filter_string == NULL || rec->filter_string[0] == 0) { if (rec->filter_string == NULL || rec->filter_string[0] == 0) {
*err = g_strdup_printf("Name cannot be empty"); *err = ws_strdup_printf("Name cannot be empty");
return FALSE; return FALSE;
} }
c = proto_check_field_name(rec->filter_string); c = proto_check_field_name(rec->filter_string);
if (c) { if (c) {
if (c == '.') { if (c == '.') {
*err = g_strdup_printf("Filter String contains illegal chars '.' (Service-ID: %i Method-ID: %i)", rec->service_id, rec->method_id); *err = ws_strdup_printf("Filter String contains illegal chars '.' (Service-ID: %i Method-ID: %i)", rec->service_id, rec->method_id);
} else if (g_ascii_isprint(c)) { } else if (g_ascii_isprint(c)) {
*err = g_strdup_printf("Filter String contains illegal chars '%c' (Service-ID: %i Method-ID: %i)", c, rec->service_id, rec->method_id); *err = ws_strdup_printf("Filter String contains illegal chars '%c' (Service-ID: %i Method-ID: %i)", c, rec->service_id, rec->method_id);
} else { } else {
*err = g_strdup_printf("Filter String contains invalid byte \\%03o (Service-ID: %i Method-ID: %i)", c, rec->service_id, rec->method_id); *err = ws_strdup_printf("Filter String contains invalid byte \\%03o (Service-ID: %i Method-ID: %i)", c, rec->service_id, rec->method_id);
} }
return FALSE; return FALSE;
} }
@ -1177,17 +1177,17 @@ update_someip_parameter_enum(void *r, char **err) {
/* enum name is not used in a filter yet. */ /* enum name is not used in a filter yet. */
if (rec->name == NULL || rec->name[0] == 0) { if (rec->name == NULL || rec->name[0] == 0) {
*err = g_strdup_printf("Name cannot be empty"); *err = ws_strdup_printf("Name cannot be empty");
return FALSE; return FALSE;
} }
if (rec->value_name == NULL || rec->value_name[0] == 0) { if (rec->value_name == NULL || rec->value_name[0] == 0) {
*err = g_strdup_printf("Value Name cannot be empty"); *err = ws_strdup_printf("Value Name cannot be empty");
return FALSE; return FALSE;
} }
if (rec->num_of_items == 0) { if (rec->num_of_items == 0) {
*err = g_strdup_printf("Number_of_Items = 0"); *err = ws_strdup_printf("Number_of_Items = 0");
return FALSE; return FALSE;
} }
@ -1317,17 +1317,17 @@ update_someip_parameter_array(void *r, char **err) {
char *tmp; char *tmp;
if (rec->name == NULL || rec->name[0] == 0) { if (rec->name == NULL || rec->name[0] == 0) {
*err = g_strdup_printf("Name cannot be empty"); *err = ws_strdup_printf("Name cannot be empty");
return FALSE; return FALSE;
} }
if (rec->num >= rec->num_of_dims) { if (rec->num >= rec->num_of_dims) {
*err = g_strdup_printf("Dimension >= Number of Dimensions"); *err = ws_strdup_printf("Dimension >= Number of Dimensions");
return FALSE; return FALSE;
} }
if (rec->filter_string == NULL || rec->filter_string[0] == 0) { if (rec->filter_string == NULL || rec->filter_string[0] == 0) {
*err = g_strdup_printf("Filter String cannot be empty"); *err = ws_strdup_printf("Filter String cannot be empty");
return FALSE; return FALSE;
} }
@ -1468,12 +1468,12 @@ update_someip_parameter_struct(void *r, char **err) {
char *tmp = NULL; char *tmp = NULL;
if (rec->struct_name == NULL || rec->struct_name[0] == 0) { if (rec->struct_name == NULL || rec->struct_name[0] == 0) {
*err = g_strdup_printf("Struct name cannot be empty"); *err = ws_strdup_printf("Struct name cannot be empty");
return FALSE; return FALSE;
} }
if (rec->filter_string == NULL || rec->filter_string[0] == 0) { if (rec->filter_string == NULL || rec->filter_string[0] == 0) {
*err = g_strdup_printf("Struct name cannot be empty"); *err = ws_strdup_printf("Struct name cannot be empty");
return FALSE; return FALSE;
} }
@ -1484,12 +1484,12 @@ update_someip_parameter_struct(void *r, char **err) {
} }
if (rec->name == NULL || rec->name[0] == 0) { if (rec->name == NULL || rec->name[0] == 0) {
*err = g_strdup_printf("Name cannot be empty"); *err = ws_strdup_printf("Name cannot be empty");
return FALSE; return FALSE;
} }
if (rec->pos >= rec->num_of_items) { if (rec->pos >= rec->num_of_items) {
*err = g_strdup_printf("Position >= Number of Parameters"); *err = ws_strdup_printf("Position >= Number of Parameters");
return FALSE; return FALSE;
} }
@ -1627,7 +1627,7 @@ update_someip_parameter_union(void *r, char **err) {
gchar *tmp; gchar *tmp;
if (rec->name == NULL || rec->name[0] == 0) { if (rec->name == NULL || rec->name[0] == 0) {
*err = g_strdup_printf("Union name cannot be empty"); *err = ws_strdup_printf("Union name cannot be empty");
return FALSE; return FALSE;
} }
@ -1638,7 +1638,7 @@ update_someip_parameter_union(void *r, char **err) {
} }
if (rec->type_name == NULL || rec->type_name[0] == 0) { if (rec->type_name == NULL || rec->type_name[0] == 0) {
*err = g_strdup_printf("Type Name cannot be empty"); *err = ws_strdup_printf("Type Name cannot be empty");
return FALSE; return FALSE;
} }
@ -1761,12 +1761,12 @@ update_someip_parameter_base_type_list(void *r, char **err) {
someip_parameter_base_type_list_uat_t *rec = (someip_parameter_base_type_list_uat_t *)r; someip_parameter_base_type_list_uat_t *rec = (someip_parameter_base_type_list_uat_t *)r;
if (rec->name == NULL || rec->name[0] == 0) { if (rec->name == NULL || rec->name[0] == 0) {
*err = g_strdup_printf("Name cannot be empty"); *err = ws_strdup_printf("Name cannot be empty");
return FALSE; return FALSE;
} }
if (rec->id > 0xffffffff) { if (rec->id > 0xffffffff) {
*err = g_strdup_printf("We currently only support 32 bit IDs (%i) Name: %s", rec->id, rec->name); *err = ws_strdup_printf("We currently only support 32 bit IDs (%i) Name: %s", rec->id, rec->name);
return FALSE; return FALSE;
} }
@ -1850,22 +1850,22 @@ update_someip_parameter_string_list(void *r, char **err) {
someip_parameter_string_uat_t *rec = (someip_parameter_string_uat_t *)r; someip_parameter_string_uat_t *rec = (someip_parameter_string_uat_t *)r;
if (rec->name == NULL || rec->name[0] == 0) { if (rec->name == NULL || rec->name[0] == 0) {
*err = g_strdup_printf("Name cannot be empty"); *err = ws_strdup_printf("Name cannot be empty");
return FALSE; return FALSE;
} }
if (rec->id > 0xffffffff) { if (rec->id > 0xffffffff) {
*err = g_strdup_printf("We currently only support 32 bit IDs (%i) Name: %s", rec->id, rec->name); *err = ws_strdup_printf("We currently only support 32 bit IDs (%i) Name: %s", rec->id, rec->name);
return FALSE; return FALSE;
} }
if (rec->max_length > 0xffffffff) { if (rec->max_length > 0xffffffff) {
*err = g_strdup_printf("We currently only support 32 bit max_length (%i) Name: %s", rec->max_length, rec->name); *err = ws_strdup_printf("We currently only support 32 bit max_length (%i) Name: %s", rec->max_length, rec->name);
return FALSE; return FALSE;
} }
if (rec->length_of_length != 0 && rec->length_of_length != 8 && rec->length_of_length != 16 && rec->length_of_length != 32) { if (rec->length_of_length != 0 && rec->length_of_length != 8 && rec->length_of_length != 16 && rec->length_of_length != 32) {
*err = g_strdup_printf("length_of_length can be only 0, 8, 16, or 32 but not %d (IDs: %i Name: %s)", rec->length_of_length, rec->id, rec->name); *err = ws_strdup_printf("length_of_length can be only 0, 8, 16, or 32 but not %d (IDs: %i Name: %s)", rec->length_of_length, rec->id, rec->name);
return FALSE; return FALSE;
} }
@ -1936,7 +1936,7 @@ update_someip_parameter_typedef_list(void *r, char **err) {
someip_parameter_typedef_uat_t *rec = (someip_parameter_typedef_uat_t *)r; someip_parameter_typedef_uat_t *rec = (someip_parameter_typedef_uat_t *)r;
if (rec->id > 0xffffffff) { if (rec->id > 0xffffffff) {
*err = g_strdup_printf("We currently only support 32 bit IDs (%i) Name: %s", rec->id, rec->name); *err = ws_strdup_printf("We currently only support 32 bit IDs (%i) Name: %s", rec->id, rec->name);
return FALSE; return FALSE;
} }
@ -2124,7 +2124,7 @@ update_dynamic_hf_entry(hf_register_info *hf_array, int pos, guint32 data_type,
if (attribs.base_type_name == NULL) { if (attribs.base_type_name == NULL) {
hf_array[pos].hfinfo.name = g_strdup(param_name); hf_array[pos].hfinfo.name = g_strdup(param_name);
} else { } else {
hf_array[pos].hfinfo.name = g_strdup_printf("%s [%s]", param_name, attribs.base_type_name); hf_array[pos].hfinfo.name = ws_strdup_printf("%s [%s]", param_name, attribs.base_type_name);
} }
hf_array[pos].hfinfo.abbrev = abbrev; hf_array[pos].hfinfo.abbrev = abbrev;
@ -2165,7 +2165,7 @@ update_dynamic_param_hf_entry(gpointer key _U_, gpointer value, gpointer data) {
if (service_name == NULL) { if (service_name == NULL) {
service_name_needs_free = TRUE; service_name_needs_free = TRUE;
service_name = g_strdup_printf("0x%04x", list->service_id); service_name = ws_strdup_printf("0x%04x", list->service_id);
} }
if (method_name != NULL) { if (method_name != NULL) {
@ -2177,10 +2177,10 @@ update_dynamic_param_hf_entry(gpointer key _U_, gpointer value, gpointer data) {
if (method_name == NULL) { if (method_name == NULL) {
method_name_needs_free = TRUE; method_name_needs_free = TRUE;
method_name = g_strdup_printf("0x%04x", list->method_id); method_name = ws_strdup_printf("0x%04x", list->method_id);
} }
char *abbrev = g_strdup_printf("someip.payload.%s", item->filter_string); char *abbrev = ws_strdup_printf("someip.payload.%s", item->filter_string);
item->hf_id = update_dynamic_hf_entry(dynamic_hf_param, *pos, item->data_type, item->id_ref, item->name, abbrev); item->hf_id = update_dynamic_hf_entry(dynamic_hf_param, *pos, item->data_type, item->id_ref, item->name, abbrev);
if (service_name_needs_free) { if (service_name_needs_free) {
@ -2207,7 +2207,7 @@ update_dynamic_array_hf_entry(gpointer key _U_, gpointer value, gpointer data) {
return; return;
} }
abbrev = g_strdup_printf("someip.payload.%s", item->filter_string); abbrev = ws_strdup_printf("someip.payload.%s", item->filter_string);
item->hf_id = update_dynamic_hf_entry(dynamic_hf_array, *pos, item->data_type, item->id_ref, item->name, abbrev); item->hf_id = update_dynamic_hf_entry(dynamic_hf_array, *pos, item->data_type, item->id_ref, item->name, abbrev);
if (item->hf_id != NULL) { if (item->hf_id != NULL) {
@ -2228,7 +2228,7 @@ update_dynamic_struct_hf_entry(gpointer key _U_, gpointer value, gpointer data)
for (i = 0; i < list->num_of_items; i++) { for (i = 0; i < list->num_of_items; i++) {
someip_payload_parameter_item_t *item = &(list->items[i]); someip_payload_parameter_item_t *item = &(list->items[i]);
char *abbrev = g_strdup_printf("someip.payload.%s", item->filter_string); char *abbrev = ws_strdup_printf("someip.payload.%s", item->filter_string);
item->hf_id = update_dynamic_hf_entry(dynamic_hf_struct, *pos, item->data_type, item->id_ref, item->name, abbrev); item->hf_id = update_dynamic_hf_entry(dynamic_hf_struct, *pos, item->data_type, item->id_ref, item->name, abbrev);
if (item->hf_id != NULL) { if (item->hf_id != NULL) {
@ -2250,7 +2250,7 @@ update_dynamic_union_hf_entry(gpointer key _U_, gpointer value, gpointer data) {
for (i = 0; i < list->num_of_items; i++) { for (i = 0; i < list->num_of_items; i++) {
someip_parameter_union_item_t *item = &(list->items[i]); someip_parameter_union_item_t *item = &(list->items[i]);
char *abbrev = g_strdup_printf("someip.payload.%s", item->filter_string); char *abbrev = ws_strdup_printf("someip.payload.%s", item->filter_string);
item->hf_id = update_dynamic_hf_entry(dynamic_hf_union, *pos, item->data_type, item->id_ref, item->name, abbrev); item->hf_id = update_dynamic_hf_entry(dynamic_hf_union, *pos, item->data_type, item->id_ref, item->name, abbrev);
if (item->hf_id != NULL) { if (item->hf_id != NULL) {

View File

@ -919,7 +919,7 @@ tcp_build_filter(packet_info *pinfo)
{ {
if( pinfo->net_src.type == AT_IPv4 && pinfo->net_dst.type == AT_IPv4 ) { if( pinfo->net_src.type == AT_IPv4 && pinfo->net_dst.type == AT_IPv4 ) {
/* TCP over IPv4 */ /* TCP over IPv4 */
return g_strdup_printf("(ip.addr eq %s and ip.addr eq %s) and (tcp.port eq %d and tcp.port eq %d)", return ws_strdup_printf("(ip.addr eq %s and ip.addr eq %s) and (tcp.port eq %d and tcp.port eq %d)",
address_to_str(pinfo->pool, &pinfo->net_src), address_to_str(pinfo->pool, &pinfo->net_src),
address_to_str(pinfo->pool, &pinfo->net_dst), address_to_str(pinfo->pool, &pinfo->net_dst),
pinfo->srcport, pinfo->destport ); pinfo->srcport, pinfo->destport );
@ -927,7 +927,7 @@ tcp_build_filter(packet_info *pinfo)
if( pinfo->net_src.type == AT_IPv6 && pinfo->net_dst.type == AT_IPv6 ) { if( pinfo->net_src.type == AT_IPv6 && pinfo->net_dst.type == AT_IPv6 ) {
/* TCP over IPv6 */ /* TCP over IPv6 */
return g_strdup_printf("(ipv6.addr eq %s and ipv6.addr eq %s) and (tcp.port eq %d and tcp.port eq %d)", return ws_strdup_printf("(ipv6.addr eq %s and ipv6.addr eq %s) and (tcp.port eq %d and tcp.port eq %d)",
address_to_str(pinfo->pool, &pinfo->net_src), address_to_str(pinfo->pool, &pinfo->net_src),
address_to_str(pinfo->pool, &pinfo->net_dst), address_to_str(pinfo->pool, &pinfo->net_dst),
pinfo->srcport, pinfo->destport ); pinfo->srcport, pinfo->destport );
@ -958,7 +958,7 @@ tcp_seq_analysis_packet( void *ptr, packet_info *pinfo, epan_dissect_t *edt _U_,
flags = tcp_flags_to_str(NULL, tcph); flags = tcp_flags_to_str(NULL, tcph);
if ((tcph->th_have_seglen)&&(tcph->th_seglen!=0)){ if ((tcph->th_have_seglen)&&(tcph->th_seglen!=0)){
sai->frame_label = g_strdup_printf("%s - Len: %u",flags, tcph->th_seglen); sai->frame_label = ws_strdup_printf("%s - Len: %u",flags, tcph->th_seglen);
} }
else{ else{
sai->frame_label = g_strdup(flags); sai->frame_label = g_strdup(flags);
@ -967,9 +967,9 @@ tcp_seq_analysis_packet( void *ptr, packet_info *pinfo, epan_dissect_t *edt _U_,
wmem_free(NULL, flags); wmem_free(NULL, flags);
if (tcph->th_flags & TH_ACK) if (tcph->th_flags & TH_ACK)
sai->comment = g_strdup_printf("Seq = %u Ack = %u",tcph->th_seq, tcph->th_ack); sai->comment = ws_strdup_printf("Seq = %u Ack = %u",tcph->th_seq, tcph->th_ack);
else else
sai->comment = g_strdup_printf("Seq = %u",tcph->th_seq); sai->comment = ws_strdup_printf("Seq = %u",tcph->th_seq);
sai->line_style = 1; sai->line_style = 1;
sai->conv_num = (guint16) tcph->th_stream; sai->conv_num = (guint16) tcph->th_stream;
@ -996,7 +996,7 @@ gchar *tcp_follow_conv_filter(epan_dissect_t *edt _U_, packet_info *pinfo, guint
return NULL; return NULL;
*stream = tcpd->stream; *stream = tcpd->stream;
return g_strdup_printf("tcp.stream eq %u", tcpd->stream); return ws_strdup_printf("tcp.stream eq %u", tcpd->stream);
} }
return NULL; return NULL;
@ -1004,7 +1004,7 @@ gchar *tcp_follow_conv_filter(epan_dissect_t *edt _U_, packet_info *pinfo, guint
gchar *tcp_follow_index_filter(guint stream, guint sub_stream _U_) gchar *tcp_follow_index_filter(guint stream, guint sub_stream _U_)
{ {
return g_strdup_printf("tcp.stream eq %u", stream); return ws_strdup_printf("tcp.stream eq %u", stream);
} }
gchar *tcp_follow_address_filter(address *src_addr, address *dst_addr, int src_port, int dst_port) gchar *tcp_follow_address_filter(address *src_addr, address *dst_addr, int src_port, int dst_port)
@ -1016,7 +1016,7 @@ gchar *tcp_follow_address_filter(address *src_addr, address *dst_addr, int src_p
address_to_str_buf(src_addr, src_addr_str, sizeof(src_addr_str)); address_to_str_buf(src_addr, src_addr_str, sizeof(src_addr_str));
address_to_str_buf(dst_addr, dst_addr_str, sizeof(dst_addr_str)); address_to_str_buf(dst_addr, dst_addr_str, sizeof(dst_addr_str));
return g_strdup_printf("((ip%s.src eq %s and tcp.srcport eq %d) and " return ws_strdup_printf("((ip%s.src eq %s and tcp.srcport eq %d) and "
"(ip%s.dst eq %s and tcp.dstport eq %d))" "(ip%s.dst eq %s and tcp.dstport eq %d))"
" or " " or "
"((ip%s.src eq %s and tcp.srcport eq %d) and " "((ip%s.src eq %s and tcp.srcport eq %d) and "
@ -1131,7 +1131,7 @@ check_follow_fragments(follow_info_t *follow_info, gboolean is_server, guint32 a
* by the receiving host. Add dummy stream chunk with the data * by the receiving host. Add dummy stream chunk with the data
* "[xxx bytes missing in capture file]". * "[xxx bytes missing in capture file]".
*/ */
dummy_str = g_strdup_printf("[%d bytes missing in capture file]", dummy_str = ws_strdup_printf("[%d bytes missing in capture file]",
(int)(lowest_seq - follow_info->seq[is_server]) ); (int)(lowest_seq - follow_info->seq[is_server]) );
// XXX the dummy replacement could be larger than the actual missing bytes. // XXX the dummy replacement could be larger than the actual missing bytes.

View File

@ -488,7 +488,7 @@ update_generic_one_identifier_16bit(void *r, char **err) {
generic_one_id_string_t *rec = (generic_one_id_string_t *)r; generic_one_id_string_t *rec = (generic_one_id_string_t *)r;
if (rec->id > 0xffff) { if (rec->id > 0xffff) {
*err = g_strdup_printf("We currently only support 16 bit identifiers (ID: %i Name: %s)", rec->id, rec->name); *err = ws_strdup_printf("We currently only support 16 bit identifiers (ID: %i Name: %s)", rec->id, rec->name);
return FALSE; return FALSE;
} }
@ -555,7 +555,7 @@ update_channel_config(void *r, char **err) {
channel_config_t *rec = (channel_config_t *)r; channel_config_t *rec = (channel_config_t *)r;
if (rec->id > 0xffffffff) { if (rec->id > 0xffffffff) {
*err = g_strdup_printf("We currently only support 32 bit identifiers (ID: %i Name: %s)", rec->id, rec->name); *err = ws_strdup_printf("We currently only support 32 bit identifiers (ID: %i Name: %s)", rec->id, rec->name);
return FALSE; return FALSE;
} }
@ -565,7 +565,7 @@ update_channel_config(void *r, char **err) {
} }
if (rec->bus_id > 0xffff) { if (rec->bus_id > 0xffff) {
*err = g_strdup_printf("We currently only support 16 bit bus identifiers (ID: %i Name: %s Bus-ID: %i)", rec->id, rec->name, rec->bus_id); *err = ws_strdup_printf("We currently only support 16 bit bus identifiers (ID: %i Name: %s Bus-ID: %i)", rec->id, rec->name, rec->bus_id);
return FALSE; return FALSE;
} }

View File

@ -1740,7 +1740,7 @@ rsakeys_uat_fld_ip_chk_cb(void* r _U_, const char* ipaddr, guint len _U_, const
return TRUE; return TRUE;
} }
*err = g_strdup_printf("No IPv4 address given."); *err = ws_strdup_printf("No IPv4 address given.");
return FALSE; return FALSE;
} }
@ -1762,7 +1762,7 @@ rsakeys_uat_fld_fileopen_chk_cb(void* r _U_, const char* p, guint len _U_, const
if (p && *p) { if (p && *p) {
ws_statb64 st; ws_statb64 st;
if (ws_stat64(p, &st) != 0) { if (ws_stat64(p, &st) != 0) {
*err = g_strdup_printf("File '%s' does not exist or access is denied.", p); *err = ws_strdup_printf("File '%s' does not exist or access is denied.", p);
return FALSE; return FALSE;
} }
} else { } else {
@ -1785,7 +1785,7 @@ rsakeys_uat_fld_password_chk_cb(void *r, const char *p, guint len _U_, const voi
gnutls_x509_privkey_t priv_key = rsa_load_pkcs12(fp, p, &msg); gnutls_x509_privkey_t priv_key = rsa_load_pkcs12(fp, p, &msg);
if (!priv_key) { if (!priv_key) {
fclose(fp); fclose(fp);
*err = g_strdup_printf("Could not load PKCS#12 key file: %s", msg); *err = ws_strdup_printf("Could not load PKCS#12 key file: %s", msg);
g_free(msg); g_free(msg);
return FALSE; return FALSE;
} }
@ -1793,7 +1793,7 @@ rsakeys_uat_fld_password_chk_cb(void *r, const char *p, guint len _U_, const voi
gnutls_x509_privkey_deinit(priv_key); gnutls_x509_privkey_deinit(priv_key);
fclose(fp); fclose(fp);
} else { } else {
*err = g_strdup_printf("Leave this field blank if the keyfile is not PKCS#12."); *err = ws_strdup_printf("Leave this field blank if the keyfile is not PKCS#12.");
return FALSE; return FALSE;
} }
} }
@ -1865,7 +1865,7 @@ xteakeys_uat_fld_key_chk_cb(void *r _U_, const char *key, guint len, const void
} }
} }
*err = g_strdup_printf("XTEA keys are 32 character long hex strings."); *err = ws_strdup_printf("XTEA keys are 32 character long hex strings.");
return FALSE; return FALSE;
} }

View File

@ -6322,7 +6322,7 @@ ssldecrypt_uat_fld_fileopen_chk_cb(void* r _U_, const char* p, guint len _U_, co
return FALSE; return FALSE;
} else { } else {
if (ws_stat64(p, &st) != 0) { if (ws_stat64(p, &st) != 0) {
*err = g_strdup_printf("File '%s' does not exist or access is denied.", p); *err = ws_strdup_printf("File '%s' does not exist or access is denied.", p);
return FALSE; return FALSE;
} }
} }
@ -6345,7 +6345,7 @@ ssldecrypt_uat_fld_password_chk_cb(void *r _U_, const char *p _U_, guint len _U_
gnutls_x509_privkey_t priv_key = rsa_load_pkcs12(fp, p, &msg); gnutls_x509_privkey_t priv_key = rsa_load_pkcs12(fp, p, &msg);
if (!priv_key) { if (!priv_key) {
fclose(fp); fclose(fp);
*err = g_strdup_printf("Could not load PKCS#12 key file: %s", msg); *err = ws_strdup_printf("Could not load PKCS#12 key file: %s", msg);
g_free(msg); g_free(msg);
return FALSE; return FALSE;
} }
@ -6353,7 +6353,7 @@ ssldecrypt_uat_fld_password_chk_cb(void *r _U_, const char *p _U_, guint len _U_
gnutls_x509_privkey_deinit(priv_key); gnutls_x509_privkey_deinit(priv_key);
fclose(fp); fclose(fp);
} else { } else {
*err = g_strdup_printf("Leave this field blank if the keyfile is not PKCS#12."); *err = ws_strdup_printf("Leave this field blank if the keyfile is not PKCS#12.");
return FALSE; return FALSE;
} }
} }

View File

@ -4052,12 +4052,12 @@ ssldecrypt_uat_fld_protocol_chk_cb(void* r _U_, const char* p, guint len _U_, co
if (!ssl_find_appdata_dissector(p)) { if (!ssl_find_appdata_dissector(p)) {
if (proto_get_id_by_filter_name(p) != -1) { if (proto_get_id_by_filter_name(p) != -1) {
*err = g_strdup_printf("While '%s' is a valid dissector filter name, that dissector is not configured" *err = ws_strdup_printf("While '%s' is a valid dissector filter name, that dissector is not configured"
" to support TLS decryption.\n\n" " to support TLS decryption.\n\n"
"If you need to decrypt '%s' over TLS, please contact the Wireshark development team.", p, p); "If you need to decrypt '%s' over TLS, please contact the Wireshark development team.", p, p);
} else { } else {
char* ssl_str = ssl_association_info("tls.port", "TCP"); char* ssl_str = ssl_association_info("tls.port", "TCP");
*err = g_strdup_printf("Could not find dissector for: '%s'\nCommonly used TLS dissectors include:\n%s", p, ssl_str); *err = ws_strdup_printf("Could not find dissector for: '%s'\nCommonly used TLS dissectors include:\n%s", p, ssl_str);
g_free(ssl_str); g_free(ssl_str);
} }
return FALSE; return FALSE;

View File

@ -353,7 +353,7 @@ udp_build_filter(packet_info *pinfo)
{ {
if( pinfo->net_src.type == AT_IPv4 && pinfo->net_dst.type == AT_IPv4 ) { if( pinfo->net_src.type == AT_IPv4 && pinfo->net_dst.type == AT_IPv4 ) {
/* UDP over IPv4 */ /* UDP over IPv4 */
return g_strdup_printf("(ip.addr eq %s and ip.addr eq %s) and (udp.port eq %d and udp.port eq %d)", return ws_strdup_printf("(ip.addr eq %s and ip.addr eq %s) and (udp.port eq %d and udp.port eq %d)",
address_to_str(pinfo->pool, &pinfo->net_src), address_to_str(pinfo->pool, &pinfo->net_src),
address_to_str(pinfo->pool, &pinfo->net_dst), address_to_str(pinfo->pool, &pinfo->net_dst),
pinfo->srcport, pinfo->destport ); pinfo->srcport, pinfo->destport );
@ -361,7 +361,7 @@ udp_build_filter(packet_info *pinfo)
if( pinfo->net_src.type == AT_IPv6 && pinfo->net_dst.type == AT_IPv6 ) { if( pinfo->net_src.type == AT_IPv6 && pinfo->net_dst.type == AT_IPv6 ) {
/* UDP over IPv6 */ /* UDP over IPv6 */
return g_strdup_printf("(ipv6.addr eq %s and ipv6.addr eq %s) and (udp.port eq %d and udp.port eq %d)", return ws_strdup_printf("(ipv6.addr eq %s and ipv6.addr eq %s) and (udp.port eq %d and udp.port eq %d)",
address_to_str(pinfo->pool, &pinfo->net_src), address_to_str(pinfo->pool, &pinfo->net_src),
address_to_str(pinfo->pool, &pinfo->net_dst), address_to_str(pinfo->pool, &pinfo->net_dst),
pinfo->srcport, pinfo->destport ); pinfo->srcport, pinfo->destport );
@ -384,7 +384,7 @@ static gchar *udp_follow_conv_filter(epan_dissect_t *edt _U_, packet_info *pinfo
return NULL; return NULL;
*stream = udpd->stream; *stream = udpd->stream;
return g_strdup_printf("udp.stream eq %u", udpd->stream); return ws_strdup_printf("udp.stream eq %u", udpd->stream);
} }
return NULL; return NULL;
@ -392,7 +392,7 @@ static gchar *udp_follow_conv_filter(epan_dissect_t *edt _U_, packet_info *pinfo
static gchar *udp_follow_index_filter(guint stream, guint sub_stream _U_) static gchar *udp_follow_index_filter(guint stream, guint sub_stream _U_)
{ {
return g_strdup_printf("udp.stream eq %u", stream); return ws_strdup_printf("udp.stream eq %u", stream);
} }
static gchar *udp_follow_address_filter(address *src_addr, address *dst_addr, int src_port, int dst_port) static gchar *udp_follow_address_filter(address *src_addr, address *dst_addr, int src_port, int dst_port)
@ -404,7 +404,7 @@ static gchar *udp_follow_address_filter(address *src_addr, address *dst_addr, in
address_to_str_buf(src_addr, src_addr_str, sizeof(src_addr_str)); address_to_str_buf(src_addr, src_addr_str, sizeof(src_addr_str));
address_to_str_buf(dst_addr, dst_addr_str, sizeof(dst_addr_str)); address_to_str_buf(dst_addr, dst_addr_str, sizeof(dst_addr_str));
return g_strdup_printf("((ip%s.src eq %s and udp.srcport eq %d) and " return ws_strdup_printf("((ip%s.src eq %s and udp.srcport eq %d) and "
"(ip%s.dst eq %s and udp.dstport eq %d))" "(ip%s.dst eq %s and udp.dstport eq %d))"
" or " " or "
"((ip%s.src eq %s and udp.srcport eq %d) and " "((ip%s.src eq %s and udp.srcport eq %d) and "

View File

@ -410,12 +410,12 @@ update_generic_addr_id_16bit(void *r, char **err) {
generic_addr_id_string_t *rec = (generic_addr_id_string_t *)r; generic_addr_id_string_t *rec = (generic_addr_id_string_t *)r;
if (rec->id > 0xffff) { if (rec->id > 0xffff) {
*err = g_strdup_printf("We currently only support 16 bit identifiers (Addr: %x ID: %i Name: %s)", rec->address, rec->id, rec->name); *err = ws_strdup_printf("We currently only support 16 bit identifiers (Addr: %x ID: %i Name: %s)", rec->address, rec->id, rec->name);
return FALSE; return FALSE;
} }
if (rec->address > 0xffff && rec->address != G_MAXUINT32) { if (rec->address > 0xffff && rec->address != G_MAXUINT32) {
*err = g_strdup_printf("We currently only support 16 bit addresses with 0xffffffff = \"don't care\" (Addr: %x ID: %i Name: %s)", *err = ws_strdup_printf("We currently only support 16 bit addresses with 0xffffffff = \"don't care\" (Addr: %x ID: %i Name: %s)",
rec->address, rec->id, rec->name); rec->address, rec->id, rec->name);
return FALSE; return FALSE;
} }

View File

@ -3041,7 +3041,7 @@ wkh_profile_warning(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_i
if (ok) { /* Valid warn-target string */ if (ok) { /* Valid warn-target string */
/* TODO: Why did we just call get_uri_value() and not use /* TODO: Why did we just call get_uri_value() and not use
* the str, since the pointer to it is immediately * the str, since the pointer to it is immediately
* forgotten with the call to g_strdup_printf()? */ * forgotten with the call to ws_strdup_printf()? */
off += len; off += len;
proto_item_append_text(ti, "; target=%s", val_str); proto_item_append_text(ti, "; target=%s", val_str);
/* Add zero or more dates */ /* Add zero or more dates */

View File

@ -642,7 +642,7 @@ uat_key_record_update_cb(void *r, char **err)
if (rec->string[0] != 0) { if (rec->string[0] != 0) {
*err = NULL; *err = NULL;
if (!zbee_gp_security_parse_key(rec->string, rec->key, rec->byte_order)) { if (!zbee_gp_security_parse_key(rec->string, rec->key, rec->byte_order)) {
*err = g_strdup_printf("Expecting %d hexadecimal bytes or a %d character double-quoted string", *err = ws_strdup_printf("Expecting %d hexadecimal bytes or a %d character double-quoted string",
ZBEE_SEC_CONST_KEYSIZE, ZBEE_SEC_CONST_KEYSIZE); ZBEE_SEC_CONST_KEYSIZE, ZBEE_SEC_CONST_KEYSIZE);
return FALSE; return FALSE;
} }

View File

@ -1856,7 +1856,7 @@ static gboolean zbee_nwk_filter_valid(packet_info *pinfo)
static gchar* zbee_nwk_build_filter(packet_info *pinfo) static gchar* zbee_nwk_build_filter(packet_info *pinfo)
{ {
return g_strdup_printf("zbee_nwk.addr eq %s and zbee_nwk.addr eq %s", return ws_strdup_printf("zbee_nwk.addr eq %s and zbee_nwk.addr eq %s",
address_to_str(pinfo->pool, &pinfo->net_src), address_to_str(pinfo->pool, &pinfo->net_src),
address_to_str(pinfo->pool, &pinfo->net_dst)); address_to_str(pinfo->pool, &pinfo->net_dst));
} }

View File

@ -148,7 +148,7 @@ static gboolean uat_key_record_update_cb(void* r, char** err) {
if (rec->string[0] != 0) { if (rec->string[0] != 0) {
*err = NULL; *err = NULL;
if ( !zbee_security_parse_key(rec->string, key, rec->byte_order) ) { if ( !zbee_security_parse_key(rec->string, key, rec->byte_order) ) {
*err = g_strdup_printf("Expecting %d hexadecimal bytes or\n" *err = ws_strdup_printf("Expecting %d hexadecimal bytes or\n"
"a %d character double-quoted string", ZBEE_SEC_CONST_KEYSIZE, ZBEE_SEC_CONST_KEYSIZE); "a %d character double-quoted string", ZBEE_SEC_CONST_KEYSIZE, ZBEE_SEC_CONST_KEYSIZE);
return FALSE; return FALSE;
} }

View File

@ -238,7 +238,7 @@ extcap_get_extcap_paths_from_dir(GSList * list, const char * dirname)
if ((dir = g_dir_open(dirname, 0, NULL)) != NULL) { if ((dir = g_dir_open(dirname, 0, NULL)) != NULL) {
while ((file = g_dir_read_name(dir)) != NULL) { while ((file = g_dir_read_name(dir)) != NULL) {
/* full path to extcap binary */ /* full path to extcap binary */
gchar *extcap_path = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", dirname, file); gchar *extcap_path = ws_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", dirname, file);
/* treat anything executable as an extcap binary */ /* treat anything executable as an extcap binary */
if (g_file_test(extcap_path, G_FILE_TEST_IS_REGULAR) && if (g_file_test(extcap_path, G_FILE_TEST_IS_REGULAR) &&
g_file_test(extcap_path, G_FILE_TEST_IS_EXECUTABLE)) { g_file_test(extcap_path, G_FILE_TEST_IS_EXECUTABLE)) {
@ -1267,7 +1267,7 @@ void extcap_if_cleanup(capture_options *capture_opts, gchar **errormsg)
{ {
if (*errormsg == NULL) if (*errormsg == NULL)
{ {
*errormsg = g_strdup_printf("Error by extcap pipe: %s", pipedata->stderr_msg); *errormsg = ws_strdup_printf("Error by extcap pipe: %s", pipedata->stderr_msg);
} }
else else
{ {
@ -2038,7 +2038,7 @@ extcap_load_interface_list(void)
} }
get_ws_version_number(&major, &minor, NULL); get_ws_version_number(&major, &minor, NULL);
char *arg_version = g_strdup_printf("%s=%d.%d", EXTCAP_ARGUMENT_VERSION, major, minor); char *arg_version = ws_strdup_printf("%s=%d.%d", EXTCAP_ARGUMENT_VERSION, major, minor);
const char *argv[] = { const char *argv[] = {
EXTCAP_ARGUMENT_LIST_INTERFACES, EXTCAP_ARGUMENT_LIST_INTERFACES,
arg_version, arg_version,

View File

@ -890,8 +890,8 @@ adb_connect_transport(const char *server_ip, unsigned short *server_tcp_port,
static void new_interface(extcap_parameters * extcap_conf, const gchar *interface_id, static void new_interface(extcap_parameters * extcap_conf, const gchar *interface_id,
const gchar *model_name, const gchar *serial_number, const gchar *display_name) const gchar *model_name, const gchar *serial_number, const gchar *display_name)
{ {
char *interface = g_strdup_printf("%s-%s", interface_id, serial_number); char *interface = ws_strdup_printf("%s-%s", interface_id, serial_number);
char *ifdisplay = g_strdup_printf("%s %s %s", display_name, model_name, serial_number); char *ifdisplay = ws_strdup_printf("%s %s %s", display_name, model_name, serial_number);
if (is_specified_interface(interface, INTERFACE_ANDROID_BLUETOOTH_HCIDUMP) || if (is_specified_interface(interface, INTERFACE_ANDROID_BLUETOOTH_HCIDUMP) ||
is_specified_interface(interface, INTERFACE_ANDROID_BLUETOOTH_EXTERNAL_PARSER) || is_specified_interface(interface, INTERFACE_ANDROID_BLUETOOTH_EXTERNAL_PARSER) ||
@ -2555,7 +2555,7 @@ int main(int argc, char *argv[]) {
ANDROIDDUMP_VERSION_RELEASE, help_url); ANDROIDDUMP_VERSION_RELEASE, help_url);
g_free(help_url); g_free(help_url);
help_header = g_strdup_printf( help_header = ws_strdup_printf(
" %s --extcap-interfaces [--adb-server-ip=<arg>] [--adb-server-tcp-port=<arg>]\n" " %s --extcap-interfaces [--adb-server-ip=<arg>] [--adb-server-tcp-port=<arg>]\n"
" %s --extcap-interface=INTERFACE --extcap-dlts\n" " %s --extcap-interface=INTERFACE --extcap-dlts\n"
" %s --extcap-interface=INTERFACE --extcap-config\n" " %s --extcap-interface=INTERFACE --extcap-config\n"

View File

@ -393,7 +393,7 @@ static ssh_channel run_capture(ssh_session sshs, const char* iface, const char*
if (read_output_bytes(channel, -1, NULL) == EXIT_FAILURE) if (read_output_bytes(channel, -1, NULL) == EXIT_FAILURE)
goto error; goto error;
cmdline = g_strdup_printf("show monitor capture buffer %s dump\n", WIRESHARK_CAPTURE_BUFFER); cmdline = ws_strdup_printf("show monitor capture buffer %s dump\n", WIRESHARK_CAPTURE_BUFFER);
if (ssh_channel_printf(channel, cmdline) == EXIT_FAILURE) if (ssh_channel_printf(channel, cmdline) == EXIT_FAILURE)
goto error; goto error;
@ -560,7 +560,7 @@ int main(int argc, char *argv[])
g_free(help_url); g_free(help_url);
extcap_base_register_interface(extcap_conf, CISCODUMP_EXTCAP_INTERFACE, "Cisco remote capture", 147, "Remote capture dependent DLT"); extcap_base_register_interface(extcap_conf, CISCODUMP_EXTCAP_INTERFACE, "Cisco remote capture", 147, "Remote capture dependent DLT");
help_header = g_strdup_printf( help_header = ws_strdup_printf(
" %s --extcap-interfaces\n" " %s --extcap-interfaces\n"
" %s --extcap-interface=%s --extcap-dlts\n" " %s --extcap-interface=%s --extcap-dlts\n"
" %s --extcap-interface=%s --extcap-config\n" " %s --extcap-interface=%s --extcap-config\n"

View File

@ -517,7 +517,7 @@ int main(int argc, char *argv[])
NULL); NULL);
extcap_base_register_interface(extcap_conf, DPAUXMON_EXTCAP_INTERFACE, "DisplayPort AUX channel monitor capture", 275, "DisplayPort AUX channel monitor"); extcap_base_register_interface(extcap_conf, DPAUXMON_EXTCAP_INTERFACE, "DisplayPort AUX channel monitor capture", 275, "DisplayPort AUX channel monitor");
help_header = g_strdup_printf( help_header = ws_strdup_printf(
" %s --extcap-interfaces\n" " %s --extcap-interfaces\n"
" %s --extcap-interface=%s --extcap-dlts\n" " %s --extcap-interface=%s --extcap-dlts\n"
" %s --extcap-interface=%s --extcap-config\n" " %s --extcap-interface=%s --extcap-config\n"

View File

@ -211,7 +211,7 @@ wtap_open_return_val etw_dump(const char* etl_filename, const char* pcapng_filen
} }
else else
{ {
*err_info = g_strdup_printf("Cannot convert provider %s to a GUID, err is 0x%x", ws_optarg, *err); *err_info = ws_strdup_printf("Cannot convert provider %s to a GUID, err is 0x%x", ws_optarg, *err);
return WTAP_OPEN_ERROR; return WTAP_OPEN_ERROR;
} }
@ -221,7 +221,7 @@ wtap_open_return_val etw_dump(const char* etl_filename, const char* pcapng_filen
if (IsEqualGUID(&g_provider_filters[0].ProviderId, &ZeroGuid)) if (IsEqualGUID(&g_provider_filters[0].ProviderId, &ZeroGuid))
{ {
*err = ERROR_INVALID_PARAMETER; *err = ERROR_INVALID_PARAMETER;
*err_info = g_strdup_printf("Provider %s is zero, err is 0x%x", ws_optarg, *err); *err_info = ws_strdup_printf("Provider %s is zero, err is 0x%x", ws_optarg, *err);
return WTAP_OPEN_ERROR; return WTAP_OPEN_ERROR;
} }
provider_idx++; provider_idx++;
@ -230,7 +230,7 @@ wtap_open_return_val etw_dump(const char* etl_filename, const char* pcapng_filen
if (provider_idx == 0) if (provider_idx == 0)
{ {
*err = ERROR_INVALID_PARAMETER; *err = ERROR_INVALID_PARAMETER;
*err_info = g_strdup_printf("-k parameter must follow -p, err is 0x%x", *err); *err_info = ws_strdup_printf("-k parameter must follow -p, err is 0x%x", *err);
return WTAP_OPEN_ERROR; return WTAP_OPEN_ERROR;
} }
@ -238,7 +238,7 @@ wtap_open_return_val etw_dump(const char* etl_filename, const char* pcapng_filen
if (!g_provider_filters[provider_idx - 1].Keyword) if (!g_provider_filters[provider_idx - 1].Keyword)
{ {
*err = ERROR_INVALID_PARAMETER; *err = ERROR_INVALID_PARAMETER;
*err_info = g_strdup_printf("Keyword %s cannot be converted, err is 0x%x", ws_optarg, *err); *err_info = ws_strdup_printf("Keyword %s cannot be converted, err is 0x%x", ws_optarg, *err);
return WTAP_OPEN_ERROR; return WTAP_OPEN_ERROR;
} }
break; break;
@ -246,7 +246,7 @@ wtap_open_return_val etw_dump(const char* etl_filename, const char* pcapng_filen
if (provider_idx == 0) if (provider_idx == 0)
{ {
*err = ERROR_INVALID_PARAMETER; *err = ERROR_INVALID_PARAMETER;
*err_info = g_strdup_printf("-l parameter must follow -p, err is 0x%x", *err); *err_info = ws_strdup_printf("-l parameter must follow -p, err is 0x%x", *err);
return WTAP_OPEN_ERROR; return WTAP_OPEN_ERROR;
} }
@ -254,13 +254,13 @@ wtap_open_return_val etw_dump(const char* etl_filename, const char* pcapng_filen
if (convert_level > UCHAR_MAX) if (convert_level > UCHAR_MAX)
{ {
*err = ERROR_INVALID_PARAMETER; *err = ERROR_INVALID_PARAMETER;
*err_info = g_strdup_printf("Level %s is bigger than 0xff, err is 0x%x", ws_optarg, *err); *err_info = ws_strdup_printf("Level %s is bigger than 0xff, err is 0x%x", ws_optarg, *err);
return WTAP_OPEN_ERROR; return WTAP_OPEN_ERROR;
} }
if (!convert_level) if (!convert_level)
{ {
*err = ERROR_INVALID_PARAMETER; *err = ERROR_INVALID_PARAMETER;
*err_info = g_strdup_printf("Level %s cannot be converted, err is 0x%x", ws_optarg, *err); *err_info = ws_strdup_printf("Level %s cannot be converted, err is 0x%x", ws_optarg, *err);
return WTAP_OPEN_ERROR; return WTAP_OPEN_ERROR;
} }
@ -307,7 +307,7 @@ wtap_open_return_val etw_dump(const char* etl_filename, const char* pcapng_filen
&super_trace_properties.prop); &super_trace_properties.prop);
if (*err != ERROR_SUCCESS) if (*err != ERROR_SUCCESS)
{ {
*err_info = g_strdup_printf("StartTrace failed with %u", *err); *err_info = ws_strdup_printf("StartTrace failed with %u", *err);
returnVal = WTAP_OPEN_ERROR; returnVal = WTAP_OPEN_ERROR;
break; break;
} }
@ -330,7 +330,7 @@ wtap_open_return_val etw_dump(const char* etl_filename, const char* pcapng_filen
NULL); NULL);
if (*err != ERROR_SUCCESS) if (*err != ERROR_SUCCESS)
{ {
*err_info = g_strdup_printf("EnableTraceEx failed with %u", *err); *err_info = ws_strdup_printf("EnableTraceEx failed with %u", *err);
returnVal = WTAP_OPEN_ERROR; returnVal = WTAP_OPEN_ERROR;
break; break;
} }
@ -340,7 +340,7 @@ wtap_open_return_val etw_dump(const char* etl_filename, const char* pcapng_filen
trace_handle = OpenTrace(&log_file); trace_handle = OpenTrace(&log_file);
if (trace_handle == INVALID_PROCESSTRACE_HANDLE) { if (trace_handle == INVALID_PROCESSTRACE_HANDLE) {
*err = GetLastError(); *err = GetLastError();
*err_info = g_strdup_printf("OpenTrace failed with %u", err); *err_info = ws_strdup_printf("OpenTrace failed with %u", err);
returnVal = WTAP_OPEN_NOT_MINE; returnVal = WTAP_OPEN_NOT_MINE;
break; break;
} }
@ -355,7 +355,7 @@ wtap_open_return_val etw_dump(const char* etl_filename, const char* pcapng_filen
*err = ProcessTrace(&trace_handle, 1, 0, 0); *err = ProcessTrace(&trace_handle, 1, 0, 0);
if (*err != ERROR_SUCCESS) { if (*err != ERROR_SUCCESS) {
returnVal = WTAP_OPEN_ERROR; returnVal = WTAP_OPEN_ERROR;
*err_info = g_strdup_printf("ProcessTrace failed with %u", err); *err_info = ws_strdup_printf("ProcessTrace failed with %u", err);
break; break;
} }
@ -369,7 +369,7 @@ wtap_open_return_val etw_dump(const char* etl_filename, const char* pcapng_filen
if (!g_num_events) { if (!g_num_events) {
*err = ERROR_NO_DATA; *err = ERROR_NO_DATA;
*err_info = g_strdup_printf("Didn't find any etw event"); *err_info = ws_strdup_printf("Didn't find any etw event");
returnVal = WTAP_OPEN_NOT_MINE; returnVal = WTAP_OPEN_NOT_MINE;
break; break;
} }

View File

@ -148,7 +148,7 @@ int main(int argc, char* argv[])
g_free(help_url); g_free(help_url);
extcap_base_register_interface(extcap_conf, ETW_EXTCAP_INTERFACE, "ETW reader", 290, "DLT_ETW"); extcap_base_register_interface(extcap_conf, ETW_EXTCAP_INTERFACE, "ETW reader", 290, "DLT_ETW");
help_header = g_strdup_printf( help_header = ws_strdup_printf(
" %s --extcap-interfaces\n" " %s --extcap-interfaces\n"
" %s --extcap-interface=%s --extcap-dlts\n" " %s --extcap-interface=%s --extcap-dlts\n"
" %s --extcap-interface=%s --extcap-config\n" " %s --extcap-interface=%s --extcap-config\n"
@ -186,7 +186,7 @@ int main(int argc, char* argv[])
case OPT_PARAMS: case OPT_PARAMS:
/* Add params as the prefix since getopt_long will ignore the first argument always */ /* Add params as the prefix since getopt_long will ignore the first argument always */
params = g_strdup_printf("params %s", ws_optarg); params = ws_strdup_printf("params %s", ws_optarg);
break; break;
case OPT_INCLUDE_UNDECIDABLE_EVENT: case OPT_INCLUDE_UNDECIDABLE_EVENT:

View File

@ -82,7 +82,7 @@ void extcap_base_set_util_info(extcap_parameters * extcap, const char * exename,
if (!minor) if (!minor)
ws_assert(!release); ws_assert(!release);
extcap->version = g_strdup_printf("%s%s%s%s%s", extcap->version = ws_strdup_printf("%s%s%s%s%s",
major, major,
minor ? "." : "", minor ? "." : "",
minor ? minor : "", minor ? minor : "",
@ -96,7 +96,7 @@ void extcap_base_set_compiled_with(extcap_parameters * extcap, const char *fmt,
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
extcap->compiled_with = g_strdup_vprintf(fmt, ap); extcap->compiled_with = ws_strdup_vprintf(fmt, ap);
va_end(ap); va_end(ap);
} }
@ -105,7 +105,7 @@ void extcap_base_set_running_with(extcap_parameters * extcap, const char *fmt, .
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
extcap->running_with = g_strdup_vprintf(fmt, ap); extcap->running_with = ws_strdup_vprintf(fmt, ap);
va_end(ap); va_end(ap);
} }

View File

@ -179,7 +179,7 @@ int main(int argc, char *argv[])
g_free(help_url); g_free(help_url);
extcap_base_register_interface(extcap_conf, RANDPKT_EXTCAP_INTERFACE, "Random packet generator", 147, "Generator dependent DLT"); extcap_base_register_interface(extcap_conf, RANDPKT_EXTCAP_INTERFACE, "Random packet generator", 147, "Generator dependent DLT");
help_header = g_strdup_printf( help_header = ws_strdup_printf(
" %s --extcap-interfaces\n" " %s --extcap-interfaces\n"
" %s --extcap-interface=%s --extcap-dlts\n" " %s --extcap-interface=%s --extcap-dlts\n"
" %s --extcap-interface=%s --extcap-config\n" " %s --extcap-interface=%s --extcap-config\n"

View File

@ -210,7 +210,7 @@ static int sdj_start_export(const int start_from_entries, const gboolean start_f
} }
appname = g_strdup_printf(SDJOURNAL_EXTCAP_INTERFACE " (Wireshark) %s.%s.%s", appname = ws_strdup_printf(SDJOURNAL_EXTCAP_INTERFACE " (Wireshark) %s.%s.%s",
SDJOURNAL_VERSION_MAJOR, SDJOURNAL_VERSION_MINOR, SDJOURNAL_VERSION_RELEASE); SDJOURNAL_VERSION_MAJOR, SDJOURNAL_VERSION_MINOR, SDJOURNAL_VERSION_RELEASE);
success = pcapng_write_section_header_block(fp, success = pcapng_write_section_header_block(fp,
NULL, /* Comment */ NULL, /* Comment */
@ -367,7 +367,7 @@ int main(int argc, char **argv)
// We don't have an SDJOURNAL DLT, so use USER0 (147). // We don't have an SDJOURNAL DLT, so use USER0 (147).
extcap_base_register_interface(extcap_conf, SDJOURNAL_EXTCAP_INTERFACE, "systemd Journal Export", 147, "USER0"); extcap_base_register_interface(extcap_conf, SDJOURNAL_EXTCAP_INTERFACE, "systemd Journal Export", 147, "USER0");
help_header = g_strdup_printf( help_header = ws_strdup_printf(
" %s --extcap-interfaces\n" " %s --extcap-interfaces\n"
" %s --extcap-interface=%s --extcap-dlts\n" " %s --extcap-interface=%s --extcap-dlts\n"
" %s --extcap-interface=%s --extcap-config\n" " %s --extcap-interface=%s --extcap-config\n"

View File

@ -51,7 +51,7 @@ ssh_session create_ssh_connection(const ssh_params_t* ssh_params, char** err_inf
} }
if (ssh_options_set(sshs, SSH_OPTIONS_HOST, ssh_params->host)) { if (ssh_options_set(sshs, SSH_OPTIONS_HOST, ssh_params->host)) {
*err_info = g_strdup_printf("Can't set the host: %s", ssh_params->host); *err_info = ws_strdup_printf("Can't set the host: %s", ssh_params->host);
goto failure; goto failure;
} }
@ -71,21 +71,21 @@ ssh_session create_ssh_connection(const ssh_params_t* ssh_params, char** err_inf
if (ssh_params->port != 0) { if (ssh_params->port != 0) {
port = ssh_params->port; port = ssh_params->port;
if (ssh_options_set(sshs, SSH_OPTIONS_PORT, &port)) { if (ssh_options_set(sshs, SSH_OPTIONS_PORT, &port)) {
*err_info = g_strdup_printf("Can't set the port: %u", port); *err_info = ws_strdup_printf("Can't set the port: %u", port);
goto failure; goto failure;
} }
} }
if (ssh_params->proxycommand) { if (ssh_params->proxycommand) {
if (ssh_options_set(sshs, SSH_OPTIONS_PROXYCOMMAND, ssh_params->proxycommand)) { if (ssh_options_set(sshs, SSH_OPTIONS_PROXYCOMMAND, ssh_params->proxycommand)) {
*err_info = g_strdup_printf("Can't set the ProxyCommand: %s", ssh_params->proxycommand); *err_info = ws_strdup_printf("Can't set the ProxyCommand: %s", ssh_params->proxycommand);
goto failure; goto failure;
} }
} }
if (ssh_params->username) { if (ssh_params->username) {
if (ssh_options_set(sshs, SSH_OPTIONS_USER, ssh_params->username)) { if (ssh_options_set(sshs, SSH_OPTIONS_USER, ssh_params->username)) {
*err_info = g_strdup_printf("Can't set the username: %s", ssh_params->username); *err_info = ws_strdup_printf("Can't set the username: %s", ssh_params->username);
goto failure; goto failure;
} }
} }
@ -100,7 +100,7 @@ ssh_session create_ssh_connection(const ssh_params_t* ssh_params, char** err_inf
/* Connect to server */ /* Connect to server */
if (ssh_connect(sshs) != SSH_OK) { if (ssh_connect(sshs) != SSH_OK) {
*err_info = g_strdup_printf("Connection error: %s", ssh_get_error(sshs)); *err_info = ws_strdup_printf("Connection error: %s", ssh_get_error(sshs));
goto failure; goto failure;
} }
@ -151,7 +151,7 @@ ssh_session create_ssh_connection(const ssh_params_t* ssh_params, char** err_inf
ws_info("ssh connection closed before public key authentication"); ws_info("ssh connection closed before public key authentication");
} }
*err_info = g_strdup_printf("Can't find a valid authentication. Disconnecting."); *err_info = ws_strdup_printf("Can't find a valid authentication. Disconnecting.");
/* All authentication failed. Disconnect and return */ /* All authentication failed. Disconnect and return */
ssh_disconnect(sshs); ssh_disconnect(sshs);
@ -168,7 +168,7 @@ int ssh_channel_printf(ssh_channel channel, const char* fmt, ...)
int ret = EXIT_SUCCESS; int ret = EXIT_SUCCESS;
va_start(arg, fmt); va_start(arg, fmt);
buf = g_strdup_vprintf(fmt, arg); buf = ws_strdup_vprintf(fmt, arg);
if (ssh_channel_write(channel, buf, (guint32)strlen(buf)) == SSH_ERROR) if (ssh_channel_write(channel, buf, (guint32)strlen(buf)) == SSH_ERROR)
ret = EXIT_FAILURE; ret = EXIT_FAILURE;
va_end(arg); va_end(arg);

View File

@ -159,9 +159,9 @@ static ssh_channel run_ssh_command(ssh_session sshs, const char* capture_command
quoted_iface = iface ? g_shell_quote(iface) : NULL; quoted_iface = iface ? g_shell_quote(iface) : NULL;
quoted_filter = g_shell_quote(cfilter ? cfilter : ""); quoted_filter = g_shell_quote(cfilter ? cfilter : "");
if (count > 0) if (count > 0)
count_str = g_strdup_printf("-c %u", count); count_str = ws_strdup_printf("-c %u", count);
cmdline = g_strdup_printf("%s tcpdump -U %s%s %s -w - %s %s", cmdline = ws_strdup_printf("%s tcpdump -U %s%s %s -w - %s %s",
use_sudo ? "sudo" : "", use_sudo ? "sudo" : "",
quoted_iface ? "-i " : "", quoted_iface ? "-i " : "",
quoted_iface ? quoted_iface : "", quoted_iface ? quoted_iface : "",
@ -341,7 +341,7 @@ static char* concat_filters(const char* extcap_filter, const char* remote_filter
if (!remote_filter && !extcap_filter) if (!remote_filter && !extcap_filter)
return NULL; return NULL;
return g_strdup_printf("(%s) and (%s)", extcap_filter, remote_filter); return ws_strdup_printf("(%s) and (%s)", extcap_filter, remote_filter);
} }
int main(int argc, char *argv[]) int main(int argc, char *argv[])
@ -390,13 +390,13 @@ int main(int argc, char *argv[])
add_libssh_info(extcap_conf); add_libssh_info(extcap_conf);
if (g_strcmp0(sshdump_extcap_interface, DEFAULT_SSHDUMP_EXTCAP_INTERFACE)) { if (g_strcmp0(sshdump_extcap_interface, DEFAULT_SSHDUMP_EXTCAP_INTERFACE)) {
gchar* temp = interface_description; gchar* temp = interface_description;
interface_description = g_strdup_printf("%s, custom version", interface_description); interface_description = ws_strdup_printf("%s, custom version", interface_description);
g_free(temp); g_free(temp);
} }
extcap_base_register_interface(extcap_conf, sshdump_extcap_interface, interface_description, 147, "Remote capture dependent DLT"); extcap_base_register_interface(extcap_conf, sshdump_extcap_interface, interface_description, 147, "Remote capture dependent DLT");
g_free(interface_description); g_free(interface_description);
help_header = g_strdup_printf( help_header = ws_strdup_printf(
" %s --extcap-interfaces\n" " %s --extcap-interfaces\n"
" %s --extcap-interface=%s --extcap-dlts\n" " %s --extcap-interface=%s --extcap-dlts\n"
" %s --extcap-interface=%s --extcap-config\n" " %s --extcap-interface=%s --extcap-config\n"

View File

@ -382,7 +382,7 @@ int main(int argc, char *argv[])
g_free(help_url); g_free(help_url);
extcap_base_register_interface(extcap_conf, UDPDUMP_EXTCAP_INTERFACE, "UDP Listener remote capture", 252, "Exported PDUs"); extcap_base_register_interface(extcap_conf, UDPDUMP_EXTCAP_INTERFACE, "UDP Listener remote capture", 252, "Exported PDUs");
help_header = g_strdup_printf( help_header = ws_strdup_printf(
" %s --extcap-interfaces\n" " %s --extcap-interfaces\n"
" %s --extcap-interface=%s --extcap-dlts\n" " %s --extcap-interface=%s --extcap-dlts\n"
" %s --extcap-interface=%s --extcap-config\n" " %s --extcap-interface=%s --extcap-config\n"
@ -392,7 +392,7 @@ int main(int argc, char *argv[])
g_free(help_header); g_free(help_header);
extcap_help_add_option(extcap_conf, "--help", "print this help"); extcap_help_add_option(extcap_conf, "--help", "print this help");
extcap_help_add_option(extcap_conf, "--version", "print the version"); extcap_help_add_option(extcap_conf, "--version", "print the version");
port_msg = g_strdup_printf("the port to listens on. Default: %u", UDPDUMP_DEFAULT_PORT); port_msg = ws_strdup_printf("the port to listens on. Default: %u", UDPDUMP_DEFAULT_PORT);
extcap_help_add_option(extcap_conf, "--port <port>", port_msg); extcap_help_add_option(extcap_conf, "--port <port>", port_msg);
g_free(port_msg); g_free(port_msg);

6
file.c
View File

@ -4536,7 +4536,7 @@ cf_save_records(capture_file *cf, const char *fname, guint save_format,
to a new file and, if the write succeeds, renaming the to a new file and, if the write succeeds, renaming the
new file on top of the old file. */ new file on top of the old file. */
if (file_exists(fname)) { if (file_exists(fname)) {
fname_new = g_strdup_printf("%s~", fname); fname_new = ws_strdup_printf("%s~", fname);
if (!copy_file_binary_mode(cf->filename, fname_new)) if (!copy_file_binary_mode(cf->filename, fname_new))
goto fail; goto fail;
} else { } else {
@ -4572,7 +4572,7 @@ cf_save_records(capture_file *cf, const char *fname, guint save_format,
file. (If the existing file is the current capture file, file. (If the existing file is the current capture file,
we *HAVE* to do that, otherwise we're overwriting the file we *HAVE* to do that, otherwise we're overwriting the file
from which we're reading the packets that we're writing!) */ from which we're reading the packets that we're writing!) */
fname_new = g_strdup_printf("%s~", fname); fname_new = ws_strdup_printf("%s~", fname);
pdh = wtap_dump_open(fname_new, save_format, compression_type, &params, pdh = wtap_dump_open(fname_new, save_format, compression_type, &params,
&err, &err_info); &err, &err_info);
} else { } else {
@ -4831,7 +4831,7 @@ cf_export_specified_packets(capture_file *cf, const char *fname,
file. (If the existing file is the current capture file, file. (If the existing file is the current capture file,
we *HAVE* to do that, otherwise we're overwriting the file we *HAVE* to do that, otherwise we're overwriting the file
from which we're reading the packets that we're writing!) */ from which we're reading the packets that we're writing!) */
fname_new = g_strdup_printf("%s~", fname); fname_new = ws_strdup_printf("%s~", fname);
pdh = wtap_dump_open(fname_new, save_format, compression_type, &params, pdh = wtap_dump_open(fname_new, save_format, compression_type, &params,
&err, &err_info); &err, &err_info);
} else { } else {

View File

@ -213,7 +213,7 @@ fileset_add_file(const char *dirname, const char *fname, gboolean current)
fileset_entry *entry = NULL; fileset_entry *entry = NULL;
path = g_strdup_printf("%s%s", dirname, fname); path = ws_strdup_printf("%s%s", dirname, fname);
fh = ws_open( path, O_RDONLY, 0000 /* no creation so don't matter */); fh = ws_open( path, O_RDONLY, 0000 /* no creation so don't matter */);
if(fh != -1) { if(fh != -1) {

View File

@ -710,7 +710,7 @@ avp(A) ::= NAME(B) AVP_OPERATOR(C) value(D). { A = new_avp(B,D,*C); }
avp(A) ::= NAME(B). { A = new_avp(B,"",'?'); } avp(A) ::= NAME(B). { A = new_avp(B,"",'?'); }
avp(A) ::= NAME(B) OPEN_BRACE avp_oneoff(C) CLOSE_BRACE. { A = new_avp(B,C,'|'); } avp(A) ::= NAME(B) OPEN_BRACE avp_oneoff(C) CLOSE_BRACE. { A = new_avp(B,C,'|'); }
avp_oneoff(A) ::= avp_oneoff(B) PIPE value(C). { A = g_strdup_printf("%s|%s",B,C); } avp_oneoff(A) ::= avp_oneoff(B) PIPE value(C). { A = ws_strdup_printf("%s|%s",B,C); }
avp_oneoff(A) ::= value(B). { A = g_strdup(B); } avp_oneoff(A) ::= value(B). { A = g_strdup(B); }
value(A) ::= QUOTED(B). { A = g_strdup(B); } value(A) ::= QUOTED(B). { A = g_strdup(B); }

View File

@ -196,7 +196,7 @@ extern gchar* add_ranges(mate_config* mc, gchar* range,GPtrArray* range_ptr_arr)
g_ptr_array_add(range_ptr_arr,(gpointer)hfidp); g_ptr_array_add(range_ptr_arr,(gpointer)hfidp);
} else { } else {
g_strfreev(ranges); g_strfreev(ranges);
return g_strdup_printf("no such proto: '%s'",ranges[i]); return ws_strdup_printf("no such proto: '%s'",ranges[i]);
} }
} }
@ -215,12 +215,12 @@ static void new_attr_hfri(mate_config* mc, gchar* item_name, GHashTable* hfids,
*p_id = -1; *p_id = -1;
hfri.p_id = p_id; hfri.p_id = p_id;
hfri.hfinfo.name = g_strdup(name); hfri.hfinfo.name = g_strdup(name);
hfri.hfinfo.abbrev = g_strdup_printf("mate.%s.%s",item_name,name); hfri.hfinfo.abbrev = ws_strdup_printf("mate.%s.%s",item_name,name);
hfri.hfinfo.type = FT_STRING; hfri.hfinfo.type = FT_STRING;
hfri.hfinfo.display = BASE_NONE; hfri.hfinfo.display = BASE_NONE;
hfri.hfinfo.strings = NULL; hfri.hfinfo.strings = NULL;
hfri.hfinfo.bitmask = 0; hfri.hfinfo.bitmask = 0;
hfri.hfinfo.blurb = g_strdup_printf("%s attribute of %s",name,item_name); hfri.hfinfo.blurb = ws_strdup_printf("%s attribute of %s",name,item_name);
*p_id = -1; *p_id = -1;
g_hash_table_insert(hfids,name,p_id); g_hash_table_insert(hfids,name,p_id);
@ -271,16 +271,16 @@ static void analyze_pdu_config(mate_config* mc, mate_cfg_pdu* cfg) {
hfri.p_id = &(cfg->hfid); hfri.p_id = &(cfg->hfid);
hfri.hfinfo.name = g_strdup(cfg->name); hfri.hfinfo.name = g_strdup(cfg->name);
hfri.hfinfo.abbrev = g_strdup_printf("mate.%s",cfg->name); hfri.hfinfo.abbrev = ws_strdup_printf("mate.%s",cfg->name);
hfri.hfinfo.blurb = g_strdup_printf("%s id",cfg->name); hfri.hfinfo.blurb = ws_strdup_printf("%s id",cfg->name);
hfri.hfinfo.type = FT_UINT32; hfri.hfinfo.type = FT_UINT32;
hfri.hfinfo.display = BASE_DEC; hfri.hfinfo.display = BASE_DEC;
g_array_append_val(mc->hfrs,hfri); g_array_append_val(mc->hfrs,hfri);
hfri.p_id = &(cfg->hfid_pdu_rel_time); hfri.p_id = &(cfg->hfid_pdu_rel_time);
hfri.hfinfo.name = g_strdup_printf("%s time",cfg->name); hfri.hfinfo.name = ws_strdup_printf("%s time",cfg->name);
hfri.hfinfo.abbrev = g_strdup_printf("mate.%s.RelativeTime",cfg->name); hfri.hfinfo.abbrev = ws_strdup_printf("mate.%s.RelativeTime",cfg->name);
hfri.hfinfo.type = FT_FLOAT; hfri.hfinfo.type = FT_FLOAT;
hfri.hfinfo.display = BASE_NONE; hfri.hfinfo.display = BASE_NONE;
hfri.hfinfo.blurb = "Seconds passed since the start of capture"; hfri.hfinfo.blurb = "Seconds passed since the start of capture";
@ -288,8 +288,8 @@ static void analyze_pdu_config(mate_config* mc, mate_cfg_pdu* cfg) {
g_array_append_val(mc->hfrs,hfri); g_array_append_val(mc->hfrs,hfri);
hfri.p_id = &(cfg->hfid_pdu_time_in_gop); hfri.p_id = &(cfg->hfid_pdu_time_in_gop);
hfri.hfinfo.name = g_strdup_printf("%s time since beginning of Gop",cfg->name); hfri.hfinfo.name = ws_strdup_printf("%s time since beginning of Gop",cfg->name);
hfri.hfinfo.abbrev = g_strdup_printf("mate.%s.TimeInGop",cfg->name); hfri.hfinfo.abbrev = ws_strdup_printf("mate.%s.TimeInGop",cfg->name);
hfri.hfinfo.type = FT_FLOAT; hfri.hfinfo.type = FT_FLOAT;
hfri.hfinfo.display = BASE_NONE; hfri.hfinfo.display = BASE_NONE;
hfri.hfinfo.blurb = "Seconds passed since the start of the GOP"; hfri.hfinfo.blurb = "Seconds passed since the start of the GOP";
@ -326,49 +326,49 @@ static void analyze_gop_config(gpointer k _U_, gpointer v, gpointer p) {
hfri.p_id = &(cfg->hfid); hfri.p_id = &(cfg->hfid);
hfri.hfinfo.name = g_strdup(cfg->name); hfri.hfinfo.name = g_strdup(cfg->name);
hfri.hfinfo.abbrev = g_strdup_printf("mate.%s",cfg->name); hfri.hfinfo.abbrev = ws_strdup_printf("mate.%s",cfg->name);
hfri.hfinfo.blurb = g_strdup_printf("%s id",cfg->name); hfri.hfinfo.blurb = ws_strdup_printf("%s id",cfg->name);
hfri.hfinfo.type = FT_UINT32; hfri.hfinfo.type = FT_UINT32;
hfri.hfinfo.display = BASE_DEC; hfri.hfinfo.display = BASE_DEC;
g_array_append_val(mc->hfrs,hfri); g_array_append_val(mc->hfrs,hfri);
hfri.p_id = &(cfg->hfid_start_time); hfri.p_id = &(cfg->hfid_start_time);
hfri.hfinfo.name = g_strdup_printf("%s start time",cfg->name); hfri.hfinfo.name = ws_strdup_printf("%s start time",cfg->name);
hfri.hfinfo.abbrev = g_strdup_printf("mate.%s.StartTime",cfg->name); hfri.hfinfo.abbrev = ws_strdup_printf("mate.%s.StartTime",cfg->name);
hfri.hfinfo.type = FT_FLOAT; hfri.hfinfo.type = FT_FLOAT;
hfri.hfinfo.display = BASE_NONE; hfri.hfinfo.display = BASE_NONE;
hfri.hfinfo.blurb = g_strdup_printf("Seconds passed since the beginning of capture to the start of this %s",cfg->name); hfri.hfinfo.blurb = ws_strdup_printf("Seconds passed since the beginning of capture to the start of this %s",cfg->name);
g_array_append_val(mc->hfrs,hfri); g_array_append_val(mc->hfrs,hfri);
hfri.p_id = &(cfg->hfid_stop_time); hfri.p_id = &(cfg->hfid_stop_time);
hfri.hfinfo.name = g_strdup_printf("%s hold time",cfg->name); hfri.hfinfo.name = ws_strdup_printf("%s hold time",cfg->name);
hfri.hfinfo.abbrev = g_strdup_printf("mate.%s.Time",cfg->name); hfri.hfinfo.abbrev = ws_strdup_printf("mate.%s.Time",cfg->name);
hfri.hfinfo.blurb = g_strdup_printf("Duration in seconds from start to stop of this %s",cfg->name); hfri.hfinfo.blurb = ws_strdup_printf("Duration in seconds from start to stop of this %s",cfg->name);
g_array_append_val(mc->hfrs,hfri); g_array_append_val(mc->hfrs,hfri);
hfri.p_id = &(cfg->hfid_last_time); hfri.p_id = &(cfg->hfid_last_time);
hfri.hfinfo.name = g_strdup_printf("%s duration",cfg->name); hfri.hfinfo.name = ws_strdup_printf("%s duration",cfg->name);
hfri.hfinfo.abbrev = g_strdup_printf("mate.%s.Duration",cfg->name); hfri.hfinfo.abbrev = ws_strdup_printf("mate.%s.Duration",cfg->name);
hfri.hfinfo.blurb = g_strdup_printf("Time passed between the start of this %s and the last pdu assigned to it",cfg->name); hfri.hfinfo.blurb = ws_strdup_printf("Time passed between the start of this %s and the last pdu assigned to it",cfg->name);
g_array_append_val(mc->hfrs,hfri); g_array_append_val(mc->hfrs,hfri);
hfri.p_id = &(cfg->hfid_gop_num_pdus); hfri.p_id = &(cfg->hfid_gop_num_pdus);
hfri.hfinfo.name = g_strdup_printf("%s number of PDUs",cfg->name); hfri.hfinfo.name = ws_strdup_printf("%s number of PDUs",cfg->name);
hfri.hfinfo.abbrev = g_strdup_printf("mate.%s.NumOfPdus",cfg->name); hfri.hfinfo.abbrev = ws_strdup_printf("mate.%s.NumOfPdus",cfg->name);
hfri.hfinfo.blurb = g_strdup_printf("Number of PDUs assigned to this %s",cfg->name); hfri.hfinfo.blurb = ws_strdup_printf("Number of PDUs assigned to this %s",cfg->name);
hfri.hfinfo.type = FT_UINT32; hfri.hfinfo.type = FT_UINT32;
hfri.hfinfo.display = BASE_DEC; hfri.hfinfo.display = BASE_DEC;
g_array_append_val(mc->hfrs,hfri); g_array_append_val(mc->hfrs,hfri);
hfri.p_id = &(cfg->hfid_gop_pdu); hfri.p_id = &(cfg->hfid_gop_pdu);
hfri.hfinfo.name = g_strdup_printf("A PDU of %s",cfg->name); hfri.hfinfo.name = ws_strdup_printf("A PDU of %s",cfg->name);
hfri.hfinfo.abbrev = g_strdup_printf("mate.%s.Pdu",cfg->name); hfri.hfinfo.abbrev = ws_strdup_printf("mate.%s.Pdu",cfg->name);
hfri.hfinfo.blurb = g_strdup_printf("A PDU assigned to this %s",cfg->name); hfri.hfinfo.blurb = ws_strdup_printf("A PDU assigned to this %s",cfg->name);
if (cfg->pdu_tree_mode == GOP_FRAME_TREE) { if (cfg->pdu_tree_mode == GOP_FRAME_TREE) {
hfri.hfinfo.type = FT_FRAMENUM; hfri.hfinfo.type = FT_FRAMENUM;
@ -445,8 +445,8 @@ static void analyze_gog_config(gpointer k _U_, gpointer v, gpointer p) {
/* create the hf array for this gog */ /* create the hf array for this gog */
hfri.p_id = &(cfg->hfid); hfri.p_id = &(cfg->hfid);
hfri.hfinfo.name = g_strdup(cfg->name); hfri.hfinfo.name = g_strdup(cfg->name);
hfri.hfinfo.abbrev = g_strdup_printf("mate.%s",cfg->name); hfri.hfinfo.abbrev = ws_strdup_printf("mate.%s",cfg->name);
hfri.hfinfo.blurb = g_strdup_printf("%s Id",cfg->name); hfri.hfinfo.blurb = ws_strdup_printf("%s Id",cfg->name);
hfri.hfinfo.type = FT_UINT32; hfri.hfinfo.type = FT_UINT32;
hfri.hfinfo.display = BASE_DEC; hfri.hfinfo.display = BASE_DEC;
@ -454,16 +454,16 @@ static void analyze_gog_config(gpointer k _U_, gpointer v, gpointer p) {
hfri.p_id = &(cfg->hfid_gog_num_of_gops); hfri.p_id = &(cfg->hfid_gog_num_of_gops);
hfri.hfinfo.name = "number of GOPs"; hfri.hfinfo.name = "number of GOPs";
hfri.hfinfo.abbrev = g_strdup_printf("mate.%s.NumOfGops",cfg->name); hfri.hfinfo.abbrev = ws_strdup_printf("mate.%s.NumOfGops",cfg->name);
hfri.hfinfo.type = FT_UINT32; hfri.hfinfo.type = FT_UINT32;
hfri.hfinfo.display = BASE_DEC; hfri.hfinfo.display = BASE_DEC;
hfri.hfinfo.blurb = g_strdup_printf("Number of GOPs assigned to this %s",cfg->name); hfri.hfinfo.blurb = ws_strdup_printf("Number of GOPs assigned to this %s",cfg->name);
g_array_append_val(mc->hfrs,hfri); g_array_append_val(mc->hfrs,hfri);
hfri.p_id = &(cfg->hfid_gog_gopstart); hfri.p_id = &(cfg->hfid_gog_gopstart);
hfri.hfinfo.name = "GopStart frame"; hfri.hfinfo.name = "GopStart frame";
hfri.hfinfo.abbrev = g_strdup_printf("mate.%s.GopStart",cfg->name); hfri.hfinfo.abbrev = ws_strdup_printf("mate.%s.GopStart",cfg->name);
hfri.hfinfo.type = FT_FRAMENUM; hfri.hfinfo.type = FT_FRAMENUM;
hfri.hfinfo.display = BASE_NONE; hfri.hfinfo.display = BASE_NONE;
hfri.hfinfo.blurb = g_strdup("The start frame of a GOP"); hfri.hfinfo.blurb = g_strdup("The start frame of a GOP");
@ -472,7 +472,7 @@ static void analyze_gog_config(gpointer k _U_, gpointer v, gpointer p) {
hfri.p_id = &(cfg->hfid_gog_gopstop); hfri.p_id = &(cfg->hfid_gog_gopstop);
hfri.hfinfo.name = "GopStop frame"; hfri.hfinfo.name = "GopStop frame";
hfri.hfinfo.abbrev = g_strdup_printf("mate.%s.GopStop",cfg->name); hfri.hfinfo.abbrev = ws_strdup_printf("mate.%s.GopStop",cfg->name);
hfri.hfinfo.type = FT_FRAMENUM; hfri.hfinfo.type = FT_FRAMENUM;
hfri.hfinfo.display = BASE_NONE; hfri.hfinfo.display = BASE_NONE;
hfri.hfinfo.blurb = g_strdup("The stop frame of a GOP"); hfri.hfinfo.blurb = g_strdup("The stop frame of a GOP");
@ -480,27 +480,27 @@ static void analyze_gog_config(gpointer k _U_, gpointer v, gpointer p) {
g_array_append_val(mc->hfrs,hfri); g_array_append_val(mc->hfrs,hfri);
hfri.p_id = &(cfg->hfid_start_time); hfri.p_id = &(cfg->hfid_start_time);
hfri.hfinfo.name = g_strdup_printf("%s start time",cfg->name); hfri.hfinfo.name = ws_strdup_printf("%s start time",cfg->name);
hfri.hfinfo.abbrev = g_strdup_printf("mate.%s.StartTime",cfg->name); hfri.hfinfo.abbrev = ws_strdup_printf("mate.%s.StartTime",cfg->name);
hfri.hfinfo.type = FT_FLOAT; hfri.hfinfo.type = FT_FLOAT;
hfri.hfinfo.blurb = g_strdup_printf("Seconds passed since the beginning of capture to the start of this %s",cfg->name); hfri.hfinfo.blurb = ws_strdup_printf("Seconds passed since the beginning of capture to the start of this %s",cfg->name);
g_array_append_val(mc->hfrs,hfri); g_array_append_val(mc->hfrs,hfri);
hfri.p_id = &(cfg->hfid_last_time); hfri.p_id = &(cfg->hfid_last_time);
hfri.hfinfo.name = g_strdup_printf("%s duration",cfg->name); hfri.hfinfo.name = ws_strdup_printf("%s duration",cfg->name);
hfri.hfinfo.abbrev = g_strdup_printf("mate.%s.Duration",cfg->name); hfri.hfinfo.abbrev = ws_strdup_printf("mate.%s.Duration",cfg->name);
hfri.hfinfo.blurb = g_strdup_printf("Time passed between the start of this %s and the last pdu assigned to it",cfg->name); hfri.hfinfo.blurb = ws_strdup_printf("Time passed between the start of this %s and the last pdu assigned to it",cfg->name);
g_array_append_val(mc->hfrs,hfri); g_array_append_val(mc->hfrs,hfri);
/* this might become mate.gogname.gopname */ /* this might become mate.gogname.gopname */
hfri.p_id = &(cfg->hfid_gog_gop); hfri.p_id = &(cfg->hfid_gog_gop);
hfri.hfinfo.name = "a GOP"; hfri.hfinfo.name = "a GOP";
hfri.hfinfo.abbrev = g_strdup_printf("mate.%s.Gop",cfg->name); hfri.hfinfo.abbrev = ws_strdup_printf("mate.%s.Gop",cfg->name);
hfri.hfinfo.type = FT_STRING; hfri.hfinfo.type = FT_STRING;
hfri.hfinfo.display = BASE_NONE; hfri.hfinfo.display = BASE_NONE;
hfri.hfinfo.blurb = g_strdup_printf("a GOPs assigned to this %s",cfg->name); hfri.hfinfo.blurb = ws_strdup_printf("a GOPs assigned to this %s",cfg->name);
g_array_append_val(mc->hfrs,hfri); g_array_append_val(mc->hfrs,hfri);
@ -586,7 +586,7 @@ extern mate_config* mate_make_config(const gchar* filename, int mate_hfid) {
mc->dbg_facility = NULL; mc->dbg_facility = NULL;
mc->mate_lib_path = g_strdup_printf("%s%c%s%c",get_datafile_dir(),DIR_SEP,DEFAULT_MATE_LIB_PATH,DIR_SEP); mc->mate_lib_path = ws_strdup_printf("%s%c%s%c",get_datafile_dir(),DIR_SEP,DEFAULT_MATE_LIB_PATH,DIR_SEP);
mc->pducfgs = g_hash_table_new(g_str_hash,g_str_equal); mc->pducfgs = g_hash_table_new(g_str_hash,g_str_equal);
mc->gopcfgs = g_hash_table_new(g_str_hash,g_str_equal); mc->gopcfgs = g_hash_table_new(g_str_hash,g_str_equal);

View File

@ -1435,13 +1435,13 @@ static LoAL* load_loal_error(FILE* fp, LoAL* loal, AVPL* curr, int linenum, cons
gchar* err; gchar* err;
va_start( list, fmt ); va_start( list, fmt );
desc = g_strdup_vprintf(fmt, list); desc = ws_strdup_vprintf(fmt, list);
va_end( list ); va_end( list );
if (loal) { if (loal) {
err = g_strdup_printf("Error Loading LoAL from file: in %s at line: %i, %s",loal->name,linenum,desc); err = ws_strdup_printf("Error Loading LoAL from file: in %s at line: %i, %s",loal->name,linenum,desc);
} else { } else {
err = g_strdup_printf("Error Loading LoAL at line: %i, %s",linenum,desc); err = ws_strdup_printf("Error Loading LoAL at line: %i, %s",linenum,desc);
} }
ret = new_loal(err); ret = new_loal(err);

View File

@ -150,7 +150,7 @@ extern void delete_avp(AVP* avp);
* avp methods * avp methods
*/ */
/* returns a newly allocated string containing a representation of the avp */ /* returns a newly allocated string containing a representation of the avp */
#define avp_to_str(avp) (g_strdup_printf("%s%c%s",avp->n,avp->o,avp->v)) #define avp_to_str(avp) (ws_strdup_printf("%s%c%s",avp->n,avp->o,avp->v))
/* returns the src avp if the src avp matches(*) the op avp or NULL if it doesn't */ /* returns the src avp if the src avp matches(*) the op avp or NULL if it doesn't */
extern AVP* match_avp(AVP* src, AVP* op); extern AVP* match_avp(AVP* src, AVP* op);

View File

@ -105,31 +105,31 @@ void toolbar_cb(gpointer toolbar_item, gpointer item_data, gpointer user_data _U
pluginifdemo_toolbar_log("Button pressed at toolbar"); pluginifdemo_toolbar_log("Button pressed at toolbar");
guint32 fnum = GPOINTER_TO_UINT(plugin_if_get_frame_data(get_frame_data_cb, NULL)); guint32 fnum = GPOINTER_TO_UINT(plugin_if_get_frame_data(get_frame_data_cb, NULL));
if (fnum) { if (fnum) {
message = g_strdup_printf("Current frame is: %u", fnum); message = ws_strdup_printf("Current frame is: %u", fnum);
pluginifdemo_toolbar_log(message); pluginifdemo_toolbar_log(message);
} }
const gchar* fnm = (const gchar*)plugin_if_get_capture_file(get_capture_file_cb, NULL); const gchar* fnm = (const gchar*)plugin_if_get_capture_file(get_capture_file_cb, NULL);
if (fnm) { if (fnm) {
message = g_strdup_printf("Capture file name is: %s", fnm); message = ws_strdup_printf("Capture file name is: %s", fnm);
pluginifdemo_toolbar_log(message); pluginifdemo_toolbar_log(message);
} }
} }
else if ( entry->item_type == EXT_TOOLBAR_BOOLEAN ) else if ( entry->item_type == EXT_TOOLBAR_BOOLEAN )
{ {
gboolean data = *((gboolean *)item_data); gboolean data = *((gboolean *)item_data);
message = g_strdup_printf( "Checkbox selected value: %d", (int) (data) ); message = ws_strdup_printf( "Checkbox selected value: %d", (int) (data) );
pluginifdemo_toolbar_log(message); pluginifdemo_toolbar_log(message);
} }
else if ( entry->item_type == EXT_TOOLBAR_STRING ) else if ( entry->item_type == EXT_TOOLBAR_STRING )
{ {
gchar * data = (gchar *)item_data; gchar * data = (gchar *)item_data;
message = g_strdup_printf( "String entered in toolbar: %s", data ); message = ws_strdup_printf( "String entered in toolbar: %s", data );
pluginifdemo_toolbar_log(message); pluginifdemo_toolbar_log(message);
} }
else if ( entry->item_type == EXT_TOOLBAR_SELECTOR ) else if ( entry->item_type == EXT_TOOLBAR_SELECTOR )
{ {
ext_toolbar_value_t * data = (ext_toolbar_value_t *)item_data; ext_toolbar_value_t * data = (ext_toolbar_value_t *)item_data;
message = g_strdup_printf( "Value from toolbar: %s", data->value ); message = ws_strdup_printf( "Value from toolbar: %s", data->value );
pluginifdemo_toolbar_log(message); pluginifdemo_toolbar_log(message);
} }

View File

@ -11889,7 +11889,7 @@ pn_io_ar_conv_filter(packet_info *pinfo)
set_address(&controllermac_addr, AT_ETHER, 6, ar->controllermac); set_address(&controllermac_addr, AT_ETHER, 6, ar->controllermac);
set_address(&devicemac_addr, AT_ETHER, 6, ar->devicemac); set_address(&devicemac_addr, AT_ETHER, 6, ar->devicemac);
buf = g_strdup_printf( buf = ws_strdup_printf(
"pn_io.ar_uuid == %s || " /* ARUUID */ "pn_io.ar_uuid == %s || " /* ARUUID */
"(pn_io.alarm_src_endpoint == 0x%x && eth.src == %s) || " /* Alarm CR (contr -> dev) */ "(pn_io.alarm_src_endpoint == 0x%x && eth.src == %s) || " /* Alarm CR (contr -> dev) */
"(pn_io.alarm_src_endpoint == 0x%x && eth.src == %s)", /* Alarm CR (dev -> contr) */ "(pn_io.alarm_src_endpoint == 0x%x && eth.src == %s)", /* Alarm CR (dev -> contr) */
@ -11919,7 +11919,7 @@ pn_io_ar_conv_data_filter(packet_info *pinfo)
guid_str = guid_to_str(pinfo->pool, (const e_guid_t*) &ar->aruuid); guid_str = guid_to_str(pinfo->pool, (const e_guid_t*) &ar->aruuid);
if (ar->arType == 0x0010) /* IOCARSingle using RT_CLASS_3 */ if (ar->arType == 0x0010) /* IOCARSingle using RT_CLASS_3 */
{ {
buf = g_strdup_printf( buf = ws_strdup_printf(
"pn_io.ar_uuid == %s || " /* ARUUID */ "pn_io.ar_uuid == %s || " /* ARUUID */
"(pn_rt.frame_id == 0x%x) || (pn_rt.frame_id == 0x%x) || " "(pn_rt.frame_id == 0x%x) || (pn_rt.frame_id == 0x%x) || "
"(pn_io.alarm_src_endpoint == 0x%x && eth.src == %s) || " /* Alarm CR (contr -> dev) */ "(pn_io.alarm_src_endpoint == 0x%x && eth.src == %s) || " /* Alarm CR (contr -> dev) */
@ -11931,7 +11931,7 @@ pn_io_ar_conv_data_filter(packet_info *pinfo)
} }
else else
{ {
buf = g_strdup_printf( buf = ws_strdup_printf(
"pn_io.ar_uuid == %s || " /* ARUUID */ "pn_io.ar_uuid == %s || " /* ARUUID */
"(pn_rt.frame_id == 0x%x && eth.src == %s && eth.dst == %s) || " /* Input CR && dev MAC -> contr MAC */ "(pn_rt.frame_id == 0x%x && eth.src == %s && eth.dst == %s) || " /* Input CR && dev MAC -> contr MAC */
"(pn_rt.frame_id == 0x%x && eth.src == %s && eth.dst == %s) || " /* Output CR && contr MAC -> dev MAC */ "(pn_rt.frame_id == 0x%x && eth.src == %s && eth.dst == %s) || " /* Output CR && contr MAC -> dev MAC */

View File

@ -345,25 +345,25 @@ cba_build_filter(packet_info *pinfo)
/* IPv4 */ /* IPv4 */
switch(GPOINTER_TO_UINT(profinet_type)) { switch(GPOINTER_TO_UINT(profinet_type)) {
case 1: case 1:
return g_strdup_printf("(ip.src eq %s and ip.dst eq %s and cba.acco.dcom == 1) || (ip.src eq %s and ip.dst eq %s and cba.acco.dcom == 0)", return ws_strdup_printf("(ip.src eq %s and ip.dst eq %s and cba.acco.dcom == 1) || (ip.src eq %s and ip.dst eq %s and cba.acco.dcom == 0)",
address_to_str(pinfo->pool, &pinfo->net_dst), address_to_str(pinfo->pool, &pinfo->net_dst),
address_to_str(pinfo->pool, &pinfo->net_src), address_to_str(pinfo->pool, &pinfo->net_src),
address_to_str(pinfo->pool, &pinfo->net_src), address_to_str(pinfo->pool, &pinfo->net_src),
address_to_str(pinfo->pool, &pinfo->net_dst)); address_to_str(pinfo->pool, &pinfo->net_dst));
case 2: case 2:
return g_strdup_printf("(ip.src eq %s and ip.dst eq %s and cba.acco.dcom == 1) || (ip.src eq %s and ip.dst eq %s and cba.acco.dcom == 0)", return ws_strdup_printf("(ip.src eq %s and ip.dst eq %s and cba.acco.dcom == 1) || (ip.src eq %s and ip.dst eq %s and cba.acco.dcom == 0)",
address_to_str(pinfo->pool, &pinfo->net_src), address_to_str(pinfo->pool, &pinfo->net_src),
address_to_str(pinfo->pool, &pinfo->net_dst), address_to_str(pinfo->pool, &pinfo->net_dst),
address_to_str(pinfo->pool, &pinfo->net_dst), address_to_str(pinfo->pool, &pinfo->net_dst),
address_to_str(pinfo->pool, &pinfo->net_src)); address_to_str(pinfo->pool, &pinfo->net_src));
case 3: case 3:
return g_strdup_printf("(ip.src eq %s and ip.dst eq %s and cba.acco.srt == 1) || (ip.src eq %s and ip.dst eq %s and cba.acco.srt == 0)", return ws_strdup_printf("(ip.src eq %s and ip.dst eq %s and cba.acco.srt == 1) || (ip.src eq %s and ip.dst eq %s and cba.acco.srt == 0)",
address_to_str(pinfo->pool, &pinfo->net_dst), address_to_str(pinfo->pool, &pinfo->net_dst),
address_to_str(pinfo->pool, &pinfo->net_src), address_to_str(pinfo->pool, &pinfo->net_src),
address_to_str(pinfo->pool, &pinfo->net_src), address_to_str(pinfo->pool, &pinfo->net_src),
address_to_str(pinfo->pool, &pinfo->net_dst)); address_to_str(pinfo->pool, &pinfo->net_dst));
case 4: case 4:
return g_strdup_printf("(ip.src eq %s and ip.dst eq %s and cba.acco.srt == 1) || (ip.src eq %s and ip.dst eq %s and cba.acco.srt == 0)", return ws_strdup_printf("(ip.src eq %s and ip.dst eq %s and cba.acco.srt == 1) || (ip.src eq %s and ip.dst eq %s and cba.acco.srt == 0)",
address_to_str(pinfo->pool, &pinfo->net_src), address_to_str(pinfo->pool, &pinfo->net_src),
address_to_str(pinfo->pool, &pinfo->net_dst), address_to_str(pinfo->pool, &pinfo->net_dst),
address_to_str(pinfo->pool, &pinfo->net_dst), address_to_str(pinfo->pool, &pinfo->net_dst),

Some files were not shown because too many files have changed in this diff Show More