Coverage Report

Created: 2026-09-28 06:52

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-lbmsrs.c
Line
Count
Source
1
/* packet-lbmsrs.c
2
* Routines for SRS Packet dissection
3
*
4
* Copyright (c) 2005-2014 Informatica Corporation. All Rights Reserved.
5
*
6
* Wireshark - Network traffic analyzer
7
* By Gerald Combs <gerald@wireshark.org>
8
* Copyright 1998 Gerald Combs
9
*
10
* SPDX-License-Identifier: GPL-2.0-or-later
11
*
12
* Special thanks to the team at https://github.com/rsocket/rsocket-wireshark
13
* for getting us started on the right path for this Ultra Messaging rsocket dissector.
14
* Rsocket Protocol Description: https://rsocket.io/about/protocol
15
*/
16
17
#include "config.h"
18
#include <epan/packet.h>
19
#include <epan/expert.h>
20
#include <epan/to_str.h>
21
#include "packet-lbm.h"
22
#include <epan/proto.h>
23
#include <epan/prefs.h>
24
#include <epan/uat.h>
25
#include <wsutil/pint.h>
26
#include "packet-tcp.h"
27
28
29
30
static int proto_lbmsrs;
31
32
void proto_register_lbmsrs(void);
33
void proto_reg_handoff_lbmsrs(void);
34
35
/****************************************LBMSRS Packet definitions**************************************************/
36
/* These definitions are from srs_protocol.h in the Ultra Messaging build node. That header is generated from the  */
37
/* SRS protocol XML definitions.                                                                                   */
38
/*******************************************************************************************************************/
39
40
16
#define LBM_SRS_INTEREST_MODE_SYMBOL_ADVERTISE_FILTER_BIT 0x01
41
16
#define LBM_SRS_INTEREST_MODE_SYMBOL_INTEREST_FORWARD_BIT 0x02
42
16
#define LBM_SRS_INTEREST_MODE_CONTEXT_NAME_FILTER_BIT 0x04
43
#define LBM_SRS_APP_TYPE_APPLICATION 0
44
#define LBM_SRS_APP_TYPE_TNWGD 1
45
#define LBM_SRS_APP_TYPE_STORE 2
46
#define LBM_SRS_CONTEXT_INSTANCE_BLOCK_SIZE 8
47
#define LBM_SRS_OTID_BLOCK_SIZE 32
48
49
73
#define L_LBM_SRS_MESSAGE_ID 2
50
51
/* LBMSRS Registration Request
52
typedef struct lbm_srs_registration_request_info_t_stct {
53
    lbm_uint8_t app_type;
54
    lbm_uint32_t client_addr;
55
    lbm_uint16_t client_port;
56
    lbm_uint32_t session_id;
57
    lbm_uint32_t host_id;
58
    lbm_uint8_t protocol_version;
59
    lbm_uint8_t interest_mode;
60
    lbm_uint32_t local_domain_id;
61
} lbm_srs_registration_request_info_t;
62
*/
63
0
#define L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_APP_TYPE 1
64
0
#define L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_CLIENT_ADDR 4
65
0
#define L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_CLIENT_PORT 2
66
0
#define L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_SESSION_ID 4
67
0
#define L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_HOST_ID 4
68
0
#define L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_PROTOCOL_VERSION 1
69
48
#define L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_INTEREST_MODE 1
70
0
#define L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_LOCAL_DOMAIN_ID 4
71
0
#define L_LBM_SRS_REGISTRATION_REQUEST_INFO_T 21 /*padding is giving length as 24 above*/
72
73
74
#define LBM_SRS_BEHAVIOR_BIT_FLOOD_TOPIC_ADVERTS    0x80
75
#define LBM_SRS_BEHAVIOR_BIT_FLOOD_TOPIC_INTEREST   0x40
76
#define LBM_SRS_BEHAVIOR_BIT_FLOOD_CTX_NAME_ADVERTS 0x20
77
78
#define LBM_SRS_INTEREST_MODE_FLOOD 0
79
#define LBM_SRS_INTEREST_MODE_FILTER 1
80
#define LBM_SRS_INTEREST_MODE_FLOOD_FORWARD_INTEREST 2
81
#define LBM_SRS_INTEREST_MODE_FILTER_FORWARD_INTEREST 3
82
#define LBM_SRS_APP_TYPE_APPLICATION 0
83
#define LBM_SRS_APP_TYPE_TNWGD 1
84
#define LBM_SRS_APP_TYPE_STORE 2
85
86
#define LBM_SRS_CTX_TYPE_APPLICATION 0
87
#define LBM_SRS_CTX_TYPE_TNWGD 1
88
#define LBM_SRS_CTX_TYPE_STORE 2
89
90
/* LBMSRS Registration Response
91
typedef struct lbm_srs_registration_response_info_t_stct {
92
    lbm_uint64_t client_id;
93
    lbm_uint32_t local_domain_id;
94
    lbm_uint8_t protocol_version;
95
} lbm_srs_registration_response_info_t;
96
*/
97
0
#define L_LBM_SRS_REGISTRATION_RESPONSE_INFO_T_CLIENT_ID 8
98
0
#define L_LBM_SRS_REGISTRATION_RESPONSE_INFO_T_LOCAL_DOMAIN_ID 4
99
0
#define L_LBM_SRS_REGISTRATION_RESPONSE_INFO_T_PROTOCOL_VERSION 1
100
0
#define L_LBM_SRS_REGISTRATION_RESPONSE_INFO_T 13
101
102
103
/* LBMSRS Stream Request
104
typedef struct lbm_srs_stream_request_info_t_stct {
105
    lbm_uint8_t unused;
106
} lbm_srs_stream_request_info_t;
107
*/
108
0
#define L_LBM_SRS_STREAM_REQUEST_INFO_T_UNUSED 1
109
0
#define L_LBM_SRS_STREAM_REQUEST_INFO_T 1
110
111
/* LBMSRS Source Info
112
typedef struct lbm_srs_src_info_info_t_stct {
113
    char * otid;
114
    lbm_uint8_t topic_len;
115
    char * topic;
116
    lbm_uint8_t source_len;
117
    char * source;
118
    lbm_uint32_t host_id;
119
    lbm_uint32_t topic_idx;
120
    lbm_uint32_t functionality_flags;
121
    lbm_uint32_t request_ip;
122
    lbm_uint16_t request_port;
123
    lbm_uint32_t domain_id;
124
    lbm_uint8_t encryption;
125
    lbm_uint8_t compression;
126
    lbm_uint32_t ulb_src_id;
127
    lbm_uint32_t ulb_queue_id;
128
    lbm_uint64_t ulb_reg_id;
129
    char* context_instance;
130
    lbm_uint8_t context_type;
131
    lbm_uint32_t version;
132
    lbm_uint32_t version_flags;
133
    lbm_uint16_t ttl;
134
    lbm_uint32_t cost;
135
} lbm_srs_src_info_info_t;
136
*/
137
25
#define L_LBM_SRS_SRC_INFO_INFO_T_OTID 32 //fixed length
138
22
#define L_LBM_SRS_SRC_INFO_INFO_T_TOPIC_LEN 1
139
18
#define L_LBM_SRS_SRC_INFO_INFO_T_SOURCE_LEN 1
140
15
#define L_LBM_SRS_SRC_INFO_INFO_T_HOST_ID 4
141
15
#define L_LBM_SRS_SRC_INFO_INFO_T_TOPIC_IDX 4
142
15
#define L_LBM_SRS_SRC_INFO_INFO_T_FUNCTIONALITY_FLAGS 4
143
15
#define L_LBM_SRS_SRC_INFO_INFO_T_REQUEST_IP 4
144
15
#define L_LBM_SRS_SRC_INFO_INFO_T_REQUEST_PORT 2
145
15
#define L_LBM_SRS_SRC_INFO_INFO_T_DOMAIN_ID 4
146
15
#define L_LBM_SRS_SRC_INFO_INFO_T_ENCRYPTION 1
147
15
#define L_LBM_SRS_SRC_INFO_INFO_T_COMPRESSION 1
148
15
#define L_LBM_SRS_SRC_INFO_INFO_T_ULB_SRC_ID 4
149
15
#define L_LBM_SRS_SRC_INFO_INFO_T_ULB_QUEUE_ID 4
150
15
#define L_LBM_SRS_SRC_INFO_INFO_T_ULB_REG_ID 8
151
15
#define L_LBM_SRS_SRC_INFO_INFO_T_CONTEXT_INSTANCE 8
152
15
#define L_LBM_SRS_SRC_INFO_INFO_T_CONTEXT_TYPE 1
153
13
#define L_LBM_SRS_SRC_INFO_INFO_T_VERSION 4
154
12
#define L_LBM_SRS_SRC_INFO_INFO_T_VERSION_FLAGS 4
155
12
#define L_LBM_SRS_SRC_INFO_INFO_T_TTL 2
156
10
#define L_LBM_SRS_SRC_INFO_INFO_T_COST 4
157
158
159
/* LBMSRS Source Delete Info
160
typedef struct lbm_srs_src_delete_info_t_stct {
161
    char * otid;
162
    lbm_uint8_t topic_len;
163
    char * topic;
164
} lbm_srs_src_delete_info_t;
165
*/
166
0
#define L_LBM_SRS_SRC_DELETE_INFO_T_OTID 32
167
0
#define L_LBM_SRS_SRC_DELETE_INFO_T_TOPIC_LEN 1
168
169
170
/* LBMSRS Receiver Info
171
typedef struct lbm_srs_rcv_info_info_t_stct {
172
    lbm_uint8_t topic_len;
173
    char * topic;
174
    lbm_uint32_t domain_id;
175
    char* context_instance;
176
    lbm_uint8_t context_type;
177
    lbm_uint32_t version;
178
    lbm_uint32_t version_flags;
179
    lbm_uint32_t reserved;
180
} lbm_srs_rcv_info_info_t;
181
*/
182
8
#define L_LBM_SRS_RCV_INFO_INFO_T_TOPIC_LEN 1
183
3
#define L_LBM_SRS_RCV_INFO_INFO_T_DOMAIN_ID 4
184
3
#define L_LBM_SRS_RCV_INFO_INFO_T_CONTEXT_INSTANCE 8
185
3
#define L_LBM_SRS_RCV_INFO_INFO_T_CONTEXT_TYPE 1
186
3
#define L_LBM_SRS_RCV_INFO_INFO_T_VERSION 4
187
3
#define L_LBM_SRS_RCV_INFO_INFO_T_VERSION_FLAGS 4
188
3
#define L_LBM_SRS_RCV_INFO_INFO_T_RESERVED 4
189
190
191
/* LBMSRS Receiver Delete Info
192
typedef struct lbm_srs_rcv_delete_info_t_stct {
193
    lbm_uint8_t topic_len;
194
    char * topic;
195
    lbm_uint32_t domain_id;
196
    char* context_instance;
197
    lbm_uint8_t context_type;
198
    lbm_uint32_t version;
199
    lbm_uint32_t version_flags;
200
    lbm_uint32_t reserved;
201
} lbm_srs_rcv_delete_info_t;
202
*/
203
0
#define L_LBM_SRS_RCV_DELETE_INFO_T_TOPIC_LEN 1
204
0
#define L_LBM_SRS_RCV_DELETE_INFO_T_DOMAIN_ID 4
205
0
#define L_LBM_SRS_RCV_DELETE_INFO_T_CONTEXT_INSTANCE 8
206
0
#define L_LBM_SRS_RCV_DELETE_INFO_T_CONTEXT_TYPE 1
207
0
#define L_LBM_SRS_RCV_DELETE_INFO_T_VERSION 4
208
0
#define L_LBM_SRS_RCV_DELETE_INFO_T_VERSION_FLAGS 4
209
0
#define L_LBM_SRS_RCV_DELETE_INFO_T_RESERVED 4
210
211
/* LBMSRS Receiver End info
212
typedef struct lbm_srs_rcv_end_info_t_stct {
213
    lbm_uint8_t topic_len;
214
    char * topic;
215
    lbm_uint32_t domain_id;
216
    char* context_iinstance;
217
    lbm_uint8_t context_type;
218
    lbm_uint32_t version;
219
    lbm_uint32_t version_flags;
220
    lbm_uint32_t reserved;
221
} lbm_srs_rcv_end_info_t;
222
*/
223
8
#define L_LBM_SRS_RCV_END_INFO_T_TOPIC_LEN 1
224
3
#define L_LBM_SRS_RCV_END_INFO_T_DOMAIN_ID 4
225
1
#define L_LBM_SRS_RCV_END_INFO_T_CONTEXT_INSTANCE 8
226
0
#define L_LBM_SRS_RCV_END_INFO_T_CONTEXT_TYPE 1
227
0
#define L_LBM_SRS_RCV_END_INFO_T_VERSION 4
228
0
#define L_LBM_SRS_RCV_END_INFO_T_VERSION_FLAGS 4
229
0
#define L_LBM_SRS_RCV_END_INFO_T_RESERVED 4
230
231
232
/* LBMSRS Wildcard Receiver Info
233
typedef struct lbm_srs_wrcv_info_info_t_stct {
234
    lbm_uint8_t pattern_len;
235
    char * pattern;
236
    lbm_uint32_t domain_id;
237
    char* context_instance;
238
    lbm_uint8_t context_type;
239
    lbm_uint32_t version;
240
    lbm_uint32_t version_flags;
241
    lbm_uint32_t reserved;
242
} lbm_srs_wrcv_info_info_t;
243
*/
244
0
#define L_LBM_SRS_WRCV_INFO_INFO_T_PATTERN_LEN 1
245
0
#define L_LBM_SRS_WRCV_INFO_INFO_T_DOMAIN_ID 4
246
0
#define L_LBM_SRS_WRCV_INFO_INFO_T_CONTEXT_INSTANCE 8
247
0
#define L_LBM_SRS_WRCV_INFO_INFO_T_CONTEXT_TYPE 1
248
0
#define L_LBM_SRS_WRCV_INFO_INFO_T_VERSION 4
249
0
#define L_LBM_SRS_WRCV_INFO_INFO_T_VERSION_FLAGS 4
250
0
#define L_LBM_SRS_WRCV_INFO_INFO_T_RESERVED 4
251
252
253
/* LBMSRS Wildcard Receive Delete Info
254
typedef struct lbm_srs_wrcv_delete_info_t_stct {
255
    lbm_uint8_t pattern_len;
256
    char * pattern;
257
    lbm_uint32_t domain_id;
258
    char* context_instance;
259
    lbm_uint8_t context_type;
260
    lbm_uint32_t version;
261
    lbm_uint32_t version_flags;
262
    lbm_uint32_t reserved;
263
} lbm_srs_wrcv_delete_info_t;
264
*/
265
4
#define L_LBM_SRS_WRCV_DELETE_INFO_T_PATTERN_LEN 1
266
1
#define L_LBM_SRS_WRCV_DELETE_INFO_T_DOMAIN_ID 4
267
0
#define L_LBM_SRS_WRCV_DELETE_INFO_T_CONTEXT_INSTANCE 8
268
0
#define L_LBM_SRS_WRCV_DELETE_INFO_T_CONTEXT_TYPE 1
269
0
#define L_LBM_SRS_WRCV_DELETE_INFO_T_VERSION 4
270
0
#define L_LBM_SRS_WRCV_DELETE_INFO_T_VERSION_FLAGS 4
271
0
#define L_LBM_SRS_WRCV_DELETE_INFO_T_RESERVED 4
272
273
274
/* LBMSRS Wildcard Receive End Info
275
typedef struct lbm_srs_wrcv_end_info_t_stct {
276
    lbm_uint8_t pattern_len;
277
    char * pattern;
278
    lbm_uint32_t domain_id;
279
    char* context_instance;
280
    lbm_uint8_t context_type;
281
    lbm_uint32_t version;
282
    lbm_uint32_t version_flags;
283
    lbm_uint32_t reserved;
284
} lbm_srs_wrcv_end_info_t;
285
*/
286
0
#define L_LBM_SRS_WRCV_END_INFO_T_PATTERN_LEN 1
287
0
#define L_LBM_SRS_WRCV_END_INFO_T_DOMAIN_ID 4
288
0
#define L_LBM_SRS_WRCV_END_INFO_T_CONTEXT_INSTANCE 8
289
0
#define L_LBM_SRS_WRCV_END_INFO_T_CONTEXT_TYPE 1
290
0
#define L_LBM_SRS_WRCV_END_INFO_T_VERSION 4
291
0
#define L_LBM_SRS_WRCV_END_INFO_T_VERSION_FLAGS 4
292
0
#define L_LBM_SRS_WRCV_END_INFO_T_RESERVED 4
293
294
295
/* LBMSRS Source Leave Info
296
typedef struct lbm_srs_src_leave_info_t_stct {
297
    char * otid;
298
    lbm_uint8_t topic_len;
299
    char * topic;
300
    lbm_uint8_t source_len;
301
    char * source;
302
    char* context_instance;
303
    lbm_uint8_t context_type;
304
    lbm_uint32_t version;
305
    lbm_uint32_t version_flags;
306
    lbm_uint32_t reserved;
307
}lbm_srs_src_leave_info_t;
308
*/
309
37
#define L_LBM_SRS_SRC_LEAVE_INFO_T_OTID 32 //fixed length
310
34
#define L_LBM_SRS_SRC_LEAVE_INFO_T_TOPIC_LEN 1
311
28
#define L_LBM_SRS_SRC_LEAVE_INFO_T_SOURCE_LEN 1
312
22
#define L_LBM_SRS_SRC_LEAVE_INFO_T_CONTEXT_INSTANCE 8
313
19
#define L_LBM_SRS_SRC_LEAVE_INFO_T_CONTEXT_TYPE 1
314
16
#define L_LBM_SRS_SRC_LEAVE_INFO_T_VERSION 4
315
13
#define L_LBM_SRS_SRC_LEAVE_INFO_T_VERSION_FLAGS 4
316
10
#define L_LBM_SRS_SRC_LEAVE_INFO_T_RESERVED 4
317
318
/*UM 6.14 Changes*/
319
320
/*
321
typedef struct lbm_srs_route_info_info_t_stct {
322
    uint16_t num_domains;
323
    uint32_t *domains;
324
    uint32_t ip;
325
    uint16_t port;
326
    char * context_instance;
327
    uint8_t context_type;
328
    uint32_t version;
329
    uint32_t version_flags;
330
    uint16_t route_index;
331
    uint16_t reserved;
332
} lbm_srs_route_info_info_t;
333
*/
334
335
0
#define L_LBM_SRS_ROUTE_INFO_T_NUM_DOMAINS 2
336
0
#define L_LBM_SRS_ROUTE_INFO_T_IP 4
337
0
#define L_LBM_SRS_ROUTE_INFO_T_PORT 2
338
0
#define L_LBM_SRS_ROUTE_INFO_T_CONTEXT_INSTANCE 8
339
0
#define L_LBM_SRS_ROUTE_INFO_T_CONTEXT_TYPE 1
340
0
#define L_LBM_SRS_ROUTE_INFO_T_VERSION 4
341
0
#define L_LBM_SRS_ROUTE_INFO_T_VERSION_FLAGS 4
342
0
#define L_LBM_SRS_ROUTE_INFO_T_ROUTE_INDEX 2
343
0
#define L_LBM_SRS_ROUTE_INFO_T_RESERVED 2
344
345
/*
346
typedef struct lbm_srs_route_end_info_t_stct {
347
    uint16_t num_domains;
348
    uint32_t *domains;
349
    uint32_t ip;
350
    uint16_t port;
351
    char * context_instance;
352
    uint8_t context_type;
353
    uint32_t version;
354
    uint32_t version_flags;
355
    uint16_t route_index;
356
    uint16_t reserved;
357
} lbm_srs_route_end_info_t;
358
*/
359
360
3
#define L_LBM_SRS_ROUTE_END_T_NUM_DOMAINS 2
361
0
#define L_LBM_SRS_ROUTE_END_T_IP 4
362
0
#define L_LBM_SRS_ROUTE_END_T_PORT 2
363
0
#define L_LBM_SRS_ROUTE_END_T_CONTEXT_INSTANCE 8
364
0
#define L_LBM_SRS_ROUTE_END_T_CONTEXT_TYPE 1
365
0
#define L_LBM_SRS_ROUTE_END_T_VERSION 4
366
0
#define L_LBM_SRS_ROUTE_END_T_VERSION_FLAGS 4
367
0
#define L_LBM_SRS_ROUTE_END_T_ROUTE_INDEX 2
368
0
#define L_LBM_SRS_ROUTE_END_T_RESERVED 2
369
370
/*
371
typedef struct lbm_srs_domain_info_info_t_stct {
372
    uint32_t domain_id;
373
    char * context_instance;
374
    uint8_t context_type;
375
    uint32_t version;
376
    uint32_t version_flags;
377
    uint32_t reserved;
378
} lbm_srs_domain_info_info_t;
379
*/
380
381
0
#define L_LBM_SRS_DOMAIN_INFO_T_DOMAIN_ID 4
382
0
#define L_LBM_SRS_DOMAIN_INFO_T_CONTEXT_INSTANCE 8
383
0
#define L_LBM_SRS_DOMAIN_INFO_T_CONTEXT_TYPE 1
384
0
#define L_LBM_SRS_DOMAIN_INFO_T_VERSION 4
385
0
#define L_LBM_SRS_DOMAIN_INFO_T_VERSION_FLAGS 4
386
0
#define L_LBM_SRS_DOMAIN_INFO_T_RESERVED 4
387
388
/*
389
typedef struct lbm_srs_context_name_query_info_t_stct {
390
    uint8_t name_len;
391
    char * name;
392
    uint32_t domain_id;
393
    char * context_instance;
394
    uint8_t context_type;
395
    uint32_t version;
396
    uint32_t version_flags;
397
    uint32_t reserved;
398
} lbm_srs_context_name_query_info_t;
399
*/
400
0
#define L_LBM_SRS_CONTEXT_NAME_QUERY_T_NAME_LEN 1
401
0
#define L_LBM_SRS_CONTEXT_NAME_QUERY_T_DOMAIN_ID 4
402
0
#define L_LBM_SRS_CONTEXT_NAME_QUERY_T_CONTEXT_INSTANCE 8
403
0
#define L_LBM_SRS_CONTEXT_NAME_QUERY_T_CONTEXT_TYPE 1
404
0
#define L_LBM_SRS_CONTEXT_NAME_QUERY_T_VERSION 4
405
0
#define L_LBM_SRS_CONTEXT_NAME_QUERY_T_VERSION_FLAGS 4
406
0
#define L_LBM_SRS_CONTEXT_NAME_QUERY_T_RESERVED 4
407
408
/*
409
typedef struct lbm_srs_context_name_info_info_t_stct {
410
    uint8_t name_len;
411
    char * name;
412
    uint32_t domain_id;
413
    uint32_t ip;
414
    uint16_t port;
415
    char * origin_context_instance;
416
    char * context_instance;
417
    uint8_t context_type;
418
    uint32_t version;
419
    uint32_t version_flags;
420
    uint32_t reserved;
421
} lbm_srs_context_name_info_info_t;
422
*/
423
12
#define L_LBM_SRS_CONTEXT_NAME_INFO_T_NAME_LEN 1
424
15
#define L_LBM_SRS_CONTEXT_NAME_INFO_T_DOMAIN_ID 4
425
15
#define L_LBM_SRS_CONTEXT_NAME_INFO_T_IP 4
426
13
#define L_LBM_SRS_CONTEXT_NAME_INFO_T_PORT 2
427
10
#define L_LBM_SRS_CONTEXT_NAME_INFO_T_ORIGIN_CONTEXT_INSTANCE 8
428
9
#define L_LBM_SRS_CONTEXT_NAME_INFO_T_CONTEXT_INSTANCE 8
429
9
#define L_LBM_SRS_CONTEXT_NAME_INFO_T_CONTEXT_TYPE 1
430
9
#define L_LBM_SRS_CONTEXT_NAME_INFO_T_VERSION 4
431
7
#define L_LBM_SRS_CONTEXT_NAME_INFO_T_VERSION_FLAGS 4
432
4
#define L_LBM_SRS_CONTEXT_NAME_INFO_T_RESERVED 4
433
434
/*
435
typedef struct lbm_srs_context_name_end_info_t_stct {
436
    uint8_t name_len;
437
    char * name;
438
    uint32_t domain_id;
439
    uint32_t ip;
440
    uint16_t port;
441
    char * origin_context_instance;
442
    char * context_instance;
443
    uint8_t context_type;
444
    uint32_t version;
445
    uint32_t version_flags;
446
    uint32_t reserved;
447
} lbm_srs_context_name_end_info_t;
448
*/
449
0
#define L_LBM_SRS_CONTEXT_NAME_END_T_NAME_LEN 1
450
0
#define L_LBM_SRS_CONTEXT_NAME_END_T_DOMAIN_ID 4
451
0
#define L_LBM_SRS_CONTEXT_NAME_END_T_IP 4
452
0
#define L_LBM_SRS_CONTEXT_NAME_END_T_PORT 2
453
0
#define L_LBM_SRS_CONTEXT_NAME_END_T_ORIGIN_CONTEXT_INSTANCE 8
454
0
#define L_LBM_SRS_CONTEXT_NAME_END_T_CONTEXT_INSTANCE 8
455
0
#define L_LBM_SRS_CONTEXT_NAME_END_T_CONTEXT_TYPE 1
456
0
#define L_LBM_SRS_CONTEXT_NAME_END_T_VERSION 4
457
0
#define L_LBM_SRS_CONTEXT_NAME_END_T_VERSION_FLAGS 4
458
0
#define L_LBM_SRS_CONTEXT_NAME_END_T_RESERVED 4
459
460
/*SRS Message IDs*/
461
1
#define MSG_ID_REGISTRATION_REQUEST 1
462
2
#define MSG_ID_REGISTRATION_RESPONSE 2
463
2
#define MSG_ID_STREAM_REQUEST 3
464
19
#define MSG_ID_SOURCE_INFO 4
465
10
#define MSG_ID_SOURCE_DELETE 5
466
16
#define MSG_ID_RCV_INFO 6
467
14
#define MSG_ID_RCV_DELETE 7
468
19
#define MSG_ID_RCV_END 8
469
17
#define MSG_ID_WRCV_INFO 9
470
18
#define MSG_ID_WRCV_DELETE 10
471
17
#define MSG_ID_WRCV_END 11
472
57
#define MSG_ID_SRC_LEAVE 12
473
/*UM 6.14 messages*/
474
44
#define MSG_ID_ROUTE_INFO 13
475
45
#define MSG_ID_ROUTE_END 14
476
44
#define MSG_ID_DOMAIN_INFO 15
477
44
#define MSG_ID_CONTEXT_NAME_QUERY 16
478
62
#define MSG_ID_CONTEXT_NAME_INFO 17
479
56
#define MSG_ID_CONTEXT_NAME_END 18
480
481
/*SRS Tag definitions*/
482
typedef struct
483
{
484
    char * name;
485
    char * ip_address;
486
    uint32_t ip_address_val_h;
487
    uint32_t tcp_port;
488
} lbmsrs_tag_entry_t;
489
490
static lbmsrs_tag_entry_t* lbmsrs_tag_entry;
491
static unsigned lbmsrs_tag_count;
492
493
0
UAT_CSTRING_CB_DEF(lbmsrs_tag, name, lbmsrs_tag_entry_t)
494
0
UAT_IPV4_CB_DEF(lbmsrs_tag, ip_address, lbmsrs_tag_entry_t)
Unexecuted instantiation: packet-lbmsrs.c:lbmsrs_tag_ip_address_chk_cb
Unexecuted instantiation: packet-lbmsrs.c:lbmsrs_tag_ip_address_set_cb
Unexecuted instantiation: packet-lbmsrs.c:lbmsrs_tag_ip_address_tostr_cb
495
0
UAT_DEC_CB_DEF(lbmsrs_tag, tcp_port, lbmsrs_tag_entry_t)
Unexecuted instantiation: packet-lbmsrs.c:lbmsrs_tag_tcp_port_set_cb
Unexecuted instantiation: packet-lbmsrs.c:lbmsrs_tag_tcp_port_tostr_cb
496
497
static uat_field_t lbmsrs_tag_array[] =
498
{
499
    UAT_FLD_CSTRING(lbmsrs_tag, name, "Tag name", "Tag name"),
500
    UAT_FLD_IPV4(lbmsrs_tag, ip_address, "LBMSRS IP Address", "LBMSRS IP Address"),
501
    UAT_FLD_DEC(lbmsrs_tag, tcp_port, "LBMSRS TCP port", "LBMSRS TCP port"),
502
    UAT_END_FIELDS
503
};
504
505
static const value_string lbmsrsMessageId[] =
506
{
507
    { MSG_ID_REGISTRATION_REQUEST, "SRS_REGISTRATION_REQUEST" },
508
    { MSG_ID_REGISTRATION_RESPONSE, "SRS_REGISTRATION_RESPONSE" },
509
    { MSG_ID_STREAM_REQUEST, "SRS_STREAM_REQUEST" },
510
    { MSG_ID_SOURCE_INFO, "SRS_SRC_INFO" },
511
    { MSG_ID_SOURCE_DELETE, "SRS_SRC_DELETE" },
512
    { MSG_ID_RCV_INFO, "SRS_RCV_INFO" },
513
    { MSG_ID_RCV_DELETE, "SRS_RCV_DELETE" },
514
    { MSG_ID_RCV_END, "SRS_RCV_END" },
515
    { MSG_ID_WRCV_INFO, "SRS_WRCV_INFO" },
516
    { MSG_ID_WRCV_DELETE, "SRS_WRCV_DELETE" },
517
    { MSG_ID_WRCV_END, "SRS_WRCV_END" },
518
    { MSG_ID_SRC_LEAVE, "SRS_LEAVE_INFO" },
519
    { MSG_ID_ROUTE_INFO, "SRS_ROUTE_INFO" },
520
    { MSG_ID_ROUTE_END, "SRS_ROUTE_END" },
521
    { MSG_ID_DOMAIN_INFO, "SRS_DOMAIN_INFO" },
522
    { MSG_ID_CONTEXT_NAME_QUERY, "SRS_CONTEXT_NAME_QUERY" },
523
    { MSG_ID_CONTEXT_NAME_INFO, "SRS_CONTEXT_NAME_INFO" },
524
    { MSG_ID_CONTEXT_NAME_END, "SRS_CONTEXT_NAME_END" },
525
    { 0,NULL}
526
};
527
528
static const value_string lbmsrsApplicationType[] =
529
{
530
    { LBM_SRS_APP_TYPE_APPLICATION, "APP_TYPE_APPLICATION" },
531
    { LBM_SRS_APP_TYPE_TNWGD, "APP_TYPE_TNWGD" },
532
    { LBM_SRS_APP_TYPE_STORE, "APP_TYPE_STORE" },
533
    { 0,NULL}
534
};
535
536
static const value_string lbmsrsContextType[] =
537
{
538
    { LBM_SRS_CTX_TYPE_APPLICATION, "CTX_TYPE_APPLICATION" },
539
    { LBM_SRS_CTX_TYPE_TNWGD, "CTX_TYPE_TNWGD" },
540
    { LBM_SRS_CTX_TYPE_STORE, "CTX_TYPE_STORE" },
541
    { 0,NULL}
542
};
543
544
/* Dissector field handles */
545
static int hf_lbmsrs_message_id;
546
547
/*handles for registration request*/
548
static int hf_lbmsrs_app_type;
549
static int hf_lbmsrs_client_addr;
550
static int hf_lbmsrs_client_port;
551
static int hf_lbmsrs_session_id;
552
static int hf_lbmsrs_host_id;
553
static int hf_lbmsrs_protocol_version;
554
static int hf_lbmsrs_interest_mode;
555
static int hf_lbmsrs_interest_mode_advertise_filter;
556
static int hf_lbmsrs_interest_mode_interest_forward;
557
static int hf_lbmsrs_interest_mode_context_name_filter;
558
static int hf_lbmsrs_req_local_domain_id;
559
560
/*handles for registration response*/
561
static int hf_lbmsrs_client_id;
562
static int hf_lbmsrs_resp_local_domain_id;
563
static int hf_lbmsrs_reg_resp_protocol_version;
564
565
/*handles for stream request*/
566
static int hf_lbmsrs_stream_req_unused;
567
568
/*handles for source info*/
569
static int hf_lbmsrs_sir;
570
static int hf_lbmsrs_sir_otid;
571
static int hf_lbmsrs_sir_topic_len;
572
static int hf_lbmsrs_sir_topic;
573
static int hf_lbmsrs_sir_source_len;
574
static int hf_lbmsrs_sir_source;
575
static int hf_lbmsrs_sir_host_id;
576
static int hf_lbmsrs_sir_topic_idx;
577
static int hf_lbmsrs_sir_functionality_flags;
578
static int hf_lbmsrs_sir_request_ip;
579
static int hf_lbmsrs_sir_request_port;
580
static int hf_lbmsrs_sir_domain_id;
581
static int hf_lbmsrs_sir_encryption;
582
static int hf_lbmsrs_sir_compression;
583
static int hf_lbmsrs_sir_ulb_src_id;
584
static int hf_lbmsrs_sir_ulb_queue_id;
585
static int hf_lbmsrs_sir_ulb_reg_id;
586
static int hf_lbmsrs_sir_context_instance;
587
static int hf_lbmsrs_sir_context_type;
588
static int hf_lbmsrs_sir_version;
589
static int hf_lbmsrs_sir_version_flags;
590
static int hf_lbmsrs_sir_ttl;
591
static int hf_lbmsrs_sir_cost;
592
593
/*handles for source delete*/
594
static int hf_lbmsrs_sdr;
595
static int hf_lbmsrs_sdr_otid;
596
static int hf_lbmsrs_sdr_topic_len;
597
static int hf_lbmsrs_sdr_topic;
598
599
/*handles for receiver info*/
600
static int hf_lbmsrs_rir;
601
static int hf_lbmsrs_rir_topic_len;
602
static int hf_lbmsrs_rir_topic;
603
static int hf_lbmsrs_rir_domain_id;
604
static int hf_lbmsrs_rir_context_instance;
605
static int hf_lbmsrs_rir_context_type;
606
static int hf_lbmsrs_rir_version;
607
static int hf_lbmsrs_rir_version_flags;
608
static int hf_lbmsrs_rir_reserved;
609
610
/*handles for receiver delete*/
611
static int hf_lbmsrs_rdr;
612
static int hf_lbmsrs_rdr_topic_len;
613
static int hf_lbmsrs_rdr_topic;
614
static int hf_lbmsrs_rdr_domain_id;
615
static int hf_lbmsrs_rdr_context_instance;
616
static int hf_lbmsrs_rdr_context_type;
617
static int hf_lbmsrs_rdr_version;
618
static int hf_lbmsrs_rdr_version_flags;
619
static int hf_lbmsrs_rdr_reserved;
620
621
/*handles for receiver end*/
622
static int hf_lbmsrs_rer;
623
static int hf_lbmsrs_rer_topic_len;
624
static int hf_lbmsrs_rer_topic;
625
static int hf_lbmsrs_rer_domain_id;
626
static int hf_lbmsrs_rer_context_instance;
627
static int hf_lbmsrs_rer_context_type;
628
static int hf_lbmsrs_rer_version;
629
static int hf_lbmsrs_rer_version_flags;
630
static int hf_lbmsrs_rer_reserved;
631
632
/*handles for wildcard receiver info*/
633
static int hf_lbmsrs_wir;
634
static int hf_lbmsrs_wir_pattern_len;
635
static int hf_lbmsrs_wir_pattern;
636
static int hf_lbmsrs_wir_domain_id;
637
static int hf_lbmsrs_wir_context_instance;
638
static int hf_lbmsrs_wir_context_type;
639
static int hf_lbmsrs_wir_version;
640
static int hf_lbmsrs_wir_version_flags;
641
static int hf_lbmsrs_wir_reserved;
642
643
/*handles for wildcard receiver delete*/
644
static int hf_lbmsrs_wdr;
645
static int hf_lbmsrs_wdr_pattern_len;
646
static int hf_lbmsrs_wdr_pattern;
647
static int hf_lbmsrs_wdr_domain_id;
648
static int hf_lbmsrs_wdr_context_instance;
649
static int hf_lbmsrs_wdr_context_type;
650
static int hf_lbmsrs_wdr_version;
651
static int hf_lbmsrs_wdr_version_flags;
652
static int hf_lbmsrs_wdr_reserved;
653
654
/*handles for wildcard receiver end*/
655
static int hf_lbmsrs_wer;
656
static int hf_lbmsrs_wer_pattern_len;
657
static int hf_lbmsrs_wer_pattern;
658
static int hf_lbmsrs_wer_domain_id;
659
static int hf_lbmsrs_wer_context_instance;
660
static int hf_lbmsrs_wer_context_type;
661
static int hf_lbmsrs_wer_version;
662
static int hf_lbmsrs_wer_version_flags;
663
static int hf_lbmsrs_wer_reserved;
664
665
/*handles for src leave info*/
666
static int hf_lbmsrs_sli;
667
static int hf_lbmsrs_sli_otid;
668
static int hf_lbmsrs_sli_topic_len;
669
static int hf_lbmsrs_sli_topic;
670
static int hf_lbmsrs_sli_source_len;
671
static int hf_lbmsrs_sli_source;
672
static int hf_lbmsrs_sli_context_instance;
673
static int hf_lbmsrs_sli_context_type;
674
static int hf_lbmsrs_sli_version;
675
static int hf_lbmsrs_sli_version_flags;
676
static int hf_lbmsrs_sli_reserved;
677
678
/*UM 6.14 changes*/
679
/*handles for route info*/
680
static int hf_lbmsrs_rti;
681
static int hf_lbmsrs_rti_num_domains;
682
static int hf_lbmsrs_rti_domain;
683
static int hf_lbmsrs_rti_domains;
684
static int hf_lbmsrs_rti_ip;
685
static int hf_lbmsrs_rti_port;
686
static int hf_lbmsrs_rti_context_instance;
687
static int hf_lbmsrs_rti_context_type;
688
static int hf_lbmsrs_rti_version;
689
static int hf_lbmsrs_rti_version_flags;
690
static int hf_lbmsrs_rti_route_index;
691
static int hf_lbmsrs_rti_reserved;
692
693
/*handles for route end*/
694
static int hf_lbmsrs_rte;
695
static int hf_lbmsrs_rte_num_domains;
696
static int hf_lbmsrs_rte_domains;
697
static int hf_lbmsrs_rte_domain;
698
static int hf_lbmsrs_rte_ip;
699
static int hf_lbmsrs_rte_port;
700
static int hf_lbmsrs_rte_context_instance;
701
static int hf_lbmsrs_rte_context_type;
702
static int hf_lbmsrs_rte_version;
703
static int hf_lbmsrs_rte_version_flags;
704
static int hf_lbmsrs_rte_route_index;
705
static int hf_lbmsrs_rte_reserved;
706
707
/*handles for domain info*/
708
static int hf_lbmsrs_dmi;
709
static int hf_lbmsrs_dmi_domain_id;
710
static int hf_lbmsrs_dmi_context_instance;
711
static int hf_lbmsrs_dmi_context_type;
712
static int hf_lbmsrs_dmi_version;
713
static int hf_lbmsrs_dmi_version_flags;
714
static int hf_lbmsrs_dmi_reserved;
715
716
/*handles for context name query*/
717
static int hf_lbmsrs_cnq;
718
static int hf_lbmsrs_cnq_name_len;
719
static int hf_lbmsrs_cnq_name;
720
static int hf_lbmsrs_cnq_domain_id;
721
static int hf_lbmsrs_cnq_context_instance;
722
static int hf_lbmsrs_cnq_context_type;
723
static int hf_lbmsrs_cnq_version;
724
static int hf_lbmsrs_cnq_version_flags;
725
static int hf_lbmsrs_cnq_reserved;
726
727
/*handles for context name info*/
728
static int hf_lbmsrs_cni;
729
static int hf_lbmsrs_cni_name_len;
730
static int hf_lbmsrs_cni_name;
731
static int hf_lbmsrs_cni_domain_id;
732
static int hf_lbmsrs_cni_ip;
733
static int hf_lbmsrs_cni_port;
734
static int hf_lbmsrs_cni_origin_context_instance;
735
static int hf_lbmsrs_cni_context_instance;
736
static int hf_lbmsrs_cni_context_type;
737
static int hf_lbmsrs_cni_version;
738
static int hf_lbmsrs_cni_version_flags;
739
static int hf_lbmsrs_cni_reserved;
740
741
/*handles for context name end*/
742
static int hf_lbmsrs_cne;
743
static int hf_lbmsrs_cne_name_len;
744
static int hf_lbmsrs_cne_name;
745
static int hf_lbmsrs_cne_domain_id;
746
static int hf_lbmsrs_cne_ip;
747
static int hf_lbmsrs_cne_port;
748
static int hf_lbmsrs_cne_origin_context_instance;
749
static int hf_lbmsrs_cne_context_instance;
750
static int hf_lbmsrs_cne_context_type;
751
static int hf_lbmsrs_cne_version;
752
static int hf_lbmsrs_cne_version_flags;
753
static int hf_lbmsrs_cne_reserved;
754
755
/*rsocket dissector field handles*/
756
static int hf_lbmsrs_rsocket_frame_len;
757
static int hf_lbmsrs_rsocket_stream_id;
758
static int hf_lbmsrs_rsocket_frame_type;
759
static int hf_lbmsrs_rsocket_mdata_len;
760
static int hf_lbmsrs_rsocket_mdata;
761
static int hf_lbmsrs_rsocket_major_version;
762
static int hf_lbmsrs_rsocket_minor_version;
763
static int hf_lbmsrs_rsocket_keepalive_interval;
764
static int hf_lbmsrs_rsocket_max_lifetime;
765
static int hf_lbmsrs_rsocket_mdata_mime_length;
766
static int hf_lbmsrs_rsocket_mdata_mime_type;
767
static int hf_lbmsrs_rsocket_data_mime_length;
768
static int hf_lbmsrs_rsocket_data_mime_type;
769
static int hf_lbmsrs_rsocket_req_n;
770
static int hf_lbmsrs_rsocket_error_code;
771
static int hf_lbmsrs_rsocket_keepalive_last_rcvd_pos;
772
static int hf_lbmsrs_rsocket_resume_token_len;
773
static int hf_lbmsrs_rsocket_resume_token;
774
775
// other flags
776
static int hf_lbmsrs_rsocket_ignore_flag;
777
static int hf_lbmsrs_rsocket_metadata_flag;
778
static int hf_lbmsrs_rsocket_resume_flag;
779
static int hf_lbmsrs_rsocket_lease_flag;
780
static int hf_lbmsrs_rsocket_follows_flag;
781
static int hf_lbmsrs_rsocket_complete_flag;
782
static int hf_lbmsrs_rsocket_next_flag;
783
static int hf_lbmsrs_rsocket_respond_flag;
784
785
/*dissector tree handles*/
786
static int ett_lbmsrs;
787
static int ett_lbmsrs_data;
788
static int ett_lbmsrs_details;
789
static int ett_lbmsrs_sir;
790
static int ett_lbmsrs_sdr;
791
static int ett_lbmsrs_ser;
792
static int ett_lbmsrs_rir;
793
static int ett_lbmsrs_rdr;
794
static int ett_lbmsrs_rer;
795
static int ett_lbmsrs_wir;
796
static int ett_lbmsrs_wdr;
797
static int ett_lbmsrs_wer;
798
static int ett_lbmsrs_sli;
799
static int ett_lbmsrs_interest_mode;
800
/*UM 6.14 changes*/
801
static int ett_lbmsrs_rti;
802
static int ett_lbmsrs_rti_domains;
803
static int ett_lbmsrs_rte;
804
static int ett_lbmsrs_rte_domains;
805
static int ett_lbmsrs_dmi;
806
static int ett_lbmsrs_cnq;
807
static int ett_lbmsrs_cni;
808
static int ett_lbmsrs_cne;
809
810
static int ett_lbmsrs_rsocket_frame;
811
812
/*Expert analysis fields*/
813
static expert_field ei_lbmsrs_analysis_invalid_msg_id;
814
815
/* Dissector handle */
816
static dissector_handle_t lbmsrs_dissector_handle;
817
818
static const unsigned rsocket_frame_len_field_size = 3;
819
static const unsigned rsocket_stream_id_field_size = 4;
820
821
/* SRS default definitions*/
822
#define LBMSRS_DEFAULT_SOURCE_PORT 0
823
3.52k
#define LBMSRS_DEFAULT_SOURCE_IP "127.0.0.1"
824
825
static uint32_t lbmsrs_source_ip_address;
826
static const char* global_lbmsrs_source_ip_address = LBMSRS_DEFAULT_SOURCE_IP;
827
static uint32_t global_lbmsrs_source_port = LBMSRS_DEFAULT_SOURCE_PORT;
828
static bool global_lbmsrs_use_tag;
829
static uint32_t lbmsrs_source_port = LBMSRS_DEFAULT_SOURCE_PORT;
830
static bool lbmsrs_use_tag;
831
832
833
#define RSOCKET_FRAME_RESERVED 0x00
834
126
#define RSOCKET_FRAME_SETUP 0x01
835
#define RSOCKET_FRAME_LEASE 0x02
836
156
#define RSOCKET_FRAME_KEEPALIVE 0x03
837
37
#define RSOCKET_FRAME_REQUEST_RESPONSE 0x04
838
54
#define RSOCKET_FRAME_REQUEST_FNF 0x05
839
23
#define RSOCKET_FRAME_REQUEST_STREAM 0x06
840
69
#define RSOCKET_FRAME_REQUEST_CHANNEL 0x07
841
148
#define RSOCKET_FRAME_REQUEST_N 0x08
842
75
#define RSOCKET_FRAME_CANCEL 0x09
843
103
#define RSOCKET_FRAME_PAYLOAD 0x0A
844
238
#define RSOCKET_FRAME_ERROR 0x0B
845
210
#define RSOCKET_FRAME_METADATA_PUSH 0x0C
846
257
#define RSOCKET_FRAME_RESUME 0x0D
847
287
#define RSOCKET_FRAME_RESUME_OK 0x0E
848
228
#define RSOCKET_FRAME_EXT 0x3F
849
850
13
#define RSOCKET_FRAME_SETUP_MIN_SIZE 14
851
2
#define RSOCKET_FRAME_KEEPALIVE_SIZE 10
852
1
#define RSOCKET_FRAME_REQUEST_RESPONSE_SIZE 2
853
3
#define RSOCKET_FRAME_REQUEST_FNF_SIZE 2
854
1
#define RSOCKET_FRAME_REQUEST_STREAM_SIZE 6
855
1
#define RSOCKET_FRAME_REQUEST_CHANNEL_SIZE 6
856
1
#define RSOCKET_FRAME_REQUEST_N_SIZE 6
857
0
#define RSOCKET_FRAME_CANCEL_SIZE 2
858
1
#define RSOCKET_FRAME_PAYLOAD_SIZE 2
859
860
static const value_string rSocketFrameTypeNames[] = {
861
    { RSOCKET_FRAME_RESERVED, "RESERVED" },
862
    { RSOCKET_FRAME_SETUP, "SETUP" },
863
    { RSOCKET_FRAME_LEASE, "LEASE" },
864
    { RSOCKET_FRAME_KEEPALIVE, "KEEPALIVE" },
865
    { RSOCKET_FRAME_REQUEST_RESPONSE, "REQUEST_RESPONSE" },
866
    { RSOCKET_FRAME_REQUEST_FNF, "REQUEST_FNF" },
867
    { RSOCKET_FRAME_REQUEST_STREAM, "REQUEST_STREAM" },
868
    { RSOCKET_FRAME_REQUEST_CHANNEL, "REQUEST_CHANNEL" },
869
    { RSOCKET_FRAME_REQUEST_N, "REQUEST_N" },
870
    { RSOCKET_FRAME_CANCEL, "CANCEL" },
871
    { RSOCKET_FRAME_PAYLOAD, "PAYLOAD" },
872
    { RSOCKET_FRAME_ERROR, "ERROR" },
873
    { RSOCKET_FRAME_METADATA_PUSH, "METADATA_PUSH" },
874
    { RSOCKET_FRAME_RESUME, "RESUME" },
875
    { RSOCKET_FRAME_RESUME_OK, "RESUME_OK" },
876
    { RSOCKET_FRAME_EXT, "EXT" },
877
    { 0,NULL} };
