aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2006-12-26 22:56:35 +0000
committerGuy Harris <guy@alum.mit.edu>2006-12-26 22:56:35 +0000
commit303082812e8bba1379b9aa44a6d663bcd8b80821 (patch)
tree4b8ad833bbc24e2fe54826e4b86d0376f0514ee4
parent81ab78cddb440b504fb58bd0a11718bd933c406d (diff)
From Sebastien Tandel: fix places where a signed character was being
passed to ctype.h macros. Make some routines in packet-exec.c not used outside that file static, and fix a typo. svn path=/trunk/; revision=20222
-rw-r--r--epan/dissectors/packet-catapult-dct2000.c10
-rw-r--r--epan/dissectors/packet-exec.c49
-rw-r--r--epan/dissectors/packet-sip.c2
-rw-r--r--epan/dissectors/packet-slimp3.c2
4 files changed, 32 insertions, 31 deletions
diff --git a/epan/dissectors/packet-catapult-dct2000.c b/epan/dissectors/packet-catapult-dct2000.c
index 1fb080d12d..76c24754f9 100644
--- a/epan/dissectors/packet-catapult-dct2000.c
+++ b/epan/dissectors/packet-catapult-dct2000.c
@@ -26,6 +26,8 @@
# include "config.h"
#endif
+#include <glib.h>
+
#include <string.h>
#include <ctype.h>
#include <epan/packet.h>
@@ -105,7 +107,7 @@ void proto_reg_handoff_catapult_dct2000(void);
void proto_register_catapult_dct2000(void);
static dissector_handle_t look_for_dissector(char *protocol_name);
-static void parse_outhdr_string(char *outhdr_string);
+static void parse_outhdr_string(guchar *outhdr_string);
static void attach_fp_info(packet_info *pinfo, gboolean received,
const char *protocol_name, int variant);
@@ -433,7 +435,7 @@ dissector_handle_t look_for_dissector(char *protocol_name)
/* Populate outhdr_values array with numbers found in outhdr_string */
-void parse_outhdr_string(char *outhdr_string)
+void parse_outhdr_string(guchar *outhdr_string)
{
int n = 0;
@@ -444,7 +446,7 @@ void parse_outhdr_string(char *outhdr_string)
guint digits;
/* Find digits */
- for (digits = 0; digits < strlen(outhdr_string); digits++, n++)
+ for (digits = 0; digits < strlen((gchar*)outhdr_string); digits++, n++)
{
if (!isdigit(outhdr_string[n]))
{
@@ -702,7 +704,7 @@ dissect_catapult_dct2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
(strcmp(protocol_name, "fp_r5") == 0) ||
(strcmp(protocol_name, "fp_r6") == 0))
{
- parse_outhdr_string((char*)tvb_get_ephemeral_string(tvb, outhdr_start, outhdr_length));
+ parse_outhdr_string(tvb_get_ephemeral_string(tvb, outhdr_start, outhdr_length));
attach_fp_info(pinfo, direction, protocol_name,
atoi((char*)tvb_get_ephemeral_string(tvb, variant_start, variant_length)));
}
diff --git a/epan/dissectors/packet-exec.c b/epan/dissectors/packet-exec.c
index ae47726a12..c1675e8ad1 100644
--- a/epan/dissectors/packet-exec.c
+++ b/epan/dissectors/packet-exec.c
@@ -46,8 +46,8 @@
/* Forward declaration we need below */
void proto_reg_handoff_exec(void);
-gboolean exec_isprint_string(gchar *string);
-gboolean exec_isdigit_string(gchar *string);
+static gboolean exec_isprint_string(guchar *string);
+static gboolean exec_isdigit_string(guchar *string);
/* Variables for our preferences */
static gboolean preference_info_show_username = TRUE;
@@ -86,7 +86,7 @@ typedef enum {
typedef struct {
/* Packet number within the conversation */
guint first_packet_number, second_packet_number;
- guint third_packet_number, forth_packet_number;
+ guint third_packet_number, fourth_packet_number;
/* The following variables are given values from session_state_t
* above to keep track of where we are in the beginning of the session
@@ -98,7 +98,7 @@ typedef struct {
/* Track where we are in the conversation */
exec_session_state_t state;
exec_session_state_t first_packet_state, second_packet_state;
- exec_session_state_t third_packet_state, forth_packet_state;
+ exec_session_state_t third_packet_state, fourth_packet_state;
gchar *username;
gchar *command;
@@ -113,7 +113,7 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *exec_tree=NULL;
/* Variables for extracting and displaying data from the packet */
- gchar *field_stringz; /* Temporary storage for each field we extract */
+ guchar *field_stringz; /* Temporary storage for each field we extract */
gint length;
guint offset = 0;
@@ -137,7 +137,7 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hash_info->first_packet_number = pinfo->fd->num;
hash_info->second_packet_number = 0;
hash_info->third_packet_number = 0;
- hash_info->forth_packet_number = 0;
+ hash_info->fourth_packet_number = 0;
hash_info->state = WAIT_FOR_STDERR_PORT; /* The first field we'll see */
@@ -151,7 +151,7 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hash_info->first_packet_state = NONE;
hash_info->second_packet_state = NONE;
hash_info->third_packet_state = NONE;
- hash_info->forth_packet_state = NONE;
+ hash_info->fourth_packet_state = NONE;
conversation_add_proto_data(conversation, proto_exec, hash_info);
}
@@ -169,10 +169,10 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* We're on the third packet of the conversation */
hash_info->third_packet_number = pinfo->fd->num;
} else if(hash_info->third_packet_number
- && !hash_info->forth_packet_number
+ && !hash_info->fourth_packet_number
&& pinfo->fd->num > hash_info->third_packet_number) {
- /* We're on the forth packet of the conversation */
- hash_info->forth_packet_number = pinfo->fd->num;
+ /* We're on the fourth packet of the conversation */
+ hash_info->fourth_packet_number = pinfo->fd->num;
}
/* Save this packet's state so we can retrieve it if this packet
@@ -202,11 +202,11 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
- if(pinfo->fd->num == hash_info->forth_packet_number){
- if(hash_info->forth_packet_state == NONE){
- hash_info->forth_packet_state = hash_info->state;
+ if(pinfo->fd->num == hash_info->fourth_packet_number){
+ if(hash_info->fourth_packet_state == NONE){
+ hash_info->fourth_packet_state = hash_info->state;
} else {
- hash_info->state = hash_info->forth_packet_state;
+ hash_info->state = hash_info->fourth_packet_state;
}
}
@@ -250,7 +250,7 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
*/
if(length == 1 || (exec_isdigit_string(field_stringz)
&& length <= EXEC_STDERR_PORT_LEN)){
- proto_tree_add_string(exec_tree, hf_exec_stderr_port, tvb, offset, length, field_stringz);
+ proto_tree_add_string(exec_tree, hf_exec_stderr_port, tvb, offset, length, (gchar*)field_stringz);
/* Next field we need */
hash_info->state = WAIT_FOR_USERNAME;
} else {
@@ -270,13 +270,13 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Check if this looks like the username field */
if(length != 1 && length <= EXEC_USERNAME_LEN
&& exec_isprint_string(field_stringz)){
- proto_tree_add_string(exec_tree, hf_exec_username, tvb, offset, length, field_stringz);
+ proto_tree_add_string(exec_tree, hf_exec_username, tvb, offset, length, (gchar*)field_stringz);
/* Store the username so we can display it in the
* info column of the entire conversation
*/
if(!hash_info->username){
- hash_info->username=se_strdup(field_stringz);
+ hash_info->username=se_strdup((gchar*)field_stringz);
}
/* Next field we need */
@@ -298,7 +298,7 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Check if this looks like the password field */
if(length != 1 && length <= EXEC_PASSWORD_LEN
&& exec_isprint_string(field_stringz)){
- proto_tree_add_string(exec_tree, hf_exec_password, tvb, offset, length, field_stringz);
+ proto_tree_add_string(exec_tree, hf_exec_password, tvb, offset, length, (gchar*)field_stringz);
/* Next field we need */
hash_info->state = WAIT_FOR_COMMAND;
@@ -321,13 +321,13 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Check if this looks like the command field */
if(length != 1 && length <= EXEC_COMMAND_LEN
&& exec_isprint_string(field_stringz)){
- proto_tree_add_string(exec_tree, hf_exec_command, tvb, offset, length, field_stringz);
+ proto_tree_add_string(exec_tree, hf_exec_command, tvb, offset, length, (gchar*)field_stringz);
/* Store the username so we can display it in the
* info column of the entire conversation
*/
if(!hash_info->command){
- hash_info->command=se_strdup(field_stringz);
+ hash_info->command=se_strdup((gchar*)field_stringz);
}
} else {
@@ -411,7 +411,6 @@ proto_register_exec(void)
prefs_register_bool_preference(exec_module, "info_show_command",
"Show command in info column?",
"Controls the display of the command being run on the server by this session in the info column. This is only displayed if the packet containing it was seen during this capture session.", &preference_info_show_command);
-
}
@@ -426,8 +425,8 @@ proto_reg_handoff_exec(void)
}
/* Custom function to check if an entire string is printable. */
-gboolean
-exec_isprint_string(gchar *string)
+static gboolean
+exec_isprint_string(guchar *string)
{
guint position;
@@ -444,8 +443,8 @@ exec_isprint_string(gchar *string)
}
/* Custom function to check if an entire string is digits. */
-gboolean
-exec_isdigit_string(gchar *string)
+static gboolean
+exec_isdigit_string(guchar *string)
{
guint position;
diff --git a/epan/dissectors/packet-sip.c b/epan/dissectors/packet-sip.c
index d17254325d..fe7042d9b5 100644
--- a/epan/dissectors/packet-sip.c
+++ b/epan/dissectors/packet-sip.c
@@ -1151,7 +1151,7 @@ static void dissect_sip_via_header(tvbuff_t *tvb, proto_tree *tree, gint start_o
guint transport_slash_count = 0;
gboolean transport_name_started = FALSE;
gboolean colon_seen = FALSE;
- gchar c;
+ guchar c;
gchar *param_name = NULL;
/* skip Spaces and Tabs */
diff --git a/epan/dissectors/packet-slimp3.c b/epan/dissectors/packet-slimp3.c
index 13170c828a..2e11762052 100644
--- a/epan/dissectors/packet-slimp3.c
+++ b/epan/dissectors/packet-slimp3.c
@@ -231,7 +231,7 @@ dissect_slimp3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gint i1;
gint offset = 0;
guint16 opcode;
- char lcd_char;
+ guchar lcd_char;
char lcd_str[MAX_LCD_STR_LEN + 1];
int to_server = FALSE;
int old_protocol = FALSE;