diff options
Diffstat (limited to 'epan/dissectors/packet-rlogin.c')
-rw-r--r-- | epan/dissectors/packet-rlogin.c | 75 |
1 files changed, 39 insertions, 36 deletions
diff --git a/epan/dissectors/packet-rlogin.c b/epan/dissectors/packet-rlogin.c index 4da21ca516..881b7c7f13 100644 --- a/epan/dissectors/packet-rlogin.c +++ b/epan/dissectors/packet-rlogin.c @@ -24,34 +24,36 @@ void proto_register_rlogin(void); void proto_reg_handoff_rlogin(void); -static int proto_rlogin = -1; - -static int ett_rlogin = -1; -static int ett_rlogin_window = -1; -static int ett_rlogin_user_info = -1; -static int ett_rlogin_window_rows = -1; -static int ett_rlogin_window_cols = -1; -static int ett_rlogin_window_x_pixels = -1; -static int ett_rlogin_window_y_pixels = -1; - -static int hf_user_info = -1; -static int hf_client_startup_flag = -1; -static int hf_startup_info_received_flag = -1; -static int hf_user_info_client_user_name = -1; -static int hf_user_info_server_user_name = -1; -static int hf_user_info_terminal_type = -1; -static int hf_user_info_terminal_speed = -1; -static int hf_control_message = -1; -static int hf_magic_cookie = -1; -static int hf_window_info = -1; -static int hf_window_info_ss = -1; -static int hf_window_info_rows = -1; -static int hf_window_info_cols = -1; -static int hf_window_info_x_pixels = -1; -static int hf_window_info_y_pixels = -1; -static int hf_data = -1; - -static expert_field ei_rlogin_termlen_invalid = EI_INIT; +static dissector_handle_t rlogin_handle; + +static int proto_rlogin; + +static int ett_rlogin; +static int ett_rlogin_window; +static int ett_rlogin_user_info; +static int ett_rlogin_window_rows; +static int ett_rlogin_window_cols; +static int ett_rlogin_window_x_pixels; +static int ett_rlogin_window_y_pixels; + +static int hf_user_info; +static int hf_client_startup_flag; +static int hf_startup_info_received_flag; +static int hf_user_info_client_user_name; +static int hf_user_info_server_user_name; +static int hf_user_info_terminal_type; +static int hf_user_info_terminal_speed; +static int hf_control_message; +static int hf_magic_cookie; +static int hf_window_info; +static int hf_window_info_ss; +static int hf_window_info_rows; +static int hf_window_info_cols; +static int hf_window_info_x_pixels; +static int hf_window_info_y_pixels; +static int hf_data; + +static expert_field ei_rlogin_termlen_invalid; static const value_string control_message_vals[] = { @@ -206,7 +208,7 @@ static void rlogin_display(rlogin_hash_entry_t *hash_info, /* Check for text data in front */ if (urgent_offset > offset) { - proto_tree_add_item(rlogin_tree, hf_data, tvb, offset, urgent_offset, ENC_ASCII|ENC_NA); + proto_tree_add_item(rlogin_tree, hf_data, tvb, offset, urgent_offset, ENC_ASCII); } /* Show control byte */ @@ -263,13 +265,13 @@ static void rlogin_display(rlogin_hash_entry_t *hash_info, /* Client user name. */ str_len = tvb_strsize(tvb, offset); proto_tree_add_item(user_info_tree, hf_user_info_client_user_name, - tvb, offset, str_len, ENC_ASCII|ENC_NA); + tvb, offset, str_len, ENC_ASCII); offset += str_len; /* Server user name. */ str_len = tvb_strsize(tvb, offset); proto_tree_add_item(user_info_tree, hf_user_info_server_user_name, - tvb, offset, str_len, ENC_ASCII|ENC_NA); + tvb, offset, str_len, ENC_ASCII); offset += str_len; /* Terminal type/speed. */ @@ -283,7 +285,7 @@ static void rlogin_display(rlogin_hash_entry_t *hash_info, /* Terminal type */ proto_tree_add_item(user_info_tree, hf_user_info_terminal_type, - tvb, offset, slash_offset-offset, ENC_ASCII|ENC_NA); + tvb, offset, slash_offset-offset, ENC_ASCII); offset = slash_offset + 1; /* Terminal speed */ @@ -323,7 +325,7 @@ static void rlogin_display(rlogin_hash_entry_t *hash_info, { /* There's data before the terminal info. */ proto_tree_add_item(rlogin_tree, hf_data, tvb, - offset, ti_offset - offset, ENC_ASCII|ENC_NA); + offset, ti_offset - offset, ENC_ASCII); } /* Create window info tree */ @@ -336,7 +338,7 @@ static void rlogin_display(rlogin_hash_entry_t *hash_info, offset += 2; /* These bytes should be "ss" */ - proto_tree_add_item(window_tree, hf_window_info_ss, tvb, offset, 2, ENC_ASCII|ENC_NA); + proto_tree_add_item(window_tree, hf_window_info_ss, tvb, offset, 2, ENC_ASCII); offset += 2; /* Character rows */ @@ -369,7 +371,7 @@ static void rlogin_display(rlogin_hash_entry_t *hash_info, if (tvb_offset_exists(tvb, offset)) { /* There's more data in the frame. */ - proto_tree_add_item(rlogin_tree, hf_data, tvb, offset, -1, ENC_ASCII|ENC_NA); + proto_tree_add_item(rlogin_tree, hf_data, tvb, offset, -1, ENC_ASCII); } } @@ -585,12 +587,13 @@ void proto_register_rlogin(void) expert_rlogin = expert_register_protocol(proto_rlogin); expert_register_field_array(expert_rlogin, ei, array_length(ei)); + + rlogin_handle = register_dissector("rlogin", dissect_rlogin,proto_rlogin); } void proto_reg_handoff_rlogin(void) { /* Dissector install routine */ - dissector_handle_t rlogin_handle = create_dissector_handle(dissect_rlogin,proto_rlogin); dissector_add_uint_with_preference("tcp.port", RLOGIN_PORT, rlogin_handle); } |