878
879
880
static const value_string rSocketErrorCodeNames[] =
881
{
882
    { 0x00000000, "RESERVED" },
883
    { 0x00000001, "INVALID_SETUP" },
884
    { 0x00000002, "UNSUPPORTED_SETUP" },
885
    { 0x00000003, "REJECTED_SETUP" },
886
    { 0x00000004, "REJECTED_RESUME" },
887
    { 0x00000101, "CONNECTION_ERROR" },
888
    { 0x00000102, "CONNECTION_CLOSE" },
889
    { 0x00000201, "APPLICATION_ERROR" },
890
    { 0x00000202, "REJECTED" },
891
    { 0x00000203, "CANCELED" },
892
    { 0x00000204, "INVALID" },
893
    { 0xFFFFFFFF, "REJECTED" },
894
    { 0,NULL}
895
};
896
897
/*----------------------------------------------------------------------------*/
898
/* UAT callback functions.                                                    */
899
/*----------------------------------------------------------------------------*/
900
static bool lbmsrs_tag_update_cb(void * record, char * * error_string)
901
0
{
902
0
    lbmsrs_tag_entry_t * tag = (lbmsrs_tag_entry_t *)record;
903
904
0
    if (tag->name == NULL)
905
0
    {
906
0
        *error_string = g_strdup("Tag name can't be empty");
907
0
        return false;
908
0
    }
909
0
    else
910
0
    {
911
0
        g_strstrip(tag->name);
912
0
        if (tag->name[0] == 0)
913
0
        {
914
0
            *error_string = g_strdup("Tag name can't be empty");
915
0
            return false;
916
0
        }
917
0
    }
918
0
    return true;
919
0
}
920
921
static void * lbmsrs_tag_copy_cb(void * destination, const void * source, size_t length _U_)
922
0
{
923
0
    const lbmsrs_tag_entry_t * src = (const lbmsrs_tag_entry_t *)source;
924
0
    lbmsrs_tag_entry_t * dest = (lbmsrs_tag_entry_t *)destination;
925
926
0
    dest->name = g_strdup(src->name);
927
0
    dest->ip_address = g_strdup(src->ip_address);
928
0
    dest->ip_address_val_h = src->ip_address_val_h;
929
0
    dest->tcp_port = src->tcp_port;
930
0
    return (dest);
931
0
}
932
933
static void lbmsrs_tag_free_cb(void * record)
934
0
{
935
0
    lbmsrs_tag_entry_t * tag = (lbmsrs_tag_entry_t *)record;
936
937
0
    if (tag->name != NULL)
938
0
    {
939
0
        g_free(tag->name);
940
0
        tag->name = NULL;
941
0
    }
942
943
0
    if (tag->ip_address != NULL)
944
0
    {
945
0
        g_free(tag->ip_address);
946
0
        tag->ip_address = NULL;
947
0
    }
948
0
}
949
950
/*Tag helper functions*/
951
static bool lbmsrs_match_packet(packet_info * pinfo, const lbmsrs_tag_entry_t * entry)
952
3.51k
{
953
3.51k
    if ((pinfo->dst.type != AT_IPv4) || (pinfo->dst.len != 4) ||
954
2.77k
        (pinfo->src.type != AT_IPv4) || (pinfo->src.len != 4))
955
738
        return false;
956
957
2.77k
    uint32_t dest_addr_h = pntohu32(pinfo->dst.data);
958
2.77k
    uint32_t src_addr_h = pntohu32(pinfo->src.data);
959
960
2.77k
    uint32_t ip_address_val_h = 0;
961
2.77k
    if (NULL != entry->ip_address)
962
2.77k
    {
963
2.77k
        ip_address_val_h = entry->ip_address_val_h;
964
2.77k
    }
965
966
    /*if only port number is specified*/
967
2.77k
    if ((entry->tcp_port > 0) && (ip_address_val_h == 0))
968
0
    {
969
0
        if ((entry->tcp_port == pinfo->destport) || (entry->tcp_port == pinfo->srcport))
970
0
        {
971
0
            return true;
972
0
        }
973
0
    }
974
    /*if only IP is specified*/
975
2.77k
    else if ((entry->tcp_port == 0) && (ip_address_val_h > 0))
976
2.77k
    {
977
2.77k
        if ((ip_address_val_h == dest_addr_h) || (ip_address_val_h == src_addr_h))
978
55
        {
979
55
            return true;
980
55
        }
981
2.77k
    }
982
    /*if both IP and port is specified*/
983
0
    else
984
0
    {
985
0
        if (((ip_address_val_h == dest_addr_h) && (entry->tcp_port == pinfo->destport))
986
0
            || ((ip_address_val_h == src_addr_h) && (entry->tcp_port == pinfo->srcport)))
987
0
        {
988
0
            return true;
989
0
        }
990
0
    }
991
992
2.71k
    return false;
993
2.77k
}
994
995
static char * lbmsrs_tag_find(packet_info * pinfo)
996
0
{
997
0
    unsigned idx;
998
0
    lbmsrs_tag_entry_t * tag = NULL;
999
1000
0
    if (!lbmsrs_use_tag)
1001
0
    {
1002
0
        return (NULL);
1003
0
    }
1004
0
    for (idx = 0; idx < lbmsrs_tag_count; ++idx)
1005
0
    {
1006
0
        tag = &(lbmsrs_tag_entry[idx]);
1007
0
        if (lbmsrs_match_packet(pinfo, tag))
1008
0
        {
1009
0
            return tag->name;
1010
0
        }
1011
0
    }
1012
0
    return (NULL);
1013
0
}
1014
1015
/*Utility functions*/
1016
88
static const char *getFrameTypeName(const uint64_t frame_type) {
1017
939
    for (size_t i = 0; i < array_length(rSocketFrameTypeNames); i++) {
1018
936
        if (rSocketFrameTypeNames[i].value == frame_type) {
1019
85
            return rSocketFrameTypeNames[i].strptr;
1020
85
        }
1021
936
    }
1022
3
    return NULL;
1023
88
}
1024
1025
static bool check_lbmsrs_packet(tvbuff_t *tvb, unsigned offset)
1026
3.51k
{
1027
    /*check if valid rsocket packet*/
1028
3.51k
    offset += rsocket_frame_len_field_size;
1029
1030
    /*check the length*/
1031
    /*rsocket data may be split across multiple packets*/
1032
3.51k
    if (tvb_captured_length_remaining(tvb, offset) < rsocket_stream_id_field_size)
1033
187
    {
1034
187
        return false;
1035
187
    }
1036
1037
    /*get the stream-id*/
1038
3.32k
    uint32_t rsocket_stream_id = tvb_get_uint32(tvb, offset, ENC_BIG_ENDIAN);
1039
1040
    /*move the offset past the stream id field*/
1041
3.32k
    offset += rsocket_stream_id_field_size;
1042
1043
3.32k
    if (!tvb_bytes_exist(tvb, offset, 1))
1044
32
    {
1045
32
        return false;
1046
32
    }
1047
1048
    /*get the rsocket frame type*/
1049
3.29k
    uint8_t rsocket_frame_type = tvb_get_bits8(tvb, offset * 8, 6);
1050
1051
    /*read the rsocket metadata flag*/
1052
3.29k
    uint8_t rsocket_metadata_flag = tvb_get_bits8(tvb, (offset * 8) + 6, 2);
1053
1054
    /*check if valid rsocket frame type*/
1055
    /*update the offset according to the frame type*/
1056
3.29k
    switch (rsocket_frame_type)
1057
3.29k
    {
1058
113
    case RSOCKET_FRAME_SETUP:
1059
154
    case RSOCKET_FRAME_KEEPALIVE:
1060
210
    case RSOCKET_FRAME_METADATA_PUSH:
1061
257
    case RSOCKET_FRAME_RESUME:
1062
287
    case RSOCKET_FRAME_RESUME_OK:
1063
287
    {
1064
        /*for these frame types stream id must be 0 */
1065
287
        if (rsocket_stream_id != 0)
1066
250
        {
1067
250
            return false;
1068
250
        }
1069
1070
37
        return true;
1071
287
    }
1072
228
    case RSOCKET_FRAME_EXT:
1073
228
    {
1074
228
        return true;
1075
287
    }
1076
1077
36
    case RSOCKET_FRAME_REQUEST_RESPONSE:
1078
51
    case RSOCKET_FRAME_REQUEST_FNF:
1079
75
    case RSOCKET_FRAME_CANCEL:
1080
102
    case RSOCKET_FRAME_PAYLOAD:
1081
102
    {
1082
102
        offset += 2;
1083
102
        break;
1084
75
    }
1085
1086
22
    case RSOCKET_FRAME_REQUEST_STREAM:
1087
68
    case RSOCKET_FRAME_REQUEST_CHANNEL:
1088
147
    case RSOCKET_FRAME_REQUEST_N:
1089
216
    case RSOCKET_FRAME_ERROR:
1090
216
    {
1091
216
        offset += 6;
1092
216
        break;
1093
147
    }
1094
1095
2.45k
    default:
1096
2.45k
        return false;
1097
3.29k
    }
1098
1099
    /*if rsocket metadata is available get the metadata length*/
1100
318
    if (rsocket_metadata_flag)
1101
233
    {
1102
233
        if (!tvb_bytes_exist(tvb, offset, 3))
1103
21
        {
1104
21
            return false;
1105
21
        }
1106
1107
        /*add the rsocket metadata length field*/
1108
212
        uint32_t rsocket_metadata_len = tvb_get_uint24(tvb, offset, ENC_BIG_ENDIAN);
1109
212
        offset += 3;
1110
        /*move the offset by the metadata length*/
1111
212
        offset += rsocket_metadata_len;
1112
212
        if (!tvb_bytes_exist(tvb, offset, 6))
1113
165
        {
1114
165
            return false;
1115
165
        }
1116
212
    }
1117
1118
1119
    /*check the SRS message id*/
1120
1121
132
    uint32_t rsocket_payload_len = tvb_captured_length_remaining(tvb, offset);
1122
    /*if payload is available start processing for SRS*/
1123
132
    if (rsocket_payload_len > 2)
1124
122
    {
1125
122
        uint16_t message_id = tvb_get_uint16(tvb, offset, ENC_BIG_ENDIAN);
1126
122
        switch (message_id)
1127
122
        {
1128
1
        case MSG_ID_REGISTRATION_REQUEST:
1129
2
        case MSG_ID_REGISTRATION_RESPONSE:
1130
2
        case MSG_ID_STREAM_REQUEST:
1131
2
        case MSG_ID_SOURCE_INFO:
1132
2
        case MSG_ID_SOURCE_DELETE:
1133
4
        case MSG_ID_RCV_INFO:
1134
4
        case MSG_ID_RCV_DELETE:
1135
5
        case MSG_ID_RCV_END:
1136
5
        case MSG_ID_WRCV_INFO:
1137
5
        case MSG_ID_WRCV_DELETE:
1138
5
        case MSG_ID_WRCV_END:
1139
19
        case MSG_ID_SRC_LEAVE:
1140
19
        case MSG_ID_ROUTE_INFO:
1141
19
        case MSG_ID_ROUTE_END:
1142
19
        case MSG_ID_DOMAIN_INFO:
1143
19
        case MSG_ID_CONTEXT_NAME_QUERY:
1144
25
        case MSG_ID_CONTEXT_NAME_INFO:
1145
25
        case MSG_ID_CONTEXT_NAME_END:
1146
25
        {
1147
25
            return true;
1148
25
        }
1149
1150
97
        default:
1151
97
            return false;
1152
1153
122
        }
1154
122
    }
1155
1156
10
    return false;
1157
132
}
1158
1159
1160
1161
static unsigned get_rsocket_frame_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
1162
214
{
1163
    /*get the rsocket frame length (3-byte long field)*/
1164
    /*offset argument points to the beginning of the Rsocket PDU*/
1165
214
    uint32_t rsocket_frame_len = tvb_get_uint24(tvb, offset, ENC_BIG_ENDIAN);
1166
1167
    /*return total RSocket PDU size*/
1168
214
    return (rsocket_frame_len + rsocket_frame_len_field_size);
1169
214
}
1170
1171
/*----------------Main Dissection Functions----------------------*/
1172
1173
/* these are used for tabulating the number of sub-elements in
1174
 * a given SRS message.  Multiples (or none) of each are possible
1175
 * within a single SRS message.
1176
 *
1177
 * These not used for controlling the dissection.
1178
 *
1179
 * Defined as static to prevent collisions with other dissectors.
1180
 */
