diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:53 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:53 +0000 |
commit | a86c5f7cae7ec9a3398300555a0b644689d946a1 (patch) | |
tree | 39fe4b107c71174fd1e8a8ceb9a4d2aa14116248 /epan/dissectors/packet-rsh.c | |
parent | Releasing progress-linux version 4.2.6-1~progress7.99u1. (diff) | |
download | wireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.tar.xz wireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.zip |
Merging upstream version 4.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/dissectors/packet-rsh.c')
-rw-r--r-- | epan/dissectors/packet-rsh.c | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/epan/dissectors/packet-rsh.c b/epan/dissectors/packet-rsh.c index 360e65b7..385e3876 100644 --- a/epan/dissectors/packet-rsh.c +++ b/epan/dissectors/packet-rsh.c @@ -30,22 +30,22 @@ void proto_reg_handoff_rsh(void); static dissector_handle_t rsh_handle; /* Variables for our preferences */ -static gboolean preference_info_show_client_username = FALSE; -static gboolean preference_info_show_server_username = TRUE; -static gboolean preference_info_show_command = FALSE; +static bool preference_info_show_client_username; +static bool preference_info_show_server_username = true; +static bool preference_info_show_command; /* Initialize the protocol and registered fields */ -static int proto_rsh = -1; +static int proto_rsh; -static int hf_rsh_stderr_port = -1; -static int hf_rsh_client_username = -1; -static int hf_rsh_server_username = -1; -static int hf_rsh_command = -1; -static int hf_rsh_client_server_data = -1; -static int hf_rsh_server_client_data = -1; +static int hf_rsh_stderr_port; +static int hf_rsh_client_username; +static int hf_rsh_server_username; +static int hf_rsh_command; +static int hf_rsh_client_server_data; +static int hf_rsh_server_client_data; /* Initialize the subtree pointers */ -static gint ett_rsh = -1; +static int ett_rsh; #define RSH_STDERR_PORT_LEN 5 #define RSH_CLIENT_USERNAME_LEN 16 @@ -68,8 +68,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 @@ -83,9 +83,9 @@ typedef struct { rsh_session_state_t first_packet_state, second_packet_state; rsh_session_state_t third_packet_state, fourth_packet_state; - gchar *client_username; - gchar *server_username; - gchar *command; + char *client_username; + char *server_username; + char *command; } rsh_hash_entry_t; @@ -97,10 +97,10 @@ dissect_rsh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) proto_tree *rsh_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; rsh_hash_entry_t *hash_info; @@ -196,17 +196,17 @@ dissect_rsh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) col_clear(pinfo->cinfo, COL_INFO); /* Client username */ - if(hash_info->client_username && preference_info_show_client_username == TRUE){ + if(hash_info->client_username && preference_info_show_client_username == true){ col_append_fstr(pinfo->cinfo, COL_INFO, "Client username:%s ", hash_info->client_username); } /* Server username */ - if(hash_info->server_username && preference_info_show_server_username == TRUE){ + if(hash_info->server_username && preference_info_show_server_username == true){ col_append_fstr(pinfo->cinfo, COL_INFO, "Server username:%s ", hash_info->server_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); } @@ -218,7 +218,7 @@ dissect_rsh(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; } @@ -232,7 +232,7 @@ dissect_rsh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) */ if(length == 1 || (isdigit_string(field_stringz) && length <= RSH_STDERR_PORT_LEN)){ - proto_tree_add_string(rsh_tree, hf_rsh_stderr_port, tvb, offset, length, (gchar*)field_stringz); + proto_tree_add_string(rsh_tree, hf_rsh_stderr_port, tvb, offset, length, (char*)field_stringz); /* Next field we need */ hash_info->state = WAIT_FOR_CLIENT_USERNAME; } else { @@ -252,13 +252,13 @@ dissect_rsh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) /* Check if this looks like the username field */ if(length != 1 && length <= RSH_CLIENT_USERNAME_LEN && isprint_string(field_stringz)){ - proto_tree_add_string(rsh_tree, hf_rsh_client_username, tvb, offset, length, (gchar*)field_stringz); + proto_tree_add_string(rsh_tree, hf_rsh_client_username, tvb, offset, length, (char*)field_stringz); /* Store the client username so we can display it in the * info column of the entire conversation */ if(!hash_info->client_username){ - hash_info->client_username=wmem_strdup(wmem_file_scope(), (gchar*)field_stringz); + hash_info->client_username=wmem_strdup(wmem_file_scope(), (char*)field_stringz); } /* Next field we need */ @@ -280,13 +280,13 @@ dissect_rsh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) /* Check if this looks like the password field */ if(length != 1 && length <= RSH_SERVER_USERNAME_LEN && isprint_string(field_stringz)){ - proto_tree_add_string(rsh_tree, hf_rsh_server_username, tvb, offset, length, (gchar*)field_stringz); + proto_tree_add_string(rsh_tree, hf_rsh_server_username, tvb, offset, length, (char*)field_stringz); /* Store the server username so we can display it in the * info column of the entire conversation */ if(!hash_info->server_username){ - hash_info->server_username=wmem_strdup(wmem_file_scope(), (gchar*)field_stringz); + hash_info->server_username=wmem_strdup(wmem_file_scope(), (char*)field_stringz); } } @@ -305,13 +305,13 @@ dissect_rsh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) /* Check if this looks like the command field */ if(length != 1 && length <= RSH_COMMAND_LEN && isprint_string(field_stringz)){ - proto_tree_add_string(rsh_tree, hf_rsh_command, tvb, offset, length, (gchar*)field_stringz); + proto_tree_add_string(rsh_tree, hf_rsh_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 { @@ -375,7 +375,7 @@ proto_register_rsh(void) }; - static gint *ett[] = + static int *ett[] = { &ett_rsh }; |