summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-exec.c')
-rw-r--r--epan/dissectors/packet-exec.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/epan/dissectors/packet-exec.c b/epan/dissectors/packet-exec.c
index 4f066191..a901fda3 100644
--- a/epan/dissectors/packet-exec.c
+++ b/epan/dissectors/packet-exec.c
@@ -22,24 +22,24 @@
#define EXEC_PORT 512
/* Variables for our preferences */
-static gboolean preference_info_show_username = TRUE;
-static gboolean preference_info_show_command = FALSE;
+static bool preference_info_show_username = true;
+static bool preference_info_show_command;
void proto_register_exec(void);
void proto_reg_handoff_exec(void);
/* Initialize the protocol and registered fields */
-static int proto_exec = -1;
+static int proto_exec;
-static int hf_exec_stderr_port = -1;
-static int hf_exec_username = -1;
-static int hf_exec_password = -1;
-static int hf_exec_command = -1;
-static int hf_exec_client_server_data = -1;
-static int hf_exec_server_client_data = -1;
+static int hf_exec_stderr_port;
+static int hf_exec_username;
+static int hf_exec_password;
+static int hf_exec_command;
+static int hf_exec_client_server_data;
+static int hf_exec_server_client_data;
/* Initialize the subtree pointers */
-static gint ett_exec = -1;
+static int ett_exec;
#define EXEC_STDERR_PORT_LEN 5
#define EXEC_USERNAME_LEN 16
@@ -62,8 +62,8 @@ typedef enum {
typedef struct {
/* Packet number within the conversation */
- guint first_packet_number, second_packet_number;
- guint third_packet_number, fourth_packet_number;
+ unsigned first_packet_number, second_packet_number;
+ unsigned 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
@@ -77,8 +77,8 @@ typedef struct {
exec_session_state_t first_packet_state, second_packet_state;
exec_session_state_t third_packet_state, fourth_packet_state;
- gchar *username;
- gchar *command;
+ char *username;
+ char *command;
} exec_hash_entry_t;
@@ -90,10 +90,10 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
proto_tree *exec_tree=NULL;
/* Variables for extracting and displaying data from the packet */
- guchar *field_stringz; /* Temporary storage for each field we extract */
+ unsigned char *field_stringz; /* Temporary storage for each field we extract */
- gint length;
- guint offset = 0;
+ int length;
+ unsigned offset = 0;
conversation_t *conversation;
exec_hash_entry_t *hash_info;
@@ -188,12 +188,12 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
col_clear(pinfo->cinfo, COL_INFO);
/*username */
- if(hash_info->username && preference_info_show_username == TRUE){
+ if(hash_info->username && preference_info_show_username == true){
col_append_fstr(pinfo->cinfo, COL_INFO, "Username:%s ", hash_info->username);
}
/* Command */
- if(hash_info->command && preference_info_show_command == TRUE){
+ if(hash_info->command && preference_info_show_command == true){
col_append_fstr(pinfo->cinfo, COL_INFO, "Command:%s ", hash_info->command);
}
@@ -205,7 +205,7 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
* then it must be session data only and we can skip looking
* for the other fields.
*/
- if(tvb_find_guint8(tvb, tvb_captured_length(tvb)-1, 1, '\0') == -1){
+ if(tvb_find_uint8(tvb, tvb_captured_length(tvb)-1, 1, '\0') == -1){
hash_info->state = WAIT_FOR_DATA;
}
@@ -219,7 +219,7 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
*/
if(length == 1 || (isdigit_string(field_stringz)
&& length <= EXEC_STDERR_PORT_LEN)){
- proto_tree_add_string(exec_tree, hf_exec_stderr_port, tvb, offset, length, (gchar*)field_stringz);
+ proto_tree_add_string(exec_tree, hf_exec_stderr_port, tvb, offset, length, (char*)field_stringz);
/* Next field we need */
hash_info->state = WAIT_FOR_USERNAME;
} else {
@@ -239,13 +239,13 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
/* Check if this looks like the username field */
if(length != 1 && length <= EXEC_USERNAME_LEN
&& isprint_string(field_stringz)){
- proto_tree_add_string(exec_tree, hf_exec_username, tvb, offset, length, (gchar*)field_stringz);
+ proto_tree_add_string(exec_tree, hf_exec_username, tvb, offset, length, (char*)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=wmem_strdup(wmem_file_scope(), (gchar*)field_stringz);
+ hash_info->username=wmem_strdup(wmem_file_scope(), (char*)field_stringz);
}
/* Next field we need */
@@ -267,7 +267,7 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
/* Check if this looks like the password field */
if(length != 1 && length <= EXEC_PASSWORD_LEN
&& isprint_string(field_stringz)){
- proto_tree_add_string(exec_tree, hf_exec_password, tvb, offset, length, (gchar*)field_stringz);
+ proto_tree_add_string(exec_tree, hf_exec_password, tvb, offset, length, (char*)field_stringz);
}
/* Used if the next field is in the same packet */
@@ -284,13 +284,13 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
/* Check if this looks like the command field */
if(length != 1 && length <= EXEC_COMMAND_LEN
&& isprint_string(field_stringz)){
- proto_tree_add_string(exec_tree, hf_exec_command, tvb, offset, length, (gchar*)field_stringz);
+ proto_tree_add_string(exec_tree, hf_exec_command, tvb, offset, length, (char*)field_stringz);
/* Store the command so we can display it in the
* info column of the entire conversation
*/
if(!hash_info->command){
- hash_info->command=wmem_strdup(wmem_file_scope(), (gchar*)field_stringz);
+ hash_info->command=wmem_strdup(wmem_file_scope(), (char*)field_stringz);
}
} else {
@@ -355,7 +355,7 @@ proto_register_exec(void)
};
- static gint *ett[] =
+ static int *ett[] =
{
&ett_exec
};