1181
static unsigned cnt_sir = 0, cnt_ser = 0, cnt_sdr = 0;
1182
static unsigned cnt_rir = 0, cnt_rer = 0, cnt_rdr = 0;
1183
static unsigned cnt_wir = 0, cnt_wer = 0, cnt_wdr = 0;
1184
static unsigned cnt_sli = 0;
1185
static unsigned cnt_rti = 0, cnt_rte = 0, cnt_dmi = 0;
1186
static unsigned cnt_cnq = 0, cnt_cni = 0, cnt_cne = 0;
1187
1188
/*Rsocket dissector function*/
1189
static unsigned dissect_rsocket_frame(uint64_t rsocket_frame_type,proto_tree* rsocket_frame_tree, tvbuff_t * tvb,unsigned offset, bool *can_dissect_further)
1190
87
{
1191
87
    unsigned total_payload_len = tvb_captured_length(tvb);
1192
87
    unsigned remaining_payload_len = total_payload_len - offset;
1193
87
    unsigned start_offset = offset;
1194
1195
87
    switch (rsocket_frame_type)
1196
87
    {
1197
13
        case RSOCKET_FRAME_SETUP:/*SETUP Frame*/
1198
13
        {
1199
1200
13
            if (remaining_payload_len < RSOCKET_FRAME_SETUP_MIN_SIZE)
1201
0
            {
1202
0
                *can_dissect_further = false;
1203
0
                break;
1204
0
            }
1205
1206
13
            int8_t resume_flag = tvb_get_bits8(tvb, (offset + 1) * 8, 1);
1207
13
            proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_resume_flag, tvb, offset, 2,ENC_BIG_ENDIAN);
1208
13
            proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_lease_flag, tvb, offset, 2,ENC_BIG_ENDIAN);
1209
13
            offset += 2;
1210
1211
13
            proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_major_version, tvb, offset, 2,ENC_BIG_ENDIAN);
1212
13
            offset += 2;
1213
1214
13
            proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_minor_version, tvb, offset, 2,ENC_BIG_ENDIAN);
1215
13
            offset += 2;
1216
13
            proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_keepalive_interval, tvb, offset, 4,ENC_BIG_ENDIAN);
1217
13
            offset += 4;
1218
13
            proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_max_lifetime, tvb, offset, 4,ENC_BIG_ENDIAN);
1219
13
            offset += 4;
1220
13
            if (resume_flag) {
1221
0
                if ((total_payload_len - offset) < 2)
1222
0
                {
1223
0
                    *can_dissect_further = false;
1224
0
                    break;
1225
0
                }
1226
0
                unsigned resume_token_len;
1227
0
                proto_tree_add_item_ret_uint(rsocket_frame_tree, hf_lbmsrs_rsocket_resume_token_len, tvb, offset,2, ENC_BIG_ENDIAN, &resume_token_len);
1228
0
                offset += 2;
1229
1230
0
                if ((total_payload_len - offset) < resume_token_len)
1231
0
                {
1232
0
                    *can_dissect_further = false;
1233
0
                    break;
1234
0
                }
1235
0
                proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_resume_token, tvb, offset,resume_token_len, ENC_STRING);
1236
0
                offset += resume_token_len;
1237
0
            }
1238
1239
13
            if ((total_payload_len - offset) < 1)
1240
0
            {
1241
0
                *can_dissect_further = false;
1242
0
                break;
1243
0
            }
1244
1245
13
            unsigned mdata_mime_length;
1246
13
            proto_tree_add_item_ret_uint(rsocket_frame_tree, hf_lbmsrs_rsocket_mdata_mime_length, tvb, offset,1, ENC_BIG_ENDIAN, &mdata_mime_length);
1247
13
            offset += 1;
1248
1249
13
            if ((total_payload_len - offset) < mdata_mime_length)
1250
1
            {
1251
1
                *can_dissect_further = false;
1252
1
                break;
1253
1
            }
1254
1255
12
            proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_mdata_mime_type, tvb, offset,mdata_mime_length, ENC_ASCII);
1256
12
            offset += mdata_mime_length;
1257
1258
12
            if ((total_payload_len - offset) < 1)
1259
0
            {
1260
0
                *can_dissect_further = false;
1261
0
                break;
1262
0
            }
1263
12
            unsigned data_mime_length;
1264
12
            proto_tree_add_item_ret_uint(rsocket_frame_tree, hf_lbmsrs_rsocket_data_mime_length, tvb, offset,1, ENC_BIG_ENDIAN, &data_mime_length);
1265
12
            offset += 1;
1266
1267
12
            if ((total_payload_len - offset) < data_mime_length)
1268
1
            {
1269
1
                *can_dissect_further = false;
1270
1
                break;
1271
1
            }
1272
1273
11
            proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_data_mime_type, tvb, offset,data_mime_length, ENC_ASCII);
1274
11
            offset += data_mime_length;
1275
11
            break;
1276
12
        }
1277
1278
2
        case RSOCKET_FRAME_KEEPALIVE:/*KEEPALIVE FRAME*/
1279
2
        {
1280
1281
2
            if (remaining_payload_len < RSOCKET_FRAME_KEEPALIVE_SIZE)
1282
2
            {
1283
2
                *can_dissect_further = false;
1284
2
                break;
1285
2
            }
1286
1287
0
            proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_respond_flag, tvb, offset, 2,ENC_BIG_ENDIAN);
1288
0
            offset += 2;
1289
1290
0
            proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_keepalive_last_rcvd_pos, tvb, offset, 8,ENC_BIG_ENDIAN);
1291
0
            offset += 8;
1292
1293
0
            break;
1294
2
        }
1295
1296
1
        case RSOCKET_FRAME_REQUEST_RESPONSE:/*REQUEST_RESPONSE FRAME*/
1297
1
        {
1298
1299
1
            if (remaining_payload_len < RSOCKET_FRAME_REQUEST_RESPONSE_SIZE)
1300
0
            {
1301
0
                *can_dissect_further = false;
1302
0
                break;
1303
0
            }
1304
1
            proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_follows_flag, tvb, offset, 2,ENC_BIG_ENDIAN);
1305
1
            offset += 2;
1306
1307
1
            break;
1308
1
        }
1309
1310
3
        case RSOCKET_FRAME_REQUEST_FNF:/*FNF FRAME*/
1311
3
        {
1312
3
            if (remaining_payload_len < RSOCKET_FRAME_REQUEST_FNF_SIZE)
1313
0
            {
1314
0
                *can_dissect_further = false;
1315
0
                break;
1316
0
            }
1317
3
            proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_follows_flag, tvb, offset, 2,ENC_BIG_ENDIAN);
1318
3
            offset += 2;
1319
3
            break;
1320
3
        }
1321
1322
1
        case RSOCKET_FRAME_REQUEST_STREAM:/*REQ_STREAM FRAME*/
1323
1
        {
1324
1
            if (remaining_payload_len < RSOCKET_FRAME_REQUEST_STREAM_SIZE)
1325
0
            {
1326
0
                *can_dissect_further = false;
1327
0
                break;
1328
0
            }
1329
1
            proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_follows_flag, tvb, offset, 2,ENC_BIG_ENDIAN);
1330
1
            offset += 2;
1331
1332
1
            proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_req_n, tvb, offset, 4, ENC_BIG_ENDIAN);
1333
1
            offset += 4;
1334
1
            break;
1335
1
        }
1336
1337
1
        case RSOCKET_FRAME_REQUEST_CHANNEL:/*REQ_CHANNEL FRAME*/
1338
1
        {
1339
1
            if (remaining_payload_len < RSOCKET_FRAME_REQUEST_CHANNEL_SIZE)
1340
0
            {
1341
0
                *can_dissect_further = false;
1342
0
                break;
1343
0
            }
1344
1
            proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_follows_flag, tvb, offset, 2,ENC_BIG_ENDIAN);
1345
1
            proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_complete_flag, tvb, offset, 2,ENC_BIG_ENDIAN);
1346
1
            offset += 2;
1347
1348
1
            proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_req_n, tvb, offset, 4, ENC_BIG_ENDIAN);
1349
1
            offset += 4;
1350
1
            break;
1351
1
        }
1352
1353
1
        case RSOCKET_FRAME_REQUEST_N:/*REQ_N FRAME*/
1354
1
        {
1355
1
            if (remaining_payload_len < RSOCKET_FRAME_REQUEST_N_SIZE)
1356
0
            {
1357
0
                *can_dissect_further = false;
1358
0
                break;
1359
0
            }
1360
1
            offset += 2;
1361
1
            proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_req_n, tvb, offset, 4, ENC_BIG_ENDIAN);
1362
1
            offset += 4;
1363
1
            break;
1364
1
        }
1365
1366
0
        case RSOCKET_FRAME_CANCEL:/*CANCEL FRAME*/
1367
0
        {
1368
0
            if (remaining_payload_len < RSOCKET_FRAME_CANCEL_SIZE)
1369
0
            {
1370
0
                *can_dissect_further = false;
1371
0
                break;
1372
0
            }
1373
0
            offset += 2;
1374
0
            break;
1375
0
        }
1376
1377
1
        case RSOCKET_FRAME_PAYLOAD:/*PAYLOAD FRAME*/
1378
1
        {
1379
1
            if (remaining_payload_len < RSOCKET_FRAME_PAYLOAD_SIZE)
1380
0
            {
1381
0
                *can_dissect_further = false;
1382
0
                break;
1383
0
            }
1384
1
            proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_follows_flag, tvb, offset, 2,ENC_BIG_ENDIAN);
1385
1
            proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_complete_flag, tvb, offset, 2,ENC_BIG_ENDIAN);
1386
1
            proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_next_flag, tvb, offset, 2,ENC_BIG_ENDIAN);
1387
1388
1
            offset += 2;
1389
1
            break;
1390
1
        }
1391
1392
22
        case RSOCKET_FRAME_ERROR:
1393
22
        {
1394
22
            if (remaining_payload_len < 6)
1395
0
            {
1396
0
                *can_dissect_further = false;
1397
0
                break;
1398
0
            }
1399
22
            offset += 2;
1400
22
            proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_error_code, tvb, offset, 4,ENC_BIG_ENDIAN);
1401
22
            offset += 4;
1402
22
            break;
1403
22
        }
1404
1405
42
        default:
1406
42
        {
1407
42
            *can_dissect_further = false;
1408
42
        }
1409
1410
87
    }
1411
1412
87
    return (offset - start_offset);
1413
1414
87
}
1415
1416
static unsigned dissect_lbmsrs_sir_ser(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, unsigned offset, unsigned *lcnt_sir, unsigned *lcnt_ser, bool *can_dissect_further)
1417
9
{
1418
9
    unsigned total_payload_len = tvb_captured_length(tvb);
1419
9
    unsigned start_offset = offset;
1420
1421
    /*first field is OTID, check if that many bytes are left to process*/
1422
9
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_OTID)
1423
1
    {
1424
        /*stop processing in case not available*/
1425
1
        *can_dissect_further = false;
1426
1
        return 0;
1427
1
    }
1428
1429
8
    proto_item *batch_item = NULL;
1430
1431
8
    batch_item = proto_tree_add_none_format(tree, hf_lbmsrs_sir, tvb, offset, -1, "SIR");
1432
8
    proto_tree *sir_tree = proto_item_add_subtree(batch_item, ett_lbmsrs_sir);
1433
1434
8
    proto_tree_add_item(sir_tree, hf_lbmsrs_message_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1435
8
    offset += 2;
1436
1437
8
    proto_tree_add_item(sir_tree, hf_lbmsrs_sir_otid, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_OTID, ENC_NA);
1438
8
    offset += L_LBM_SRS_SRC_INFO_INFO_T_OTID;
1439
1440
8
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_TOPIC_LEN)
1441
1
    {
1442
        /*stop processing in case not available*/
1443
1
        *can_dissect_further = false;
1444
1
        return (offset - start_offset);
1445
1
    }
1446
    /* This protocol uses a belt-and-suspenders approach of having a leading
1447
     * length field which includes a trailing null which is also present.
1448
     * Cf packet-ajp13.c
1449
     * However, there are also some exceptions (mdata_mime_type) where sample
1450
     * files show that no trailing NULL is present. */
1451
7
    uint8_t topic_len = tvb_get_uint8(tvb, offset);
1452
7
    proto_tree_add_item(sir_tree, hf_lbmsrs_sir_topic_len, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_TOPIC_LEN, ENC_BIG_ENDIAN);
1453
7
    offset += L_LBM_SRS_SRC_INFO_INFO_T_TOPIC_LEN;
1454
1455
7
    if ((total_payload_len - offset) < topic_len)
1456
1
    {
1457
        /*stop processing in case not available*/
1458
1
        *can_dissect_further = false;
1459
1
        return (offset - start_offset);
1460
1
    }
1461
6
    const char* name;
1462
6
    proto_tree_add_item_ret_string(sir_tree, hf_lbmsrs_sir_topic, tvb, offset, topic_len, ENC_ASCII, pinfo->pool, (const uint8_t**)&name);
1463
6
    offset += topic_len;
1464
1465
6
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_SOURCE_LEN)
1466
0
    {
1467
        /*stop processing in case not available*/
1468
0
        *can_dissect_further = false;
1469
0
        return (offset - start_offset);
1470
0
    }
1471
6
    uint8_t source_len = tvb_get_uint8(tvb, offset);
1472
6
    proto_tree_add_item(sir_tree, hf_lbmsrs_sir_source_len, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_SOURCE_LEN, ENC_BIG_ENDIAN);
1473
6
    offset += L_LBM_SRS_SRC_INFO_INFO_T_SOURCE_LEN;
1474
1475
6
    if ((total_payload_len - offset) < source_len)
1476
1
    {
1477
        /*stop processing in case not available*/
1478
1
        *can_dissect_further = false;
1479
1
        return (offset - start_offset);
1480
1
    }
1481
1482
5
    proto_tree_add_item(sir_tree, hf_lbmsrs_sir_source, tvb, offset, source_len, ENC_ASCII);
1483
5
    offset += source_len;
1484
1485
5
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_HOST_ID)
1486
0
    {
1487
        /*stop processing in case not available*/
1488
0
        *can_dissect_further = false;
1489
0
        return (offset - start_offset);
1490
0
    }
1491
5
    proto_tree_add_item(sir_tree, hf_lbmsrs_sir_host_id, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_HOST_ID, ENC_BIG_ENDIAN);
1492
5
    offset += L_LBM_SRS_SRC_INFO_INFO_T_HOST_ID;
1493
1494
5
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_TOPIC_IDX)
1495
0
    {
1496
        /*stop processing in case not available*/
1497
0
        *can_dissect_further = false;
1498
0
        return (offset - start_offset);
1499
0
    }
1500
5
    proto_tree_add_item(sir_tree, hf_lbmsrs_sir_topic_idx, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_TOPIC_IDX, ENC_BIG_ENDIAN);
1501
5
    offset += L_LBM_SRS_SRC_INFO_INFO_T_TOPIC_IDX;
1502
1503
5
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_FUNCTIONALITY_FLAGS)
1504
0
    {
1505
        /*stop processing in case not available*/
1506
0
        *can_dissect_further = false;
1507
0
        return (offset - start_offset);
1508
0
    }
1509
5
    proto_tree_add_item(sir_tree, hf_lbmsrs_sir_functionality_flags, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_FUNCTIONALITY_FLAGS, ENC_BIG_ENDIAN);
1510
5
    offset += L_LBM_SRS_SRC_INFO_INFO_T_FUNCTIONALITY_FLAGS;
1511
1512
5
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_REQUEST_IP)
1513
0
    {
1514
        /*stop processing in case not available*/
1515
0
        *can_dissect_further = false;
1516
0
        return (offset - start_offset);
1517
0
    }
1518
5
    proto_tree_add_item(sir_tree, hf_lbmsrs_sir_request_ip, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_REQUEST_IP, ENC_BIG_ENDIAN);
1519
5
    offset += L_LBM_SRS_SRC_INFO_INFO_T_REQUEST_IP;
1520
1521
5
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_REQUEST_PORT)
1522
0
    {
1523
        /*stop processing in case not available*/
1524
0
        *can_dissect_further = false;
1525
0
        return (offset - start_offset);
1526
0
    }
1527
5
    proto_tree_add_item(sir_tree, hf_lbmsrs_sir_request_port, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_REQUEST_PORT, ENC_BIG_ENDIAN);
1528
5
    offset += L_LBM_SRS_SRC_INFO_INFO_T_REQUEST_PORT;
1529
1530
5
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_DOMAIN_ID)
1531
0
    {
1532
        /*stop processing in case not available*/
1533
0
        *can_dissect_further = false;
1534
0
        return (offset - start_offset);
1535
0
    }
1536
5
    proto_tree_add_item(sir_tree, hf_lbmsrs_sir_domain_id, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_DOMAIN_ID, ENC_BIG_ENDIAN);
1537
5
    offset += L_LBM_SRS_SRC_INFO_INFO_T_DOMAIN_ID;
1538
1539
5
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_ENCRYPTION)
1540
0
    {
1541
        /*stop processing in case not available*/
1542
0
        *can_dissect_further = false;
1543
0
        return (offset - start_offset);
1544
0
    }
1545
5
    proto_tree_add_item(sir_tree, hf_lbmsrs_sir_encryption, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_ENCRYPTION, ENC_BIG_ENDIAN);
1546
5
    offset += L_LBM_SRS_SRC_INFO_INFO_T_ENCRYPTION;
1547
1548
5
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_COMPRESSION)
1549
0
    {
1550
        /*stop processing in case not available*/
1551
0
        *can_dissect_further = false;
1552
0
        return (offset - start_offset);
1553
0
    }
1554
5
    proto_tree_add_item(sir_tree, hf_lbmsrs_sir_compression, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_COMPRESSION, ENC_BIG_ENDIAN);
1555
5
    offset += L_LBM_SRS_SRC_INFO_INFO_T_COMPRESSION;
1556
1557
5
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_ULB_SRC_ID)
1558
0
    {
1559
        /*stop processing in case not available*/
1560
0
        *can_dissect_further = false;
1561
0
        return (offset - start_offset);
1562
0
    }
1563
5
    proto_tree_add_item(sir_tree, hf_lbmsrs_sir_ulb_src_id, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_ULB_SRC_ID, ENC_BIG_ENDIAN);
1564
5
    offset += L_LBM_SRS_SRC_INFO_INFO_T_ULB_SRC_ID;
1565
1566
5
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_ULB_QUEUE_ID)
1567
0
    {
1568
        /*stop processing in case not available*/
1569
0
        *can_dissect_further = false;
1570
0
        return (offset - start_offset);
1571
0
    }
1572
5
    proto_tree_add_item(sir_tree, hf_lbmsrs_sir_ulb_queue_id, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_ULB_QUEUE_ID, ENC_BIG_ENDIAN);
1573
5
    offset += L_LBM_SRS_SRC_INFO_INFO_T_ULB_QUEUE_ID;
1574
1575
5
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_ULB_REG_ID)
1576
0
    {
1577
        /*stop processing in case not available*/
1578
0
        *can_dissect_further = false;
1579
0
        return (offset - start_offset);
1580
0
    }
1581
5
    proto_tree_add_item(sir_tree, hf_lbmsrs_sir_ulb_reg_id, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_ULB_REG_ID, ENC_BIG_ENDIAN);
1582
5
    offset += L_LBM_SRS_SRC_INFO_INFO_T_ULB_REG_ID;
1583
1584
5
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_CONTEXT_INSTANCE)
1585
0
    {
1586
        /*stop processing in case not available*/
1587
0
        *can_dissect_further = false;
1588
0
        return (offset - start_offset);
1589
0
    }
1590
5
    proto_tree_add_item(sir_tree, hf_lbmsrs_sir_context_instance, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_CONTEXT_INSTANCE, ENC_NA);
1591
5
    offset += L_LBM_SRS_SRC_INFO_INFO_T_CONTEXT_INSTANCE;
1592
1593
5
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_CONTEXT_TYPE)
1594
0
    {
1595
        /*stop processing in case not available*/
1596
0
        *can_dissect_further = false;
1597
0
        return (offset - start_offset);
1598
0
    }
1599
5
    proto_tree_add_item(sir_tree, hf_lbmsrs_sir_context_type, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_CONTEXT_TYPE, ENC_BIG_ENDIAN);
1600
5
    offset += L_LBM_SRS_SRC_INFO_INFO_T_CONTEXT_TYPE;
1601
1602
5
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_VERSION)
1603
1
    {
1604
        /*stop processing in case not available*/
1605
1
        *can_dissect_further = false;
1606
1
        return (offset - start_offset);
1607
1
    }
1608
4
    proto_tree_add_item(sir_tree, hf_lbmsrs_sir_version, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_VERSION, ENC_BIG_ENDIAN);
1609
4
    offset += L_LBM_SRS_SRC_INFO_INFO_T_VERSION;
1610
1611
4
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_VERSION_FLAGS)
1612
0
    {
1613
        /*stop processing in case not available*/
1614
0
        *can_dissect_further = false;
1615
0
        return (offset - start_offset);
1616
0
    }
1617
4
    proto_tree_add_item(sir_tree, hf_lbmsrs_sir_version_flags, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_VERSION_FLAGS, ENC_BIG_ENDIAN);
1618
4
    offset += L_LBM_SRS_SRC_INFO_INFO_T_VERSION_FLAGS;
1619
1620
4
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_TTL)
1621
0
    {
1622
        /*stop processing in case not available*/
1623
0
        *can_dissect_further = false;
1624
0
        return (offset - start_offset);
1625
0
    }
1626
4
    proto_tree_add_item(sir_tree, hf_lbmsrs_sir_ttl, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_TTL, ENC_BIG_ENDIAN);
1627
4
    offset += L_LBM_SRS_SRC_INFO_INFO_T_TTL;
1628
1629
4
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_COST)
1630
1
    {
1631
        /*stop processing in case not available*/
1632
1
        *can_dissect_further = false;
1633
1
        return (offset - start_offset);
1634
1
    }
1635
3
    int32_t cost;
1636
3
    proto_tree_add_item_ret_int(sir_tree, hf_lbmsrs_sir_cost, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_COST, ENC_BIG_ENDIAN, &cost);
1637
3
    offset += L_LBM_SRS_SRC_INFO_INFO_T_COST;
1638
1639
3
    if (-1 == cost)
1640
1
    {
1641
1
        proto_item_set_text(batch_item, "SER:Topic:%s", name);
1642
1
        (*lcnt_ser)++;
1643
1
    }
1644
2
    else
1645
2
    {
1646
2
        proto_item_set_text(batch_item, "SIR:Topic:%s", name);
1647
2
        (*lcnt_sir)++;
1648
2
    }
1649
1650
1651
3
    proto_item_set_len(batch_item, (offset - start_offset));
1652
3
    return (offset - start_offset);
1653
4
}
1654
1655
static unsigned dissect_lbmsrs_sdr(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, unsigned offset, unsigned *lcnt_sdr, bool *can_dissect_further)
1656
0
{
1657
0
    unsigned total_payload_len = tvb_captured_length(tvb);
1658
0
    unsigned start_offset = offset;
1659
1660
    /*first field is OTID, check if that many bytes are left to process*/
1661
0
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_OTID)
1662
0
    {
1663
        /*stop processing in case not available*/
1664
0
        *can_dissect_further = false;
1665
0
        return 0;
1666
0
    }
1667
1668
    /*add a sub-tree for SDR */
1669
0
    proto_item * batch_item = proto_tree_add_none_format(tree, hf_lbmsrs_sdr, tvb, offset, -1, "SDR");
1670
0
    proto_tree *sdr_tree = proto_item_add_subtree(batch_item, ett_lbmsrs_sdr);
1671
1672
0
    proto_tree_add_item(sdr_tree, hf_lbmsrs_message_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1673
0
    offset += 2;
1674
1675
    /*first field is OTID, check if that many bytes are left to process*/
1676
0
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_OTID)
1677
0
    {
1678
        /*stop processing in case not available*/
1679
0
        *can_dissect_further = false;
1680
0
        return (offset - start_offset);
1681
0
    }
1682
1683
0
    proto_tree_add_item(sdr_tree, hf_lbmsrs_sdr_otid, tvb, offset, L_LBM_SRS_SRC_DELETE_INFO_T_OTID, ENC_NA);
1684
0
    offset += L_LBM_SRS_SRC_DELETE_INFO_T_OTID;
1685
1686
0
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_DELETE_INFO_T_TOPIC_LEN)
1687
0
    {
1688
        /*stop processing in case not available*/
1689
0
        *can_dissect_further = false;
1690
0
        return (offset - start_offset);
1691
0
    }
1692
0
    uint8_t topic_len = tvb_get_uint8(tvb, offset);
1693
0
    proto_tree_add_item(sdr_tree, hf_lbmsrs_sdr_topic_len, tvb, offset, L_LBM_SRS_SRC_DELETE_INFO_T_TOPIC_LEN, ENC_BIG_ENDIAN);
1694
1695
0
    offset += L_LBM_SRS_SRC_DELETE_INFO_T_TOPIC_LEN;
1696
1697
0
    if ((total_payload_len - offset) < topic_len)
1698
0
    {
1699
        /*stop processing in case not available*/
1700
0
        *can_dissect_further = false;
1701
0
        return (offset - start_offset);
1702
0
    }
1703
0
    const char* name;
1704
0
    proto_tree_add_item_ret_string(sdr_tree, hf_lbmsrs_sdr_topic, tvb, offset, topic_len, ENC_ASCII, pinfo->pool, (const uint8_t**)&name);
1705
0
    offset += topic_len;
1706
1707
0
    proto_item_set_text(batch_item, "SDR:Topic:%s", name);
1708
0
    (*lcnt_sdr)++;
1709
1710
0
    proto_item_set_len(batch_item, (offset - start_offset));
1711
0
    return (offset - start_offset);
