Skip to content

Commit 67f9591

Browse files
author
Manikandan Somasundaram
committed
Parse resume tokens
1 parent d5fc455 commit 67f9591

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

packet-rsocket.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ static int hf_rsocket_data_mime_type = -1;
5050
static int hf_rsocket_req_n = -1;
5151
static int hf_rsocket_error_code = -1;
5252
static int hf_rsocket_keepalive_last_rcvd_pos = -1;
53+
static int hf_rsocket_resume_token_len = -1;
54+
static int hf_rsocket_resume_token = -1;
5355

5456
// other flags
5557
static int hf_rsocket_ignore_flag = -1;
@@ -106,7 +108,7 @@ static const gchar *getFrameTypeName(const guint64 frame_type) {
106108
static gint read_rsocket_setup_frame(proto_tree *tree, tvbuff_t *tvb,
107109
gint offset) {
108110

109-
guint8 resume_flag = tvb_get_bits8(tvb, (offset + 1) * 8, 0);
111+
gint8 resume_flag = tvb_get_bits8(tvb, (offset + 1) * 8, 1);
110112
proto_tree_add_item(tree, hf_rsocket_resume_flag, tvb, offset, 2,
111113
ENC_BIG_ENDIAN);
112114
proto_tree_add_item(tree, hf_rsocket_lease_flag, tvb, offset, 2,
@@ -130,7 +132,13 @@ static gint read_rsocket_setup_frame(proto_tree *tree, tvbuff_t *tvb,
130132
offset += 4;
131133

132134
if (resume_flag) {
133-
// parse tokens
135+
guint resume_token_len;
136+
proto_tree_add_item_ret_uint(tree, hf_rsocket_resume_token_len, tvb, offset,
137+
2, ENC_BIG_ENDIAN, &resume_token_len);
138+
offset += 2;
139+
proto_tree_add_item(tree, hf_rsocket_resume_token, tvb, offset,
140+
resume_token_len, ENC_STRING);
141+
offset += resume_token_len;
134142
}
135143

136144
guint mdata_mime_length;
@@ -429,6 +437,12 @@ void proto_register_rsocket(void) {
429437
{"Keepalive Last Received Position",
430438
"rsocket.keepalive_last_received_position", FT_UINT64, BASE_DEC, NULL,
431439
0x0, NULL, HFILL}},
440+
{&hf_rsocket_resume_token_len,
441+
{"Resume Token Length", "rsocket.resume.token.len", FT_UINT16, BASE_DEC,
442+
NULL, 0x0, NULL, HFILL}},
443+
{&hf_rsocket_resume_token,
444+
{"Resume Token", "rsocket.resume.token", FT_STRING, STR_ASCII, NULL, 0x0,
445+
NULL, HFILL}},
432446
};
433447

434448
static gint *ett[] = {&ett_rsocket, &ett_rframe};

0 commit comments

Comments
 (0)