1712
1713
0
}
1714
1715
static unsigned dissect_lbmsrs_rir(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, unsigned offset, unsigned *lcnt_rir, bool *can_dissect_further)
1716
2
{
1717
2
    unsigned total_payload_len = tvb_captured_length(tvb);
1718
2
    unsigned start_offset = offset;
1719
1720
    /*first field is Topic length, check if that many bytes are left to process*/
1721
2
    if ((total_payload_len - offset) < L_LBM_SRS_RCV_INFO_INFO_T_TOPIC_LEN)
1722
0
    {
1723
        /*stop processing in case not available*/
1724
0
        *can_dissect_further = false;
1725
0
        return 0;
1726
0
    }
1727
1728
    /*add a sub-tree for RIR */
1729
2
    proto_item * batch_item = proto_tree_add_none_format(tree, hf_lbmsrs_rir, tvb, offset, -1, "RIR");
1730
2
    proto_tree *rir_tree = proto_item_add_subtree(batch_item, ett_lbmsrs_rir);
1731
1732
2
    proto_tree_add_item(rir_tree, hf_lbmsrs_message_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1733
2
    offset += 2;
1734
1735
    /*first field is Topic length, check if that many bytes are left to process*/
1736
2
    if ((total_payload_len - offset) < L_LBM_SRS_RCV_INFO_INFO_T_TOPIC_LEN)
1737
0
    {
1738
        /*stop processing in case not available*/
1739
0
        *can_dissect_further = false;
1740
0
        return (offset - start_offset);
1741
0
    }
1742
1743
2
    uint8_t topic_len = tvb_get_uint8(tvb, offset);
1744
2
    proto_tree_add_item(rir_tree, hf_lbmsrs_rir_topic_len, tvb, offset, L_LBM_SRS_RCV_INFO_INFO_T_TOPIC_LEN, ENC_BIG_ENDIAN);
1745
1746
2
    offset += L_LBM_SRS_RCV_INFO_INFO_T_TOPIC_LEN;
1747
1748
2
    if ((total_payload_len - offset) < topic_len)
1749
1
    {
1750
        /*stop processing in case not available*/
1751
1
        *can_dissect_further = false;
1752
1
        return (offset - start_offset);
1753
1
    }
1754
1
    const char* name;
1755
1
    proto_tree_add_item_ret_string(rir_tree, hf_lbmsrs_rir_topic, tvb, offset, topic_len, ENC_ASCII, pinfo->pool, (const uint8_t**)&name);
1756
1
    offset += topic_len;
1757
1758
1
    if ((total_payload_len - offset) < L_LBM_SRS_RCV_INFO_INFO_T_DOMAIN_ID)
1759
0
    {
1760
        /*stop processing in case not available*/
1761
0
        *can_dissect_further = false;
1762
0
        return (offset - start_offset);
1763
0
    }
1764
1
    proto_tree_add_item(rir_tree, hf_lbmsrs_rir_domain_id, tvb, offset, L_LBM_SRS_RCV_INFO_INFO_T_DOMAIN_ID, ENC_BIG_ENDIAN);
1765
1
    offset += L_LBM_SRS_RCV_INFO_INFO_T_DOMAIN_ID;
1766
1767
1
    if ((total_payload_len - offset) < L_LBM_SRS_RCV_INFO_INFO_T_CONTEXT_INSTANCE)
1768
0
    {
1769
        /*stop processing in case not available*/
1770
0
        *can_dissect_further = false;
1771
0
        return (offset - start_offset);
1772
0
    }
1773
1
    proto_tree_add_item(rir_tree, hf_lbmsrs_rir_context_instance, tvb, offset, L_LBM_SRS_RCV_INFO_INFO_T_CONTEXT_INSTANCE, ENC_NA);
1774
1
    offset += L_LBM_SRS_RCV_INFO_INFO_T_CONTEXT_INSTANCE;
1775
1776
1
    if ((total_payload_len - offset) < L_LBM_SRS_RCV_INFO_INFO_T_CONTEXT_TYPE)
1777
0
    {
1778
        /*stop processing in case not available*/
1779
0
        *can_dissect_further = false;
1780
0
        return (offset - start_offset);
1781
0
    }
1782
1
    proto_tree_add_item(rir_tree, hf_lbmsrs_rir_context_type, tvb, offset, L_LBM_SRS_RCV_INFO_INFO_T_CONTEXT_TYPE, ENC_BIG_ENDIAN);
1783
1
    offset += L_LBM_SRS_RCV_INFO_INFO_T_CONTEXT_TYPE;
1784
1785
1
    if ((total_payload_len - offset) < L_LBM_SRS_RCV_INFO_INFO_T_VERSION)
1786
0
    {
1787
        /*stop processing in case not available*/
1788
0
        *can_dissect_further = false;
1789
0
        return (offset - start_offset);
1790
0
    }
1791
1
    proto_tree_add_item(rir_tree, hf_lbmsrs_rir_version, tvb, offset, L_LBM_SRS_RCV_INFO_INFO_T_VERSION, ENC_BIG_ENDIAN);
1792
1
    offset += L_LBM_SRS_RCV_INFO_INFO_T_VERSION;
1793
1794
1
    if ((total_payload_len - offset) < L_LBM_SRS_RCV_INFO_INFO_T_VERSION_FLAGS)
1795
0
    {
1796
        /*stop processing in case not available*/
1797
0
        *can_dissect_further = false;
1798
0
        return (offset - start_offset);
1799
0
    }
1800
1
    proto_tree_add_item(rir_tree, hf_lbmsrs_rir_version_flags, tvb, offset, L_LBM_SRS_RCV_INFO_INFO_T_VERSION_FLAGS, ENC_BIG_ENDIAN);
1801
1
    offset += L_LBM_SRS_RCV_INFO_INFO_T_VERSION_FLAGS;
1802
1803
1
    if ((total_payload_len - offset) < L_LBM_SRS_RCV_INFO_INFO_T_RESERVED)
1804
0
    {
1805
        /*stop processing in case not available*/
1806
0
        *can_dissect_further = false;
1807
0
        return (offset - start_offset);
1808
0
    }
1809
1
    proto_tree_add_item(rir_tree, hf_lbmsrs_rir_reserved, tvb, offset, L_LBM_SRS_RCV_INFO_INFO_T_RESERVED, ENC_BIG_ENDIAN);
1810
1
    offset += L_LBM_SRS_RCV_INFO_INFO_T_RESERVED;
1811
1812
1
    proto_item_set_text(batch_item, "RIR:Topic:%s", name);
1813
1
    (*lcnt_rir)++;
1814
1815
1
    proto_item_set_len(batch_item, (offset - start_offset));
1816
1
    return (offset - start_offset);
1817
1818
1
}
1819
1820
static unsigned dissect_lbmsrs_rer(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, unsigned offset, unsigned *lcnt_rer, bool *can_dissect_further)
1821
2
{
1822
2
    unsigned total_payload_len = tvb_captured_length(tvb);
1823
2
    unsigned start_offset = offset;
1824
1825
    /*first field is Topic length, check if that many bytes are left to process*/
1826
2
    if ((total_payload_len - offset) < L_LBM_SRS_RCV_END_INFO_T_TOPIC_LEN)
1827
0
    {
1828
        /*stop processing in case not available*/
1829
0
        *can_dissect_further = false;
1830
0
        return 0;
1831
0
    }
1832
1833
    /*add a sub-tree for RIR */
1834
2
    proto_item * batch_item = proto_tree_add_none_format(tree, hf_lbmsrs_rer, tvb, offset, -1, "RER");
1835
2
    proto_tree *rer_tree = proto_item_add_subtree(batch_item, ett_lbmsrs_rer);
1836
1837
2
    proto_tree_add_item(rer_tree, hf_lbmsrs_message_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1838
2
    offset += 2;
1839
1840
    /*first field is Topic length, check if that many bytes are left to process*/
1841
2
    if ((total_payload_len - offset) < L_LBM_SRS_RCV_END_INFO_T_TOPIC_LEN)
1842
0
    {
1843
        /*stop processing in case not available*/
1844
0
        *can_dissect_further = false;
1845
0
        return (offset - start_offset);
1846
0
    }
1847
1848
2
    uint8_t topic_len = tvb_get_uint8(tvb, offset);
1849
2
    proto_tree_add_item(rer_tree, hf_lbmsrs_rer_topic_len, tvb, offset, L_LBM_SRS_RCV_END_INFO_T_TOPIC_LEN, ENC_BIG_ENDIAN);
1850
1851
2
    offset += L_LBM_SRS_RCV_END_INFO_T_TOPIC_LEN;
1852
1853
2
    if ((total_payload_len - offset) < topic_len)
1854
1
    {
1855
        /*stop processing in case not available*/
1856
1
        *can_dissect_further = false;
1857
1
        return (offset - start_offset);
1858
1
    }
1859
1
    const char* name;
1860
1
    proto_tree_add_item_ret_string(rer_tree, hf_lbmsrs_rer_topic, tvb, offset, topic_len, ENC_ASCII, pinfo->pool, (const uint8_t**)&name);
1861
1
    offset += topic_len;
1862
1863
1
    if ((total_payload_len - offset) < L_LBM_SRS_RCV_END_INFO_T_DOMAIN_ID)
1864
0
    {
1865
        /*stop processing in case not available*/
1866
0
        *can_dissect_further = false;
1867
0
        return (offset - start_offset);
1868
0
    }
1869
1
    proto_tree_add_item(rer_tree, hf_lbmsrs_rer_domain_id, tvb, offset, L_LBM_SRS_RCV_END_INFO_T_DOMAIN_ID, ENC_BIG_ENDIAN);
1870
1
    offset += L_LBM_SRS_RCV_END_INFO_T_DOMAIN_ID;
1871
1872
1
    if ((total_payload_len - offset) < L_LBM_SRS_RCV_END_INFO_T_CONTEXT_INSTANCE)
1873
1
    {
1874
        /*stop processing in case not available*/
1875
1
        *can_dissect_further = false;
1876
1
        return (offset - start_offset);
1877
1
    }
1878
0
    proto_tree_add_item(rer_tree, hf_lbmsrs_rer_context_instance, tvb, offset, L_LBM_SRS_RCV_END_INFO_T_CONTEXT_INSTANCE, ENC_NA);
1879
0
    offset += L_LBM_SRS_RCV_END_INFO_T_CONTEXT_INSTANCE;
1880
1881
0
    if ((total_payload_len - offset) < L_LBM_SRS_RCV_END_INFO_T_CONTEXT_TYPE)
1882
0
    {
1883
        /*stop processing in case not available*/
1884
0
        *can_dissect_further = false;
1885
0
        return (offset - start_offset);
1886
0
    }
1887
0
    proto_tree_add_item(rer_tree, hf_lbmsrs_rer_context_type, tvb, offset, L_LBM_SRS_RCV_END_INFO_T_CONTEXT_TYPE, ENC_BIG_ENDIAN);
1888
0
    offset += L_LBM_SRS_RCV_END_INFO_T_CONTEXT_TYPE;
1889
1890
0
    if ((total_payload_len - offset) < L_LBM_SRS_RCV_END_INFO_T_VERSION)
1891
0
    {
1892
        /*stop processing in case not available*/
1893
0
        *can_dissect_further = false;
1894
0
        return (offset - start_offset);
1895
0
    }
1896
0
    proto_tree_add_item(rer_tree, hf_lbmsrs_rer_version, tvb, offset, L_LBM_SRS_RCV_END_INFO_T_VERSION, ENC_BIG_ENDIAN);
1897
0
    offset += L_LBM_SRS_RCV_END_INFO_T_VERSION;
1898
1899
0
    if ((total_payload_len - offset) < L_LBM_SRS_RCV_END_INFO_T_VERSION_FLAGS)
1900
0
    {
1901
        /*stop processing in case not available*/
1902
0
        *can_dissect_further = false;
1903
0
        return (offset - start_offset);
1904
0
    }
1905
0
    proto_tree_add_item(rer_tree, hf_lbmsrs_rer_version_flags, tvb, offset, L_LBM_SRS_RCV_END_INFO_T_VERSION_FLAGS, ENC_BIG_ENDIAN);
1906
0
    offset += L_LBM_SRS_RCV_END_INFO_T_VERSION_FLAGS;
1907
1908
1909
0
    if ((total_payload_len - offset) < L_LBM_SRS_RCV_END_INFO_T_RESERVED)
1910
0
    {
1911
        /*stop processing in case not available*/
1912
0
        *can_dissect_further = false;
1913
0
        return (offset - start_offset);
1914
0
    }
1915
0
    proto_tree_add_item(rer_tree, hf_lbmsrs_rer_reserved, tvb, offset, L_LBM_SRS_RCV_END_INFO_T_RESERVED, ENC_BIG_ENDIAN);
1916
0
    offset += L_LBM_SRS_RCV_END_INFO_T_RESERVED;
1917
1918
0
    proto_item_set_text(batch_item, "RER:Topic:%s", name);
1919
0
    (*lcnt_rer)++;
1920
1921
0
    proto_item_set_len(batch_item, (offset - start_offset));
1922
0
    return (offset - start_offset);
1923
1924
0
}
1925
1926
static unsigned dissect_lbmsrs_rdr(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, unsigned offset, unsigned *lcnt_rdr, bool *can_dissect_further)
1927
0
{
1928
0
    unsigned total_payload_len = tvb_captured_length(tvb);
1929
0
    unsigned start_offset = offset;
1930
1931
    /*first field is Topic length, check if that many bytes are left to process*/
1932
0
    if ((total_payload_len - offset) < L_LBM_SRS_RCV_DELETE_INFO_T_TOPIC_LEN)
1933
0
    {
1934
        /*stop processing in case not available*/
1935
0
        *can_dissect_further = false;
1936
0
        return 0;
1937
0
    }
1938
1939
    /*add a sub-tree for RIR */
1940
0
    proto_item * batch_item = proto_tree_add_none_format(tree, hf_lbmsrs_rdr, tvb, offset, -1, "RDR");
1941
0
    proto_tree *rdr_tree = proto_item_add_subtree(batch_item, ett_lbmsrs_rdr);
1942
1943
0
    proto_tree_add_item(rdr_tree, hf_lbmsrs_message_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1944
0
    offset += 2;
1945
1946
    /*first field is Topic length, check if that many bytes are left to process*/
1947
0
    if ((total_payload_len - offset) < L_LBM_SRS_RCV_DELETE_INFO_T_TOPIC_LEN)
1948
0
    {
1949
        /*stop processing in case not available*/
1950
0
        *can_dissect_further = false;
1951
0
        return (offset - start_offset);
1952
0
    }
1953
1954
0
    uint8_t topic_len = tvb_get_uint8(tvb, offset);
1955
0
    proto_tree_add_item(rdr_tree, hf_lbmsrs_rdr_topic_len, tvb, offset, L_LBM_SRS_RCV_DELETE_INFO_T_TOPIC_LEN, ENC_BIG_ENDIAN);
1956
1957
0
    offset += L_LBM_SRS_RCV_DELETE_INFO_T_TOPIC_LEN;
1958
1959
0
    if ((total_payload_len - offset) < topic_len)
1960
0
    {
1961
        /*stop processing in case not available*/
1962
0
        *can_dissect_further = false;
1963
0
        return (offset - start_offset);
1964
0
    }
1965
0
    const char* name;
1966
0
    proto_tree_add_item_ret_string(rdr_tree, hf_lbmsrs_rdr_topic, tvb, offset, topic_len, ENC_ASCII, pinfo->pool, (const uint8_t**)&name);
1967
0
    offset += topic_len;
1968
1969
0
    if ((total_payload_len - offset) < L_LBM_SRS_RCV_DELETE_INFO_T_DOMAIN_ID)
1970
0
    {
1971
        /*stop processing in case not available*/
1972
0
        *can_dissect_further = false;
1973
0
        return (offset - start_offset);
1974
0
    }
1975
0
    proto_tree_add_item(rdr_tree, hf_lbmsrs_rdr_domain_id, tvb, offset, L_LBM_SRS_RCV_DELETE_INFO_T_DOMAIN_ID, ENC_BIG_ENDIAN);
1976
0
    offset += L_LBM_SRS_RCV_DELETE_INFO_T_DOMAIN_ID;
1977
1978
0
    if ((total_payload_len - offset) < L_LBM_SRS_RCV_DELETE_INFO_T_CONTEXT_INSTANCE)
1979
0
    {
1980
        /*stop processing in case not available*/
1981
0
        *can_dissect_further = false;
1982
0
        return (offset - start_offset);
1983
0
    }
1984
0
    proto_tree_add_item(rdr_tree, hf_lbmsrs_rdr_context_instance, tvb, offset, L_LBM_SRS_RCV_DELETE_INFO_T_CONTEXT_INSTANCE, ENC_NA);
1985
0
    offset += L_LBM_SRS_RCV_DELETE_INFO_T_CONTEXT_INSTANCE;
1986
1987
0
    if ((total_payload_len - offset) < L_LBM_SRS_RCV_DELETE_INFO_T_CONTEXT_TYPE)
1988
0
    {
1989
        /*stop processing in case not available*/
1990
0
        *can_dissect_further = false;
1991
0
        return (offset - start_offset);
1992
0
    }
1993
0
    proto_tree_add_item(rdr_tree, hf_lbmsrs_rdr_context_type, tvb, offset, L_LBM_SRS_RCV_DELETE_INFO_T_CONTEXT_TYPE, ENC_BIG_ENDIAN);
1994
0
    offset += L_LBM_SRS_RCV_DELETE_INFO_T_CONTEXT_TYPE;
1995
1996
1997
0
    if ((total_payload_len - offset) < L_LBM_SRS_RCV_DELETE_INFO_T_VERSION)
1998
0
    {
1999
        /*stop processing in case not available*/
2000
0
        *can_dissect_further = false;
2001
0
        return (offset - start_offset);
2002
0
    }
2003
0
    proto_tree_add_item(rdr_tree, hf_lbmsrs_rdr_version, tvb, offset, L_LBM_SRS_RCV_DELETE_INFO_T_VERSION, ENC_BIG_ENDIAN);
2004
0
    offset += L_LBM_SRS_RCV_DELETE_INFO_T_VERSION;
2005
2006
0
    if ((total_payload_len - offset) < L_LBM_SRS_RCV_DELETE_INFO_T_VERSION_FLAGS)
2007
0
    {
2008
        /*stop processing in case not available*/
2009
0
        *can_dissect_further = false;
2010
0
        return (offset - start_offset);
2011
0
    }
2012
0
    proto_tree_add_item(rdr_tree, hf_lbmsrs_rdr_version_flags, tvb, offset, L_LBM_SRS_RCV_DELETE_INFO_T_VERSION_FLAGS, ENC_BIG_ENDIAN);
2013
0
    offset += L_LBM_SRS_RCV_INFO_INFO_T_VERSION_FLAGS;
2014
2015
0
    if ((total_payload_len - offset) < L_LBM_SRS_RCV_DELETE_INFO_T_RESERVED)
2016
0
    {
2017
        /*stop processing in case not available*/
2018
0
        *can_dissect_further = false;
2019
0
        return (offset - start_offset);
2020
0
    }
2021
0
    proto_tree_add_item(rdr_tree, hf_lbmsrs_rdr_reserved, tvb, offset, L_LBM_SRS_RCV_DELETE_INFO_T_RESERVED, ENC_BIG_ENDIAN);
2022
0
    offset += L_LBM_SRS_RCV_DELETE_INFO_T_RESERVED;
2023
2024
0
    proto_item_set_text(batch_item, "RDR:Topic:%s", name);
2025
0
    (*lcnt_rdr)++;
2026
2027
0
    proto_item_set_len(batch_item, (offset - start_offset));
2028
0
    return (offset - start_offset);
2029
2030
0
}
2031
2032
static unsigned dissect_lbmsrs_wir(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, unsigned offset, unsigned *lcnt_wir, bool *can_dissect_further)
2033
0
{
2034
0
    unsigned total_payload_len = tvb_captured_length(tvb);
2035
0
    unsigned start_offset = offset;
2036
2037
    /*first field is Topic length, check if that many bytes are left to process*/
2038
0
    if ((total_payload_len - offset) < L_LBM_SRS_WRCV_INFO_INFO_T_PATTERN_LEN)
2039
0
    {
2040
        /*stop processing in case not available*/
2041
0
        *can_dissect_further = false;
2042
0
        return 0;
2043
0
    }
2044
2045
    /*add a sub-tree for RIR */
2046
0
    proto_item * batch_item = proto_tree_add_none_format(tree, hf_lbmsrs_wir, tvb, offset, -1, "WIR");
2047
0
    proto_tree *wir_tree = proto_item_add_subtree(batch_item, ett_lbmsrs_wir);
2048
2049
0
    proto_tree_add_item(wir_tree, hf_lbmsrs_message_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2050
0
    offset += 2;
2051
2052
    /*first field is Topic length, check if that many bytes are left to process*/
2053
0
    if ((total_payload_len - offset) < L_LBM_SRS_WRCV_INFO_INFO_T_PATTERN_LEN)
2054
0
    {
2055
        /*stop processing in case not available*/
2056
0
        *can_dissect_further = false;
2057
0
        return (offset - start_offset);
2058
0
    }
2059
2060
0
    uint8_t pattern_len = tvb_get_uint8(tvb, offset);
2061
0
    proto_tree_add_item(wir_tree, hf_lbmsrs_wir_pattern_len, tvb, offset, L_LBM_SRS_WRCV_INFO_INFO_T_PATTERN_LEN, ENC_BIG_ENDIAN);
2062
2063
0
    offset += L_LBM_SRS_WRCV_INFO_INFO_T_PATTERN_LEN;
2064
2065
0
    if ((total_payload_len - offset) < pattern_len)
2066
0
    {
2067
        /*stop processing in case not available*/
2068
0
        *can_dissect_further = false;
2069
0
        return (offset - start_offset);
2070
0
    }
2071
0
    const char* name;
2072
0
    proto_tree_add_item_ret_string(wir_tree, hf_lbmsrs_wir_pattern, tvb, offset, pattern_len, ENC_ASCII, pinfo->pool, (const uint8_t**)&name);
2073
0
    offset += pattern_len;
2074
2075
0
    if ((total_payload_len - offset) < L_LBM_SRS_WRCV_INFO_INFO_T_DOMAIN_ID)
2076
0
    {
2077
        /*stop processing in case not available*/
2078
0
        *can_dissect_further = false;
2079
0
        return (offset - start_offset);
2080
0
    }
2081
0
    proto_tree_add_item(wir_tree, hf_lbmsrs_wir_domain_id, tvb, offset, L_LBM_SRS_WRCV_INFO_INFO_T_DOMAIN_ID, ENC_BIG_ENDIAN);
2082
0
    offset += L_LBM_SRS_WRCV_INFO_INFO_T_DOMAIN_ID;
2083
2084
0
    if ((total_payload_len - offset) < L_LBM_SRS_WRCV_INFO_INFO_T_CONTEXT_INSTANCE)
2085
0
    {
2086
        /*stop processing in case not available*/
2087
0
        *can_dissect_further = false;
2088
0
        return (offset - start_offset);
2089
0
    }
2090
0
    proto_tree_add_item(wir_tree, hf_lbmsrs_wir_context_instance, tvb, offset, L_LBM_SRS_WRCV_INFO_INFO_T_CONTEXT_INSTANCE, ENC_NA);
2091
0
    offset += L_LBM_SRS_WRCV_INFO_INFO_T_CONTEXT_INSTANCE;
2092
2093
0
    if ((total_payload_len - offset) < L_LBM_SRS_WRCV_INFO_INFO_T_CONTEXT_TYPE)
2094
0
    {
2095
        /*stop processing in case not available*/
2096
0
        *can_dissect_further = false;
2097
0
        return (offset - start_offset);
2098
0
    }
2099
0
    proto_tree_add_item(wir_tree, hf_lbmsrs_wir_context_type, tvb, offset, L_LBM_SRS_WRCV_INFO_INFO_T_CONTEXT_TYPE, ENC_BIG_ENDIAN);
2100
0
    offset += L_LBM_SRS_WRCV_INFO_INFO_T_CONTEXT_TYPE;
2101
2102
2103
0
    if ((total_payload_len - offset) < L_LBM_SRS_WRCV_INFO_INFO_T_VERSION)
2104
0
    {
2105
        /*stop processing in case not available*/
2106
0
        *can_dissect_further = false;
2107
0
        return (offset - start_offset);
2108
0
    }
2109
0
    proto_tree_add_item(wir_tree, hf_lbmsrs_wir_version, tvb, offset, L_LBM_SRS_WRCV_INFO_INFO_T_VERSION, ENC_BIG_ENDIAN);
2110
0
    offset += L_LBM_SRS_WRCV_INFO_INFO_T_VERSION;
2111
2112
0
    if ((total_payload_len - offset) < L_LBM_SRS_WRCV_INFO_INFO_T_VERSION_FLAGS)
2113
0
    {
2114
        /*stop processing in case not available*/
2115
0
        *can_dissect_further = false;
2116
0
        return (offset - start_offset);
2117
0
    }
2118
0
    proto_tree_add_item(wir_tree, hf_lbmsrs_wir_version_flags, tvb, offset, L_LBM_SRS_WRCV_INFO_INFO_T_VERSION_FLAGS, ENC_BIG_ENDIAN);
2119
0
    offset += L_LBM_SRS_WRCV_INFO_INFO_T_VERSION_FLAGS;
2120
2121
0
    if ((total_payload_len - offset) < L_LBM_SRS_WRCV_INFO_INFO_T_RESERVED)
2122
0
    {
2123
        /*stop processing in case not available*/
2124
0
        *can_dissect_further = false;
2125
0
        return (offset - start_offset);
2126
0
    }
2127
0
    proto_tree_add_item(wir_tree, hf_lbmsrs_wir_reserved, tvb, offset, L_LBM_SRS_WRCV_INFO_INFO_T_RESERVED, ENC_BIG_ENDIAN);
2128
0
    offset += L_LBM_SRS_WRCV_INFO_INFO_T_RESERVED;
2129
2130
0
    proto_item_set_text(batch_item, "WIR:Topic:%s", name);
2131
0
    (*lcnt_wir)++;
2132
2133
0
    proto_item_set_len(batch_item, (offset - start_offset));
2134
0
    return (offset - start_offset);
2135
2136
0
}
2137
2138
static unsigned dissect_lbmsrs_wdr(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, unsigned offset, unsigned *lcnt_wdr, bool *can_dissect_further)
2139
1
{
2140
1
    unsigned total_payload_len = tvb_captured_length(tvb);
2141
1
    unsigned start_offset = offset;
2142
2143
    /*first field is Topic length, check if that many bytes are left to process*/
2144
1
    if ((total_payload_len - offset) < L_LBM_SRS_WRCV_DELETE_INFO_T_PATTERN_LEN)
2145
0
    {
2146
        /*stop processing in case not available*/
2147
0
        *can_dissect_further = false;
2148
0
        return 0;
2149
0
    }
2150
2151
    /*add a sub-tree for RIR */
2152
1
    proto_item * batch_item = proto_tree_add_none_format(tree, hf_lbmsrs_wdr, tvb, offset, -1, "WDR");
2153
1
    proto_tree *wdr_tree = proto_item_add_subtree(batch_item, ett_lbmsrs_wdr);
2154
2155
1
    proto_tree_add_item(wdr_tree, hf_lbmsrs_message_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2156
1
    offset += 2;
2157
2158
    /*first field is Topic length, check if that many bytes are left to process*/
2159
1
    if ((total_payload_len - offset) < L_LBM_SRS_WRCV_DELETE_INFO_T_PATTERN_LEN)
2160
0
    {
2161
        /*stop processing in case not available*/
2162
0
        *can_dissect_further = false;
2163
0
        return (offset - start_offset);
2164
0
    }
2165
2166
1
    uint8_t pattern_len = tvb_get_uint8(tvb, offset);
2167
1
    proto_tree_add_item(wdr_tree, hf_lbmsrs_wdr_pattern_len, tvb, offset, L_LBM_SRS_WRCV_DELETE_INFO_T_PATTERN_LEN, ENC_BIG_ENDIAN);
2168
2169
1
    offset += L_LBM_SRS_WRCV_DELETE_INFO_T_PATTERN_LEN;
2170
2171
1
    if ((total_payload_len - offset) < pattern_len)
2172
0
    {
2173
        /*stop processing in case not available*/
2174
0
        *can_dissect_further = false;
2175
0
        return (offset - start_offset);
2176
0
    }
2177
1
    const char* name;
2178
1
    proto_tree_add_item_ret_string(wdr_tree, hf_lbmsrs_wdr_pattern, tvb, offset, pattern_len, ENC_ASCII, pinfo->pool, (const uint8_t**)&name);
2179
1
    offset += pattern_len;
2180
2181
1
    if ((total_payload_len - offset) < L_LBM_SRS_WRCV_DELETE_INFO_T_DOMAIN_ID)
2182
1
    {
2183
        /*stop processing in case not available*/
2184
1
        *can_dissect_further = false;
2185
1
        return (offset - start_offset);
2186
1
    }
2187
0
    proto_tree_add_item(wdr_tree, hf_lbmsrs_wdr_domain_id, tvb, offset, L_LBM_SRS_WRCV_DELETE_INFO_T_DOMAIN_ID, ENC_BIG_ENDIAN);
2188
0
    offset += L_LBM_SRS_WRCV_DELETE_INFO_T_DOMAIN_ID;
2189
2190
0
    if ((total_payload_len - offset) < L_LBM_SRS_WRCV_DELETE_INFO_T_CONTEXT_INSTANCE)
2191
0
    {
2192
        /*stop processing in case not available*/
2193
0
        *can_dissect_further = false;
2194
0
        return (offset - start_offset);
2195
0
    }
2196
0
    proto_tree_add_item(wdr_tree, hf_lbmsrs_wdr_context_instance, tvb, offset, L_LBM_SRS_WRCV_DELETE_INFO_T_CONTEXT_INSTANCE, ENC_NA);
2197
0
    offset += L_LBM_SRS_WRCV_DELETE_INFO_T_CONTEXT_INSTANCE;
2198
2199
0
    if ((total_payload_len - offset) < L_LBM_SRS_WRCV_DELETE_INFO_T_CONTEXT_TYPE)
2200
0
    {
2201
        /*stop processing in case not available*/
2202
0
        *can_dissect_further = false;
2203
0
        return (offset - start_offset);
2204
0
    }
2205
0
    proto_tree_add_item(wdr_tree, hf_lbmsrs_wdr_context_type, tvb, offset, L_LBM_SRS_WRCV_DELETE_INFO_T_CONTEXT_TYPE, ENC_BIG_ENDIAN);
2206
0
    offset += L_LBM_SRS_WRCV_DELETE_INFO_T_CONTEXT_TYPE;
2207
2208
2209
0
    if ((total_payload_len - offset) < L_LBM_SRS_WRCV_DELETE_INFO_T_VERSION)
2210
0
    {
2211
        /*stop processing in case not available*/
2212
0
        *can_dissect_further = false;
2213
0
        return (offset - start_offset);
2214
0
    }
2215
0
    proto_tree_add_item(wdr_tree, hf_lbmsrs_wdr_version, tvb, offset, L_LBM_SRS_WRCV_DELETE_INFO_T_VERSION, ENC_BIG_ENDIAN);
2216
0
    offset += L_LBM_SRS_WRCV_DELETE_INFO_T_VERSION;
2217
2218
0
    if ((total_payload_len - offset) < L_LBM_SRS_WRCV_DELETE_INFO_T_VERSION_FLAGS)
2219
0
    {
2220
        /*stop processing in case not available*/
2221
0
        *can_dissect_further = false;
2222
0
        return (offset - start_offset);
2223
0
    }
2224
0
    proto_tree_add_item(wdr_tree, hf_lbmsrs_wdr_version_flags, tvb, offset, L_LBM_SRS_WRCV_DELETE_INFO_T_VERSION_FLAGS, ENC_BIG_ENDIAN);
2225
0
    offset += L_LBM_SRS_WRCV_DELETE_INFO_T_VERSION_FLAGS;
2226
2227
0
    if ((total_payload_len - offset) < L_LBM_SRS_WRCV_DELETE_INFO_T_RESERVED)
2228
0
    {
2229
        /*stop processing in case not available*/
2230
0
        *can_dissect_further = false;
2231
0
        return (offset - start_offset);
2232
0
    }
2233
0
    proto_tree_add_item(wdr_tree, hf_lbmsrs_wdr_reserved, tvb, offset, L_LBM_SRS_WRCV_DELETE_INFO_T_RESERVED, ENC_BIG_ENDIAN);
2234
0
    offset += L_LBM_SRS_WRCV_DELETE_INFO_T_RESERVED;
2235
2236
0
    proto_item_set_text(batch_item, "WDR:Topic:%s", name);
2237
0
    (*lcnt_wdr)++;
2238
2239
0
    proto_item_set_len(batch_item, (offset - start_offset));
2240
0
    return (offset - start_offset);
2241
2242
0
}
2243
2244
static unsigned dissect_lbmsrs_wer(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, unsigned offset, unsigned *lcnt_wer, bool *can_dissect_further)
2245
0
{
2246
0
    unsigned total_payload_len = tvb_captured_length(tvb);
2247
0
    int start_offset = offset;
2248
2249
    /*first field is Topic length, check if that many bytes are left to process*/
2250
0
    if ((total_payload_len - offset) < L_LBM_SRS_WRCV_END_INFO_T_PATTERN_LEN)
2251
0
    {
2252
        /*stop processing in case not available*/
2253
0
        *can_dissect_further = false;
2254
0
        return 0;
2255
0
    }
2256
2257
    /*add a sub-tree for WER */
2258
0
    proto_item * batch_item = proto_tree_add_none_format(tree, hf_lbmsrs_wer, tvb, offset, -1, "WER");
2259
0
    proto_tree *wer_tree = proto_item_add_subtree(batch_item, ett_lbmsrs_wer);
2260
2261
0
    proto_tree_add_item(wer_tree, hf_lbmsrs_message_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2262
0
    offset += 2;
2263
2264
    /*first field is Topic length, check if that many bytes are left to process*/
2265
0
    if ((total_payload_len - offset) < L_LBM_SRS_WRCV_END_INFO_T_PATTERN_LEN)
2266
0
    {
2267
        /*stop processing in case not available*/
2268
0
        *can_dissect_further = false;
2269
0
        return (offset - start_offset);
2270
0
    }
2271
2272
0
    uint8_t pattern_len = tvb_get_uint8(tvb, offset);
2273
0
    proto_tree_add_item(wer_tree, hf_lbmsrs_wer_pattern_len, tvb, offset, L_LBM_SRS_WRCV_END_INFO_T_PATTERN_LEN, ENC_BIG_ENDIAN);
2274
2275
0
    offset += L_LBM_SRS_WRCV_END_INFO_T_PATTERN_LEN;
2276
2277
0
    if ((total_payload_len - offset) < pattern_len)
2278
0
    {
2279
        /*stop processing in case not available*/
2280
0
        *can_dissect_further = false;
2281
0
        return (offset - start_offset);
2282
0
    }
2283
0
    const char* name;
2284
0
    proto_tree_add_item_ret_string(wer_tree, hf_lbmsrs_wer_pattern, tvb, offset, pattern_len, ENC_ASCII, pinfo->pool, (const uint8_t**)&name);
2285
0
    offset += pattern_len;
2286
2287
0
    if ((total_payload_len - offset) < L_LBM_SRS_WRCV_END_INFO_T_DOMAIN_ID)
2288
0
    {
2289
        /*stop processing in case not available*/
2290
0
        *can_dissect_further = false;
2291
0
        return (offset - start_offset);
2292
0
    }
2293
0
    proto_tree_add_item(wer_tree, hf_lbmsrs_wer_domain_id, tvb, offset, L_LBM_SRS_WRCV_END_INFO_T_DOMAIN_ID, ENC_BIG_ENDIAN);
2294
0
    offset += L_LBM_SRS_WRCV_END_INFO_T_DOMAIN_ID;
2295
2296
0
    if ((total_payload_len - offset) < L_LBM_SRS_WRCV_END_INFO_T_CONTEXT_INSTANCE)
2297
0
    {
2298
        /*stop processing in case not available*/
2299
0
        *can_dissect_further = false;
2300
0
        return (offset - start_offset);
2301
0
    }
2302
0
    proto_tree_add_item(wer_tree, hf_lbmsrs_wer_context_instance, tvb, offset, L_LBM_SRS_WRCV_END_INFO_T_CONTEXT_INSTANCE, ENC_NA);
2303
0
    offset += L_LBM_SRS_WRCV_END_INFO_T_CONTEXT_INSTANCE;
2304
2305
0
    if ((total_payload_len - offset) < L_LBM_SRS_WRCV_END_INFO_T_CONTEXT_TYPE)
2306
0
    {
2307
        /*stop processing in case not available*/
2308
0
        *can_dissect_further = false;
2309
0
        return (offset - start_offset);
2310
0
    }
2311
0
    proto_tree_add_item(wer_tree, hf_lbmsrs_wer_context_type, tvb, offset, L_LBM_SRS_WRCV_END_INFO_T_CONTEXT_TYPE, ENC_BIG_ENDIAN);
2312
0
    offset += L_LBM_SRS_WRCV_END_INFO_T_CONTEXT_TYPE;
2313
2314
0
    if ((total_payload_len - offset) < L_LBM_SRS_WRCV_END_INFO_T_VERSION)
2315
0
    {
2316
        /*stop processing in case not available*/
2317
0
        *can_dissect_further = false;
2318
0
        return (offset - start_offset);
2319
0
    }
2320
0
    proto_tree_add_item(wer_tree, hf_lbmsrs_wer_version, tvb, offset, L_LBM_SRS_WRCV_END_INFO_T_VERSION, ENC_BIG_ENDIAN);
2321
0
    offset += L_LBM_SRS_WRCV_END_INFO_T_VERSION;
2322
2323
0
    if ((total_payload_len - offset) < L_LBM_SRS_WRCV_END_INFO_T_VERSION_FLAGS)
2324
0
    {
2325
        /*stop processing in case not available*/
2326
0
        *can_dissect_further = false;
2327
0
        return (offset - start_offset);
2328
0
    }
2329
0
    proto_tree_add_item(wer_tree, hf_lbmsrs_wer_version_flags, tvb, offset, L_LBM_SRS_WRCV_END_INFO_T_VERSION_FLAGS, ENC_BIG_ENDIAN);
2330
0
    offset += L_LBM_SRS_WRCV_END_INFO_T_VERSION_FLAGS;
2331
2332
0
    if ((total_payload_len - offset) < L_LBM_SRS_WRCV_END_INFO_T_RESERVED)
2333
0
    {
2334
        /*stop processing in case not available*/
2335
0
        *can_dissect_further = false;
2336
0
        return (offset - start_offset);
2337
0
    }
2338
0
    proto_tree_add_item(wer_tree, hf_lbmsrs_wer_reserved, tvb, offset, L_LBM_SRS_WRCV_END_INFO_T_RESERVED, ENC_BIG_ENDIAN);
2339
0
    offset += L_LBM_SRS_WRCV_END_INFO_T_RESERVED;
2340
2341
0
    proto_item_set_text(batch_item, "WER:Topic:%s", name);
2342
0
    (*lcnt_wer)++;
2343
2344
0
    proto_item_set_len(batch_item, (offset - start_offset));
2345
0
    return (offset - start_offset);
2346
2347
0
}
2348
2349
static unsigned dissect_lbmsrs_sli(tvbuff_t * tvb, packet_info * pinfo,  proto_tree * tree, unsigned offset, unsigned *lcnt_sli, bool *can_dissect_further)
2350
13
{
2351
13
    unsigned total_payload_len = tvb_captured_length(tvb);
2352
13
    unsigned start_offset = offset;
2353
2354
    /*first field is OTID, check if that many bytes are left to process*/
2355
13
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_LEAVE_INFO_T_OTID)
2356
1
    {
2357
        /*stop processing in case not available*/
2358
1
        *can_dissect_further = false;
2359
1
        return 0;
2360
1
    }
2361
2362
12
    proto_item *batch_item = NULL;
2363
2364
12
    batch_item = proto_tree_add_none_format(tree, hf_lbmsrs_sli, tvb, offset, -1, "SLI");
2365
12
    proto_tree *sli_tree = proto_item_add_subtree(batch_item, ett_lbmsrs_sli);
2366
2367
12
    proto_tree_add_item(sli_tree, hf_lbmsrs_message_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2368
12
    offset += 2;
2369
2370
12
    proto_tree_add_item(sli_tree, hf_lbmsrs_sli_otid, tvb, offset, L_LBM_SRS_SRC_LEAVE_INFO_T_OTID, ENC_NA);
2371
12
    offset += L_LBM_SRS_SRC_LEAVE_INFO_T_OTID;
2372
2373
12
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_LEAVE_INFO_T_TOPIC_LEN)
2374
1
    {
2375
        /*stop processing in case not available*/
2376
1
        *can_dissect_further = false;
2377
1
        return (offset - start_offset);
2378
1
    }
2379
11
    uint8_t topic_len = tvb_get_uint8(tvb, offset);
2380
11
    proto_tree_add_item(sli_tree, hf_lbmsrs_sli_topic_len, tvb, offset, L_LBM_SRS_SRC_LEAVE_INFO_T_TOPIC_LEN, ENC_BIG_ENDIAN);
2381
11
    offset += L_LBM_SRS_SRC_LEAVE_INFO_T_TOPIC_LEN;
2382
2383
11
    if ((total_payload_len - offset) < topic_len)
2384
1
    {
2385
        /*stop processing in case not available*/
2386
1
        *can_dissect_further = false;
2387
1
        return (offset - start_offset);
2388
1
    }
2389
10
    const char* name;
2390
10
    proto_tree_add_item_ret_string(sli_tree, hf_lbmsrs_sli_topic, tvb, offset, topic_len, ENC_ASCII, pinfo->pool, (const uint8_t**)&name);
2391
10
    offset += topic_len;
2392
2393
10
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_LEAVE_INFO_T_SOURCE_LEN)
2394
1
    {
2395
        /*stop processing in case not available*/
2396
1
        *can_dissect_further = false;
2397
1
        return (offset - start_offset);
2398
1
    }
2399
9
    uint8_t source_len = tvb_get_uint8(tvb, offset);
2400
9
    proto_tree_add_item(sli_tree, hf_lbmsrs_sli_source_len, tvb, offset, L_LBM_SRS_SRC_LEAVE_INFO_T_SOURCE_LEN, ENC_BIG_ENDIAN);
2401
9
    offset += L_LBM_SRS_SRC_LEAVE_INFO_T_SOURCE_LEN;
2402
2403
9
    if ((total_payload_len - offset) < source_len)
2404
1
    {
2405
        /*stop processing in case not available*/
2406
1
        *can_dissect_further = false;
2407
1
        return (offset - start_offset);
2408
1
    }
2409
8
    proto_tree_add_item(sli_tree, hf_lbmsrs_sli_source, tvb, offset, source_len, ENC_ASCII);
2410
8
    offset += source_len;
2411
2412
8
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_LEAVE_INFO_T_CONTEXT_INSTANCE)
2413
1
    {
2414
        /*stop processing in case not available*/
2415
1
        *can_dissect_further = false;
2416
1
        return (offset - start_offset);
2417
1
    }
2418
7
    proto_tree_add_item(sli_tree, hf_lbmsrs_sli_context_instance, tvb, offset, L_LBM_SRS_SRC_LEAVE_INFO_T_CONTEXT_INSTANCE, ENC_NA);
2419
7
    offset += L_LBM_SRS_SRC_LEAVE_INFO_T_CONTEXT_INSTANCE;
2420
2421
7
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_LEAVE_INFO_T_CONTEXT_TYPE)
2422
1
    {
2423
        /*stop processing in case not available*/
2424
1
        *can_dissect_further = false;
2425
1
        return (offset - start_offset);
2426
1
    }
2427
6
    proto_tree_add_item(sli_tree, hf_lbmsrs_sli_context_type, tvb, offset, L_LBM_SRS_SRC_LEAVE_INFO_T_CONTEXT_TYPE, ENC_BIG_ENDIAN);
2428
6
    offset += L_LBM_SRS_SRC_LEAVE_INFO_T_CONTEXT_TYPE;
2429
2430
2431
6
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_LEAVE_INFO_T_VERSION)
2432
1
    {
2433
        /*stop processing in case not available*/
2434
1
        *can_dissect_further = false;
2435
1
        return (offset - start_offset);
2436
1
    }
2437
5
    proto_tree_add_item(sli_tree, hf_lbmsrs_sli_version, tvb, offset, L_LBM_SRS_SRC_LEAVE_INFO_T_VERSION, ENC_BIG_ENDIAN);
2438
5
    offset += L_LBM_SRS_SRC_LEAVE_INFO_T_VERSION;
2439
2440
5
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_LEAVE_INFO_T_VERSION_FLAGS)
2441
1
    {
2442
        /*stop processing in case not available*/
2443
1
        *can_dissect_further = false;
2444
1
        return (offset - start_offset);
2445
1
    }
2446
4
    proto_tree_add_item(sli_tree, hf_lbmsrs_sli_version_flags, tvb, offset, L_LBM_SRS_SRC_LEAVE_INFO_T_VERSION_FLAGS, ENC_BIG_ENDIAN);
2447
4
    offset += L_LBM_SRS_SRC_LEAVE_INFO_T_VERSION_FLAGS;
2448
2449
2450
4
    if ((total_payload_len - offset) < L_LBM_SRS_SRC_LEAVE_INFO_T_RESERVED)
2451
1
    {
2452
        /*stop processing in case not available*/
2453
1
        *can_dissect_further = false;
2454
1
        return (offset - start_offset);
2455
1
    }
2456
3
    proto_tree_add_item(sli_tree, hf_lbmsrs_sli_reserved, tvb, offset, L_LBM_SRS_SRC_LEAVE_INFO_T_RESERVED, ENC_BIG_ENDIAN);
2457
3
    offset += L_LBM_SRS_SRC_LEAVE_INFO_T_RESERVED;
2458
2459
3
    proto_item_set_text(batch_item, "SLI:Topic:%s", name);
2460
3
    (*lcnt_sli)++;
2461
2462
3
    proto_item_set_len(batch_item, (offset - start_offset));
2463
3
    return (offset - start_offset);
2464
4
}
2465
2466
static unsigned dissect_lbmsrs_rti(tvbuff_t * tvb, proto_tree * tree, unsigned offset, unsigned *lcnt_rti, bool *can_dissect_further)
2467
0
{
2468
0
    unsigned total_payload_len = tvb_captured_length(tvb);
2469
0
    unsigned start_offset = offset;
2470
2471
0
    if ((total_payload_len - offset) < L_LBM_SRS_ROUTE_INFO_T_NUM_DOMAINS)
2472
0
    {
2473
        /*stop processing in case not available*/
2474
0
        *can_dissect_further = FALSE;
2475
0
        return 0;
2476
0
    }
2477
2478
0
    proto_item *batch_item = NULL;
2479
2480
0
    batch_item = proto_tree_add_none_format(tree, hf_lbmsrs_rti, tvb, offset, -1, "RTI");
2481
0
    proto_tree *rti_tree = proto_item_add_subtree(batch_item, ett_lbmsrs_rti);
2482
2483
0
    proto_tree_add_item(rti_tree, hf_lbmsrs_message_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2484
0
    offset += 2;
2485
2486
0
    uint16_t num_domains = tvb_get_uint16(tvb, offset, ENC_BIG_ENDIAN);
2487
0
    proto_tree_add_item(rti_tree, hf_lbmsrs_rti_num_domains, tvb, offset, L_LBM_SRS_ROUTE_INFO_T_NUM_DOMAINS, ENC_BIG_ENDIAN);
2488
0
    offset += L_LBM_SRS_ROUTE_INFO_T_NUM_DOMAINS;
2489
2490
    /*size of each domain is uint32, calculate total size*/
2491
0
    uint32_t all_domain_size = sizeof(lbm_uint32_t) * num_domains;
2492
2493
0
    if ((total_payload_len - offset) < all_domain_size)
2494
0
    {
2495
        /*stop processing in case not available*/
2496
0
        *can_dissect_further = FALSE;
2497
0
        return (offset - start_offset);
2498
0
    }
2499
2500
    /*create a domain tree as a sub-tree*/
2501
0
    if (num_domains > 0)
2502
0
    {
2503
0
        proto_item *domains = proto_tree_add_none_format(rti_tree, hf_lbmsrs_rti_domains, tvb, offset, -1, "Domains:");
2504
0
        proto_tree *domains_tree = proto_item_add_subtree(domains, ett_lbmsrs_rti_domains);
2505
        /*add all the domains in the domain tree*/
2506
0
        for (uint16_t idx = 0; idx < num_domains; idx++)
2507
0
        {
2508
0
            proto_tree_add_item(domains_tree, hf_lbmsrs_rti_domain, tvb, offset, sizeof(lbm_uint32_t), ENC_BIG_ENDIAN);
2509
0
            offset += sizeof(lbm_uint32_t);
2510
0
        }
2511
2512
0
        proto_item_set_len(domains, all_domain_size);
2513
0
    }
2514
2515
0
    if ((total_payload_len - offset) < L_LBM_SRS_ROUTE_INFO_T_IP)
2516
0
    {
2517
        /*stop processing in case not available*/
2518
0
        *can_dissect_further = FALSE;
2519
0
        return (offset - start_offset);
2520
0
    }
2521
2522
0
    proto_tree_add_item(rti_tree, hf_lbmsrs_rti_ip, tvb, offset, L_LBM_SRS_ROUTE_INFO_T_IP, ENC_BIG_ENDIAN);
2523
0
    offset += L_LBM_SRS_ROUTE_INFO_T_IP;
2524
2525
0
    if ((total_payload_len - offset) < L_LBM_SRS_ROUTE_INFO_T_PORT)
2526
0
    {
2527
        /*stop processing in case not available*/
2528
0
        *can_dissect_further = FALSE;
2529
0
        return (offset - start_offset);
2530
0
    }
2531
2532
0
    proto_tree_add_item(rti_tree, hf_lbmsrs_rti_port, tvb, offset, L_LBM_SRS_ROUTE_INFO_T_PORT, ENC_BIG_ENDIAN);
2533
0
    offset += L_LBM_SRS_ROUTE_INFO_T_PORT;
2534
2535
0
    if ((total_payload_len - offset) < L_LBM_SRS_ROUTE_INFO_T_CONTEXT_INSTANCE)
2536
0
    {
2537
        /*stop processing in case not available*/
2538
0
        *can_dissect_further = FALSE;
2539
0
        return (offset - start_offset);
2540
0
    }
2541
0
    proto_tree_add_item(rti_tree, hf_lbmsrs_rti_context_instance, tvb, offset, L_LBM_SRS_ROUTE_INFO_T_CONTEXT_INSTANCE, ENC_NA);
2542
0
    offset += L_LBM_SRS_ROUTE_INFO_T_CONTEXT_INSTANCE;
2543
2544
0
    if ((total_payload_len - offset) < L_LBM_SRS_ROUTE_INFO_T_CONTEXT_TYPE)
2545
0
    {
2546
        /*stop processing in case not available*/
2547
0
        *can_dissect_further = FALSE;
2548
0
        return (offset - start_offset);
2549
0
    }
2550
0
    proto_tree_add_item(rti_tree, hf_lbmsrs_rti_context_type, tvb, offset, L_LBM_SRS_ROUTE_INFO_T_CONTEXT_TYPE, ENC_BIG_ENDIAN);
2551
0
    offset += L_LBM_SRS_ROUTE_INFO_T_CONTEXT_TYPE;
2552
2553
2554
0
    if ((total_payload_len - offset) < L_LBM_SRS_ROUTE_INFO_T_VERSION)
2555
0
    {
2556
        /*stop processing in case not available*/
2557
0
        *can_dissect_further = FALSE;
2558
0
        return (offset - start_offset);
2559
0
    }
2560
0
    proto_tree_add_item(rti_tree, hf_lbmsrs_rti_version, tvb, offset, L_LBM_SRS_ROUTE_INFO_T_VERSION, ENC_BIG_ENDIAN);
2561
0
    offset += L_LBM_SRS_ROUTE_INFO_T_VERSION;
2562
2563
0
    if ((total_payload_len - offset) < L_LBM_SRS_ROUTE_INFO_T_VERSION_FLAGS)
2564
0
    {
2565
        /*stop processing in case not available*/
2566
0
        *can_dissect_further = FALSE;
2567
0
        return (offset - start_offset);
2568
0
    }
2569
0
    proto_tree_add_item(rti_tree, hf_lbmsrs_rti_version_flags, tvb, offset, L_LBM_SRS_ROUTE_INFO_T_VERSION_FLAGS, ENC_BIG_ENDIAN);
2570
0
    offset += L_LBM_SRS_ROUTE_INFO_T_VERSION_FLAGS;
2571
2572
2573
0
    if ((total_payload_len - offset) < L_LBM_SRS_ROUTE_INFO_T_ROUTE_INDEX)
2574
0
    {
2575
        /*stop processing in case not available*/
2576
0
        *can_dissect_further = FALSE;
2577
0
        return (offset - start_offset);
2578
0
    }
2579
0
    proto_tree_add_item(rti_tree, hf_lbmsrs_rti_route_index, tvb, offset, L_LBM_SRS_ROUTE_INFO_T_ROUTE_INDEX, ENC_BIG_ENDIAN);
2580
0
    offset += L_LBM_SRS_ROUTE_INFO_T_ROUTE_INDEX;
2581
2582
0
    if ((total_payload_len - offset) < L_LBM_SRS_ROUTE_INFO_T_RESERVED)
2583
0
    {
2584
        /*stop processing in case not available*/
2585
0
        *can_dissect_further = FALSE;
2586
0
        return (offset - start_offset);
2587
0
    }
2588
0
    proto_tree_add_item(rti_tree, hf_lbmsrs_rti_reserved, tvb, offset, L_LBM_SRS_ROUTE_INFO_T_RESERVED, ENC_BIG_ENDIAN);
2589
0
    offset += L_LBM_SRS_ROUTE_INFO_T_RESERVED;
2590
2591
0
    (*lcnt_rti)++;
2592
2593
0
    proto_item_set_len(batch_item, (offset - start_offset));
2594
0
    return (offset - start_offset);
2595
0
}
2596
2597
static unsigned dissect_lbmsrs_rte(tvbuff_t * tvb, proto_tree * tree, unsigned offset, unsigned *lcnt_rte, bool *can_dissect_further)
2598
1
{
2599
1
    unsigned total_payload_len = tvb_captured_length(tvb);
2600
1
    unsigned start_offset = offset;
2601
2602
1
    if ((total_payload_len - offset) < L_LBM_SRS_ROUTE_END_T_NUM_DOMAINS)
2603
0
    {
2604
        /*stop processing in case not available*/
2605
0
        *can_dissect_further = FALSE;
2606
0
        return 0;
2607
0
    }
2608
2609
1
    proto_item *batch_item = NULL;
2610
2611
1
    batch_item = proto_tree_add_none_format(tree, hf_lbmsrs_rte, tvb, offset, -1, "RTE");
2612
1
    proto_tree *rte_tree = proto_item_add_subtree(batch_item, ett_lbmsrs_rte);
2613
2614
1
    proto_tree_add_item(rte_tree, hf_lbmsrs_message_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2615
1
    offset += 2;
2616
2617
1
    uint16_t num_domains = tvb_get_uint16(tvb, offset, ENC_BIG_ENDIAN);
2618
1
    proto_tree_add_item(rte_tree, hf_lbmsrs_rte_num_domains, tvb, offset, L_LBM_SRS_ROUTE_END_T_NUM_DOMAINS, ENC_BIG_ENDIAN);
2619
1
    offset += L_LBM_SRS_ROUTE_END_T_NUM_DOMAINS;
2620
2621
    /*size of each domain is uint32, calculate total size*/
2622
1
    uint32_t all_domain_size = sizeof(lbm_uint32_t) * num_domains;
2623
2624
1
    if ((total_payload_len - offset) < all_domain_size)
2625
1
    {
2626
        /*stop processing in case not available*/
2627
1
        *can_dissect_further = FALSE;
2628
1
        return (offset - start_offset);
2629
1
    }
2630
2631
    /*create a domain tree as a sub-tree*/
2632
0
    if (num_domains > 0)
2633
0
    {
2634
0
        proto_item *domains = proto_tree_add_none_format(rte_tree, hf_lbmsrs_rte_domains, tvb, offset, -1, "Domains:");
2635
0
        proto_tree *domains_tree = proto_item_add_subtree(domains, ett_lbmsrs_rte_domains);
2636
        /*add all the domains in the domain tree*/
2637
0
        for (uint16_t idx = 0; idx < num_domains; idx++)
2638
0
        {
2639
0
            proto_tree_add_item(domains_tree, hf_lbmsrs_rte_domain, tvb, offset, sizeof(lbm_uint32_t), ENC_BIG_ENDIAN);
2640
0
            offset += sizeof(lbm_uint32_t);
2641
0
        }
2642
2643
0
        proto_item_set_len(domains, all_domain_size);
2644
0
    }
2645
2646
0
    if ((total_payload_len - offset) < L_LBM_SRS_ROUTE_END_T_IP)
2647
0
    {
2648
        /*stop processing in case not available*/
2649
0
        *can_dissect_further = FALSE;
2650
0
        return (offset - start_offset);
2651
0
    }
2652
2653
0
    proto_tree_add_item(rte_tree, hf_lbmsrs_rte_ip, tvb, offset, L_LBM_SRS_ROUTE_END_T_IP, ENC_BIG_ENDIAN);
2654
0
    offset += L_LBM_SRS_ROUTE_END_T_IP;
2655
2656
0
    if ((total_payload_len - offset) < L_LBM_SRS_ROUTE_END_T_PORT)
2657
0
    {
2658
        /*stop processing in case not available*/
2659
0
        *can_dissect_further = FALSE;
2660
0
        return (offset - start_offset);
2661
0
    }
2662
2663
0
    proto_tree_add_item(rte_tree, hf_lbmsrs_rte_port, tvb, offset, L_LBM_SRS_ROUTE_END_T_PORT, ENC_BIG_ENDIAN);
2664
0
    offset += L_LBM_SRS_ROUTE_END_T_PORT;
2665
2666
0
    if ((total_payload_len - offset) < L_LBM_SRS_ROUTE_END_T_CONTEXT_INSTANCE)
2667
0
    {
2668
        /*stop processing in case not available*/
2669
0
        *can_dissect_further = FALSE;
2670
0
        return (offset - start_offset);
2671
0
    }
2672
0
    proto_tree_add_item(rte_tree, hf_lbmsrs_rte_context_instance, tvb, offset, L_LBM_SRS_ROUTE_END_T_CONTEXT_INSTANCE, ENC_NA);
2673
0
    offset += L_LBM_SRS_ROUTE_END_T_CONTEXT_INSTANCE;
2674
2675
0
    if ((total_payload_len - offset) < L_LBM_SRS_ROUTE_END_T_CONTEXT_TYPE)
2676
0
    {
2677
        /*stop processing in case not available*/
2678
0
        *can_dissect_further = FALSE;
2679
0
        return (offset - start_offset);
2680
0
    }
2681
0
    proto_tree_add_item(rte_tree, hf_lbmsrs_rte_context_type, tvb, offset, L_LBM_SRS_ROUTE_END_T_CONTEXT_TYPE, ENC_BIG_ENDIAN);
2682
0
    offset += L_LBM_SRS_ROUTE_END_T_CONTEXT_TYPE;
2683
2684
2685
0
    if ((total_payload_len - offset) < L_LBM_SRS_ROUTE_END_T_VERSION)
2686
0
    {
2687
        /*stop processing in case not available*/
2688
0
        *can_dissect_further = FALSE;
2689
0
        return (offset - start_offset);
2690
0
    }
2691
0
    proto_tree_add_item(rte_tree, hf_lbmsrs_rte_version, tvb, offset, L_LBM_SRS_ROUTE_END_T_VERSION, ENC_BIG_ENDIAN);
2692
0
    offset += L_LBM_SRS_ROUTE_END_T_VERSION;
2693
2694
0
    if ((total_payload_len - offset) < L_LBM_SRS_ROUTE_END_T_VERSION_FLAGS)
2695
0
    {
2696
        /*stop processing in case not available*/
2697
0
        *can_dissect_further = FALSE;
2698
0
        return (offset - start_offset);
2699
0
    }
2700
0
    proto_tree_add_item(rte_tree, hf_lbmsrs_rte_version_flags, tvb, offset, L_LBM_SRS_ROUTE_END_T_VERSION_FLAGS, ENC_BIG_ENDIAN);
2701
0
    offset += L_LBM_SRS_ROUTE_END_T_VERSION_FLAGS;
2702
2703
2704
0
    if ((total_payload_len - offset) < L_LBM_SRS_ROUTE_END_T_ROUTE_INDEX)
2705
0
    {
2706
        /*stop processing in case not available*/
2707
0
        *can_dissect_further = FALSE;
2708
0
        return (offset - start_offset);
2709
0
    }
2710
0
    proto_tree_add_item(rte_tree, hf_lbmsrs_rte_route_index, tvb, offset, L_LBM_SRS_ROUTE_END_T_ROUTE_INDEX, ENC_BIG_ENDIAN);
2711
0
    offset += L_LBM_SRS_ROUTE_END_T_ROUTE_INDEX;
2712
2713
0
    if ((total_payload_len - offset) < L_LBM_SRS_ROUTE_END_T_RESERVED)
2714
0
    {
2715
        /*stop processing in case not available*/
2716
0
        *can_dissect_further = FALSE;
2717
0
        return (offset - start_offset);
2718
0
    }
2719
0
    proto_tree_add_item(rte_tree, hf_lbmsrs_rte_reserved, tvb, offset, L_LBM_SRS_ROUTE_END_T_RESERVED, ENC_BIG_ENDIAN);
2720
0
    offset += L_LBM_SRS_ROUTE_END_T_RESERVED;
2721
2722
0
    (*lcnt_rte)++;
2723
2724
0
    proto_item_set_len(batch_item, (offset - start_offset));
2725
0
    return (offset - start_offset);
2726
0
}
2727
2728
static unsigned dissect_lbmsrs_dmi(tvbuff_t * tvb, proto_tree * tree, unsigned offset, unsigned *lcnt_dmi, bool *can_dissect_further)
2729
0
{
2730
0
    unsigned total_payload_len = tvb_captured_length(tvb);
2731
0
    unsigned start_offset = offset;
2732
2733
0
    if ((total_payload_len - offset) < L_LBM_SRS_DOMAIN_INFO_T_DOMAIN_ID)
2734
0
    {
2735
        /*stop processing in case not available*/
2736
0
        *can_dissect_further = FALSE;
2737
0
        return 0;
2738
0
    }
2739
2740
0
    proto_item *batch_item = NULL;
2741
2742
0
    batch_item = proto_tree_add_none_format(tree, hf_lbmsrs_dmi, tvb, offset, -1, "DMI");
2743
0
    proto_tree *dmi_tree = proto_item_add_subtree(batch_item, ett_lbmsrs_dmi);
2744
2745
0
    proto_tree_add_item(dmi_tree, hf_lbmsrs_message_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2746
0
    offset += 2;
2747
2748
0
    proto_tree_add_item(dmi_tree, hf_lbmsrs_dmi_domain_id, tvb, offset, L_LBM_SRS_DOMAIN_INFO_T_DOMAIN_ID, ENC_BIG_ENDIAN);
2749
0
    offset += L_LBM_SRS_DOMAIN_INFO_T_DOMAIN_ID;
2750
2751
0
    if ((total_payload_len - offset) < L_LBM_SRS_DOMAIN_INFO_T_CONTEXT_INSTANCE)
2752
0
    {
2753
        /*stop processing in case not available*/
2754
0
        *can_dissect_further = FALSE;
2755
0
        return (offset - start_offset);
2756
0
    }
2757
0
    proto_tree_add_item(dmi_tree, hf_lbmsrs_dmi_context_instance, tvb, offset, L_LBM_SRS_DOMAIN_INFO_T_CONTEXT_INSTANCE, ENC_NA);
2758
0
    offset += L_LBM_SRS_DOMAIN_INFO_T_CONTEXT_INSTANCE;
2759
2760
0
    if ((total_payload_len - offset) < L_LBM_SRS_DOMAIN_INFO_T_CONTEXT_TYPE)
2761
0
    {
2762
        /*stop processing in case not available*/
2763
0
        *can_dissect_further = FALSE;
2764
0
        return (offset - start_offset);
2765
0
    }
2766
0
    proto_tree_add_item(dmi_tree, hf_lbmsrs_dmi_context_type, tvb, offset, L_LBM_SRS_DOMAIN_INFO_T_CONTEXT_TYPE, ENC_BIG_ENDIAN);
2767
0
    offset += L_LBM_SRS_DOMAIN_INFO_T_CONTEXT_TYPE;
2768
2769
2770
0
    if ((total_payload_len - offset) < L_LBM_SRS_DOMAIN_INFO_T_VERSION)
2771
0
    {
2772
        /*stop processing in case not available*/
2773
0
        *can_dissect_further = FALSE;
2774
0
        return (offset - start_offset);
2775
0
    }
2776
0
    proto_tree_add_item(dmi_tree, hf_lbmsrs_dmi_version, tvb, offset, L_LBM_SRS_DOMAIN_INFO_T_VERSION, ENC_BIG_ENDIAN);
2777
0
    offset += L_LBM_SRS_DOMAIN_INFO_T_VERSION;
2778
2779
0
    if ((total_payload_len - offset) < L_LBM_SRS_DOMAIN_INFO_T_VERSION_FLAGS)
2780
0
    {
2781
        /*stop processing in case not available*/
2782
0
        *can_dissect_further = FALSE;
2783
0
        return (offset - start_offset);
2784
0
    }
2785
0
    proto_tree_add_item(dmi_tree, hf_lbmsrs_dmi_version_flags, tvb, offset, L_LBM_SRS_DOMAIN_INFO_T_VERSION_FLAGS, ENC_BIG_ENDIAN);
2786
0
    offset += L_LBM_SRS_DOMAIN_INFO_T_VERSION_FLAGS;
2787
2788
2789
0
    if ((total_payload_len - offset) < L_LBM_SRS_DOMAIN_INFO_T_RESERVED)
2790
0
    {
2791
        /*stop processing in case not available*/
2792
0
        *can_dissect_further = FALSE;
2793
0
        return (offset - start_offset);
2794
0
    }
2795
0
    proto_tree_add_item(dmi_tree, hf_lbmsrs_dmi_reserved, tvb, offset, L_LBM_SRS_DOMAIN_INFO_T_RESERVED, ENC_BIG_ENDIAN);
2796
0
    offset += L_LBM_SRS_DOMAIN_INFO_T_RESERVED;
2797
2798
0
    (*lcnt_dmi)++;
2799
2800
0
    proto_item_set_len(batch_item, (offset - start_offset));
2801
2802
0
    return (offset - start_offset);
2803
0
}
2804
2805
static unsigned dissect_lbmsrs_cnq(tvbuff_t * tvb, proto_tree * tree, unsigned offset, unsigned *lcnt_cnq, bool *can_dissect_further)
2806
0
{
2807
0
    unsigned total_payload_len = tvb_captured_length(tvb);
2808
0
    unsigned start_offset = offset;
2809
2810
0
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_QUERY_T_NAME_LEN)
2811
0
    {
2812
        /*stop processing in case not available*/
2813
0
        *can_dissect_further = FALSE;
2814
0
        return 0;
2815
0
    }
2816
2817
0
    proto_item *batch_item = NULL;
2818
2819
0
    batch_item = proto_tree_add_none_format(tree, hf_lbmsrs_cnq, tvb, offset, -1, "CNQ");
2820
0
    proto_tree *cnq_tree = proto_item_add_subtree(batch_item, ett_lbmsrs_cnq);
2821
2822
0
    proto_tree_add_item(cnq_tree, hf_lbmsrs_message_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2823
0
    offset += 2;
2824
2825
0
    unsigned name_len = tvb_get_uint8(tvb, offset);
2826
0
    offset += L_LBM_SRS_CONTEXT_NAME_QUERY_T_NAME_LEN;
2827
2828
0
    if ((total_payload_len - offset) < name_len)
2829
0
    {
2830
        /*stop processing in case not available*/
2831
0
        *can_dissect_further = FALSE;
2832
0
        return 0;
2833
0
    }
2834
2835
0
    proto_tree_add_item(cnq_tree, hf_lbmsrs_cnq_name, tvb, offset, name_len, ENC_ASCII);
2836
0
    offset += name_len;
2837
2838
0
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_QUERY_T_DOMAIN_ID)
2839
0
    {
2840
        /*stop processing in case not available*/
2841
0
        *can_dissect_further = FALSE;
2842
0
        return (offset - start_offset);
2843
0
    }
2844
0
    proto_tree_add_item(cnq_tree, hf_lbmsrs_cnq_domain_id, tvb, offset, L_LBM_SRS_CONTEXT_NAME_QUERY_T_DOMAIN_ID, ENC_BIG_ENDIAN);
2845
0
    offset += L_LBM_SRS_CONTEXT_NAME_QUERY_T_DOMAIN_ID;
2846
2847
0
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_QUERY_T_CONTEXT_INSTANCE)
2848
0
    {
2849
        /*stop processing in case not available*/
2850
0
        *can_dissect_further = FALSE;
2851
0
        return (offset - start_offset);
2852
0
    }
2853
0
    proto_tree_add_item(cnq_tree, hf_lbmsrs_cnq_context_instance, tvb, offset, L_LBM_SRS_CONTEXT_NAME_QUERY_T_CONTEXT_INSTANCE, ENC_NA);
2854
0
    offset += L_LBM_SRS_CONTEXT_NAME_QUERY_T_CONTEXT_INSTANCE;
2855
2856
0
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_QUERY_T_CONTEXT_TYPE)
2857
0
    {
2858
        /*stop processing in case not available*/
2859
0
        *can_dissect_further = FALSE;
2860
0
        return (offset - start_offset);
2861
0
    }
2862
0
    proto_tree_add_item(cnq_tree, hf_lbmsrs_cnq_context_type, tvb, offset, L_LBM_SRS_CONTEXT_NAME_QUERY_T_CONTEXT_TYPE, ENC_BIG_ENDIAN);
2863
0
    offset += L_LBM_SRS_CONTEXT_NAME_QUERY_T_CONTEXT_TYPE;
2864
2865
2866
0
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_QUERY_T_VERSION)
2867
0
    {
2868
        /*stop processing in case not available*/
2869
0
        *can_dissect_further = FALSE;
2870
0
        return (offset - start_offset);
2871
0
    }
2872
0
    proto_tree_add_item(cnq_tree, hf_lbmsrs_cnq_version, tvb, offset, L_LBM_SRS_CONTEXT_NAME_QUERY_T_VERSION, ENC_BIG_ENDIAN);
2873
0
    offset += L_LBM_SRS_CONTEXT_NAME_QUERY_T_VERSION;
2874
2875
0
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_QUERY_T_VERSION_FLAGS)
2876
0
    {
2877
        /*stop processing in case not available*/
2878
0
        *can_dissect_further = FALSE;
2879
0
        return (offset - start_offset);
2880
0
    }
2881
0
    proto_tree_add_item(cnq_tree, hf_lbmsrs_cnq_version_flags, tvb, offset, L_LBM_SRS_CONTEXT_NAME_QUERY_T_VERSION_FLAGS, ENC_BIG_ENDIAN);
2882
0
    offset += L_LBM_SRS_CONTEXT_NAME_QUERY_T_VERSION_FLAGS;
2883
2884
2885
0
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_QUERY_T_RESERVED)
2886
0
    {
2887
        /*stop processing in case not available*/
2888
0
        *can_dissect_further = FALSE;
2889
0
        return (offset - start_offset);
2890
0
    }
2891
0
    proto_tree_add_item(cnq_tree, hf_lbmsrs_cnq_reserved, tvb, offset, L_LBM_SRS_CONTEXT_NAME_QUERY_T_RESERVED, ENC_BIG_ENDIAN);
2892
0
    offset += L_LBM_SRS_CONTEXT_NAME_QUERY_T_RESERVED;
2893
2894
0
    (*lcnt_cnq)++;
2895
2896
0
    proto_item_set_len(batch_item, (offset - start_offset));
2897
2898
2899
0
    return (offset - start_offset);
2900
0
}
2901
2902
static unsigned dissect_lbmsrs_cni(tvbuff_t * tvb, proto_tree * tree, unsigned offset, unsigned *lcnt_cni, bool *can_dissect_further)
2903
6
{
2904
6
    unsigned total_payload_len = tvb_captured_length(tvb);
2905
6
    unsigned start_offset = offset;
2906
2907
6
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_INFO_T_NAME_LEN)
2908
0
    {
2909
        /*stop processing in case not available*/
2910
0
        *can_dissect_further = FALSE;
2911
0
        return 0;
2912
0
    }
2913
2914
6
    proto_item *batch_item = NULL;
2915
2916
6
    batch_item = proto_tree_add_none_format(tree, hf_lbmsrs_cni, tvb, offset, -1, "CNI");
2917
6
    proto_tree *cni_tree = proto_item_add_subtree(batch_item, ett_lbmsrs_cni);
2918
2919
6
    proto_tree_add_item(cni_tree, hf_lbmsrs_message_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2920
6
    offset += 2;
2921
2922
6
    unsigned name_len = tvb_get_uint8(tvb, offset);
2923
6
    offset += L_LBM_SRS_CONTEXT_NAME_INFO_T_NAME_LEN;
2924
2925
6
    if ((total_payload_len - offset) < name_len)
2926
1
    {
2927
        /*stop processing in case not available*/
2928
1
        *can_dissect_further = FALSE;
2929
1
        return 0;
2930
1
    }
2931
2932
5
    proto_tree_add_item(cni_tree, hf_lbmsrs_cni_name, tvb, offset, name_len, ENC_ASCII);
2933
5
    offset += name_len;
2934
2935
5
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_INFO_T_DOMAIN_ID)
2936
0
    {
2937
        /*stop processing in case not available*/
2938
0
        *can_dissect_further = FALSE;
2939
0
        return (offset - start_offset);
2940
0
    }
2941
5
    proto_tree_add_item(cni_tree, hf_lbmsrs_cni_domain_id, tvb, offset, L_LBM_SRS_CONTEXT_NAME_INFO_T_DOMAIN_ID, ENC_BIG_ENDIAN);
2942
5
    offset += L_LBM_SRS_CONTEXT_NAME_INFO_T_DOMAIN_ID;
2943
2944
5
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_INFO_T_IP)
2945
0
    {
2946
        /*stop processing in case not available*/
2947
0
        *can_dissect_further = FALSE;
2948
0
        return (offset - start_offset);
2949
0
    }
2950
2951
5
    proto_tree_add_item(cni_tree, hf_lbmsrs_cni_ip, tvb, offset, L_LBM_SRS_CONTEXT_NAME_INFO_T_IP, ENC_BIG_ENDIAN);
2952
5
    offset += L_LBM_SRS_CONTEXT_NAME_INFO_T_IP;
2953
2954
5
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_INFO_T_PORT)
2955
1
    {
2956
        /*stop processing in case not available*/
2957
1
        *can_dissect_further = FALSE;
2958
1
        return (offset - start_offset);
2959
1
    }
2960
2961
4
    proto_tree_add_item(cni_tree, hf_lbmsrs_cni_port, tvb, offset, L_LBM_SRS_CONTEXT_NAME_INFO_T_PORT, ENC_BIG_ENDIAN);
2962
4
    offset += L_LBM_SRS_CONTEXT_NAME_INFO_T_PORT;
2963
2964
4
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_INFO_T_ORIGIN_CONTEXT_INSTANCE)
2965
1
    {
2966
        /*stop processing in case not available*/
2967
1
        *can_dissect_further = FALSE;
2968
1
        return (offset - start_offset);
2969
1
    }
2970
3
    proto_tree_add_item(cni_tree, hf_lbmsrs_cni_origin_context_instance, tvb, offset, L_LBM_SRS_CONTEXT_NAME_INFO_T_ORIGIN_CONTEXT_INSTANCE, ENC_NA);
2971
3
    offset += L_LBM_SRS_CONTEXT_NAME_INFO_T_ORIGIN_CONTEXT_INSTANCE;
2972
2973
3
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_INFO_T_CONTEXT_INSTANCE)
2974
0
    {
2975
        /*stop processing in case not available*/
2976
0
        *can_dissect_further = FALSE;
2977
0
        return (offset - start_offset);
2978
0
    }
2979
3
    proto_tree_add_item(cni_tree, hf_lbmsrs_cni_context_instance, tvb, offset, L_LBM_SRS_CONTEXT_NAME_INFO_T_CONTEXT_INSTANCE, ENC_NA);
2980
3
    offset += L_LBM_SRS_CONTEXT_NAME_INFO_T_CONTEXT_INSTANCE;
2981
2982
3
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_INFO_T_CONTEXT_TYPE)
2983
0
    {
2984
        /*stop processing in case not available*/
2985
0
        *can_dissect_further = FALSE;
2986
0
        return (offset - start_offset);
2987
0
    }
2988
3
    proto_tree_add_item(cni_tree, hf_lbmsrs_cni_context_type, tvb, offset, L_LBM_SRS_CONTEXT_NAME_INFO_T_CONTEXT_TYPE, ENC_BIG_ENDIAN);
2989
3
    offset += L_LBM_SRS_CONTEXT_NAME_INFO_T_CONTEXT_TYPE;
2990
2991
2992
3
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_INFO_T_VERSION)
2993
0
    {
2994
        /*stop processing in case not available*/
2995
0
        *can_dissect_further = FALSE;
2996
0
        return (offset - start_offset);
2997
0
    }
2998
3
    proto_tree_add_item(cni_tree, hf_lbmsrs_cni_version, tvb, offset, L_LBM_SRS_CONTEXT_NAME_INFO_T_VERSION, ENC_BIG_ENDIAN);
2999
3
    offset += L_LBM_SRS_CONTEXT_NAME_INFO_T_VERSION;
3000
3001
3
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_INFO_T_VERSION_FLAGS)
3002
1
    {
3003
        /*stop processing in case not available*/
3004
1
        *can_dissect_further = FALSE;
3005
1
        return (offset - start_offset);
3006
1
    }
3007
2
    proto_tree_add_item(cni_tree, hf_lbmsrs_cni_version_flags, tvb, offset, L_LBM_SRS_CONTEXT_NAME_INFO_T_VERSION_FLAGS, ENC_BIG_ENDIAN);
3008
2
    offset += L_LBM_SRS_CONTEXT_NAME_INFO_T_VERSION_FLAGS;
3009
3010
3011
2
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_INFO_T_RESERVED)
3012
1
    {
3013
        /*stop processing in case not available*/
3014
1
        *can_dissect_further = FALSE;
3015
1
        return (offset - start_offset);
3016
1
    }
3017
1
    proto_tree_add_item(cni_tree, hf_lbmsrs_cni_reserved, tvb, offset, L_LBM_SRS_CONTEXT_NAME_INFO_T_RESERVED, ENC_BIG_ENDIAN);
3018
1
    offset += L_LBM_SRS_CONTEXT_NAME_INFO_T_RESERVED;
3019
3020
1
    (*lcnt_cni)++;
3021
3022
1
    proto_item_set_len(batch_item, (offset - start_offset));
3023
3024
1
    return (offset - start_offset);
3025
2
}
3026
3027
static unsigned dissect_lbmsrs_cne(tvbuff_t * tvb, proto_tree * tree, unsigned offset, unsigned *lcnt_cne, bool *can_dissect_further)
3028
0
{
3029
0
    unsigned total_payload_len = tvb_captured_length(tvb);
3030
0
    unsigned start_offset = offset;
3031
3032
0
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_END_T_NAME_LEN)
3033
0
    {
3034
        /*stop processing in case not available*/
3035
0
        *can_dissect_further = FALSE;
3036
0
        return 0;
3037
0
    }
3038
3039
0
    proto_item *batch_item = NULL;
3040
3041
0
    batch_item = proto_tree_add_none_format(tree, hf_lbmsrs_cne, tvb, offset, -1, "CNE");
3042
0
    proto_tree *cne_tree = proto_item_add_subtree(batch_item, ett_lbmsrs_cne);
3043
3044
0
    proto_tree_add_item(cne_tree, hf_lbmsrs_message_id, tvb, offset, 2, ENC_BIG_ENDIAN);
3045
0
    offset += 2;
3046
3047
0
    unsigned name_len = tvb_get_uint8(tvb, offset);
3048
0
    offset += L_LBM_SRS_CONTEXT_NAME_END_T_NAME_LEN;
3049
3050
0
    if ((total_payload_len - offset) < name_len)
3051
0
    {
3052
        /*stop processing in case not available*/
3053
0
        *can_dissect_further = FALSE;
3054
0
        return 0;
3055
0
    }
3056
3057
0
    proto_tree_add_item(cne_tree, hf_lbmsrs_cne_name, tvb, offset, name_len, ENC_ASCII);
3058
0
    offset += name_len;
3059
3060
0
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_END_T_DOMAIN_ID)
3061
0
    {
3062
        /*stop processing in case not available*/
3063
0
        *can_dissect_further = FALSE;
3064
0
        return (offset - start_offset);
3065
0
    }
3066
0
    proto_tree_add_item(cne_tree, hf_lbmsrs_cne_domain_id, tvb, offset, L_LBM_SRS_CONTEXT_NAME_END_T_DOMAIN_ID, ENC_BIG_ENDIAN);
3067
0
    offset += L_LBM_SRS_CONTEXT_NAME_END_T_DOMAIN_ID;
3068
3069
0
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_END_T_IP)
3070
0
    {
3071
        /*stop processing in case not available*/
3072
0
        *can_dissect_further = FALSE;
3073
0
        return (offset - start_offset);
3074
0
    }
3075
3076
0
    proto_tree_add_item(cne_tree, hf_lbmsrs_cne_ip, tvb, offset, L_LBM_SRS_CONTEXT_NAME_END_T_IP, ENC_BIG_ENDIAN);
3077
0
    offset += L_LBM_SRS_CONTEXT_NAME_END_T_IP;
3078
3079
0
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_END_T_PORT)
3080
0
    {
3081
        /*stop processing in case not available*/
3082
0
        *can_dissect_further = FALSE;
3083
0
        return (offset - start_offset);
3084
0
    }
3085
3086
0
    proto_tree_add_item(cne_tree, hf_lbmsrs_cne_port, tvb, offset, L_LBM_SRS_CONTEXT_NAME_END_T_PORT, ENC_BIG_ENDIAN);
3087
0
    offset += L_LBM_SRS_CONTEXT_NAME_END_T_PORT;
3088
3089
0
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_END_T_ORIGIN_CONTEXT_INSTANCE)
3090
0
    {
3091
        /*stop processing in case not available*/
3092
0
        *can_dissect_further = FALSE;
3093
0
        return (offset - start_offset);
3094
0
    }
3095
0
    proto_tree_add_item(cne_tree, hf_lbmsrs_cne_origin_context_instance, tvb, offset, L_LBM_SRS_CONTEXT_NAME_END_T_ORIGIN_CONTEXT_INSTANCE, ENC_NA);
3096
0
    offset += L_LBM_SRS_CONTEXT_NAME_END_T_ORIGIN_CONTEXT_INSTANCE;
3097
3098
0
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_END_T_CONTEXT_INSTANCE)
3099
0
    {
3100
        /*stop processing in case not available*/
3101
0
        *can_dissect_further = FALSE;
3102
0
        return (offset - start_offset);
3103
0
    }
3104
0
    proto_tree_add_item(cne_tree, hf_lbmsrs_cne_context_instance, tvb, offset, L_LBM_SRS_CONTEXT_NAME_END_T_CONTEXT_INSTANCE, ENC_NA);
3105
0
    offset += L_LBM_SRS_CONTEXT_NAME_END_T_CONTEXT_INSTANCE;
3106
3107
0
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_END_T_CONTEXT_TYPE)
3108
0
    {
3109
        /*stop processing in case not available*/
3110
0
        *can_dissect_further = FALSE;
3111
0
        return (offset - start_offset);
3112
0
    }
3113
0
    proto_tree_add_item(cne_tree, hf_lbmsrs_cne_context_type, tvb, offset, L_LBM_SRS_CONTEXT_NAME_END_T_CONTEXT_TYPE, ENC_BIG_ENDIAN);
3114
0
    offset += L_LBM_SRS_CONTEXT_NAME_END_T_CONTEXT_TYPE;
3115
3116
3117
0
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_END_T_VERSION)
3118
0
    {
3119
        /*stop processing in case not available*/
3120
0
        *can_dissect_further = FALSE;
3121
0
        return (offset - start_offset);
3122
0
    }
3123
0
    proto_tree_add_item(cne_tree, hf_lbmsrs_cne_version, tvb, offset, L_LBM_SRS_CONTEXT_NAME_END_T_VERSION, ENC_BIG_ENDIAN);
3124
0
    offset += L_LBM_SRS_CONTEXT_NAME_END_T_VERSION;
3125
3126
0
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_END_T_VERSION_FLAGS)
3127
0
    {
3128
        /*stop processing in case not available*/
3129
0
        *can_dissect_further = FALSE;
3130
0
        return (offset - start_offset);
3131
0
    }
3132
0
    proto_tree_add_item(cne_tree, hf_lbmsrs_cne_version_flags, tvb, offset, L_LBM_SRS_CONTEXT_NAME_END_T_VERSION_FLAGS, ENC_BIG_ENDIAN);
3133
0
    offset += L_LBM_SRS_CONTEXT_NAME_END_T_VERSION_FLAGS;
3134
3135
3136
0
    if ((total_payload_len - offset) < L_LBM_SRS_CONTEXT_NAME_END_T_RESERVED)
3137
0
    {
3138
        /*stop processing in case not available*/
3139
0
        *can_dissect_further = FALSE;
3140
0
        return (offset - start_offset);
3141
0
    }
3142
0
    proto_tree_add_item(cne_tree, hf_lbmsrs_cne_reserved, tvb, offset, L_LBM_SRS_CONTEXT_NAME_END_T_RESERVED, ENC_BIG_ENDIAN);
3143
0
    offset += L_LBM_SRS_CONTEXT_NAME_END_T_RESERVED;
3144
3145
0
    (*lcnt_cne)++;
3146
3147
0
    proto_item_set_len(batch_item, (offset - start_offset));
3148
3149
0
    return (offset - start_offset);
3150
0
}
3151
3152
static void update_counts(struct epan_column_info* cinfo,proto_item* item)
3153
30
{
3154
30
    char counts[1024] = "[ ";
3155
30
    size_t i;
3156
3157
30
    if (cnt_sir > 0)
3158
2
    {
3159
2
        i = strlen( counts );
3160
2
        snprintf(&counts[i], 1024-i, "SIR:%u ",cnt_sir);
3161
2
    }
3162
3163
30
    if (cnt_ser > 0)
3164
1
    {
3165
1
        i = strlen( counts );
3166
1
        snprintf(&counts[i], 1024-i, "SER:%u ",cnt_ser);
3167
1
    }
3168
3169
30
    if (cnt_sdr > 0)
3170
0
    {
3171
0
        i = strlen( counts );
3172
0
        snprintf(&counts[i], 1024-i, "SDR:%u ",cnt_sdr);
3173
0
    }
3174
3175
30
    if (cnt_rir > 0)
3176
1
    {
3177
1
        i = strlen( counts );
3178
1
        snprintf(&counts[i], 1024-i, "RIR:%u ",cnt_rir);
3179
1
    }
3180
3181
30
    if (cnt_rer > 0)
3182
0
    {
3183
0
        i = strlen( counts );
3184
0
        snprintf(&counts[i], 1024-i, "RER:%u ",cnt_rer);
3185
0
    }
3186
3187
30
    if (cnt_rdr > 0)
3188
0
    {
3189
0
        i = strlen( counts );
3190
0
        snprintf(&counts[i], 1024-i, "RDR:%u ",cnt_rdr);
3191
0
    }
3192
3193
30
    if (cnt_wir > 0)
3194
0
    {
3195
0
        i = strlen( counts );
3196
0
        snprintf(&counts[i], 1024-i, "WIR:%u ",cnt_wir);
3197
0
    }
3198
3199
30
    if (cnt_wer > 0)
3200
0
    {
3201
0
        i = strlen( counts );
3202
0
        snprintf(&counts[i], 1024-i, "WER:%u ",cnt_wer);
3203
0
    }
3204
3205
30
    if (cnt_wdr > 0)
3206
0
    {
3207
0
        i = strlen( counts );
3208
0
        snprintf(&counts[i], 1024-i, "WDR:%u ",cnt_wdr);
3209
0
    }
3210
3211
30
    if (cnt_sli > 0)
3212
2
    {
3213
2
        i = strlen( counts );
3214
2
        snprintf(&counts[i], 1024-i, "SLI:%u ",cnt_sli);
3215
2
    }
3216
3217
30
    if (cnt_rti > 0)
3218
0
    {
3219
0
        i = strlen( counts );
3220
0
        snprintf(&counts[i], 1024-i, "RTI:%u ",cnt_rti);
3221
0
    }
3222
3223
30
    if (cnt_rte > 0)
3224
0
    {
3225
0
        i = strlen( counts );
3226
0
        snprintf(&counts[i], 1024-i, "RTE:%u ",cnt_rte);
3227
0
    }
3228
3229
30
    if (cnt_dmi > 0)
3230
0
    {
3231
0
        i = strlen( counts );
3232
0
        snprintf(&counts[i], 1024-i, "DMI:%u ",cnt_dmi);
3233
0
    }
3234
3235
30
    if (cnt_cnq > 0)
3236
0
    {
3237
0
        i = strlen( counts );
3238
0
        snprintf(&counts[i], 1024-i, "CNQ:%u ",cnt_cnq);
3239
0
    }
3240
3241
30
    if (cnt_cni > 0)
3242
1
    {
3243
1
        i = strlen( counts );
3244
1
        snprintf(&counts[i], 1024-i, "CNI:%u ",cnt_cni);
3245
1
    }
3246
3247
30
    if (cnt_cne > 0)
3248
0
    {
3249
0
        i = strlen( counts );
3250
0
        snprintf(&counts[i], 1024-i, "CNE:%u ",cnt_cne);
3251
0
    }
3252
3253
3254
30
    i = strlen( counts );
3255
30
    snprintf(&counts[i], 1024-i, "]");
3256
3257
30
    col_append_str(cinfo, COL_INFO, counts);
3258
30
    proto_item_set_text(item, "SRS:%s",counts);
3259
3260
30
}
3261
3262
/*Function to dissect SRS batch*/
3263
static unsigned dissect_lbmsrs_batch(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, unsigned offset, uint32_t rsocket_payload_len)
3264
31
{
3265
31
    unsigned start_offset = offset;
3266
31
    unsigned total_payload_len = tvb_captured_length(tvb);
3267
    /*reset all the counters*/
3268
31
    cnt_sir = cnt_ser = cnt_sdr = 0;
3269
31
    cnt_rir = cnt_rer = cnt_rdr = 0;
3270
31
    cnt_wir = cnt_wer = cnt_wdr = 0;
3271
31
    cnt_sli = 0;
3272
31
    cnt_rti = cnt_rte = cnt_dmi = 0;
3273
31
    cnt_cnq = cnt_cni = cnt_cne = 0;
3274
3275
    /*add a sub-tree for the batch */
3276
31
    proto_item *srs_batch;
3277
31
    proto_tree_add_subtree(tree, tvb, offset, rsocket_payload_len, ett_lbmsrs_details, &srs_batch, "SRS SIR/SER/SDR/RIR/RDR/RER/WIR/WDR/WER");
3278
3279
    /*this is a start of the batch which will contain SIR,SDR,SER*/
3280
39
    while (offset < total_payload_len)
3281
38
    {
3282
        /*at least two bytes required to check the message id*/
3283
38
        if ((total_payload_len - offset) < L_LBM_SRS_MESSAGE_ID)
3284
1
        {
3285
1
            proto_item_set_len(srs_batch, (offset - start_offset));
3286
1
            return (offset - start_offset);
3287
1
        }
3288
3289
37
        uint16_t message_id = tvb_get_uint16(tvb, offset, ENC_BIG_ENDIAN);
3290
3291
        /*process the SIR/SDR/SER*/
3292
37
        unsigned len_dissected = 0;
3293
37
        bool can_dissect_further = TRUE;
3294
37
        switch (message_id)
3295
37
        {
3296
9
            case MSG_ID_SOURCE_INFO:
3297
9
            {
3298
9
                len_dissected = dissect_lbmsrs_sir_ser(tvb, pinfo, tree, offset, &cnt_sir, &cnt_ser,&can_dissect_further);
3299
9
                break;
3300
0
            }
3301
3302
0
            case MSG_ID_SOURCE_DELETE:
3303
0
            {
3304
0
                len_dissected = dissect_lbmsrs_sdr(tvb, pinfo, tree, offset, &cnt_sdr, &can_dissect_further);
3305
0
                break;
3306
0
            }
3307
3308
2
            case MSG_ID_RCV_INFO:
3309
2
            {
3310
2
                len_dissected = dissect_lbmsrs_rir(tvb, pinfo, tree, offset, &cnt_rir, &can_dissect_further);
3311
2
                break;
3312
0
            }
3313
0
            case MSG_ID_RCV_DELETE:
3314
0
            {
3315
0
                len_dissected = dissect_lbmsrs_rdr(tvb, pinfo, tree, offset, &cnt_rdr, &can_dissect_further);
3316
0
                break;
3317
0
            }
3318
2
            case MSG_ID_RCV_END:
3319
2
            {
3320
2
                len_dissected = dissect_lbmsrs_rer(tvb, pinfo, tree, offset, &cnt_rer, &can_dissect_further);
3321
2
                break;
3322
0
            }
3323
0
            case MSG_ID_WRCV_INFO:
3324
0
            {
3325
0
                len_dissected = dissect_lbmsrs_wir(tvb, pinfo, tree, offset, &cnt_wir, &can_dissect_further);
3326
0
                break;
3327
0
            }
3328
1
            case MSG_ID_WRCV_DELETE:
3329
1
            {
3330
1
                len_dissected = dissect_lbmsrs_wdr(tvb, pinfo, tree, offset, &cnt_wdr, &can_dissect_further);
3331
1
                break;
3332
0
            }
3333
0
            case MSG_ID_WRCV_END:
3334
0
            {
3335
0
                len_dissected = dissect_lbmsrs_wer(tvb, pinfo, tree, offset, &cnt_wer, &can_dissect_further);
3336
0
                break;
3337
0
            }
3338
13
            case MSG_ID_SRC_LEAVE:
3339
13
            {
3340
13
                len_dissected = dissect_lbmsrs_sli(tvb, pinfo,tree, offset, &cnt_sli, &can_dissect_further);
3341
13
                break;
3342
0
            }
3343
0
            case MSG_ID_ROUTE_INFO:
3344
0
            {
3345
0
                len_dissected = dissect_lbmsrs_rti(tvb, tree, offset, &cnt_rti, &can_dissect_further);
3346
0
                break;
3347
0
            }
3348
1
            case MSG_ID_ROUTE_END:
3349
1
            {
3350
1
                len_dissected = dissect_lbmsrs_rte(tvb, tree, offset, &cnt_rte, &can_dissect_further);
3351
1
                break;
3352
0
            }
3353
0
            case MSG_ID_DOMAIN_INFO:
3354
0
            {
3355
0
                len_dissected = dissect_lbmsrs_dmi(tvb, tree, offset, &cnt_dmi, &can_dissect_further);
3356
0
                break;
3357
0
            }
3358
0
            case MSG_ID_CONTEXT_NAME_QUERY:
3359
0
            {
3360
0
                len_dissected = dissect_lbmsrs_cnq(tvb, tree, offset, &cnt_cnq, &can_dissect_further);
3361
0
                break;
3362
0
            }
3363
6
            case MSG_ID_CONTEXT_NAME_INFO:
3364
6
            {
3365
6
                len_dissected = dissect_lbmsrs_cni(tvb, tree, offset, &cnt_cni, &can_dissect_further);
3366
6
                break;
3367
0
            }
3368
0
            case MSG_ID_CONTEXT_NAME_END:
3369
0
            {
3370
0
                len_dissected = dissect_lbmsrs_cne(tvb, tree, offset, &cnt_cne, &can_dissect_further);
3371
0
                break;
3372
0
            }
3373
3374
3
            default:
3375
3
                break;
3376
37
        }
3377
3378
37
        offset += len_dissected;
3379
3380
        /*if nothing is dissected then return the current offset*/
3381
37
        if ((len_dissected == 0) || (FALSE == can_dissect_further))
3382
29
        {
3383
29
            update_counts(pinfo->cinfo,srs_batch);
3384
29
            proto_item_set_len(srs_batch, (offset - start_offset));
3385
29
            return (offset - start_offset);
3386
29
        }
3387
3388
37
    }
3389
3390
1
    update_counts(pinfo->cinfo, srs_batch);
3391
1
    proto_item_set_len(srs_batch, (offset - start_offset));
3392
3393
1
    return (offset - start_offset);
3394
31
}
3395
3396
static unsigned dissect_lbmsrs_registration_request(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, unsigned offset, uint32_t rsocket_payload_len)
3397
0
{
3398
0
    unsigned start_offset = offset;
3399
0
    proto_tree_add_item(tree, hf_lbmsrs_message_id, tvb, offset, L_LBM_SRS_MESSAGE_ID, ENC_BIG_ENDIAN);
3400
0
    offset += L_LBM_SRS_MESSAGE_ID;
3401
3402
    /*reduce by message id field length*/
3403
0
    rsocket_payload_len -= L_LBM_SRS_MESSAGE_ID;
3404
0
    if (L_LBM_SRS_REGISTRATION_REQUEST_INFO_T != rsocket_payload_len)
3405
0
    {
3406
0
        return (offset - start_offset);
3407
0
    }
3408
3409
0
    col_append_str(pinfo->cinfo, COL_INFO, "[SRS REGISTRATION REQUEST]");
3410
    /*add a sub-tree for SRS */
3411
0
    proto_item *lbmsrs_details;
3412
0
    proto_tree *lbmsrs_details_tree = proto_tree_add_subtree(tree, tvb, offset, rsocket_payload_len, ett_lbmsrs_details, &lbmsrs_details, "SRS Registration Request");
3413
3414
0
    static int * const flags[] =
3415
0
    {
3416
0
        &hf_lbmsrs_interest_mode_advertise_filter,
3417
0
        &hf_lbmsrs_interest_mode_interest_forward,
3418
0
        &hf_lbmsrs_interest_mode_context_name_filter,
3419
0
        NULL
3420
0
    };
3421
3422
0
    proto_tree_add_item(lbmsrs_details_tree, hf_lbmsrs_app_type, tvb, offset, L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_APP_TYPE, ENC_BIG_ENDIAN);
3423
0
    offset += L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_APP_TYPE;
3424
0
    proto_tree_add_item(lbmsrs_details_tree, hf_lbmsrs_client_addr, tvb, offset, L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_CLIENT_ADDR, ENC_BIG_ENDIAN);
3425
0
    offset += L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_CLIENT_ADDR;
3426
0
    proto_tree_add_item(lbmsrs_details_tree, hf_lbmsrs_client_port, tvb, offset, L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_CLIENT_PORT, ENC_BIG_ENDIAN);
3427
0
    offset += L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_CLIENT_PORT;
3428
0
    proto_tree_add_item(lbmsrs_details_tree, hf_lbmsrs_session_id, tvb, offset, L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_SESSION_ID, ENC_BIG_ENDIAN);
3429
0
    offset += L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_SESSION_ID;
3430
0
    proto_tree_add_item(lbmsrs_details_tree, hf_lbmsrs_host_id, tvb, offset, L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_HOST_ID, ENC_BIG_ENDIAN);
3431
0
    offset += L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_HOST_ID;
3432
0
    proto_tree_add_item(lbmsrs_details_tree, hf_lbmsrs_protocol_version, tvb, offset, L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_PROTOCOL_VERSION, ENC_BIG_ENDIAN);
3433
0
    offset += L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_PROTOCOL_VERSION;
3434
0
    proto_tree_add_bitmask(lbmsrs_details_tree, tvb, offset, hf_lbmsrs_interest_mode, ett_lbmsrs_interest_mode, flags, ENC_BIG_ENDIAN);
3435
0
    offset += L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_INTEREST_MODE;
3436
0
    proto_tree_add_item(lbmsrs_details_tree, hf_lbmsrs_req_local_domain_id, tvb, offset, L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_LOCAL_DOMAIN_ID, ENC_BIG_ENDIAN);
3437
0
    offset += L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_LOCAL_DOMAIN_ID;
3438
3439
0
    return (offset - start_offset); //return the total length dissected
3440
3441
0
}
3442
3443
static unsigned dissect_lbmsrs_registration_response(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, unsigned offset, uint32_t rsocket_payload_len)
3444
0
{
3445
0
    unsigned start_offset = offset;
3446
0
    proto_tree_add_item(tree, hf_lbmsrs_message_id, tvb, offset, L_LBM_SRS_MESSAGE_ID, ENC_BIG_ENDIAN);
3447
0
    offset += L_LBM_SRS_MESSAGE_ID;
3448
3449
    /*reduce by message id field length*/
3450
0
    rsocket_payload_len -= L_LBM_SRS_MESSAGE_ID;
3451
3452
0
    if (L_LBM_SRS_REGISTRATION_RESPONSE_INFO_T != rsocket_payload_len)
3453
0
    {
3454
0
        return (offset - start_offset);
3455
0
    }
3456
3457
0
    col_append_str(pinfo->cinfo, COL_INFO, "[SRS REGISTRATION RESPONSE]");
3458
3459
    /*add a sub-tree for SRS */
3460
0
    proto_item *lbmsrs_details;
3461
0
    proto_tree *lbmsrs_details_tree = proto_tree_add_subtree(tree, tvb, offset, rsocket_payload_len, ett_lbmsrs_details, &lbmsrs_details, "SRS Registration Response");
3462
3463
0
    proto_tree_add_item(lbmsrs_details_tree, hf_lbmsrs_client_id, tvb, offset, L_LBM_SRS_REGISTRATION_RESPONSE_INFO_T_CLIENT_ID, ENC_BIG_ENDIAN);
3464
0
    offset += L_LBM_SRS_REGISTRATION_RESPONSE_INFO_T_CLIENT_ID;
3465
0
    proto_tree_add_item(lbmsrs_details_tree, hf_lbmsrs_resp_local_domain_id, tvb, offset, L_LBM_SRS_REGISTRATION_RESPONSE_INFO_T_LOCAL_DOMAIN_ID, ENC_BIG_ENDIAN);
3466
0
    offset += L_LBM_SRS_REGISTRATION_RESPONSE_INFO_T_LOCAL_DOMAIN_ID;
3467
0
    proto_tree_add_item(lbmsrs_details_tree, hf_lbmsrs_reg_resp_protocol_version, tvb, offset, L_LBM_SRS_REGISTRATION_RESPONSE_INFO_T_PROTOCOL_VERSION, ENC_BIG_ENDIAN);
3468
0
    offset += L_LBM_SRS_REGISTRATION_RESPONSE_INFO_T_PROTOCOL_VERSION;
3469
3470
0
    return (offset - start_offset);
3471
0
}
3472
3473
static unsigned dissect_lbmsrs_stream_request(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, unsigned offset, uint32_t rsocket_payload_len)
3474
0
{
3475
0
    unsigned start_offset = offset;
3476
0
    proto_tree_add_item(tree, hf_lbmsrs_message_id, tvb, offset, L_LBM_SRS_MESSAGE_ID, ENC_BIG_ENDIAN);
3477
0
    offset += L_LBM_SRS_MESSAGE_ID;
3478
3479
    /*reduce by message id field length*/
3480
0
    rsocket_payload_len -= L_LBM_SRS_MESSAGE_ID;
3481
3482
0
    if (L_LBM_SRS_STREAM_REQUEST_INFO_T != rsocket_payload_len)
3483
0
    {
3484
0
        return (offset - start_offset);
3485
0
    }
3486
3487
0
    col_append_str(pinfo->cinfo, COL_INFO, "[SRS STREAM REQUEST]");
3488
3489
    /*add a sub-tree for SRS */
3490
0
    proto_item *lbmsrs_details;
3491
0
    proto_tree *lbmsrs_details_tree = proto_tree_add_subtree(tree, tvb, offset, rsocket_payload_len, ett_lbmsrs_details, &lbmsrs_details, "SRS Stream Request");
3492
3493
0
    proto_tree_add_item(lbmsrs_details_tree, hf_lbmsrs_stream_req_unused, tvb, offset, L_LBM_SRS_STREAM_REQUEST_INFO_T_UNUSED, ENC_BIG_ENDIAN);
3494
0
    offset += L_LBM_SRS_STREAM_REQUEST_INFO_T_UNUSED;
3495
3496
0
    return (offset - start_offset);
3497
0
}
3498
/*Function to dissect SRS as part of Rsocket payload/metadata*/
3499
static unsigned dissect_lbmsrs_data(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, unsigned offset, uint32_t rsocket_payload_len)
3500
35
{
3501
35
    unsigned len_dissected = 0;
3502
3503
35
    if (tvb_captured_length_remaining(tvb, offset) < L_LBM_SRS_MESSAGE_ID)
3504
1
    {
3505
1
        return 0;
3506
1
    }
3507
3508
    /*add and get the SRS message id*/
3509
34
    uint16_t message_id = tvb_get_uint16(tvb,offset, ENC_BIG_ENDIAN);
3510
3511
34
    switch (message_id)
3512
34
    {
3513
0
        case MSG_ID_REGISTRATION_REQUEST:
3514
0
        {
3515
0
            len_dissected = dissect_lbmsrs_registration_request(tvb,pinfo,tree,offset,rsocket_payload_len);
3516
0
            break;
3517
0
        }
3518
0
        case MSG_ID_REGISTRATION_RESPONSE:
3519
0
        {
3520
0
            len_dissected = dissect_lbmsrs_registration_response(tvb, pinfo, tree, offset, rsocket_payload_len);
3521
0
            break;
3522
0
        }
3523
0
        case MSG_ID_STREAM_REQUEST:
3524
0
        {
3525
0
            len_dissected = dissect_lbmsrs_stream_request(tvb, pinfo, tree, offset, rsocket_payload_len);
3526
0
            break;
3527
0
        }
3528
8
        case MSG_ID_SOURCE_INFO:
3529
8
        case MSG_ID_SOURCE_DELETE:
3530
10
        case MSG_ID_RCV_INFO:
3531
10
        case MSG_ID_RCV_DELETE:
3532
12
        case MSG_ID_RCV_END:
3533
12
        case MSG_ID_WRCV_INFO:
3534
12
        case MSG_ID_WRCV_DELETE:
3535
12
        case MSG_ID_WRCV_END:
3536
25
        case MSG_ID_SRC_LEAVE:
3537
25
        case MSG_ID_ROUTE_INFO:
3538
25
        case MSG_ID_ROUTE_END:
3539
25
        case MSG_ID_DOMAIN_INFO:
3540
25
        case MSG_ID_CONTEXT_NAME_QUERY:
3541
31
        case MSG_ID_CONTEXT_NAME_INFO:
3542
31
        case MSG_ID_CONTEXT_NAME_END:
3543
31
        {
3544
31
            len_dissected = dissect_lbmsrs_batch(tvb, pinfo, tree, offset, rsocket_payload_len);
3545
31
            break;
3546
31
        }
3547
3548
3
        default:
3549
3
        {
3550
3
            expert_add_info_format(pinfo, tree, &ei_lbmsrs_analysis_invalid_msg_id,
3551
3
                "Invalid LBMSRS Message Id :%" PRIu16, message_id);
3552
3553
3
        }
3554
3555
34
    }
3556
3557
34
    return len_dissected;
3558
34
}
3559
3560
/* This is the main dissector function
3561
Return 0 - If the data does not belong to the protocol
3562
Return > 0 - If the data is dissected properly, return the actual length dissected
3563
Return < 0 - If need more data for dissection, return the negative of the length required*/
3564
static int dissect_lbmsrs_pdus(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * user_data _U_)
3565
214
{
3566
214
    unsigned offset = 0;
3567
214
    unsigned tvb_length = tvb_captured_length(tvb);
3568
3569
214
    if (tvb_length < rsocket_frame_len_field_size)
3570
0
    {
3571
0
        return 0;
3572
0
    }
3573
3574
    /*get the rsocket frame length*/
3575
214
    uint32_t rsocket_frame_len = tvb_get_uint24(tvb, offset, ENC_BIG_ENDIAN);
3576
    /*adjust the rsocket tree size correctly so as to accommodate
3577
    only the available data. It's always possible that the rsocket length reported
3578
    in the rsocket PDU is more than the data captured in this packet or vice-versa*/
3579
214
    uint32_t rsocket_tree_length = rsocket_frame_len;
3580
214
    if (tvb_length < (rsocket_frame_len + rsocket_frame_len_field_size))
3581
51
    {
3582
51
        rsocket_tree_length = tvb_length - rsocket_frame_len_field_size;
3583
51
    }
3584
3585
    /*check if nothing is available to dissect*/
3586
214
    if (rsocket_tree_length <= 0)
3587
121
    {
3588
121
        return 0;
3589
121
    }
3590
    /*add the srs subtree, this will allow to use the "srs" filter*/
3591
93
    proto_item *ti = proto_tree_add_item(tree, proto_lbmsrs, tvb, offset, -1, ENC_NA);
3592
93
    proto_tree *srs_tree = proto_item_add_subtree(ti, ett_lbmsrs);
3593
3594
    /*add the rsocket frame length field*/
3595
93
    proto_tree_add_item(srs_tree, hf_lbmsrs_rsocket_frame_len, tvb, offset,
3596
93
        rsocket_frame_len_field_size, ENC_BIG_ENDIAN);
3597
93
    offset += rsocket_frame_len_field_size;
3598
3599
3600
    /*add the rsocket frame subtree*/
3601
93
    proto_item *rsocket_frame;
3602
93
    proto_tree *rsocket_frame_tree = proto_tree_add_subtree(
3603
93
        srs_tree, tvb, offset, rsocket_tree_length, ett_lbmsrs_rsocket_frame, &rsocket_frame, "RSocket Frame");
3604
3605
    /*add the rocket stream id*/
3606
93
    if ((tvb_length - offset) < rsocket_stream_id_field_size)
3607
4
    {
3608
4
        return offset;
3609
4
    }
3610
89
    proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_stream_id, tvb, offset, 4,
3611
89
        ENC_BIG_ENDIAN);
3612
89
    offset += rsocket_stream_id_field_size;
3613
3614
3615
    /*read and add the rsocket frame type*/
3616
89
    if ((tvb_length - offset) < 1)
3617
1
    {
3618
1
        return offset;
3619
1
    }
3620
88
    uint64_t rsocket_frame_type;
3621
88
    proto_tree_add_bits_ret_val(rsocket_frame_tree, hf_lbmsrs_rsocket_frame_type, tvb,
3622
88
        offset * 8, 6, &rsocket_frame_type, ENC_BIG_ENDIAN);
3623
3624
3625
88
    const char *frameName = getFrameTypeName(rsocket_frame_type);
3626
3627
88
    if (frameName) {
3628
85
        col_add_str(pinfo->cinfo, COL_INFO, frameName);
3629
85
    }
3630
3
    else {
3631
3
        col_set_str(pinfo->cinfo, COL_INFO, "UNDEFINED");
3632
3
    }
3633
3634
    /*add the rsocket ignore flag*/
3635
88
    proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_ignore_flag, tvb, offset, 2,
3636
88
        ENC_BIG_ENDIAN);
3637
3638
    /*read the rsocket metadata flag*/
3639
88
    uint8_t rsocket_metadata_flag = tvb_get_bits8(tvb, (offset * 8) + 6, 2);
3640
88
    proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_metadata_flag, tvb, offset, 2,
3641
88
        ENC_BIG_ENDIAN);
3642
3643
    /*dissect rsocket frame based on type */
3644
88
    bool can_dissect_further = true;
3645
88
    int rsocket_dissected_len  = dissect_rsocket_frame(rsocket_frame_type, rsocket_frame_tree, tvb, offset,&can_dissect_further);
3646
88
    offset += rsocket_dissected_len;
3647
3648
88
    if (false == can_dissect_further)
3649
46
    {
3650
46
        return (offset - rsocket_frame_len);
3651
46
    }
3652
3653
    /*if rsocket metadata is available add it to the tree*/
3654
42
    if (rsocket_metadata_flag)
3655
29
    {
3656
        /*add the rsocket metadata length field*/
3657
29
        if ((tvb_length - offset) < 3)
3658
0
        {
3659
0
            return (offset - rsocket_frame_len);
3660
0
        }
3661
29
        uint32_t rsocket_metadata_len;
3662
29
        proto_tree_add_item_ret_uint(rsocket_frame_tree, hf_lbmsrs_rsocket_mdata_len, tvb, offset,3, ENC_BIG_ENDIAN, &rsocket_metadata_len);
3663
29
        offset += 3;
3664
3665
        /*add the rsocket metadata*/
3666
29
        if ((tvb_length - offset) < rsocket_metadata_len)
3667
6
        {
3668
6
            return (offset - rsocket_frame_len);
3669
6
        }
3670
23
        proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_mdata, tvb, offset, rsocket_metadata_len, ENC_ASCII);
3671
23
        offset += rsocket_metadata_len;
3672
23
    }
3673
3674
    /*get the remaining payload length*/
3675
36
    uint32_t rsocket_payload_len = tvb_length - offset;
3676
3677
    /*if payload is available start processing for SRS*/
3678
36
    if (rsocket_payload_len > 0) {
3679
35
        proto_item *lbmsrs_data;
3680
35
        proto_tree *lbmsrs_data_tree = proto_tree_add_subtree(rsocket_frame_tree, tvb, offset, rsocket_payload_len, ett_lbmsrs_data, &lbmsrs_data, "LBMSRS Data");
3681
35
        offset += dissect_lbmsrs_data(tvb, pinfo, lbmsrs_data_tree, offset, rsocket_payload_len);
3682
35
    }
3683
3684
36
    return (offset - rsocket_frame_len);
3685
42
}
3686
3687
/*common dissection function for LBMSRS*/
3688
static unsigned dissect_lbmsrs_real(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * data _U_)
3689
51
{
3690
51
    char* tag_name = NULL;
3691
51
    if (lbmsrs_use_tag)
3692
0
    {
3693
0
        tag_name = lbmsrs_tag_find(pinfo);
3694
0
    }
3695
51
    col_clear(pinfo->cinfo, COL_INFO);
3696
51
    if (tag_name != NULL)
3697
0
    {
3698
0
        col_add_fstr(pinfo->cinfo, COL_INFO, "[Tag: %s]", tag_name);
3699
0
    }
3700
3701
51
    col_set_str(pinfo->cinfo, COL_PROTOCOL, "LBMSRS");
3702
51
    col_set_fence(pinfo->cinfo, COL_INFO);
3703
3704
51
    tcp_dissect_pdus(tvb, pinfo, tree, true, 3, get_rsocket_frame_len, dissect_lbmsrs_pdus, data);
3705
51
    return tvb_captured_length(tvb);
3706
51
}
3707
3708
/*normal dissection function*/
3709
static int dissect_lbmsrs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
3710
0
{
3711
0
    if (!check_lbmsrs_packet(tvb, 0))
3712
0
    {
3713
0
        return 0;
3714
0
    }
3715
3716
0
    return dissect_lbmsrs_real(tvb,pinfo,tree,data);
3717
0
}
3718
3719
/*heuristic dissection function*/
3720
static bool test_lbmsrs_packet(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * user_data _U_)
3721
3.51k
{
3722
3.51k
    bool valid_packet = false;
3723
3.51k
    lbmsrs_tag_entry_t entry;
3724
3725
    /* Must be a TCP packet. */
3726
3.51k
    if (pinfo->ptype != PT_TCP)
3727
0
    {
3728
0
        return false;
3729
0
    }
3730
3731
3.51k
    if (lbmsrs_use_tag)
3732
0
    {
3733
0
        if (lbmsrs_tag_find(pinfo) != NULL)
3734
0
        {
3735
0
            valid_packet = true;
3736
0
        }
3737
0
    }
3738
3.51k
    else
3739
3.51k
    {
3740
3.51k
        entry.name = NULL;
3741
3.51k
        entry.ip_address = LBMSRS_DEFAULT_SOURCE_IP;
3742
3.51k
        if (*global_lbmsrs_source_ip_address == '\0')
3743
0
        {
3744
0
            entry.ip_address = NULL;
3745
0
        }
3746
3.51k
        entry.ip_address_val_h = lbmsrs_source_ip_address;
3747
3.51k
        entry.tcp_port = lbmsrs_source_port;
3748
3.51k
        valid_packet = lbmsrs_match_packet(pinfo, &entry);
3749
3.51k
    }
3750
3751
3.51k
    if (!check_lbmsrs_packet(tvb, 0))
3752
3.22k
    {
3753
3.22k
        return false;
3754
3.22k
    }
3755
3756
290
    if (valid_packet)
3757
51
    {
3758
51
        dissect_lbmsrs_real(tvb, pinfo, tree, user_data);
3759
51
        return true;
3760
51
    }
3761
3762
239
    return false;
3763
3764
290
}
3765
3766
void proto_register_lbmsrs(void)
3767
16
{
3768
16
    static hf_register_info hf[] = {
3769
16
        { &hf_lbmsrs_message_id,
3770
16
        { "Message ID", "lbmsrs.message_id", FT_UINT16, BASE_DEC, VALS(lbmsrsMessageId), 0x0, NULL, HFILL } },
3771
        /*rsocket related items start*/
3772
16
        { &hf_lbmsrs_rsocket_frame_len,
3773
16
        { "Frame Length", "lbmsrs.rsocket.frame_len", FT_UINT24, BASE_DEC, NULL, 0x0,NULL, HFILL } },
3774
16
        { &hf_lbmsrs_rsocket_stream_id,
3775
16
        { "Stream ID", "lbmsrs.rsocket.stream_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL,HFILL } },
3776
16
        { &hf_lbmsrs_rsocket_frame_type,
3777
16
        { "Frame Type", "lbmsrs.rsocket.frame_type", FT_UINT8, BASE_DEC,VALS(rSocketFrameTypeNames), 0x0, NULL, HFILL } },
3778
16
        { &hf_lbmsrs_rsocket_mdata_len,
3779
16
        { "Metadata Length", "lbmsrs.rsocket.metadata_len", FT_UINT24, BASE_DEC, NULL,0x0, NULL, HFILL } },
3780
16
        { &hf_lbmsrs_rsocket_mdata,
3781
16
        { "Metadata", "lbmsrs.rsocket.metadata", FT_STRING, BASE_NONE, NULL, 0x0, NULL,HFILL } },
3782
16
        { &hf_lbmsrs_rsocket_ignore_flag,
3783
16
        { "Ignore", "lbmsrs.rsocket.flags.ignore", FT_BOOLEAN, 16, NULL, 0x0200, NULL,HFILL } },
3784
16
        { &hf_lbmsrs_rsocket_metadata_flag,
3785
16
        { "Metadata", "lbmsrs.rsocket.flags.metadata", FT_BOOLEAN, 16, NULL, 0x0100,NULL, HFILL } },
3786
16
        { &hf_lbmsrs_rsocket_resume_flag,
3787
16
        { "Resume", "lbmsrs.rsocket.flags.resume", FT_BOOLEAN, 16, NULL, 0x0080, NULL,HFILL } },
3788
16
        { &hf_lbmsrs_rsocket_lease_flag,
3789
16
        { "Lease", "lbmsrs.rsocket.flags.lease", FT_BOOLEAN, 16, NULL, 0x0040, NULL,HFILL } },
3790
16
        { &hf_lbmsrs_rsocket_follows_flag,
3791
16
        { "Follows", "lbmsrs.rsocket.flags.follows", FT_BOOLEAN, 16, NULL, 0x0080, NULL,HFILL } },
3792
16
        { &hf_lbmsrs_rsocket_complete_flag,
3793
16
        { "Complete", "lbmsrs.rsocket.flags.complete", FT_BOOLEAN, 16, NULL, 0x0040,NULL, HFILL } },
3794
16
        { &hf_lbmsrs_rsocket_next_flag,
3795
16
        { "Next", "lbmsrs.rsocket.flags.next", FT_BOOLEAN, 16, NULL, 0x0020, NULL,HFILL } },
3796
16
        { &hf_lbmsrs_rsocket_respond_flag,
3797
16
        { "Respond", "lbmsrs.rsocket.flags.respond", FT_BOOLEAN, 16, NULL, 0x0080, NULL,HFILL } },
3798
16
        { &hf_lbmsrs_rsocket_major_version,
3799
16
        { "Major Version", "lbmsrs.rsocket.version.major", FT_UINT16, BASE_DEC, NULL,0x0, NULL, HFILL } },
3800
16
        { &hf_lbmsrs_rsocket_minor_version,
3801
16
        { "Minor Version", "lbmsrs.rsocket.version.minor", FT_UINT16, BASE_DEC, NULL,0x0, NULL, HFILL } },
3802
16
        { &hf_lbmsrs_rsocket_keepalive_interval,
3803
16
        { "Keepalive Interval", "lbmsrs.rsocket.keepalive.interval", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3804
16
        { &hf_lbmsrs_rsocket_max_lifetime,
3805
16
        { "Max Lifetime", "lbmsrs.rsocket.max_lifetime", FT_UINT32, BASE_DEC, NULL, 0x0,NULL, HFILL } },
3806
16
        { &hf_lbmsrs_rsocket_mdata_mime_length,
3807
16
        { "Metadata MIME Length", "lbmsrs.rsocket.mdata_mime_length", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3808
16
        { &hf_lbmsrs_rsocket_mdata_mime_type,
3809
16
        { "Metadata MIME Type", "lbmsrs.rsocket.mdata_mime_type", FT_STRING, BASE_NONE,NULL, 0x0, NULL, HFILL } },
3810
16
        { &hf_lbmsrs_rsocket_data_mime_length,
3811
16
        { "Data MIME Length", "lbmsrs.rsocket.data_mime_length", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3812
16
        { &hf_lbmsrs_rsocket_data_mime_type,
3813
16
        { "Data MIME Type", "lbmsrs.rsocket.data_mime_type", FT_STRING, BASE_NONE, NULL,0x0, NULL, HFILL } },
3814
16
        { &hf_lbmsrs_rsocket_req_n,
3815
16
        { "Request N", "lbmsrs.rsocket.request_n", FT_UINT32, BASE_DEC, NULL, 0x0, NULL,HFILL } },
3816
16
        { &hf_lbmsrs_rsocket_error_code,
3817
16
        { "Error Code", "lbmsrs.rsocket.error_code", FT_UINT32, BASE_DEC,VALS(rSocketErrorCodeNames), 0x0, NULL, HFILL } },
3818
16
        { &hf_lbmsrs_rsocket_keepalive_last_rcvd_pos,
3819
16
        { "Keepalive Last Received Position","lbmsrs.rsocket.keepalive_last_received_position", FT_UINT64, BASE_DEC, NULL,0x0, NULL, HFILL } },
3820
16
        { &hf_lbmsrs_rsocket_resume_token_len,
3821
16
        { "Resume Token Length", "lbmsrs.rsocket.resume.token.len", FT_UINT16, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3822
16
        { &hf_lbmsrs_rsocket_resume_token,
3823
16
        { "Resume Token", "lbmsrs.rsocket.resume.token", FT_STRING, BASE_NONE, NULL, 0x0,NULL, HFILL } },
3824
        /*rsocket related items end*/
3825
3826
        /*SRS Registration Request items start*/
3827
16
        { &hf_lbmsrs_app_type,
3828
16
        { "Application Type", "lbmsrs.registration_request.app_type", FT_UINT8, BASE_DEC,VALS(lbmsrsApplicationType), 0x0, NULL, HFILL } },
3829
16
        { &hf_lbmsrs_client_addr,
3830
16
        { "Client Address", "lbmsrs.registration_request.client_addr", FT_IPv4, BASE_NONE,NULL, 0x0, NULL, HFILL } },
3831
16
        { &hf_lbmsrs_client_port,
3832
16
        { "Client Port", "lbmsrs.registration_request.client_port", FT_UINT16, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3833
16
        { &hf_lbmsrs_session_id,
3834
16
        { "Session ID", "lbmsrs.registration_request.session_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3835
16
        { &hf_lbmsrs_host_id,
3836
16
        { "Host ID", "lbmsrs.registration_request.host_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3837
16
        { &hf_lbmsrs_protocol_version,
3838
16
        { "Protocol Version", "lbmsrs.registration_request.protocol_version", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3839
16
        { &hf_lbmsrs_interest_mode,
3840
16
        { "Interest Mode", "lbmsrs.registration_request.interest_mode", FT_UINT8, BASE_HEX,NULL, 0x0, NULL, HFILL } },
3841
16
        { &hf_lbmsrs_interest_mode_advertise_filter,
3842
16
            { "Filter Advertisements", "lbmsrs.registration_request.interest_mode.advertise_filter", FT_BOOLEAN, L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_INTEREST_MODE * 8, TFS(&tfs_set_notset),LBM_SRS_INTEREST_MODE_SYMBOL_ADVERTISE_FILTER_BIT, "If set, advertisements are filtered", HFILL } },
3843
16
        { &hf_lbmsrs_interest_mode_interest_forward,
3844
16
            { "Forward Interest", "lbmsrs.registration_request.interest_mode.interest_forward", FT_BOOLEAN, L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_INTEREST_MODE * 8, TFS(&tfs_set_notset), LBM_SRS_INTEREST_MODE_SYMBOL_INTEREST_FORWARD_BIT, "If set, topic interest is forwarded", HFILL } },
3845
16
        { &hf_lbmsrs_interest_mode_context_name_filter,
3846
16
            { "Filter Context Names", "lbmsrs.registration_request.interest_mode.context_name_filter", FT_BOOLEAN, L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_INTEREST_MODE * 8, TFS(&tfs_set_notset), LBM_SRS_INTEREST_MODE_CONTEXT_NAME_FILTER_BIT, "If set, context names are filtered", HFILL } },
3847
16
        { &hf_lbmsrs_req_local_domain_id,
3848
16
        { "Local Domain ID", "lbmsrs.registration_request.local_domain_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3849
        /*SRS Registration Request items end*/
3850
3851
        /*SRS Registration Response items start*/
3852
16
        { &hf_lbmsrs_client_id,
3853
16
        { "Client ID", "lbmsrs.registration_response.client_id", FT_UINT64, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3854
16
        { &hf_lbmsrs_resp_local_domain_id,
3855
16
        { "Local Domain ID", "lbmsrs.registration_response.local_domain_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3856
16
        { &hf_lbmsrs_reg_resp_protocol_version,
3857
16
        { "Protocol Version", "lbmsrs.registration_response.protocol_version", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3858
        /*SRS Registration Response items end*/
3859
3860
        /*SRS Stream Request items start*/
3861
16
        { &hf_lbmsrs_stream_req_unused,
3862
16
        { "Unused", "lbmsrs.stream_req.unused", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3863
        /*SRS Stream Request items end*/
3864
3865
        /*SRS Source Info items start*/
3866
16
        { &hf_lbmsrs_sir,
3867
16
        { "SIR", "lbmsrs.sir", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
3868
16
        { &hf_lbmsrs_sir_otid,
3869
16
        { "OTID", "lbmsrs.sir.otid", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
3870
16
        { &hf_lbmsrs_sir_topic_len,
3871
16
        { "Topic Length", "lbmsrs.sir.topic_len", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3872
16
        { &hf_lbmsrs_sir_topic,
3873
16
        { "Topic", "lbmsrs.sir.topic", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL } },
3874
16
        { &hf_lbmsrs_sir_source_len,
3875
16
        { "Source Length", "lbmsrs.sir.source_len", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3876
16
        { &hf_lbmsrs_sir_source,
3877
16
        { "Source", "lbmsrs.sir.source", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL } },
3878
16
        { &hf_lbmsrs_sir_host_id,
3879
16
        { "Host ID", "lbmsrs.sir.host_id", FT_UINT32, BASE_DEC_HEX,NULL, 0x0, NULL, HFILL } },
3880
16
        { &hf_lbmsrs_sir_topic_idx,
3881
16
        { "Topic Index", "lbmsrs.sir.topic_idx", FT_UINT32, BASE_DEC_HEX,NULL, 0x0, NULL, HFILL } },
3882
16
        { &hf_lbmsrs_sir_functionality_flags,
3883
16
        { "Functionality Flags", "lbmsrs.sir.functionality_flags", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3884
16
        { &hf_lbmsrs_sir_request_ip,
3885
16
        { "Request IP", "lbmsrs.sir.request_ip", FT_IPv4, BASE_NONE,NULL, 0x0, NULL, HFILL } },
3886
16
        { &hf_lbmsrs_sir_request_port,
3887
16
        { "Request Port", "lbmsrs.sir.request_port", FT_UINT16, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3888
16
        { &hf_lbmsrs_sir_domain_id,
3889
16
        { "Domain ID", "lbmsrs.sir.domain_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3890
16
        { &hf_lbmsrs_sir_encryption,
3891
16
        { "Encryption", "lbmsrs.sir.encryption", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3892
16
        { &hf_lbmsrs_sir_compression,
3893
16
        { "Compression", "lbmsrs.sir.compression", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3894
16
        { &hf_lbmsrs_sir_ulb_src_id,
3895
16
        { "ULB Source ID", "lbmsrs.sir.ulb_src_id", FT_UINT32, BASE_DEC_HEX,NULL, 0x0, NULL, HFILL } },
3896
16
        { &hf_lbmsrs_sir_ulb_queue_id,
3897
16
        { "ULB Queue ID", "lbmsrs.sir.ulb_queue_id", FT_UINT32, BASE_DEC_HEX,NULL, 0x0, NULL, HFILL } },
3898
16
        { &hf_lbmsrs_sir_ulb_reg_id,
3899
16
        { "ULB Registration ID", "lbmsrs.sir.ulb_reg_id", FT_UINT64, BASE_DEC_HEX,NULL, 0x0, NULL, HFILL } },
3900
16
        { &hf_lbmsrs_sir_context_instance,
3901
16
        { "Context Instance", "lbmsrs.sir.context_instance", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
3902
16
        { &hf_lbmsrs_sir_context_type,
3903
16
        { "Context Type", "lbmsrs.sir.context_type", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3904
16
        { &hf_lbmsrs_sir_version,
3905
16
        { "Version", "lbmsrs.sir.version", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3906
16
        { &hf_lbmsrs_sir_version_flags,
3907
16
        { "Version Flags", "lbmsrs.sir.version_flags", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3908
16
        { &hf_lbmsrs_sir_ttl,
3909
16
        { "TTL", "lbmsrs.sir.ttl", FT_UINT16, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3910
16
        { &hf_lbmsrs_sir_cost,
3911
16
        { "Cost", "lbmsrs.sir.cost", FT_INT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3912
        /*SRS Source Info items end*/
3913
3914
        /*SRS Source Delete items start*/
3915
16
        { &hf_lbmsrs_sdr,
3916
16
        { "SDR", "lbmsrs.sdr", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
3917
16
        { &hf_lbmsrs_sdr_otid,
3918
16
        { "OTID", "lbmsrs.sdr.otid", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
3919
16
        { &hf_lbmsrs_sdr_topic_len,
3920
16
        { "Topic Length", "lbmsrs.sdr.topic_len", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3921
16
        { &hf_lbmsrs_sdr_topic,
3922
16
        { "Topic", "lbmsrs.sdr.topic", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL } },
3923
        /*SRS Source Delete items end*/
3924
3925
        /*SRS Receiver Info items start*/
3926
16
        { &hf_lbmsrs_rir,
3927
16
        { "RIR", "lbmsrs.rir", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
3928
16
        { &hf_lbmsrs_rir_topic_len,
3929
16
        { "Topic Length", "lbmsrs.rir.topic_len", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3930
16
        { &hf_lbmsrs_rir_topic,
3931
16
        { "Topic", "lbmsrs.rir.topic", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL } },
3932
16
        { &hf_lbmsrs_rir_domain_id,
3933
16
        { "Domain ID", "lbmsrs.rir.domain_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3934
16
        { &hf_lbmsrs_rir_context_instance,
3935
16
        { "Context Instance", "lbmsrs.rir.context_instance", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
3936
16
        { &hf_lbmsrs_rir_context_type,
3937
16
        { "Context Type", "lbmsrs.rir.context_type", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3938
16
        { &hf_lbmsrs_rir_version,
3939
16
        { "Version", "lbmsrs.rir.version", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3940
16
        { &hf_lbmsrs_rir_version_flags,
3941
16
        { "Version Flags", "lbmsrs.rir.version_flags", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3942
16
        { &hf_lbmsrs_rir_reserved,
3943
16
        { "Reserved", "lbmsrs.rir.reserved", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3944
        /*SRS Receiver Info items end*/
3945
3946
        /*SRS Receiver Delete Info items start*/
3947
16
        { &hf_lbmsrs_rdr,
3948
16
        { "RDR", "lbmsrs.rdr", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
3949
16
        { &hf_lbmsrs_rdr_topic_len,
3950
16
        { "Topic Length", "lbmsrs.rdr.topic_len", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3951
16
        { &hf_lbmsrs_rdr_topic,
3952
16
        { "Topic", "lbmsrs.rdr.topic", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL } },
3953
16
        { &hf_lbmsrs_rdr_domain_id,
3954
16
        { "Domain ID", "lbmsrs.rdr.domain_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3955
16
        { &hf_lbmsrs_rdr_context_instance,
3956
16
        { "Context Instance", "lbmsrs.rdr.context_instance", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
3957
16
        { &hf_lbmsrs_rdr_context_type,
3958
16
        { "Context Type", "lbmsrs.rdr.context_type", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3959
16
        { &hf_lbmsrs_rdr_version,
3960
16
        { "Version", "lbmsrs.rdr.version", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3961
16
        { &hf_lbmsrs_rdr_version_flags,
3962
16
        { "Version Flags", "lbmsrs.rdr.version_flags", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3963
16
        { &hf_lbmsrs_rdr_reserved,
3964
16
        { "Reserved", "lbmsrs.rdr.reserved", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3965
        /*SRS Receiver Delete items end*/
3966
3967
        /*SRS Receiver End Info items start*/
3968
16
        { &hf_lbmsrs_rer,
3969
16
        { "RER", "lbmsrs.rer", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
3970
16
        { &hf_lbmsrs_rer_topic_len,
3971
16
        { "Topic Length", "lbmsrs.rer.topic_len", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3972
16
        { &hf_lbmsrs_rer_topic,
3973
16
        { "Topic", "lbmsrs.rer.topic", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL } },
3974
16
        { &hf_lbmsrs_rer_domain_id,
3975
16
        { "Domain ID", "lbmsrs.rer.domain_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3976
16
        { &hf_lbmsrs_rer_context_instance,
3977
16
        { "Context Instance", "lbmsrs.rer.context_instance", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
3978
16
        { &hf_lbmsrs_rer_context_type,
3979
16
        { "Context Type", "lbmsrs.rer.context_type", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3980
16
        { &hf_lbmsrs_rer_version,
3981
16
        { "Version", "lbmsrs.rer.version", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3982
16
        { &hf_lbmsrs_rer_version_flags,
3983
16
        { "Version Flags", "lbmsrs.rer.version_flags", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3984
16
        { &hf_lbmsrs_rer_reserved,
3985
16
        { "Reserved", "lbmsrs.rer.reserved", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3986
        /*SRS Receiver End items end*/
3987
3988
3989
        /*SRS Wildcard Receiver Info items start*/
3990
16
        { &hf_lbmsrs_wir,
3991
16
        { "WIR", "lbmsrs.wir", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
3992
16
        { &hf_lbmsrs_wir_pattern_len,
3993
16
        { "Topic Length", "lbmsrs.wir.pattern_len", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3994
16
        { &hf_lbmsrs_wir_pattern,
3995
16
        { "Topic", "lbmsrs.wir.pattern", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL } },
3996
16
        { &hf_lbmsrs_wir_domain_id,
3997
16
        { "Domain ID", "lbmsrs.wir.domain_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
3998
16
        { &hf_lbmsrs_wir_context_instance,
3999
16
        { "Context Instance", "lbmsrs.wir.context_instance", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
4000
16
        { &hf_lbmsrs_wir_context_type,
4001
16
        { "Context Type", "lbmsrs.wir.context_type", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4002
16
        { &hf_lbmsrs_wir_version,
4003
16
        { "Version", "lbmsrs.wir.version", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4004
16
        { &hf_lbmsrs_wir_version_flags,
4005
16
        { "Version Flags", "lbmsrs.wir.version_flags", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4006
16
        { &hf_lbmsrs_wir_reserved,
4007
16
        { "Reserved", "lbmsrs.wir.reserved", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4008
        /*SRS Wildcard Receiver Info items end*/
4009
4010
        /*SRS Wildcard Receiver Delete Info items start*/
4011
16
        { &hf_lbmsrs_wdr,
4012
16
        { "WDR", "lbmsrs.wdr", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
4013
16
        { &hf_lbmsrs_wdr_pattern_len,
4014
16
        { "Topic Length", "lbmsrs.wdr.pattern_len", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4015
16
        { &hf_lbmsrs_wdr_pattern,
4016
16
        { "Topic", "lbmsrs.wdr.pattern", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL } },
4017
16
        { &hf_lbmsrs_wdr_domain_id,
4018
16
        { "Domain ID", "lbmsrs.wdr.domain_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4019
16
        { &hf_lbmsrs_wdr_context_instance,
4020
16
        { "Context Instance", "lbmsrs.wdr.context_instance", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
4021
16
        { &hf_lbmsrs_wdr_context_type,
4022
16
        { "Context Type", "lbmsrs.wdr.context_type", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4023
16
        { &hf_lbmsrs_wdr_version,
4024
16
        { "Version", "lbmsrs.wdr.version", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4025
16
        { &hf_lbmsrs_wdr_version_flags,
4026
16
        { "Version Flags", "lbmsrs.wdr.version_flags", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4027
16
        { &hf_lbmsrs_wdr_reserved,
4028
16
        { "Reserved", "lbmsrs.wdr.reserved", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4029
        /*SRS Wildcard Receiver Delete items end*/
4030
4031
        /*SRS Wildcard Receiver End Info items start*/
4032
16
        { &hf_lbmsrs_wer,
4033
16
        { "WER", "lbmsrs.wer", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
4034
16
        { &hf_lbmsrs_wer_pattern_len,
4035
16
        { "Topic Length", "lbmsrs.wer.pattern_len", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4036
16
        { &hf_lbmsrs_wer_pattern,
4037
16
        { "Topic", "lbmsrs.wer.pattern", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL } },
4038
16
        { &hf_lbmsrs_wer_domain_id,
4039
16
        { "Domain ID", "lbmsrs.wer.domain_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4040
16
        { &hf_lbmsrs_wer_context_instance,
4041
16
        { "Context Instance", "lbmsrs.wer.context_instance", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
4042
16
        { &hf_lbmsrs_wer_context_type,
4043
16
        { "Context Type", "lbmsrs.wer.context_type", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4044
16
        { &hf_lbmsrs_wer_version,
4045
16
        { "Version", "lbmsrs.wer.version", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4046
16
        { &hf_lbmsrs_wer_version_flags,
4047
16
        { "Version Flags", "lbmsrs.wer.version_flags", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4048
16
        { &hf_lbmsrs_wer_reserved,
4049
16
        { "Reserved", "lbmsrs.wer.reserved", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4050
        /*SRS Wildcard Receiver End items end*/
4051
4052
        /*SRS Source Leave Info items start*/
4053
16
        { &hf_lbmsrs_sli,
4054
16
        { "SLI", "lbmsrs.sli", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
4055
16
        { &hf_lbmsrs_sli_otid,
4056
16
        { "OTID", "lbmsrs.sli.otid", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
4057
16
        { &hf_lbmsrs_sli_topic_len,
4058
16
        { "Topic Length", "lbmsrs.sli.topic_len", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4059
16
        { &hf_lbmsrs_sli_topic,
4060
16
        { "Topic", "lbmsrs.sli.topic", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL } },
4061
16
        { &hf_lbmsrs_sli_source_len,
4062
16
        { "Source Length", "lbmsrs.sli.source_len", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4063
16
        { &hf_lbmsrs_sli_source,
4064
16
        { "Source", "lbmsrs.sli.source", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL } },
4065
16
        { &hf_lbmsrs_sli_context_instance,
4066
16
        { "Context Instance", "lbmsrs.sli.context_instance", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
4067
16
        { &hf_lbmsrs_sli_context_type,
4068
16
        { "Context Type", "lbmsrs.sli.context_type", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4069
16
        { &hf_lbmsrs_sli_version,
4070
16
        { "Version", "lbmsrs.sli.version", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4071
16
        { &hf_lbmsrs_sli_version_flags,
4072
16
        { "Version Flags", "lbmsrs.sli.version_flags", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4073
16
        { &hf_lbmsrs_sli_reserved,
4074
16
        { "Reserved", "lbmsrs.sli.reserved", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4075
        /*SRS Source Leave Info items end*/
4076
4077
        /*SRS Route Info items start*/
4078
16
        { &hf_lbmsrs_rti,
4079
16
        { "RTI", "lbmsrs.rti", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
4080
16
        { &hf_lbmsrs_rti_num_domains,
4081
16
        { "Number of domains", "lbmsrs.rti.num_domains", FT_UINT16, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4082
16
        { &hf_lbmsrs_rti_domains,
4083
16
        { "Domains", "lbmsrs.rti.domains", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
4084
16
        { &hf_lbmsrs_rti_domain,
4085
16
        { "Domain", "lbmsrs.rti.domains.domain", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4086
16
        { &hf_lbmsrs_rti_ip,
4087
16
        { "IP", "lbmsrs.rti.ip", FT_IPv4, BASE_NONE,NULL, 0x0, NULL, HFILL } },
4088
16
        { &hf_lbmsrs_rti_port,
4089
16
        { "Port", "lbmsrs.rti.port", FT_UINT16, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4090
16
        { &hf_lbmsrs_rti_context_instance,
4091
16
        { "Context Instance", "lbmsrs.rti.context_instance", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
4092
16
        { &hf_lbmsrs_rti_context_type,
4093
16
        { "Context Type", "lbmsrs.rti.context_type", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4094
16
        { &hf_lbmsrs_rti_version,
4095
16
        { "Version", "lbmsrs.rti.version", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4096
16
        { &hf_lbmsrs_rti_version_flags,
4097
16
        { "Version Flags", "lbmsrs.rti.version_flags", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4098
16
        { &hf_lbmsrs_rti_route_index,
4099
16
        { "Route Index", "lbmsrs.rti.route_index", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
4100
16
        { &hf_lbmsrs_rti_reserved,
4101
16
        { "Reserved", "lbmsrs.rti.reserved", FT_UINT16, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4102
        /*SRS Route Info items end*/
4103
4104
        /*SRS Route End items start*/
4105
16
        { &hf_lbmsrs_rte,
4106
16
        { "RTE", "lbmsrs.rte", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
4107
16
        { &hf_lbmsrs_rte_num_domains,
4108
16
        { "Number of domains", "lbmsrs.rte.num_domains", FT_UINT16, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4109
16
        { &hf_lbmsrs_rte_domains,
4110
16
        { "Domains", "lbmsrs.rte.domains", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
4111
16
        { &hf_lbmsrs_rte_domain,
4112
16
        { "Domain", "lbmsrs.rte.domains.domain", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4113
16
        { &hf_lbmsrs_rte_ip,
4114
16
        { "IP", "lbmsrs.rte.ip", FT_IPv4, BASE_NONE,NULL, 0x0, NULL, HFILL } },
4115
16
        { &hf_lbmsrs_rte_port,
4116
16
        { "Port", "lbmsrs.rte.port", FT_UINT16, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4117
16
        { &hf_lbmsrs_rte_context_instance,
4118
16
        { "Context Instance", "lbmsrs.rte.context_instance", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
4119
16
        { &hf_lbmsrs_rte_context_type,
4120
16
        { "Context Type", "lbmsrs.rte.context_type", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4121
16
        { &hf_lbmsrs_rte_version,
4122
16
        { "Version", "lbmsrs.rte.version", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4123
16
        { &hf_lbmsrs_rte_version_flags,
4124
16
        { "Version Flags", "lbmsrs.rte.version_flags", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4125
16
        { &hf_lbmsrs_rte_route_index,
4126
16
        { "Route Index", "lbmsrs.rte.route_index", FT_UINT16, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4127
16
        { &hf_lbmsrs_rte_reserved,
4128
16
        { "Reserved", "lbmsrs.rte.reserved", FT_UINT16, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4129
        /*SRS Route End items end*/
4130
4131
        /*SRS Domain Info items start*/
4132
16
        { &hf_lbmsrs_dmi,
4133
16
        { "DMI", "lbmsrs.dmi", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
4134
16
        { &hf_lbmsrs_dmi_domain_id,
4135
16
        { "Domain Id", "lbmsrs.dmi.domain_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4136
16
        { &hf_lbmsrs_dmi_context_instance,
4137
16
        { "Context Instance", "lbmsrs.dmi.context_instance", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
4138
16
        { &hf_lbmsrs_dmi_context_type,
4139
16
        { "Context Type", "lbmsrs.dmi.context_type", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4140
16
        { &hf_lbmsrs_dmi_version,
4141
16
        { "Version", "lbmsrs.dmi.version", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4142
16
        { &hf_lbmsrs_dmi_version_flags,
4143
16
        { "Version Flags", "lbmsrs.dmi.version_flags", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4144
16
        { &hf_lbmsrs_dmi_reserved,
4145
16
        { "Reserved", "lbmsrs.dmi.reserved", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4146
        /*SRS Domain Info items end*/
4147
4148
        /*SRS Context Name Query items start*/
4149
16
        { &hf_lbmsrs_cnq,
4150
16
        { "CNQ", "lbmsrs.cnq", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
4151
16
        { &hf_lbmsrs_cnq_name_len,
4152
16
        { "Name Length", "lbmsrs.cnq.name_len", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4153
16
        { &hf_lbmsrs_cnq_name,
4154
16
        { "Name", "lbmsrs.cnq.name", FT_STRING, BASE_NONE,NULL, 0x0, NULL, HFILL } },
4155
16
        { &hf_lbmsrs_cnq_domain_id,
4156
16
        { "Domain Id", "lbmsrs.cnq.domain_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4157
16
        { &hf_lbmsrs_cnq_context_instance,
4158
16
        { "Context Instance", "lbmsrs.cnq.context_instance", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
4159
16
        { &hf_lbmsrs_cnq_context_type,
4160
16
        { "Context Type", "lbmsrs.cnq.context_type", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4161
16
        { &hf_lbmsrs_cnq_version,
4162
16
        { "Version", "lbmsrs.cnq.version", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4163
16
        { &hf_lbmsrs_cnq_version_flags,
4164
16
        { "Version Flags", "lbmsrs.cnq.version_flags", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4165
16
        { &hf_lbmsrs_cnq_reserved,
4166
16
        { "Reserved", "lbmsrs.cnq.reserved", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4167
        /*SRS Context Name Query items end*/
4168
4169
        /*SRS Context Name Info items start*/
4170
16
        { &hf_lbmsrs_cni,
4171
16
        { "CNI", "lbmsrs.cni", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
4172
16
        { &hf_lbmsrs_cni_name_len,
4173
16
        { "Name Length", "lbmsrs.cni.name_len", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4174
16
        { &hf_lbmsrs_cni_name,
4175
16
        { "Name", "lbmsrs.cni.name", FT_STRING, BASE_NONE,NULL, 0x0, NULL, HFILL } },
4176
16
        { &hf_lbmsrs_cni_domain_id,
4177
16
        { "Domain Id", "lbmsrs.cni.domain_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4178
16
        { &hf_lbmsrs_cni_ip,
4179
16
        { "IP", "lbmsrs.cni.ip", FT_IPv4, BASE_NONE,NULL, 0x0, NULL, HFILL } },
4180
16
        { &hf_lbmsrs_cni_port,
4181
16
        { "Port", "lbmsrs.cni.port", FT_UINT16, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4182
16
        { &hf_lbmsrs_cni_origin_context_instance,
4183
16
        { "Origin Context Instance", "lbmsrs.cni.origin_context_instance", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
4184
16
        { &hf_lbmsrs_cni_context_instance,
4185
16
        { "Context Instance", "lbmsrs.cni.context_instance", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
4186
16
        { &hf_lbmsrs_cni_context_type,
4187
16
        { "Context Type", "lbmsrs.cni.context_type", FT_UINT8, BASE_DEC, VALS(lbmsrsContextType), 0x0, NULL, HFILL } },
4188
16
        { &hf_lbmsrs_cni_version,
4189
16
        { "Version", "lbmsrs.cni.version", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4190
16
        { &hf_lbmsrs_cni_version_flags,
4191
16
        { "Version Flags", "lbmsrs.cni.version_flags", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4192
16
        { &hf_lbmsrs_cni_reserved,
4193
16
        { "Reserved", "lbmsrs.cni.reserved", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4194
        /*SRS Context Name Info items end*/
4195
4196
        /*SRS Context Name End items start*/
4197
16
        { &hf_lbmsrs_cne,
4198
16
        { "CNE", "lbmsrs.cne", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
4199
16
        { &hf_lbmsrs_cne_name_len,
4200
16
        { "Name Length", "lbmsrs.cne.name_len", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4201
16
        { &hf_lbmsrs_cne_name,
4202
16
        { "Name", "lbmsrs.cne.name", FT_STRING, BASE_NONE,NULL, 0x0, NULL, HFILL } },
4203
16
        { &hf_lbmsrs_cne_domain_id,
4204
16
        { "Domain Id", "lbmsrs.cne.domain_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4205
16
        { &hf_lbmsrs_cne_ip,
4206
16
        { "IP", "lbmsrs.cne.ip", FT_IPv4, BASE_NONE,NULL, 0x0, NULL, HFILL } },
4207
16
        { &hf_lbmsrs_cne_port,
4208
16
        { "Port", "lbmsrs.cne.port", FT_UINT16, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4209
16
        { &hf_lbmsrs_cne_origin_context_instance,
4210
16
        { "Origin Context Instance", "lbmsrs.cne.origin_context_instance", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
4211
16
        { &hf_lbmsrs_cne_context_instance,
4212
16
        { "Context Instance", "lbmsrs.cne.context_instance", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
4213
16
        { &hf_lbmsrs_cne_context_type,
4214
16
        { "Context Type", "lbmsrs.cne.context_type", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4215
16
        { &hf_lbmsrs_cne_version,
4216
16
        { "Version", "lbmsrs.cne.version", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4217
16
        { &hf_lbmsrs_cne_version_flags,
4218
16
        { "Version Flags", "lbmsrs.cne.version_flags", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
4219
16
        { &hf_lbmsrs_cne_reserved,
4220
16
        { "Reserved", "lbmsrs.cne.reserved", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } }
4221
        /*SRS Context Name End items end*/
4222
4223
16
    };
4224
4225
16
    static int *ett[] =
4226
16
    {
4227
16
        &ett_lbmsrs,
4228
16
        &ett_lbmsrs_rsocket_frame,
4229
16
        &ett_lbmsrs_data,
4230
16
        &ett_lbmsrs_details,
4231
16
        &ett_lbmsrs_sir,
4232
16
        &ett_lbmsrs_sdr,
4233
16
        &ett_lbmsrs_ser,
4234
16
        &ett_lbmsrs_rir,
4235
16
        &ett_lbmsrs_rdr,
4236
16
        &ett_lbmsrs_rer,
4237
16
        &ett_lbmsrs_wir,
4238
16
        &ett_lbmsrs_wdr,
4239
16
        &ett_lbmsrs_wer,
4240
16
        &ett_lbmsrs_sli,
4241
16
        &ett_lbmsrs_rti,
4242
16
        &ett_lbmsrs_rti_domains,
4243
16
        &ett_lbmsrs_rte,
4244
16
        &ett_lbmsrs_rte_domains,
4245
16
        &ett_lbmsrs_dmi,
4246
16
        &ett_lbmsrs_cnq,
4247
16
        &ett_lbmsrs_cni,
4248
16
        &ett_lbmsrs_cne,
4249
16
        &ett_lbmsrs_interest_mode
4250
16
    };
4251
4252
16
    static ei_register_info ei[] =
4253
16
    {
4254
16
        { &ei_lbmsrs_analysis_invalid_msg_id, { "lbmsrs.analysis.invalid_msg_id", PI_MALFORMED, PI_ERROR, "Invalid LBMSRS Message Id", EXPFILL } }
4255
16
    };
4256
16
    proto_lbmsrs = proto_register_protocol("LBM Stateful Resolution Service Protocol", "LBMSRS", "lbmsrs");
4257
16
    proto_register_field_array(proto_lbmsrs, hf, array_length(hf));
4258
16
    proto_register_subtree_array(ett, array_length(ett));
4259
4260
16
    expert_module_t *expert_lbmsrs = expert_register_protocol(proto_lbmsrs);
4261
16
    expert_register_field_array(expert_lbmsrs, ei, array_length(ei));
4262
4263
16
    lbmsrs_dissector_handle = register_dissector("lbmsrs", dissect_lbmsrs, proto_lbmsrs);
4264
4265
    /*Set the preference menu items*/
4266
16
    module_t* lbmsrs_module = prefs_register_protocol_subtree("29West", proto_lbmsrs, proto_reg_handoff_lbmsrs);
4267
4268
16
    uint32_t addr;
4269
16
    ws_inet_pton4(LBMSRS_DEFAULT_SOURCE_IP, &addr);
4270
16
    lbmsrs_source_ip_address = g_ntohl(addr);
4271
16
    prefs_register_string_preference(lbmsrs_module,
4272
16
        "source_ip_address",
4273
16
        "Source IP address (default " LBMSRS_DEFAULT_SOURCE_IP ")",
4274
16
        "Set the LBMSRS IP Address",
4275
16
        &global_lbmsrs_source_ip_address);
4276
4277
16
    prefs_register_uint_preference(lbmsrs_module,
4278
16
        "source_port",
4279
16
        "Source port (default " MAKESTRING(LBMSRS_DEFAULT_SOURCE_PORT)")",
4280
16
        "Set the source TCP port",
4281
16
        10,
4282
16
        &global_lbmsrs_source_port);
4283
4284
16
    prefs_register_bool_preference(lbmsrs_module,
4285
16
        "use_lbmsrs_domain",
4286
16
        "Use LBMSRS tag table",
4287
16
        "Use table of LBMSRS tags to decode the packet instead of above values",
4288
16
        &global_lbmsrs_use_tag);
4289
4290
16
    uat_t *tag_uat = uat_new("LBMSRS tag definitions",
4291
16
        sizeof(lbmsrs_tag_entry_t),
4292
16
        "lbmsrs_domains",
4293
16
        true,
4294
16
        (void * *)&lbmsrs_tag_entry,
4295
16
        &lbmsrs_tag_count,
4296
16
        UAT_AFFECTS_DISSECTION,
4297
16
        NULL,
4298
16
        lbmsrs_tag_copy_cb,
4299
16
        lbmsrs_tag_update_cb,
4300
16
        lbmsrs_tag_free_cb,
4301
16
        NULL,
4302
16
        NULL,
4303
16
        lbmsrs_tag_array);
4304
4305
    /*add the tag edit table*/
4306
16
    prefs_register_uat_preference(lbmsrs_module,
4307
16
        "tnw_lbmsrs_tags",
4308
16
        "LBMSRS Tags",
4309
16
        "A table to define LBMSRS tags",
4310
16
        tag_uat);
4311
16
}
4312
4313
void proto_reg_handoff_lbmsrs(void)
4314
16
{
4315
16
    static bool already_registered = false;
4316
16
    uint32_t addr;
4317
4318
16
    if (!already_registered)
4319
16
    {
4320
16
        lbmsrs_dissector_handle = create_dissector_handle(dissect_lbmsrs, proto_lbmsrs);
4321
16
        dissector_add_for_decode_as_with_preference("tcp.port", lbmsrs_dissector_handle);
4322
16
        heur_dissector_add("tcp", test_lbmsrs_packet, "LBM Stateful Resolution Service over RSocket", "lbmsrs_tcp", proto_lbmsrs, HEURISTIC_ENABLE);
4323
16
    }
4324
4325
16
    ws_inet_pton4(global_lbmsrs_source_ip_address, &addr);
4326
16
    lbmsrs_source_ip_address = g_ntohl(addr);
4327
16
    lbmsrs_source_port = global_lbmsrs_source_port;
4328
16
    lbmsrs_use_tag = global_lbmsrs_use_tag;
4329
    already_registered = true;
4330
16
}
4331
/*
4332
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
4333
 *
4334
 * Local variables:
4335
 * c-basic-offset: 4
4336
 * tab-width: 8
4337
 * indent-tabs-mode: nil
4338
 * End:
4339
 *
4340
 * vi: set shiftwidth=4 tabstop=8 expandtab:
4341
 * :indentSize=4:tabSize=8:noTabs=true:
4342
 */