Use address functions instead of ADDRESS macros in asn1 and epan
[metze/wireshark/wip.git] / epan / dissectors / packet-lbmr.c
1 /* packet-lbmr.c
2  * Routines for LBM Topic Resolution 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  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23  */
24
25 #include "config.h"
26 #ifdef HAVE_ARPA_INET_H
27     #include <arpa/inet.h>
28 #endif
29 #if HAVE_WINSOCK2_H
30     #include <winsock2.h>
31 #endif
32 #include <epan/packet.h>
33 #include <epan/address.h>
34 #include <epan/strutil.h>
35 #include <epan/prefs.h>
36 #include <epan/tap.h>
37 #include <epan/stats_tree.h>
38 #include <epan/expert.h>
39 #include <epan/uat.h>
40 #include <epan/to_str.h>
41 #ifndef HAVE_INET_ATON
42     #include <wsutil/inet_aton.h>
43 #endif
44 #include <wsutil/pint.h>
45 #include "packet-lbm.h"
46 #include "packet-lbtru.h"
47 #include "packet-lbtrm.h"
48 #include "packet-lbttcp.h"
49
50 #define LBMR_MAX_NAMELEN 256
51
52 void proto_register_lbmr(void);
53 void proto_reg_handoff_lbmr(void);
54
55 /*----------------------------------------------------------------------------*/
56 /* LBT-IPC transport management.                                              */
57 /*----------------------------------------------------------------------------*/
58
59 typedef struct
60 {
61     guint32 host_id;
62     guint32 session_id;
63     guint16 xport_id;
64     guint64 channel;
65 } lbtipc_transport_t;
66
67 static wmem_tree_t * lbtipc_transport_table = NULL;
68
69 #define LBTIPC_KEY_ELEMENT_COUNT 3
70 #define LBTIPC_KEY_ELEMENT_HOST_ID 0
71 #define LBTIPC_KEY_ELEMENT_SESSION_ID 1
72 #define LBTIPC_KEY_ELEMENT_XPORT_ID 2
73
74 static void lbtipc_transport_init(void)
75 {
76     lbtipc_transport_table = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
77 }
78
79 static lbtipc_transport_t * lbtipc_transport_find(guint32 host_id, guint32 session_id, guint16 xport_id)
80 {
81     lbtipc_transport_t * entry = NULL;
82     guint32 keyval[LBTIPC_KEY_ELEMENT_COUNT];
83     wmem_tree_key_t tkey[2];
84
85     keyval[LBTIPC_KEY_ELEMENT_HOST_ID] = host_id;
86     keyval[LBTIPC_KEY_ELEMENT_SESSION_ID] = session_id;
87     keyval[LBTIPC_KEY_ELEMENT_XPORT_ID] = (guint32) xport_id;
88     tkey[0].length = LBTIPC_KEY_ELEMENT_COUNT;
89     tkey[0].key = keyval;
90     tkey[1].length = 0;
91     tkey[1].key = NULL;
92     entry = (lbtipc_transport_t *) wmem_tree_lookup32_array(lbtipc_transport_table, tkey);
93     return (entry);
94 }
95
96 static lbtipc_transport_t * lbtipc_transport_add(guint32 host_id, guint32 session_id, guint16 xport_id)
97 {
98     lbtipc_transport_t * entry;
99     guint32 keyval[LBTIPC_KEY_ELEMENT_COUNT];
100     wmem_tree_key_t tkey[2];
101
102     entry = lbtipc_transport_find(host_id, session_id, xport_id);
103     if (entry != NULL)
104     {
105         return (entry);
106     }
107     entry = wmem_new(wmem_file_scope(), lbtipc_transport_t);
108     entry->host_id = host_id;
109     entry->session_id = session_id;
110     entry->xport_id = xport_id;
111     entry->channel = lbm_channel_assign(LBM_CHANNEL_TRANSPORT_LBTIPC);
112     keyval[LBTIPC_KEY_ELEMENT_HOST_ID] = host_id;
113     keyval[LBTIPC_KEY_ELEMENT_SESSION_ID] = session_id;
114     keyval[LBTIPC_KEY_ELEMENT_XPORT_ID] = (guint32) xport_id;
115     tkey[0].length = LBTIPC_KEY_ELEMENT_COUNT;
116     tkey[0].key = keyval;
117     tkey[1].length = 0;
118     tkey[1].key = NULL;
119     wmem_tree_insert32_array(lbtipc_transport_table, tkey, (void *) entry);
120     return (entry);
121 }
122
123 static char * lbtipc_transport_source_string(guint32 host_id _U_, guint32 session_id, guint16 xport_id)
124 {
125     return (wmem_strdup_printf(wmem_file_scope(), "LBT-IPC:%x:%" G_GUINT16_FORMAT, session_id, xport_id));
126 }
127
128 /*----------------------------------------------------------------------------*/
129 /* LBT-SMX transport management.                                              */
130 /*----------------------------------------------------------------------------*/
131
132 typedef struct
133 {
134     guint32 host_id;
135     guint32 session_id;
136     guint16 xport_id;
137     guint64 channel;
138 } lbtsmx_transport_t;
139
140 static wmem_tree_t * lbtsmx_transport_table = NULL;
141
142 #define LBTSMX_KEY_ELEMENT_COUNT 3
143 #define LBTSMX_KEY_ELEMENT_HOST_ID 0
144 #define LBTSMX_KEY_ELEMENT_SESSION_ID 1
145 #define LBTSMX_KEY_ELEMENT_XPORT_ID 2
146
147 static void lbtsmx_transport_init(void)
148 {
149     lbtsmx_transport_table = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
150 }
151
152 static lbtsmx_transport_t * lbtsmx_transport_find(guint32 host_id, guint32 session_id, guint16 xport_id)
153 {
154     lbtsmx_transport_t * entry = NULL;
155     guint32 keyval[LBTSMX_KEY_ELEMENT_COUNT];
156     wmem_tree_key_t tkey[2];
157
158     keyval[LBTSMX_KEY_ELEMENT_HOST_ID] = host_id;
159     keyval[LBTSMX_KEY_ELEMENT_SESSION_ID] = session_id;
160     keyval[LBTSMX_KEY_ELEMENT_XPORT_ID] = (guint32) xport_id;
161     tkey[0].length = LBTSMX_KEY_ELEMENT_COUNT;
162     tkey[0].key = keyval;
163     tkey[1].length = 0;
164     tkey[1].key = NULL;
165     entry = (lbtsmx_transport_t *) wmem_tree_lookup32_array(lbtsmx_transport_table, tkey);
166     return (entry);
167 }
168
169 static lbtsmx_transport_t * lbtsmx_transport_add(guint32 host_id, guint32 session_id, guint16 xport_id)
170 {
171     lbtsmx_transport_t * entry;
172     guint32 keyval[LBTSMX_KEY_ELEMENT_COUNT];
173     wmem_tree_key_t tkey[2];
174
175     entry = lbtsmx_transport_find(host_id, session_id, xport_id);
176     if (entry != NULL)
177     {
178         return (entry);
179     }
180     entry = wmem_new(wmem_file_scope(), lbtsmx_transport_t);
181     entry->host_id = host_id;
182     entry->session_id = session_id;
183     entry->xport_id = xport_id;
184     entry->channel = lbm_channel_assign(LBM_CHANNEL_TRANSPORT_LBTSMX);
185     keyval[LBTSMX_KEY_ELEMENT_HOST_ID] = host_id;
186     keyval[LBTSMX_KEY_ELEMENT_SESSION_ID] = session_id;
187     keyval[LBTSMX_KEY_ELEMENT_XPORT_ID] = (guint32) xport_id;
188     tkey[0].length = LBTSMX_KEY_ELEMENT_COUNT;
189     tkey[0].key = keyval;
190     tkey[1].length = 0;
191     tkey[1].key = NULL;
192     wmem_tree_insert32_array(lbtsmx_transport_table, tkey, (void *) entry);
193     return (entry);
194 }
195
196 static char * lbtsmx_transport_source_string(guint32 host_id _U_, guint32 session_id, guint16 xport_id)
197 {
198     return (wmem_strdup_printf(wmem_file_scope(), "LBT-SMX:%x:%" G_GUINT16_FORMAT, session_id, xport_id));
199 }
200
201 /*----------------------------------------------------------------------------*/
202 /* LBT-RDMA transport management.                                             */
203 /*----------------------------------------------------------------------------*/
204
205 typedef struct
206 {
207     address source_address;
208     guint32 session_id;
209     guint16 port;
210     guint64 channel;
211 } lbtrdma_transport_t;
212
213 static wmem_tree_t * lbtrdma_transport_table = NULL;
214
215 #define LBTRDMA_KEY_ELEMENT_COUNT          3
216 #define LBTRDMA_KEY_ELEMENT_SOURCE_ADDRESS 0
217 #define LBTRDMA_KEY_ELEMENT_SESSION_ID     1
218 #define LBTRDMA_KEY_ELEMENT_PORT           2
219
220 static void lbtrdma_transport_init(void)
221 {
222     lbtrdma_transport_table = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
223 }
224
225 static void lbtrdma_transport_build_key(guint32 * key_value, wmem_tree_key_t * key, const lbtrdma_transport_t * transport)
226 {
227     guint32 val;
228
229     memcpy((void *) &val, (void *) transport->source_address.data, sizeof(guint32));
230     key_value[LBTRDMA_KEY_ELEMENT_SOURCE_ADDRESS] = val;
231     key_value[LBTRDMA_KEY_ELEMENT_SESSION_ID] = transport->session_id;
232     key_value[LBTRDMA_KEY_ELEMENT_PORT] = (guint32) transport->port;
233     key[0].length = LBTRDMA_KEY_ELEMENT_COUNT;
234     key[0].key = key_value;
235     key[1].length = 0;
236     key[1].key = NULL;
237 }
238
239 static lbtrdma_transport_t * lbtrdma_transport_find(const address * source_address, guint32 session_id, guint16 port)
240 {
241     lbtrdma_transport_t key;
242     lbtrdma_transport_t * entry = NULL;
243     guint32 keyval[LBTRDMA_KEY_ELEMENT_COUNT];
244     wmem_tree_key_t tkey[2];
245
246     memset((void *)&key, 0, sizeof(lbtrdma_transport_t));
247     copy_address_shallow(&(key.source_address), source_address);
248     key.session_id = session_id;
249     key.port = port;
250     lbtrdma_transport_build_key(keyval, tkey, &key);
251     entry = (lbtrdma_transport_t *) wmem_tree_lookup32_array(lbtrdma_transport_table, tkey);
252     return (entry);
253 }
254
255 static lbtrdma_transport_t * lbtrdma_transport_add(const address * source_address, guint32 session_id, guint16 port)
256 {
257     lbtrdma_transport_t * entry;
258     guint32 keyval[LBTRDMA_KEY_ELEMENT_COUNT];
259     wmem_tree_key_t tkey[2];
260
261     entry = lbtrdma_transport_find(source_address, session_id, port);
262     if (entry != NULL)
263     {
264         return (entry);
265     }
266     entry = wmem_new(wmem_file_scope(), lbtrdma_transport_t);
267     WMEM_COPY_ADDRESS(wmem_file_scope(), &(entry->source_address), source_address);
268     entry->session_id = session_id;
269     entry->port = port;
270     entry->channel = lbm_channel_assign(LBM_CHANNEL_TRANSPORT_LBTRDMA);
271     lbtrdma_transport_build_key(keyval, tkey, entry);
272     wmem_tree_insert32_array(lbtrdma_transport_table, tkey, (void *) entry);
273     return (entry);
274 }
275
276 static char * lbtrdma_transport_source_string(const address * source_address _U_, guint32 session_id, guint16 port)
277 {
278     return (wmem_strdup_printf(wmem_file_scope(), "LBT-RDMA:%x:%" G_GUINT16_FORMAT, session_id, port));
279 }
280
281 /*----------------------------------------------------------------------------*/
282 /* Packet layouts.                                                            */
283 /*----------------------------------------------------------------------------*/
284
285 /* LBMR main header. */
286 typedef struct
287 {
288     lbm_uint8_t ver_type;
289     lbm_uint8_t tqrs;
290     lbm_uint16_t tirs;
291 } lbmr_hdr_t;
292 #define O_LBMR_HDR_T_VER_TYPE OFFSETOF(lbmr_hdr_t, ver_type)
293 #define L_LBMR_HDR_T_VER_TYPE SIZEOF(lbmr_hdr_t, ver_type)
294 #define O_LBMR_HDR_T_TQRS OFFSETOF(lbmr_hdr_t, tqrs)
295 #define L_LBMR_HDR_T_TQRS SIZEOF(lbmr_hdr_t, tqrs)
296 #define O_LBMR_HDR_T_TIRS OFFSETOF(lbmr_hdr_t, tirs)
297 #define L_LBMR_HDR_T_TIRS SIZEOF(lbmr_hdr_t, tirs)
298 #define L_LBMR_HDR_T (gint) sizeof(lbmr_hdr_t)
299
300 #define LBMR_HDR_VER_VER_MASK 0xf0
301 #define LBMR_HDR_VER_TYPE_MASK 0x07
302 #define LBMR_HDR_VER(x) (((x) & LBMR_HDR_VER_VER_MASK) >> 4)
303 #define LBMR_HDR_TYPE(x) ((x) & LBMR_HDR_VER_TYPE_MASK)
304
305 #define LBMR_HDR_TYPE_NORMAL 0x0
306 #define LBMR_HDR_TYPE_WC_TQRS 0x1
307 #define LBMR_HDR_TYPE_UCAST_RCV_ALIVE 0x2
308 #define LBMR_HDR_TYPE_UCAST_SRC_ALIVE 0x3
309 #define LBMR_HDR_TYPE_TOPIC_MGMT 0x4
310 #define LBMR_HDR_TYPE_QUEUE_RES 0x6
311 #define LBMR_HDR_TYPE_EXT 0x7
312 #define LBMR_HDR_TYPE_OPTS_MASK 0x8
313
314 /* LBMR extended header. */
315 typedef struct
316 {
317     lbm_uint8_t ver_type;
318     lbm_uint8_t ext_type;
319     lbm_uint16_t dep;
320 } lbmr_hdr_ext_type_t;
321 #define O_LBMR_HDR_EXT_TYPE_T_VER_TYPE OFFSETOF(lbmr_hdr_ext_type_t, ver_type)
322 #define L_LBMR_HDR_EXT_TYPE_T_VER_TYPE SIZEOF(lbmr_hdr_ext_type_t, ver_type)
323 #define O_LBMR_HDR_EXT_TYPE_T_EXT_TYPE OFFSETOF(lbmr_hdr_ext_type_t, ext_type)
324 #define L_LBMR_HDR_EXT_TYPE_T_EXT_TYPE SIZEOF(lbmr_hdr_ext_type_t, ext_type)
325 #define O_LBMR_HDR_EXT_TYPE_T_DEP OFFSETOF(lbmr_hdr_ext_type_t, dep)
326 #define L_LBMR_HDR_EXT_TYPE_T_DEP SIZEOF(lbmr_hdr_ext_type_t, dep)
327 #define L_LBMR_HDR_EXT_TYPE_T (gint) sizeof(lbmr_hdr_ext_type_t)
328
329 #define LBMR_HDR_EXT_TYPE_UME_PROXY_SRC_ELECT 0x1
330 #define LBMR_HDR_EXT_TYPE_UMQ_QUEUE_MGMT 0x2
331 #define LBMR_HDR_EXT_TYPE_CONTEXT_INFO 0x3
332 #define LBMR_HDR_EXT_TYPE_TOPIC_RES_REQUEST 0x4
333 #define LBMR_HDR_EXT_TYPE_TNWG_MSG 0x5
334 #define LBMR_HDR_EXT_TYPE_REMOTE_DOMAIN_ROUTE 0x6
335 #define LBMR_HDR_EXT_TYPE_REMOTE_CONTEXT_INFO 0x7
336
337 /* LBMR topic information record */
338 typedef struct
339 {
340     lbm_uint8_t transport;
341     lbm_uint8_t tlen;
342     lbm_uint16_t ttl;
343     lbm_uint32_t idx;
344 } lbmr_tir_t;
345 #define O_LBMR_TIR_T_TRANSPORT OFFSETOF(lbmr_tir_t, transport)
346 #define L_LBMR_TIR_T_TRANSPORT SIZEOF(lbmr_tir_t, transport)
347 #define O_LBMR_TIR_T_TLEN OFFSETOF(lbmr_tir_t, tlen)
348 #define L_LBMR_TIR_T_TLEN SIZEOF(lbmr_tir_t, tlen)
349 #define O_LBMR_TIR_T_TTL OFFSETOF(lbmr_tir_t, ttl)
350 #define L_LBMR_TIR_T_TTL SIZEOF(lbmr_tir_t, ttl)
351 #define O_LBMR_TIR_T_INDEX OFFSETOF(lbmr_tir_t, idx)
352 #define L_LBMR_TIR_T_INDEX SIZEOF(lbmr_tir_t, idx)
353 #define L_LBMR_TIR_T (gint) sizeof(lbmr_tir_t)
354
355 /* LBMR topic information record TCP option data */
356 typedef struct
357 {
358     lbm_uint32_t ip;
359     lbm_uint16_t port;
360 } lbmr_tir_tcp_t;
361 #define O_LBMR_TIR_TCP_T_IP OFFSETOF(lbmr_tir_tcp_t, ip)
362 #define L_LBMR_TIR_TCP_T_IP SIZEOF(lbmr_tir_tcp_t, ip)
363 #define O_LBMR_TIR_TCP_T_PORT OFFSETOF(lbmr_tir_tcp_t, port)
364 #define L_LBMR_TIR_TCP_T_PORT SIZEOF(lbmr_tir_tcp_t, port)
365 #define L_LBMR_TIR_TCP_T 6
366
367 typedef struct {
368     lbm_uint32_t ip;
369     lbm_uint32_t session_id;
370     lbm_uint16_t port;
371 } lbmr_tir_tcp_with_sid_t;
372 #define O_LBMR_TIR_TCP_WITH_SID_T_IP OFFSETOF(lbmr_tir_tcp_with_sid_t, ip)
373 #define L_LBMR_TIR_TCP_WITH_SID_T_IP SIZEOF(lbmr_tir_tcp_with_sid_t, ip)
374 #define O_LBMR_TIR_TCP_WITH_SID_T_SESSION_ID OFFSETOF(lbmr_tir_tcp_with_sid_t, session_id)
375 #define L_LBMR_TIR_TCP_WITH_SID_T_SESSION_ID SIZEOF(lbmr_tir_tcp_with_sid_t, session_id)
376 #define O_LBMR_TIR_TCP_WITH_SID_T_PORT OFFSETOF(lbmr_tir_tcp_with_sid_t, port)
377 #define L_LBMR_TIR_TCP_WITH_SID_T_PORT SIZEOF(lbmr_tir_tcp_with_sid_t, port)
378 #define L_LBMR_TIR_TCP_WITH_SID_T 10
379
380 /* LBMR topic information record LBT-RM option data */
381 typedef struct
382 {
383     lbm_uint32_t src_addr;
384     lbm_uint32_t mcast_addr;
385     lbm_uint32_t session_id;
386     lbm_uint16_t udp_dest_port;
387     lbm_uint16_t src_ucast_port;
388 } lbmr_tir_lbtrm_t;
389 #define O_LBMR_TIR_LBTRM_T_SRC_ADDR OFFSETOF(lbmr_tir_lbtrm_t, src_addr)
390 #define L_LBMR_TIR_LBTRM_T_SRC_ADDR SIZEOF(lbmr_tir_lbtrm_t, src_addr)
391 #define O_LBMR_TIR_LBTRM_T_MCAST_ADDR OFFSETOF(lbmr_tir_lbtrm_t, mcast_addr)
392 #define L_LBMR_TIR_LBTRM_T_MCAST_ADDR SIZEOF(lbmr_tir_lbtrm_t, mcast_addr)
393 #define O_LBMR_TIR_LBTRM_T_SESSION_ID OFFSETOF(lbmr_tir_lbtrm_t, session_id)
394 #define L_LBMR_TIR_LBTRM_T_SESSION_ID SIZEOF(lbmr_tir_lbtrm_t, session_id)
395 #define O_LBMR_TIR_LBTRM_T_UDP_DEST_PORT OFFSETOF(lbmr_tir_lbtrm_t, udp_dest_port)
396 #define L_LBMR_TIR_LBTRM_T_UDP_DEST_PORT SIZEOF(lbmr_tir_lbtrm_t, udp_dest_port)
397 #define O_LBMR_TIR_LBTRM_T_SRC_UCAST_PORT OFFSETOF(lbmr_tir_lbtrm_t, src_ucast_port)
398 #define L_LBMR_TIR_LBTRM_T_SRC_UCAST_PORT SIZEOF(lbmr_tir_lbtrm_t, src_ucast_port)
399 #define L_LBMR_TIR_LBTRM_T (gint) sizeof(lbmr_tir_lbtrm_t)
400
401 /* LBMR topic information record LBT-RU option data */
402 typedef struct
403 {
404     lbm_uint32_t ip;
405     lbm_uint16_t port;
406 } lbmr_tir_lbtru_t;
407 #define O_LBMR_TIR_LBTRU_T_IP OFFSETOF(lbmr_tir_lbtru_t, ip)
408 #define L_LBMR_TIR_LBTRU_T_IP SIZEOF(lbmr_tir_lbtru_t, ip)
409 #define O_LBMR_TIR_LBTRU_T_PORT OFFSETOF(lbmr_tir_lbtru_t, port)
410 #define L_LBMR_TIR_LBTRU_T_PORT SIZEOF(lbmr_tir_lbtru_t, port)
411 #define L_LBMR_TIR_LBTRU_T 6
412
413 typedef struct
414 {
415     lbm_uint32_t ip;
416     lbm_uint32_t session_id;
417     lbm_uint16_t port;
418 } lbmr_tir_lbtru_with_sid_t;
419 #define O_LBMR_TIR_LBTRU_WITH_SID_T_IP OFFSETOF(lbmr_tir_lbtru_with_sid_t, ip)
420 #define L_LBMR_TIR_LBTRU_WITH_SID_T_IP SIZEOF(lbmr_tir_lbtru_with_sid_t, ip)
421 #define O_LBMR_TIR_LBTRU_WITH_SID_T_SESSION_ID OFFSETOF(lbmr_tir_lbtru_with_sid_t, session_id)
422 #define L_LBMR_TIR_LBTRU_WITH_SID_T_SESSION_ID SIZEOF(lbmr_tir_lbtru_with_sid_t, session_id)
423 #define O_LBMR_TIR_LBTRU_WITH_SID_T_PORT OFFSETOF(lbmr_tir_lbtru_with_sid_t, port)
424 #define L_LBMR_TIR_LBTRU_WITH_SID_T_PORT SIZEOF(lbmr_tir_lbtru_with_sid_t, port)
425 #define L_LBMR_TIR_LBTRU_WITH_SID_T 10
426
427 /* LBMR topic information record LBT-IPC option data */
428 typedef struct
429 {
430     lbm_uint32_t host_id;
431     lbm_uint32_t session_id;
432     lbm_uint16_t xport_id;
433 } lbmr_tir_lbtipc_t;
434 #define O_LBMR_TIR_LBTIPC_T_HOST_ID OFFSETOF(lbmr_tir_lbtipc_t, host_id)
435 #define L_LBMR_TIR_LBTIPC_T_HOST_ID SIZEOF(lbmr_tir_lbtipc_t, host_id)
436 #define O_LBMR_TIR_LBTIPC_T_SESSION_ID OFFSETOF(lbmr_tir_lbtipc_t, session_id)
437 #define L_LBMR_TIR_LBTIPC_T_SESSION_ID SIZEOF(lbmr_tir_lbtipc_t, session_id)
438 #define O_LBMR_TIR_LBTIPC_T_XPORT_ID OFFSETOF(lbmr_tir_lbtipc_t, xport_id)
439 #define L_LBMR_TIR_LBTIPC_T_XPORT_ID SIZEOF(lbmr_tir_lbtipc_t, xport_id)
440 #define L_LBMR_TIR_LBTIPC_T 10
441
442 /* LBMR topic information record LBT-RDMA option data */
443 typedef struct
444 {
445     lbm_uint32_t ip;
446     lbm_uint32_t session_id;
447     lbm_uint16_t port;
448 } lbmr_tir_lbtrdma_t;
449 #define O_LBMR_TIR_LBTRDMA_T_IP OFFSETOF(lbmr_tir_lbtrdma_t, ip)
450 #define L_LBMR_TIR_LBTRDMA_T_IP SIZEOF(lbmr_tir_lbtrdma_t, ip)
451 #define O_LBMR_TIR_LBTRDMA_T_SESSION_ID OFFSETOF(lbmr_tir_lbtrdma_t, session_id)
452 #define L_LBMR_TIR_LBTRDMA_T_SESSION_ID SIZEOF(lbmr_tir_lbtrdma_t, session_id)
453 #define O_LBMR_TIR_LBTRDMA_T_PORT OFFSETOF(lbmr_tir_lbtrdma_t, port)
454 #define L_LBMR_TIR_LBTRDMA_T_PORT SIZEOF(lbmr_tir_lbtrdma_t, port)
455 #define L_LBMR_TIR_LBTRDMA_T 10
456
457 /* LBMR topic information record LBT-SMX option data */
458 typedef struct
459 {
460     lbm_uint32_t host_id;
461     lbm_uint32_t session_id;
462     lbm_uint16_t xport_id;
463 } lbmr_tir_lbtsmx_t;
464 #define O_LBMR_TIR_LBTSMX_T_HOST_ID OFFSETOF(lbmr_tir_lbtsmx_t, host_id)
465 #define L_LBMR_TIR_LBTSMX_T_HOST_ID SIZEOF(lbmr_tir_lbtsmx_t, host_id)
466 #define O_LBMR_TIR_LBTSMX_T_SESSION_ID OFFSETOF(lbmr_tir_lbtsmx_t, session_id)
467 #define L_LBMR_TIR_LBTSMX_T_SESSION_ID SIZEOF(lbmr_tir_lbtsmx_t, session_id)
468 #define O_LBMR_TIR_LBTSMX_T_XPORT_ID OFFSETOF(lbmr_tir_lbtsmx_t, xport_id)
469 #define L_LBMR_TIR_LBTSMX_T_XPORT_ID SIZEOF(lbmr_tir_lbtsmx_t, xport_id)
470 #define L_LBMR_TIR_LBTSMX_T 10
471
472 #define LBMR_TIR_TRANSPORT 0x7F
473 #define LBMR_TIR_OPTIONS 0x80
474
475 /* LBMR topic option */
476 typedef struct
477 {
478     lbm_uint8_t type;
479     lbm_uint8_t len;
480     lbm_uint16_t flags;
481 } lbmr_topic_opt_t;
482 #define O_LBMR_TOPIC_OPT_T_TYPE OFFSETOF(lbmr_topic_opt_t, type)
483 #define L_LBMR_TOPIC_OPT_T_TYPE SIZEOF(lbmr_topic_opt_t, type)
484 #define O_LBMR_TOPIC_OPT_T_LEN OFFSETOF(lbmr_topic_opt_t, len)
485 #define L_LBMR_TOPIC_OPT_T_LEN SIZEOF(lbmr_topic_opt_t, len)
486 #define O_LBMR_TOPIC_OPT_T_FLAGS OFFSETOF(lbmr_topic_opt_t, flags)
487 #define L_LBMR_TOPIC_OPT_T_FLAGS SIZEOF(lbmr_topic_opt_t, flags)
488 #define L_LBMR_TOPIC_OPT_T (gint) sizeof(lbmr_topic_opt_t)
489
490 #define LBMR_TOPIC_OPT_FLAG_IGNORE 0x8000
491
492 /* LBMR topic option length */
493 typedef struct
494 {
495     lbm_uint8_t type;
496     lbm_uint8_t len;
497     lbm_uint16_t total_len;
498 } lbmr_topic_opt_len_t;
499 #define O_LBMR_TOPIC_OPT_LEN_T_TYPE OFFSETOF(lbmr_topic_opt_len_t, type)
500 #define L_LBMR_TOPIC_OPT_LEN_T_TYPE SIZEOF(lbmr_topic_opt_len_t, type)
501 #define O_LBMR_TOPIC_OPT_LEN_T_LEN OFFSETOF(lbmr_topic_opt_len_t, len)
502 #define L_LBMR_TOPIC_OPT_LEN_T_LEN SIZEOF(lbmr_topic_opt_len_t, len)
503 #define O_LBMR_TOPIC_OPT_LEN_T_TOTAL_LEN OFFSETOF(lbmr_topic_opt_len_t, total_len)
504 #define L_LBMR_TOPIC_OPT_LEN_T_TOTAL_LEN SIZEOF(lbmr_topic_opt_len_t, total_len)
505 #define L_LBMR_TOPIC_OPT_LEN_T (gint) sizeof(lbmr_topic_opt_len_t)
506
507 #define LBMR_TOPIC_OPT_LEN_TYPE 0x00
508 #define LBMR_TOPIC_OPT_LEN_SZ 4
509
510 /* LBMR topic UME option */
511 typedef struct
512 {
513     lbm_uint8_t type;
514     lbm_uint8_t len;
515     lbm_uint16_t flags;
516     lbm_uint16_t store_tcp_port;
517     lbm_uint16_t src_tcp_port;
518     lbm_uint32_t store_tcp_addr;
519     lbm_uint32_t src_tcp_addr;
520     lbm_uint32_t src_reg_id;
521     lbm_uint32_t transport_idx;
522     lbm_uint32_t high_seqnum;
523     lbm_uint32_t low_seqnum;
524 } lbmr_topic_opt_ume_t;
525 #define O_LBMR_TOPIC_OPT_UME_T_TYPE OFFSETOF(lbmr_topic_opt_ume_t, type)
526 #define L_LBMR_TOPIC_OPT_UME_T_TYPE SIZEOF(lbmr_topic_opt_ume_t, type)
527 #define O_LBMR_TOPIC_OPT_UME_T_LEN OFFSETOF(lbmr_topic_opt_ume_t, len)
528 #define L_LBMR_TOPIC_OPT_UME_T_LEN SIZEOF(lbmr_topic_opt_ume_t, len)
529 #define O_LBMR_TOPIC_OPT_UME_T_FLAGS OFFSETOF(lbmr_topic_opt_ume_t, flags)
530 #define L_LBMR_TOPIC_OPT_UME_T_FLAGS SIZEOF(lbmr_topic_opt_ume_t, flags)
531 #define O_LBMR_TOPIC_OPT_UME_T_STORE_TCP_PORT OFFSETOF(lbmr_topic_opt_ume_t, store_tcp_port)
532 #define L_LBMR_TOPIC_OPT_UME_T_STORE_TCP_PORT SIZEOF(lbmr_topic_opt_ume_t, store_tcp_port)
533 #define O_LBMR_TOPIC_OPT_UME_T_SRC_TCP_PORT OFFSETOF(lbmr_topic_opt_ume_t, src_tcp_port)
534 #define L_LBMR_TOPIC_OPT_UME_T_SRC_TCP_PORT SIZEOF(lbmr_topic_opt_ume_t, src_tcp_port)
535 #define O_LBMR_TOPIC_OPT_UME_T_STORE_TCP_ADDR OFFSETOF(lbmr_topic_opt_ume_t, store_tcp_addr)
536 #define L_LBMR_TOPIC_OPT_UME_T_STORE_TCP_ADDR SIZEOF(lbmr_topic_opt_ume_t, store_tcp_addr)
537 #define O_LBMR_TOPIC_OPT_UME_T_SRC_TCP_ADDR OFFSETOF(lbmr_topic_opt_ume_t, src_tcp_addr)
538 #define L_LBMR_TOPIC_OPT_UME_T_SRC_TCP_ADDR SIZEOF(lbmr_topic_opt_ume_t, src_tcp_addr)
539 #define O_LBMR_TOPIC_OPT_UME_T_SRC_REG_ID OFFSETOF(lbmr_topic_opt_ume_t, src_reg_id)
540 #define L_LBMR_TOPIC_OPT_UME_T_SRC_REG_ID SIZEOF(lbmr_topic_opt_ume_t, src_reg_id)
541 #define O_LBMR_TOPIC_OPT_UME_T_TRANSPORT_IDX OFFSETOF(lbmr_topic_opt_ume_t, transport_idx)
542 #define L_LBMR_TOPIC_OPT_UME_T_TRANSPORT_IDX SIZEOF(lbmr_topic_opt_ume_t, transport_idx)
543 #define O_LBMR_TOPIC_OPT_UME_T_HIGH_SEQNUM OFFSETOF(lbmr_topic_opt_ume_t, high_seqnum)
544 #define L_LBMR_TOPIC_OPT_UME_T_HIGH_SEQNUM SIZEOF(lbmr_topic_opt_ume_t, high_seqnum)
545 #define O_LBMR_TOPIC_OPT_UME_T_LOW_SEQNUM OFFSETOF(lbmr_topic_opt_ume_t, low_seqnum)
546 #define L_LBMR_TOPIC_OPT_UME_T_LOW_SEQNUM SIZEOF(lbmr_topic_opt_ume_t, low_seqnum)
547 #define L_LBMR_TOPIC_OPT_UME_T (gint) sizeof(lbmr_topic_opt_ume_t)
548
549 #define LBMR_TOPIC_OPT_UME_TYPE 0x01
550 #define LBMR_TOPIC_OPT_UME_FLAG_IGNORE 0x8000
551 #define LBMR_TOPIC_OPT_UME_FLAG_LATEJOIN 0x4000
552 #define LBMR_TOPIC_OPT_UME_FLAG_STORE 0x2000
553 #define LBMR_TOPIC_OPT_UME_FLAG_QCCAP 0x1000
554 #define LBMR_TOPIC_OPT_UME_FLAG_ACKTOSRC 0x800
555 #define LBMR_TOPIC_OPT_UME_SZ 32
556
557 /* LBMR topic UME store option */
558 typedef struct
559 {
560     lbm_uint8_t type;
561     lbm_uint8_t len;
562     lbm_uint8_t flags;
563     lbm_uint8_t grp_idx;
564     lbm_uint16_t store_tcp_port;
565     lbm_uint16_t store_idx;
566     lbm_uint32_t store_ip_addr;
567     lbm_uint32_t src_reg_id;
568 } lbmr_topic_opt_ume_store_t;
569 #define O_LBMR_TOPIC_OPT_UME_STORE_T_TYPE OFFSETOF(lbmr_topic_opt_ume_store_t, type)
570 #define L_LBMR_TOPIC_OPT_UME_STORE_T_TYPE SIZEOF(lbmr_topic_opt_ume_store_t, type)
571 #define O_LBMR_TOPIC_OPT_UME_STORE_T_LEN OFFSETOF(lbmr_topic_opt_ume_store_t, len)
572 #define L_LBMR_TOPIC_OPT_UME_STORE_T_LEN SIZEOF(lbmr_topic_opt_ume_store_t, len)
573 #define O_LBMR_TOPIC_OPT_UME_STORE_T_FLAGS OFFSETOF(lbmr_topic_opt_ume_store_t, flags)
574 #define L_LBMR_TOPIC_OPT_UME_STORE_T_FLAGS SIZEOF(lbmr_topic_opt_ume_store_t, flags)
575 #define O_LBMR_TOPIC_OPT_UME_STORE_T_GRP_IDX OFFSETOF(lbmr_topic_opt_ume_store_t, grp_idx)
576 #define L_LBMR_TOPIC_OPT_UME_STORE_T_GRP_IDX SIZEOF(lbmr_topic_opt_ume_store_t, grp_idx)
577 #define O_LBMR_TOPIC_OPT_UME_STORE_T_STORE_TCP_PORT OFFSETOF(lbmr_topic_opt_ume_store_t, store_tcp_port)
578 #define L_LBMR_TOPIC_OPT_UME_STORE_T_STORE_TCP_PORT SIZEOF(lbmr_topic_opt_ume_store_t, store_tcp_port)
579 #define O_LBMR_TOPIC_OPT_UME_STORE_T_STORE_IDX OFFSETOF(lbmr_topic_opt_ume_store_t, store_idx)
580 #define L_LBMR_TOPIC_OPT_UME_STORE_T_STORE_IDX SIZEOF(lbmr_topic_opt_ume_store_t, store_idx)
581 #define O_LBMR_TOPIC_OPT_UME_STORE_T_STORE_IP_ADDR OFFSETOF(lbmr_topic_opt_ume_store_t, store_ip_addr)
582 #define L_LBMR_TOPIC_OPT_UME_STORE_T_STORE_IP_ADDR SIZEOF(lbmr_topic_opt_ume_store_t, store_ip_addr)
583 #define O_LBMR_TOPIC_OPT_UME_STORE_T_SRC_REG_ID OFFSETOF(lbmr_topic_opt_ume_store_t, src_reg_id)
584 #define L_LBMR_TOPIC_OPT_UME_STORE_T_SRC_REG_ID SIZEOF(lbmr_topic_opt_ume_store_t, src_reg_id)
585 #define L_LBMR_TOPIC_OPT_UME_STORE_T (gint) sizeof(lbmr_topic_opt_ume_store_t)
586
587 #define LBMR_TOPIC_OPT_UME_STORE_TYPE 0x02
588 #define LBMR_TOPIC_OPT_UME_STORE_FLAG_IGNORE 0x80
589 #define LBMR_TOPIC_OPT_UME_STORE_SZ 16
590
591 /* LBMR topic UME store group option */
592 typedef struct
593 {
594     lbm_uint8_t type;
595     lbm_uint8_t len;
596     lbm_uint8_t flags;
597     lbm_uint8_t grp_idx;
598     lbm_uint16_t grp_sz;
599     lbm_uint16_t reserved;
600 } lbmr_topic_opt_ume_store_group_t;
601 #define O_LBMR_TOPIC_OPT_UME_STORE_GROUP_T_TYPE OFFSETOF(lbmr_topic_opt_ume_store_group_t, type)
602 #define L_LBMR_TOPIC_OPT_UME_STORE_GROUP_T_TYPE SIZEOF(lbmr_topic_opt_ume_store_group_t, type)
603 #define O_LBMR_TOPIC_OPT_UME_STORE_GROUP_T_LEN OFFSETOF(lbmr_topic_opt_ume_store_group_t, len)
604 #define L_LBMR_TOPIC_OPT_UME_STORE_GROUP_T_LEN SIZEOF(lbmr_topic_opt_ume_store_group_t, len)
605 #define O_LBMR_TOPIC_OPT_UME_STORE_GROUP_T_FLAGS OFFSETOF(lbmr_topic_opt_ume_store_group_t, flags)
606 #define L_LBMR_TOPIC_OPT_UME_STORE_GROUP_T_FLAGS SIZEOF(lbmr_topic_opt_ume_store_group_t, flags)
607 #define O_LBMR_TOPIC_OPT_UME_STORE_GROUP_T_GRP_IDX OFFSETOF(lbmr_topic_opt_ume_store_group_t, grp_idx)
608 #define L_LBMR_TOPIC_OPT_UME_STORE_GROUP_T_GRP_IDX SIZEOF(lbmr_topic_opt_ume_store_group_t, grp_idx)
609 #define O_LBMR_TOPIC_OPT_UME_STORE_GROUP_T_GRP_SZ OFFSETOF(lbmr_topic_opt_ume_store_group_t, grp_sz)
610 #define L_LBMR_TOPIC_OPT_UME_STORE_GROUP_T_GRP_SZ SIZEOF(lbmr_topic_opt_ume_store_group_t, grp_sz)
611 #define O_LBMR_TOPIC_OPT_UME_STORE_GROUP_T_RESERVED OFFSETOF(lbmr_topic_opt_ume_store_group_t, reserved)
612 #define L_LBMR_TOPIC_OPT_UME_STORE_GROUP_T_RESERVED SIZEOF(lbmr_topic_opt_ume_store_group_t, reserved)
613 #define L_LBMR_TOPIC_OPT_UME_STORE_GROUP_T (gint) sizeof(lbmr_topic_opt_ume_store_group_t)
614
615 #define LBMR_TOPIC_OPT_UME_STORE_GROUP_TYPE 0x03
616 #define LBMR_TOPIC_OPT_UME_STORE_GROUP_FLAG_IGNORE 0x80
617 #define LBMR_TOPIC_OPT_UME_STORE_GROUP_SZ 8
618
619 /* LBMR topic latejoin option */
620 typedef struct
621 {
622     lbm_uint8_t type;
623     lbm_uint8_t len;
624     lbm_uint16_t flags;
625     lbm_uint16_t src_tcp_port;
626     lbm_uint16_t reserved;
627     lbm_uint32_t src_ip_addr;
628     lbm_uint32_t transport_idx;
629     lbm_uint32_t high_seqnum;
630     lbm_uint32_t low_seqnum;
631 } lbmr_topic_opt_latejoin_t;
632 #define O_LBMR_TOPIC_OPT_LATEJOIN_T_TYPE OFFSETOF(lbmr_topic_opt_latejoin_t, type)
633 #define L_LBMR_TOPIC_OPT_LATEJOIN_T_TYPE SIZEOF(lbmr_topic_opt_latejoin_t, type)
634 #define O_LBMR_TOPIC_OPT_LATEJOIN_T_LEN OFFSETOF(lbmr_topic_opt_latejoin_t, len)
635 #define L_LBMR_TOPIC_OPT_LATEJOIN_T_LEN SIZEOF(lbmr_topic_opt_latejoin_t, len)
636 #define O_LBMR_TOPIC_OPT_LATEJOIN_T_FLAGS OFFSETOF(lbmr_topic_opt_latejoin_t, flags)
637 #define L_LBMR_TOPIC_OPT_LATEJOIN_T_FLAGS SIZEOF(lbmr_topic_opt_latejoin_t, flags)
638 #define O_LBMR_TOPIC_OPT_LATEJOIN_T_SRC_TCP_PORT OFFSETOF(lbmr_topic_opt_latejoin_t, src_tcp_port)
639 #define L_LBMR_TOPIC_OPT_LATEJOIN_T_SRC_TCP_PORT SIZEOF(lbmr_topic_opt_latejoin_t, src_tcp_port)
640 #define O_LBMR_TOPIC_OPT_LATEJOIN_T_RESERVED OFFSETOF(lbmr_topic_opt_latejoin_t, reserved)
641 #define L_LBMR_TOPIC_OPT_LATEJOIN_T_RESERVED SIZEOF(lbmr_topic_opt_latejoin_t, reserved)
642 #define O_LBMR_TOPIC_OPT_LATEJOIN_T_SRC_IP_ADDR OFFSETOF(lbmr_topic_opt_latejoin_t, src_ip_addr)
643 #define L_LBMR_TOPIC_OPT_LATEJOIN_T_SRC_IP_ADDR SIZEOF(lbmr_topic_opt_latejoin_t, src_ip_addr)
644 #define O_LBMR_TOPIC_OPT_LATEJOIN_T_TRANSPORT_IDX OFFSETOF(lbmr_topic_opt_latejoin_t, transport_idx)
645 #define L_LBMR_TOPIC_OPT_LATEJOIN_T_TRANSPORT_IDX SIZEOF(lbmr_topic_opt_latejoin_t, transport_idx)
646 #define O_LBMR_TOPIC_OPT_LATEJOIN_T_HIGH_SEQNUM OFFSETOF(lbmr_topic_opt_latejoin_t, high_seqnum)
647 #define L_LBMR_TOPIC_OPT_LATEJOIN_T_HIGH_SEQNUM SIZEOF(lbmr_topic_opt_latejoin_t, high_seqnum)
648 #define O_LBMR_TOPIC_OPT_LATEJOIN_T_LOW_SEQNUM OFFSETOF(lbmr_topic_opt_latejoin_t, low_seqnum)
649 #define L_LBMR_TOPIC_OPT_LATEJOIN_T_LOW_SEQNUM SIZEOF(lbmr_topic_opt_latejoin_t, low_seqnum)
650 #define L_LBMR_TOPIC_OPT_LATEJOIN_T (gint) sizeof(lbmr_topic_opt_latejoin_t)
651
652 #define LBMR_TOPIC_OPT_LATEJOIN_TYPE 0x04
653 #define LBMR_TOPIC_OPT_LATEJOIN_FLAG_IGNORE 0x8000
654 #define LBMR_TOPIC_OPT_LATEJOIN_FLAG_ACKTOSRC 0x4000
655 #define LBMR_TOPIC_OPT_LATEJOIN_SZ 24
656
657 /* LBMR topic queue control option */
658 typedef struct
659 {
660     lbm_uint8_t type;
661     lbm_uint8_t len;
662     lbm_uint16_t flags;
663     lbm_uint32_t rcr_idx;
664 } lbmr_topic_opt_umq_rcridx_t;
665 #define O_LBMR_TOPIC_OPT_UMQ_RCRIDX_T_TYPE OFFSETOF(lbmr_topic_opt_umq_rcridx_t, type)
666 #define L_LBMR_TOPIC_OPT_UMQ_RCRIDX_T_TYPE SIZEOF(lbmr_topic_opt_umq_rcridx_t, type)
667 #define O_LBMR_TOPIC_OPT_UMQ_RCRIDX_T_LEN OFFSETOF(lbmr_topic_opt_umq_rcridx_t, len)
668 #define L_LBMR_TOPIC_OPT_UMQ_RCRIDX_T_LEN SIZEOF(lbmr_topic_opt_umq_rcridx_t, len)
669 #define O_LBMR_TOPIC_OPT_UMQ_RCRIDX_T_FLAGS OFFSETOF(lbmr_topic_opt_umq_rcridx_t, flags)
670 #define L_LBMR_TOPIC_OPT_UMQ_RCRIDX_T_FLAGS SIZEOF(lbmr_topic_opt_umq_rcridx_t, flags)
671 #define O_LBMR_TOPIC_OPT_UMQ_RCRIDX_T_RCR_IDX OFFSETOF(lbmr_topic_opt_umq_rcridx_t, rcr_idx)
672 #define L_LBMR_TOPIC_OPT_UMQ_RCRIDX_T_RCR_IDX SIZEOF(lbmr_topic_opt_umq_rcridx_t, rcr_idx)
673 #define L_LBMR_TOPIC_OPT_UMQ_RCRIDX_T (gint) sizeof(lbmr_topic_opt_umq_rcridx_t)
674
675 #define LBMR_TOPIC_OPT_UMQ_RCRIDX_TYPE 0x05
676 #define LBMR_TOPIC_OPT_UMQ_RCRIDX_SZ 8
677 #define LBMR_TOPIC_OPT_UMQ_RCRIDX_FLAG_IGNORE 0x8000
678
679 #define LBMR_TOPIC_OPT_UMQ_QINFO_TYPE 0x06
680 #define LBMR_TOPIC_OPT_UMQ_FLAG_IGNORE 0x8000
681 #define LBMR_TOPIC_OPT_UMQ_FLAG_QUEUE 0x4000
682 #define LBMR_TOPIC_OPT_UMQ_FLAG_RCVLISTEN 0x2000
683 #define LBMR_TOPIC_OPT_UMQ_FLAG_CONTROL 0x1000
684 #define LBMR_TOPIC_OPT_UMQ_FLAG_SRCRCVLISTEN 0x0800
685 #define LBMR_TOPIC_OPT_UMQ_FLAG_PARTICIPANTS_ONLY 0x0400
686 #define LBMR_TOPIC_OPT_UMQ_MAX_QNAME_LEN 252
687
688 /* LBMR topic ULB option */
689 typedef struct
690 {
691     lbm_uint8_t type;
692     lbm_uint8_t len;
693     lbm_uint16_t flags;
694     lbm_uint32_t queue_id;
695     lbm_uint8_t regid[8];
696     lbm_uint32_t ulb_src_id;
697     lbm_uint32_t src_ip_addr;
698     lbm_uint16_t src_tcp_port;
699     lbm_uint16_t reserved;
700 } lbmr_topic_opt_ulb_t;
701 #define O_LBMR_TOPIC_OPT_ULB_T_TYPE OFFSETOF(lbmr_topic_opt_ulb_t, type)
702 #define L_LBMR_TOPIC_OPT_ULB_T_TYPE SIZEOF(lbmr_topic_opt_ulb_t, type)
703 #define O_LBMR_TOPIC_OPT_ULB_T_LEN OFFSETOF(lbmr_topic_opt_ulb_t, len)
704 #define L_LBMR_TOPIC_OPT_ULB_T_LEN SIZEOF(lbmr_topic_opt_ulb_t, len)
705 #define O_LBMR_TOPIC_OPT_ULB_T_FLAGS OFFSETOF(lbmr_topic_opt_ulb_t, flags)
706 #define L_LBMR_TOPIC_OPT_ULB_T_FLAGS SIZEOF(lbmr_topic_opt_ulb_t, flags)
707 #define O_LBMR_TOPIC_OPT_ULB_T_QUEUE_ID OFFSETOF(lbmr_topic_opt_ulb_t, queue_id)
708 #define L_LBMR_TOPIC_OPT_ULB_T_QUEUE_ID SIZEOF(lbmr_topic_opt_ulb_t, queue_id)
709 #define O_LBMR_TOPIC_OPT_ULB_T_REGID OFFSETOF(lbmr_topic_opt_ulb_t, regid)
710 #define L_LBMR_TOPIC_OPT_ULB_T_REGID SIZEOF(lbmr_topic_opt_ulb_t, regid)
711 #define O_LBMR_TOPIC_OPT_ULB_T_ULB_SRC_ID OFFSETOF(lbmr_topic_opt_ulb_t, ulb_src_id)
712 #define L_LBMR_TOPIC_OPT_ULB_T_ULB_SRC_ID SIZEOF(lbmr_topic_opt_ulb_t, ulb_src_id)
713 #define O_LBMR_TOPIC_OPT_ULB_T_SRC_IP_ADDR OFFSETOF(lbmr_topic_opt_ulb_t, src_ip_addr)
714 #define L_LBMR_TOPIC_OPT_ULB_T_SRC_IP_ADDR SIZEOF(lbmr_topic_opt_ulb_t, src_ip_addr)
715 #define O_LBMR_TOPIC_OPT_ULB_T_SRC_TCP_PORT OFFSETOF(lbmr_topic_opt_ulb_t, src_tcp_port)
716 #define L_LBMR_TOPIC_OPT_ULB_T_SRC_TCP_PORT SIZEOF(lbmr_topic_opt_ulb_t, src_tcp_port)
717 #define O_LBMR_TOPIC_OPT_ULB_T_RESERVED OFFSETOF(lbmr_topic_opt_ulb_t, reserved)
718 #define L_LBMR_TOPIC_OPT_ULB_T_RESERVED SIZEOF(lbmr_topic_opt_ulb_t, reserved)
719 #define L_LBMR_TOPIC_OPT_ULB_T (gint) sizeof(lbmr_topic_opt_ulb_t)
720
721 #define LBMR_TOPIC_OPT_ULB_TYPE 0x0B
722 #define LBMR_TOPIC_OPT_ULB_FLAG_IGNORE 0x8000
723 #define LBMR_TOPIC_OPT_ULB_SZ 28
724
725 /* LBMR topic cost option */
726 typedef struct
727 {
728     lbm_uint8_t type;
729     lbm_uint8_t len;
730     lbm_uint8_t flags;
731     lbm_uint8_t hop_count;
732     lbm_uint32_t cost;
733 } lbmr_topic_opt_cost_t;
734 #define O_LBMR_TOPIC_OPT_COST_T_TYPE OFFSETOF(lbmr_topic_opt_cost_t, type)
735 #define L_LBMR_TOPIC_OPT_COST_T_TYPE SIZEOF(lbmr_topic_opt_cost_t, type)
736 #define O_LBMR_TOPIC_OPT_COST_T_LEN OFFSETOF(lbmr_topic_opt_cost_t, len)
737 #define L_LBMR_TOPIC_OPT_COST_T_LEN SIZEOF(lbmr_topic_opt_cost_t, len)
738 #define O_LBMR_TOPIC_OPT_COST_T_FLAGS OFFSETOF(lbmr_topic_opt_cost_t, flags)
739 #define L_LBMR_TOPIC_OPT_COST_T_FLAGS SIZEOF(lbmr_topic_opt_cost_t, flags)
740 #define O_LBMR_TOPIC_OPT_COST_T_HOP_COUNT OFFSETOF(lbmr_topic_opt_cost_t, hop_count)
741 #define L_LBMR_TOPIC_OPT_COST_T_HOP_COUNT SIZEOF(lbmr_topic_opt_cost_t, hop_count)
742 #define O_LBMR_TOPIC_OPT_COST_T_COST OFFSETOF(lbmr_topic_opt_cost_t, cost)
743 #define L_LBMR_TOPIC_OPT_COST_T_COST SIZEOF(lbmr_topic_opt_cost_t, cost)
744 #define L_LBMR_TOPIC_OPT_COST_T (gint) sizeof(lbmr_topic_opt_cost_t)
745
746 #define LBMR_TOPIC_OPT_COST_TYPE 0x07
747 #define LBMR_TOPIC_OPT_COST_FLAG_IGNORE 0x80
748 #define LBMR_TOPIC_OPT_COST_SZ 8
749
750 /* LBMR topic originating transport ID option */
751 typedef struct
752 {
753     lbm_uint8_t type;
754     lbm_uint8_t len;
755     lbm_uint16_t flags;
756     lbm_uint8_t originating_transport[LBM_OTID_BLOCK_SZ];
757 } lbmr_topic_opt_otid_t;
758 #define O_LBMR_TOPIC_OPT_OTID_T_TYPE OFFSETOF(lbmr_topic_opt_otid_t, type)
759 #define L_LBMR_TOPIC_OPT_OTID_T_TYPE SIZEOF(lbmr_topic_opt_otid_t, type)
760 #define O_LBMR_TOPIC_OPT_OTID_T_LEN OFFSETOF(lbmr_topic_opt_otid_t, len)
761 #define L_LBMR_TOPIC_OPT_OTID_T_LEN SIZEOF(lbmr_topic_opt_otid_t, len)
762 #define O_LBMR_TOPIC_OPT_OTID_T_FLAGS OFFSETOF(lbmr_topic_opt_otid_t, flags)
763 #define L_LBMR_TOPIC_OPT_OTID_T_FLAGS SIZEOF(lbmr_topic_opt_otid_t, flags)
764 #define O_LBMR_TOPIC_OPT_OTID_T_ORIGINATING_TRANSPORT OFFSETOF(lbmr_topic_opt_otid_t, originating_transport)
765 #define L_LBMR_TOPIC_OPT_OTID_T_ORIGINATING_TRANSPORT SIZEOF(lbmr_topic_opt_otid_t, originating_transport)
766 #define L_LBMR_TOPIC_OPT_OTID_T (gint) sizeof(lbmr_topic_opt_otid_t)
767
768 #define LBMR_TOPIC_OPT_OTID_TYPE 0x08
769 #define LBMR_TOPIC_OPT_OTID_FLAG_IGNORE 0x8000
770 #define LBMR_TOPIC_OPT_OTID_SZ 36
771
772 /* LBMR topic context instance transport option */
773 typedef struct
774 {
775     lbm_uint8_t type;
776     lbm_uint8_t len;
777     lbm_uint8_t flags;
778     lbm_uint8_t res;
779     lbm_uint8_t ctxinst[LBM_CONTEXT_INSTANCE_BLOCK_SZ];
780 } lbmr_topic_opt_ctxinst_t;
781 #define O_LBMR_TOPIC_OPT_CTXINST_T_TYPE OFFSETOF(lbmr_topic_opt_ctxinst_t, type)
782 #define L_LBMR_TOPIC_OPT_CTXINST_T_TYPE SIZEOF(lbmr_topic_opt_ctxinst_t, type)
783 #define O_LBMR_TOPIC_OPT_CTXINST_T_LEN OFFSETOF(lbmr_topic_opt_ctxinst_t, len)
784 #define L_LBMR_TOPIC_OPT_CTXINST_T_LEN SIZEOF(lbmr_topic_opt_ctxinst_t, len)
785 #define O_LBMR_TOPIC_OPT_CTXINST_T_FLAGS OFFSETOF(lbmr_topic_opt_ctxinst_t, flags)
786 #define L_LBMR_TOPIC_OPT_CTXINST_T_FLAGS SIZEOF(lbmr_topic_opt_ctxinst_t, flags)
787 #define O_LBMR_TOPIC_OPT_CTXINST_T_RES OFFSETOF(lbmr_topic_opt_ctxinst_t, res)
788 #define L_LBMR_TOPIC_OPT_CTXINST_T_RES SIZEOF(lbmr_topic_opt_ctxinst_t, res)
789 #define O_LBMR_TOPIC_OPT_CTXINST_T_CTXINST OFFSETOF(lbmr_topic_opt_ctxinst_t, ctxinst)
790 #define L_LBMR_TOPIC_OPT_CTXINST_T_CTXINST SIZEOF(lbmr_topic_opt_ctxinst_t, ctxinst)
791 #define L_LBMR_TOPIC_OPT_CTXINST_T (gint) sizeof(lbmr_topic_opt_ctxinst_t)
792
793 #define LBMR_TOPIC_OPT_CTXINST_TYPE 0x09
794 #define LBMR_TOPIC_OPT_CTXINST_FLAG_IGNORE 0x80
795 #define LBMR_TOPIC_OPT_CTXINST_SZ 12
796
797 /* LBMR topic context instance store transport option */
798 typedef struct
799 {
800     lbm_uint8_t type;
801     lbm_uint8_t len;
802     lbm_uint8_t flags;
803     lbm_uint8_t idx;
804     lbm_uint8_t ctxinst[LBM_CONTEXT_INSTANCE_BLOCK_SZ];
805 } lbmr_topic_opt_ctxinsts_t;
806 #define O_LBMR_TOPIC_OPT_CTXINSTS_T_TYPE OFFSETOF(lbmr_topic_opt_ctxinsts_t, type)
807 #define L_LBMR_TOPIC_OPT_CTXINSTS_T_TYPE SIZEOF(lbmr_topic_opt_ctxinsts_t, type)
808 #define O_LBMR_TOPIC_OPT_CTXINSTS_T_LEN OFFSETOF(lbmr_topic_opt_ctxinsts_t, len)
809 #define L_LBMR_TOPIC_OPT_CTXINSTS_T_LEN SIZEOF(lbmr_topic_opt_ctxinsts_t, len)
810 #define O_LBMR_TOPIC_OPT_CTXINSTS_T_FLAGS OFFSETOF(lbmr_topic_opt_ctxinsts_t, flags)
811 #define L_LBMR_TOPIC_OPT_CTXINSTS_T_FLAGS SIZEOF(lbmr_topic_opt_ctxinsts_t, flags)
812 #define O_LBMR_TOPIC_OPT_CTXINSTS_T_IDX OFFSETOF(lbmr_topic_opt_ctxinsts_t, idx)
813 #define L_LBMR_TOPIC_OPT_CTXINSTS_T_IDX SIZEOF(lbmr_topic_opt_ctxinsts_t, idx)
814 #define O_LBMR_TOPIC_OPT_CTXINSTS_T_CTXINST OFFSETOF(lbmr_topic_opt_ctxinsts_t, ctxinst)
815 #define L_LBMR_TOPIC_OPT_CTXINSTS_T_CTXINST SIZEOF(lbmr_topic_opt_ctxinsts_t, ctxinst)
816 #define L_LBMR_TOPIC_OPT_CTXINSTS_T (gint) sizeof(lbmr_topic_opt_ctxinsts_t)
817
818 #define LBMR_TOPIC_OPT_CTXINSTS_TYPE 0x0A
819 #define LBMR_TOPIC_OPT_CTXINSTS_FLAG_IGNORE 0x80
820 #define LBMR_TOPIC_OPT_CTXINSTS_SZ 12
821
822 /* LBMR topic context instance queue transport option */
823 typedef struct
824 {
825     lbm_uint8_t type;
826     lbm_uint8_t len;
827     lbm_uint8_t flags;
828     lbm_uint8_t idx;
829     lbm_uint8_t ctxinst[LBM_CONTEXT_INSTANCE_BLOCK_SZ];
830 } lbmr_topic_opt_ctxinstq_t;
831 #define O_LBMR_TOPIC_OPT_CTXINSTQ_T_TYPE OFFSETOF(lbmr_topic_opt_ctxinstq_t, type)
832 #define L_LBMR_TOPIC_OPT_CTXINSTQ_T_TYPE SIZEOF(lbmr_topic_opt_ctxinstq_t, type)
833 #define O_LBMR_TOPIC_OPT_CTXINSTQ_T_LEN OFFSETOF(lbmr_topic_opt_ctxinstq_t, len)
834 #define L_LBMR_TOPIC_OPT_CTXINSTQ_T_LEN SIZEOF(lbmr_topic_opt_ctxinstq_t, len)
835 #define O_LBMR_TOPIC_OPT_CTXINSTQ_T_FLAGS OFFSETOF(lbmr_topic_opt_ctxinstq_t, flags)
836 #define L_LBMR_TOPIC_OPT_CTXINSTQ_T_FLAGS SIZEOF(lbmr_topic_opt_ctxinstq_t, flags)
837 #define O_LBMR_TOPIC_OPT_CTXINSTQ_T_IDX OFFSETOF(lbmr_topic_opt_ctxinstq_t, idx)
838 #define L_LBMR_TOPIC_OPT_CTXINSTQ_T_IDX SIZEOF(lbmr_topic_opt_ctxinstq_t, idx)
839 #define O_LBMR_TOPIC_OPT_CTXINSTQ_T_CTXINST OFFSETOF(lbmr_topic_opt_ctxinstq_t, ctxinst)
840 #define L_LBMR_TOPIC_OPT_CTXINSTQ_T_CTXINST SIZEOF(lbmr_topic_opt_ctxinstq_t, ctxinst)
841 #define L_LBMR_TOPIC_OPT_CTXINSTQ_T (gint) sizeof(lbmr_topic_opt_ctxinstq_t)
842
843 #define LBMR_TOPIC_OPT_CTXINSTQ_TYPE 0x0C
844 #define LBMR_TOPIC_OPT_CTXINSTQ_FLAG_IGNORE 0x80
845 #define LBMR_TOPIC_OPT_CTXINSTQ_SZ 12
846
847 /* LBMR topic domain ID option */
848 typedef struct
849 {
850     lbm_uint8_t type;
851     lbm_uint8_t len;
852     lbm_uint16_t flags;
853     lbm_uint32_t domain_id;
854 } lbmr_topic_opt_domain_id_t;
855 #define O_LBMR_TOPIC_OPT_DOMAIN_ID_T_TYPE OFFSETOF(lbmr_topic_opt_domain_id_t, type)
856 #define L_LBMR_TOPIC_OPT_DOMAIN_ID_T_TYPE SIZEOF(lbmr_topic_opt_domain_id_t, type)
857 #define O_LBMR_TOPIC_OPT_DOMAIN_ID_T_LEN OFFSETOF(lbmr_topic_opt_domain_id_t, len)
858 #define L_LBMR_TOPIC_OPT_DOMAIN_ID_T_LEN SIZEOF(lbmr_topic_opt_domain_id_t, len)
859 #define O_LBMR_TOPIC_OPT_DOMAIN_ID_T_FLAGS OFFSETOF(lbmr_topic_opt_domain_id_t, flags)
860 #define L_LBMR_TOPIC_OPT_DOMAIN_ID_T_FLAGS SIZEOF(lbmr_topic_opt_domain_id_t, flags)
861 #define O_LBMR_TOPIC_OPT_DOMAIN_ID_T_DOMAIN_ID OFFSETOF(lbmr_topic_opt_domain_id_t, domain_id)
862 #define L_LBMR_TOPIC_OPT_DOMAIN_ID_T_DOMAIN_ID SIZEOF(lbmr_topic_opt_domain_id_t, domain_id)
863 #define L_LBMR_TOPIC_OPT_DOMAIN_ID_T (gint) sizeof(lbmr_topic_opt_domain_id_t)
864
865 #define LBMR_TOPIC_OPT_DOMAIN_ID_TYPE 0x0D
866 #define LBMR_TOPIC_OPT_DOMAIN_ID_FLAG_IGNORE 0x8000
867 #define LBMR_TOPIC_OPT_DOMAIN_ID_SZ 8
868
869 /* LBMR topic extended functionality option */
870 typedef struct
871 {
872     lbm_uint8_t type;
873     lbm_uint8_t len;
874     lbm_uint16_t flags;
875     lbm_uint16_t src_tcp_port;
876     lbm_uint16_t reserved;
877     lbm_uint32_t src_ip_addr;
878     lbm_uint32_t functionality_flags;
879 } lbmr_topic_opt_exfunc_t;
880 #define O_LBMR_TOPIC_OPT_EXFUNC_T_TYPE OFFSETOF(lbmr_topic_opt_exfunc_t, type)
881 #define L_LBMR_TOPIC_OPT_EXFUNC_T_TYPE SIZEOF(lbmr_topic_opt_exfunc_t, type)
882 #define O_LBMR_TOPIC_OPT_EXFUNC_T_LEN OFFSETOF(lbmr_topic_opt_exfunc_t, len)
883 #define L_LBMR_TOPIC_OPT_EXFUNC_T_LEN SIZEOF(lbmr_topic_opt_exfunc_t, len)
884 #define O_LBMR_TOPIC_OPT_EXFUNC_T_FLAGS OFFSETOF(lbmr_topic_opt_exfunc_t, flags)
885 #define L_LBMR_TOPIC_OPT_EXFUNC_T_FLAGS SIZEOF(lbmr_topic_opt_exfunc_t, flags)
886 #define O_LBMR_TOPIC_OPT_EXFUNC_T_SRC_TCP_PORT OFFSETOF(lbmr_topic_opt_exfunc_t, src_tcp_port)
887 #define L_LBMR_TOPIC_OPT_EXFUNC_T_SRC_TCP_PORT SIZEOF(lbmr_topic_opt_exfunc_t, src_tcp_port)
888 #define O_LBMR_TOPIC_OPT_EXFUNC_T_RESERVED OFFSETOF(lbmr_topic_opt_exfunc_t, reserved)
889 #define L_LBMR_TOPIC_OPT_EXFUNC_T_RESERVED SIZEOF(lbmr_topic_opt_exfunc_t, reserved)
890 #define O_LBMR_TOPIC_OPT_EXFUNC_T_SRC_IP_ADDR OFFSETOF(lbmr_topic_opt_exfunc_t, src_ip_addr)
891 #define L_LBMR_TOPIC_OPT_EXFUNC_T_SRC_IP_ADDR SIZEOF(lbmr_topic_opt_exfunc_t, src_ip_addr)
892 #define O_LBMR_TOPIC_OPT_EXFUNC_T_FUNCTIONALITY_FLAGS OFFSETOF(lbmr_topic_opt_exfunc_t, functionality_flags)
893 #define L_LBMR_TOPIC_OPT_EXFUNC_T_FUNCTIONALITY_FLAGS SIZEOF(lbmr_topic_opt_exfunc_t, functionality_flags)
894 #define L_LBMR_TOPIC_OPT_EXFUNC_T (gint) sizeof(lbmr_topic_opt_exfunc_t)
895
896 #define LBMR_TOPIC_OPT_EXFUNC_TYPE 0x0E
897 #define LBMR_TOPIC_OPT_EXFUNC_FLAG_IGNORE 0x8000
898 #define LBMR_TOPIC_OPT_EXFUNC_SZ 16
899
900 /* Transports */
901 #define LBMR_TRANSPORT_TCP 0x00
902 #define LBMR_TRANSPORT_LBTRU 0x01
903 #define LBMR_TRANSPORT_TCP6 0x02
904 #define LBMR_TRANSPORT_LBTSMX 0x4
905 #define LBMR_TRANSPORT_LBTRM 0x10
906 #define LBMR_TRANSPORT_LBTIPC 0x40
907 #define LBMR_TRANSPORT_LBTRDMA 0x20
908 #define LBMR_TRANSPORT_PGM 0x11
909
910 #define LBMR_TRANSPORT_OPTION_MASK 0x80
911
912 /* LBMR context info */
913 typedef struct
914 {
915     lbm_uint8_t ver_type;
916     lbm_uint8_t ext_type;
917     lbm_uint8_t len;
918     lbm_uint8_t hop_count;
919     lbm_uint16_t flags;
920     lbm_uint16_t port;
921     lbm_uint32_t ip;
922     lbm_uint8_t instance[LBM_CONTEXT_INSTANCE_BLOCK_SZ];
923 } lbmr_ctxinfo_t;
924 #define O_LBMR_CTXINFO_T_VER_TYPE OFFSETOF(lbmr_ctxinfo_t, ver_type)
925 #define L_LBMR_CTXINFO_T_VER_TYPE SIZEOF(lbmr_ctxinfo_t, ver_type)
926 #define O_LBMR_CTXINFO_T_EXT_TYPE OFFSETOF(lbmr_ctxinfo_t, ext_type)
927 #define L_LBMR_CTXINFO_T_EXT_TYPE SIZEOF(lbmr_ctxinfo_t, ext_type)
928 #define O_LBMR_CTXINFO_T_LEN OFFSETOF(lbmr_ctxinfo_t, len)
929 #define L_LBMR_CTXINFO_T_LEN SIZEOF(lbmr_ctxinfo_t, len)
930 #define O_LBMR_CTXINFO_T_HOP_COUNT OFFSETOF(lbmr_ctxinfo_t, hop_count)
931 #define L_LBMR_CTXINFO_T_HOP_COUNT SIZEOF(lbmr_ctxinfo_t, hop_count)
932 #define O_LBMR_CTXINFO_T_FLAGS OFFSETOF(lbmr_ctxinfo_t, flags)
933 #define L_LBMR_CTXINFO_T_FLAGS SIZEOF(lbmr_ctxinfo_t, flags)
934 #define O_LBMR_CTXINFO_T_PORT OFFSETOF(lbmr_ctxinfo_t, port)
935 #define L_LBMR_CTXINFO_T_PORT SIZEOF(lbmr_ctxinfo_t, port)
936 #define O_LBMR_CTXINFO_T_IP OFFSETOF(lbmr_ctxinfo_t, ip)
937 #define L_LBMR_CTXINFO_T_IP SIZEOF(lbmr_ctxinfo_t, ip)
938 #define O_LBMR_CTXINFO_T_INSTANCE OFFSETOF(lbmr_ctxinfo_t, instance)
939 #define L_LBMR_CTXINFO_T_INSTANCE SIZEOF(lbmr_ctxinfo_t, instance)
940 #define L_LBMR_CTXINFO_T (gint) sizeof(lbmr_ctxinfo_t)
941
942 #define LBMR_CTXINFO_QUERY_FLAG 0x8000
943 #define LBMR_CTXINFO_IP_FLAG 0x4000
944 #define LBMR_CTXINFO_INSTANCE_FLAG 0x2000
945 #define LBMR_CTXINFO_TNWG_SRC_FLAG 0x1000
946 #define LBMR_CTXINFO_TNWG_RCV_FLAG 0x0800
947 #define LBMR_CTXINFO_PROXY_FLAG 0x0400
948 #define LBMR_CTXINFO_NAME_FLAG 0x0001
949
950 /* LBMR topic resolution request */
951 typedef struct
952 {
953     lbm_uint8_t ver_type;
954     lbm_uint8_t ext_type;
955     lbm_uint16_t flags;
956 } lbmr_topic_res_request_t;
957 #define O_LBMR_TOPIC_RES_REQUEST_T_VER_TYPE OFFSETOF(lbmr_topic_res_request_t, ver_type)
958 #define L_LBMR_TOPIC_RES_REQUEST_T_VER_TYPE SIZEOF(lbmr_topic_res_request_t, ver_type)
959 #define O_LBMR_TOPIC_RES_REQUEST_T_EXT_TYPE OFFSETOF(lbmr_topic_res_request_t, ext_type)
960 #define L_LBMR_TOPIC_RES_REQUEST_T_EXT_TYPE SIZEOF(lbmr_topic_res_request_t, ext_type)
961 #define O_LBMR_TOPIC_RES_REQUEST_T_FLAGS OFFSETOF(lbmr_topic_res_request_t, flags)
962 #define L_LBMR_TOPIC_RES_REQUEST_T_FLAGS SIZEOF(lbmr_topic_res_request_t, flags)
963 #define L_LBMR_TOPIC_RES_REQUEST_T (gint) sizeof(lbmr_topic_res_request_t)
964
965 #define LBM_TOPIC_RES_REQUEST_GW_REMOTE_INTEREST 0x40
966 #define LBM_TOPIC_RES_REQUEST_CONTEXT_QUERY 0x20
967 #define LBM_TOPIC_RES_REQUEST_CONTEXT_ADVERTISEMENT 0x10
968 #define LBM_TOPIC_RES_REQUEST_RESERVED1 0x08
969 #define LBM_TOPIC_RES_REQUEST_ADVERTISEMENT 0x04
970 #define LBM_TOPIC_RES_REQUEST_QUERY 0x02
971 #define LBM_TOPIC_RES_REQUEST_WILDCARD_QUERY 0x01
972
973 /* LBMR topic management block */
974 typedef struct
975 {
976     lbm_uint16_t len;
977     lbm_uint16_t tmrs;
978 } lbmr_tmb_t;
979 #define O_LBMR_TMB_T_LEN OFFSETOF(lbmr_tmb_t, len)
980 #define L_LBMR_TMB_T_LEN SIZEOF(lbmr_tmb_t, len)
981 #define O_LBMR_TMB_T_TMRS OFFSETOF(lbmr_tmb_t, tmrs)
982 #define L_LBMR_TMB_T_TMRS SIZEOF(lbmr_tmb_t, tmrs)
983 #define L_LBMR_TMB_T (gint) sizeof(lbmr_tmb_t)
984
985 /* LBMR topic management record */
986 typedef struct
987 {
988     lbm_uint16_t len;
989     lbm_uint8_t type;
990     lbm_uint8_t flags;
991 } lbmr_tmr_t;
992 #define O_LBMR_TMR_T_LEN OFFSETOF(lbmr_tmr_t, len)
993 #define L_LBMR_TMR_T_LEN SIZEOF(lbmr_tmr_t, len)
994 #define O_LBMR_TMR_T_TYPE OFFSETOF(lbmr_tmr_t, type)
995 #define L_LBMR_TMR_T_TYPE SIZEOF(lbmr_tmr_t, type)
996 #define O_LBMR_TMR_T_FLAGS OFFSETOF(lbmr_tmr_t, flags)
997 #define L_LBMR_TMR_T_FLAGS SIZEOF(lbmr_tmr_t, flags)
998 #define L_LBMR_TMR_T (gint) sizeof(lbmr_tmr_t)
999
1000 #define LBMR_TMR_LEAVE_TOPIC 0x00
1001 #define LBMR_TMR_TOPIC_USE 0x01
1002
1003 #define LBMR_TMR_FLAG_RESPONSE 0x80
1004 #define LBMR_TMR_FLAG_WILDCARD_PCRE 0x40
1005 #define LBMR_TMR_FLAG_WILDCARD_REGEX 0x20
1006 #define LBMR_TMR_FLAG_WILDCARD_MASK (LBMR_TMR_FLAG_WILDCARD_PCRE | LBMR_TMR_FLAG_WILDCARD_REGEX)
1007
1008 /* LBMR queue information record */
1009 typedef struct
1010 {
1011     lbm_uint32_t queue_id;
1012     lbm_uint32_t queue_ver;
1013     lbm_uint32_t queue_prev_ver;
1014     lbm_uint16_t grp_blks;
1015     lbm_uint16_t queue_blks;
1016 } lbmr_qir_t;
1017 #define O_LBMR_QIR_T_QUEUE_ID OFFSETOF(lbmr_qir_t, queue_id)
1018 #define L_LBMR_QIR_T_QUEUE_ID SIZEOF(lbmr_qir_t, queue_id)
1019 #define O_LBMR_QIR_T_QUEUE_VER OFFSETOF(lbmr_qir_t, queue_ver)
1020 #define L_LBMR_QIR_T_QUEUE_VER SIZEOF(lbmr_qir_t, queue_ver)
1021 #define O_LBMR_QIR_T_QUEUE_PREV_VER OFFSETOF(lbmr_qir_t, queue_prev_ver)
1022 #define L_LBMR_QIR_T_QUEUE_PREV_VER SIZEOF(lbmr_qir_t, queue_prev_ver)
1023 #define O_LBMR_QIR_T_GRP_BLKS OFFSETOF(lbmr_qir_t, grp_blks)
1024 #define L_LBMR_QIR_T_GRP_BLKS SIZEOF(lbmr_qir_t, grp_blks)
1025 #define O_LBMR_QIR_T_QUEUE_BLKS OFFSETOF(lbmr_qir_t, queue_blks)
1026 #define L_LBMR_QIR_T_QUEUE_BLKS SIZEOF(lbmr_qir_t, queue_blks)
1027 #define L_LBMR_QIR_T (gint) sizeof(lbmr_qir_t)
1028
1029 #define LBMR_QIR_OPTIONS 0x8000
1030 #define LBMR_QIR_GRP_BLOCKS_MASK 0x7fff
1031
1032 /* LBMR queue group block record */
1033 typedef struct
1034 {
1035     lbm_uint16_t grp_idx;
1036     lbm_uint16_t grp_sz;
1037 } lbmr_qir_grp_blk_t;
1038 #define O_LBMR_QIR_GRP_BLK_T_GRP_IDX OFFSETOF(lbmr_qir_grp_blk_t, grp_idx)
1039 #define L_LBMR_QIR_GRP_BLK_T_GRP_IDX SIZEOF(lbmr_qir_grp_blk_t, grp_idx)
1040 #define O_LBMR_QIR_GRP_BLK_T_GRP_SZ OFFSETOF(lbmr_qir_grp_blk_t, grp_sz)
1041 #define L_LBMR_QIR_GRP_BLK_T_GRP_SZ SIZEOF(lbmr_qir_grp_blk_t, grp_sz)
1042 #define L_LBMR_QIR_GRP_BLK_T (gint) sizeof(lbmr_qir_grp_blk_t)
1043
1044 /* LBMR queue block record */
1045 typedef struct
1046 {
1047     lbm_uint32_t ip;
1048     lbm_uint16_t port;
1049     lbm_uint16_t idx;
1050     lbm_uint16_t grp_idx;
1051     lbm_uint16_t reserved;
1052 } lbmr_qir_queue_blk_t;
1053 #define O_LBMR_QIR_QUEUE_BLK_T_IP OFFSETOF(lbmr_qir_queue_blk_t, ip)
1054 #define L_LBMR_QIR_QUEUE_BLK_T_IP SIZEOF(lbmr_qir_queue_blk_t, ip)
1055 #define O_LBMR_QIR_QUEUE_BLK_T_PORT OFFSETOF(lbmr_qir_queue_blk_t, port)
1056 #define L_LBMR_QIR_QUEUE_BLK_T_PORT SIZEOF(lbmr_qir_queue_blk_t, port)
1057 #define O_LBMR_QIR_QUEUE_BLK_T_IDX OFFSETOF(lbmr_qir_queue_blk_t, idx)
1058 #define L_LBMR_QIR_QUEUE_BLK_T_IDX SIZEOF(lbmr_qir_queue_blk_t, idx)
1059 #define O_LBMR_QIR_QUEUE_BLK_T_GRP_IDX OFFSETOF(lbmr_qir_queue_blk_t, grp_idx)
1060 #define L_LBMR_QIR_QUEUE_BLK_T_GRP_IDX SIZEOF(lbmr_qir_queue_blk_t, grp_idx)
1061 #define O_LBMR_QIR_QUEUE_BLK_T_RESERVED OFFSETOF(lbmr_qir_queue_blk_t, reserved)
1062 #define L_LBMR_QIR_QUEUE_BLK_T_RESERVED SIZEOF(lbmr_qir_queue_blk_t, reserved)
1063 #define L_LBMR_QIR_QUEUE_BLK_T (gint) sizeof(lbmr_qir_queue_blk_t)
1064
1065 #define LBMR_QIR_QUEUE_BLK_FLAG_MASTER 0x8000
1066
1067 /* LBMR packet option header */
1068 typedef struct
1069 {
1070     lbm_uint8_t type;
1071     lbm_uint8_t len;
1072     lbm_uint16_t flags;
1073 } lbmr_lbmr_opt_hdr_t;
1074 #define O_LBMR_LBMR_OPT_HDR_T_TYPE OFFSETOF(lbmr_lbmr_opt_hdr_t, type)
1075 #define L_LBMR_LBMR_OPT_HDR_T_TYPE SIZEOF(lbmr_lbmr_opt_hdr_t, type)
1076 #define O_LBMR_LBMR_OPT_HDR_T_LEN OFFSETOF(lbmr_lbmr_opt_hdr_t, len)
1077 #define L_LBMR_LBMR_OPT_HDR_T_LEN SIZEOF(lbmr_lbmr_opt_hdr_t, len)
1078 #define O_LBMR_LBMR_OPT_HDR_T_FLAGS OFFSETOF(lbmr_lbmr_opt_hdr_t, flags)
1079 #define L_LBMR_LBMR_OPT_HDR_T_FLAGS SIZEOF(lbmr_lbmr_opt_hdr_t, flags)
1080 #define L_LBMR_LBMR_OPT_HDR_T (gint) sizeof(lbmr_lbmr_opt_hdr_t)
1081
1082 #define LBMR_LBMR_OPT_HDR_FLAG_IGNORE 0x8000
1083
1084 /* LBMR packet option length header */
1085 typedef struct
1086 {
1087     lbm_uint8_t type;
1088     lbm_uint8_t len;
1089     lbm_uint16_t total_len;
1090 } lbmr_lbmr_opt_len_t;
1091 #define O_LBMR_LBMR_OPT_LEN_T_TYPE OFFSETOF(lbmr_lbmr_opt_len_t, type)
1092 #define L_LBMR_LBMR_OPT_LEN_T_TYPE SIZEOF(lbmr_lbmr_opt_len_t, type)
1093 #define O_LBMR_LBMR_OPT_LEN_T_LEN OFFSETOF(lbmr_lbmr_opt_len_t, len)
1094 #define L_LBMR_LBMR_OPT_LEN_T_LEN SIZEOF(lbmr_lbmr_opt_len_t, len)
1095 #define O_LBMR_LBMR_OPT_LEN_T_TOTAL_LEN OFFSETOF(lbmr_lbmr_opt_len_t, total_len)
1096 #define L_LBMR_LBMR_OPT_LEN_T_TOTAL_LEN SIZEOF(lbmr_lbmr_opt_len_t, total_len)
1097 #define L_LBMR_LBMR_OPT_LEN_T (gint) sizeof(lbmr_lbmr_opt_len_t)
1098
1099 #define LBMR_LBMR_OPT_LEN_TYPE 0x80
1100
1101 /* LBMR packet option source ID header */
1102 typedef struct
1103 {
1104     lbm_uint8_t type;
1105     lbm_uint8_t len;
1106     lbm_uint16_t flags;
1107     lbm_uint8_t src_id[LBM_CONTEXT_INSTANCE_BLOCK_SZ];
1108 } lbmr_lbmr_opt_src_id_t;
1109 #define O_LBMR_LBMR_OPT_SRC_ID_T_TYPE OFFSETOF(lbmr_lbmr_opt_src_id_t, type)
1110 #define L_LBMR_LBMR_OPT_SRC_ID_T_TYPE SIZEOF(lbmr_lbmr_opt_src_id_t, type)
1111 #define O_LBMR_LBMR_OPT_SRC_ID_T_LEN OFFSETOF(lbmr_lbmr_opt_src_id_t, len)
1112 #define L_LBMR_LBMR_OPT_SRC_ID_T_LEN SIZEOF(lbmr_lbmr_opt_src_id_t, len)
1113 #define O_LBMR_LBMR_OPT_SRC_ID_T_FLAGS OFFSETOF(lbmr_lbmr_opt_src_id_t, flags)
1114 #define L_LBMR_LBMR_OPT_SRC_ID_T_FLAGS SIZEOF(lbmr_lbmr_opt_src_id_t, flags)
1115 #define O_LBMR_LBMR_OPT_SRC_ID_T_SRC_ID OFFSETOF(lbmr_lbmr_opt_src_id_t, src_id)
1116 #define L_LBMR_LBMR_OPT_SRC_ID_T_SRC_ID SIZEOF(lbmr_lbmr_opt_src_id_t, src_id)
1117 #define L_LBMR_LBMR_OPT_SRC_ID_T (gint) sizeof(lbmr_lbmr_opt_src_id_t)
1118
1119 #define LBMR_LBMR_OPT_SRC_ID_TYPE 0x81
1120 #define LBMR_LBMR_OPT_SRC_ID_FLAG_IGNORE 0x8000
1121
1122 /* LBMR packet option source type header */
1123 typedef struct
1124 {
1125     lbm_uint8_t type;
1126     lbm_uint8_t len;
1127     lbm_uint8_t flags;
1128     lbm_uint8_t src_type;
1129 } lbmr_lbmr_opt_src_type_t;
1130 #define O_LBMR_LBMR_OPT_SRC_TYPE_T_TYPE OFFSETOF(lbmr_lbmr_opt_src_type_t, type)
1131 #define L_LBMR_LBMR_OPT_SRC_TYPE_T_TYPE SIZEOF(lbmr_lbmr_opt_src_type_t, type)
1132 #define O_LBMR_LBMR_OPT_SRC_TYPE_T_LEN OFFSETOF(lbmr_lbmr_opt_src_type_t, len)
1133 #define L_LBMR_LBMR_OPT_SRC_TYPE_T_LEN SIZEOF(lbmr_lbmr_opt_src_type_t, len)
1134 #define O_LBMR_LBMR_OPT_SRC_TYPE_T_FLAGS OFFSETOF(lbmr_lbmr_opt_src_type_t, flags)
1135 #define L_LBMR_LBMR_OPT_SRC_TYPE_T_FLAGS SIZEOF(lbmr_lbmr_opt_src_type_t, flags)
1136 #define O_LBMR_LBMR_OPT_SRC_TYPE_T_SRC_TYPE OFFSETOF(lbmr_lbmr_opt_src_type_t, src_type)
1137 #define L_LBMR_LBMR_OPT_SRC_TYPE_T_SRC_TYPE SIZEOF(lbmr_lbmr_opt_src_type_t, src_type)
1138 #define L_LBMR_LBMR_OPT_SRC_TYPE_T (gint) sizeof(lbmr_lbmr_opt_src_type_t)
1139
1140 #define LBMR_LBMR_OPT_SRC_TYPE_TYPE 0x82
1141 #define LBMR_LBMR_OPT_SRC_TYPE_SZ 4
1142 #define LBMR_LBMR_OPT_SRC_TYPE_FLAG_IGNORE 0x80
1143
1144 #define LBMR_LBMR_OPT_SRC_TYPE_SRC_TYPE_APPLICATION 0
1145 #define LBMR_LBMR_OPT_SRC_TYPE_SRC_TYPE_TNWGD 1
1146 #define LBMR_LBMR_OPT_SRC_TYPE_SRC_TYPE_STORE 2
1147
1148 /* LBMR packet option version header */
1149 typedef struct
1150 {
1151     lbm_uint8_t type;
1152     lbm_uint8_t len;
1153     lbm_uint16_t flags;
1154     lbm_uint32_t version;
1155 } lbmr_lbmr_opt_version_t;
1156 #define O_LBMR_LBMR_OPT_VERSION_T_TYPE OFFSETOF(lbmr_lbmr_opt_version_t, type)
1157 #define L_LBMR_LBMR_OPT_VERSION_T_TYPE SIZEOF(lbmr_lbmr_opt_version_t, type)
1158 #define O_LBMR_LBMR_OPT_VERSION_T_LEN OFFSETOF(lbmr_lbmr_opt_version_t, len)
1159 #define L_LBMR_LBMR_OPT_VERSION_T_LEN SIZEOF(lbmr_lbmr_opt_version_t, len)
1160 #define O_LBMR_LBMR_OPT_VERSION_T_FLAGS OFFSETOF(lbmr_lbmr_opt_version_t, flags)
1161 #define L_LBMR_LBMR_OPT_VERSION_T_FLAGS SIZEOF(lbmr_lbmr_opt_version_t, flags)
1162 #define O_LBMR_LBMR_OPT_VERSION_T_VERSION OFFSETOF(lbmr_lbmr_opt_version_t, version)
1163 #define L_LBMR_LBMR_OPT_VERSION_T_VERSION SIZEOF(lbmr_lbmr_opt_version_t, version)
1164 #define L_LBMR_LBMR_OPT_VERSION_T (gint) sizeof(lbmr_lbmr_opt_version_t)
1165
1166 #define LBMR_LBMR_OPT_VERSION_TYPE 0x83
1167 #define LBMR_LBMR_OPT_VERSIION_SZ 8
1168 #define LBMR_LBMR_OPT_VERSION_FLAG_IGNORE 0x8000
1169 #define LBMR_LBMR_OPT_VERSION_FLAG_UME    0x0001
1170 #define LBMR_LBMR_OPT_VERSION_FLAG_UMQ    0x0002
1171
1172 /* LBMR packet option domain header */
1173 typedef struct
1174 {
1175     lbm_uint8_t type;
1176     lbm_uint8_t len;
1177     lbm_uint16_t flags;
1178     lbm_uint32_t local_domain_id;
1179 } lbmr_lbmr_opt_local_domain_t;
1180 #define O_LBMR_LBMR_OPT_LOCAL_DOMAIN_T_TYPE OFFSETOF(lbmr_lbmr_opt_local_domain_t, type)
1181 #define L_LBMR_LBMR_OPT_LOCAL_DOMAIN_T_TYPE SIZEOF(lbmr_lbmr_opt_local_domain_t, type)
1182 #define O_LBMR_LBMR_OPT_LOCAL_DOMAIN_T_LEN OFFSETOF(lbmr_lbmr_opt_local_domain_t, len)
1183 #define L_LBMR_LBMR_OPT_LOCAL_DOMAIN_T_LEN SIZEOF(lbmr_lbmr_opt_local_domain_t, len)
1184 #define O_LBMR_LBMR_OPT_LOCAL_DOMAIN_T_FLAGS OFFSETOF(lbmr_lbmr_opt_local_domain_t, flags)
1185 #define L_LBMR_LBMR_OPT_LOCAL_DOMAIN_T_FLAGS SIZEOF(lbmr_lbmr_opt_local_domain_t, flags)
1186 #define O_LBMR_LBMR_OPT_LOCAL_DOMAIN_T_LOCAL_DOMAIN_ID OFFSETOF(lbmr_lbmr_opt_local_domain_t, local_domain_id)
1187 #define L_LBMR_LBMR_OPT_LOCAL_DOMAIN_T_LOCAL_DOMAIN_ID SIZEOF(lbmr_lbmr_opt_local_domain_t, local_domain_id)
1188 #define L_LBMR_LBMR_OPT_LOCAL_DOMAIN_T (gint) sizeof(lbmr_lbmr_opt_local_domain_t)
1189
1190 #define LBMR_LBMR_OPT_LOCAL_DOMAIN_TYPE 0x84
1191 #define LBMR_LBMR_OPT_LOCAL_DOMAIN_SZ 8
1192 #define LBMR_LBMR_OPT_LOCAL_DOMAIN_FLAG_IGNORE 0x8000
1193
1194 /* LBMR (extended) proxy source election record */
1195 typedef struct
1196 {
1197     lbm_uint8_t ver_type;
1198     lbm_uint8_t ext_type;
1199     lbm_uint16_t dep_type;
1200     lbm_uint16_t len;
1201     lbm_uint16_t flags;
1202     lbm_uint32_t source_ip;
1203     lbm_uint32_t store_ip;
1204     lbm_uint32_t transport_idx;
1205     lbm_uint32_t topic_idx;
1206     lbm_uint16_t source_port;
1207     lbm_uint16_t store_port;
1208 } lbmr_pser_t;
1209 #define O_LBMR_PSER_T_VER_TYPE OFFSETOF(lbmr_pser_t, ver_type)
1210 #define L_LBMR_PSER_T_VER_TYPE SIZEOF(lbmr_pser_t, ver_type)
1211 #define O_LBMR_PSER_T_EXT_TYPE OFFSETOF(lbmr_pser_t, ext_type)
1212 #define L_LBMR_PSER_T_EXT_TYPE SIZEOF(lbmr_pser_t, ext_type)
1213 #define O_LBMR_PSER_T_DEP_TYPE OFFSETOF(lbmr_pser_t, dep_type)
1214 #define L_LBMR_PSER_T_DEP_TYPE SIZEOF(lbmr_pser_t, dep_type)
1215 #define O_LBMR_PSER_T_LEN OFFSETOF(lbmr_pser_t, len)
1216 #define L_LBMR_PSER_T_LEN SIZEOF(lbmr_pser_t, len)
1217 #define O_LBMR_PSER_T_FLAGS OFFSETOF(lbmr_pser_t, flags)
1218 #define L_LBMR_PSER_T_FLAGS SIZEOF(lbmr_pser_t, flags)
1219 #define O_LBMR_PSER_T_SOURCE_IP OFFSETOF(lbmr_pser_t, source_ip)
1220 #define L_LBMR_PSER_T_SOURCE_IP SIZEOF(lbmr_pser_t, source_ip)
1221 #define O_LBMR_PSER_T_STORE_IP OFFSETOF(lbmr_pser_t, store_ip)
1222 #define L_LBMR_PSER_T_STORE_IP SIZEOF(lbmr_pser_t, store_ip)
1223 #define O_LBMR_PSER_T_TRANSPORT_IDX OFFSETOF(lbmr_pser_t, transport_idx)
1224 #define L_LBMR_PSER_T_TRANSPORT_IDX SIZEOF(lbmr_pser_t, transport_idx)
1225 #define O_LBMR_PSER_T_TOPIC_IDX OFFSETOF(lbmr_pser_t, topic_idx)
1226 #define L_LBMR_PSER_T_TOPIC_IDX SIZEOF(lbmr_pser_t, topic_idx)
1227 #define O_LBMR_PSER_T_SOURCE_PORT OFFSETOF(lbmr_pser_t, source_port)
1228 #define L_LBMR_PSER_T_SOURCE_PORT SIZEOF(lbmr_pser_t, source_port)
1229 #define O_LBMR_PSER_T_STORE_PORT OFFSETOF(lbmr_pser_t, store_port)
1230 #define L_LBMR_PSER_T_STORE_PORT SIZEOF(lbmr_pser_t, store_port)
1231 #define O_LBMR_PSER_T_TOPIC (O_LBMR_PSER_T_STORE_PORT + L_LBMR_PSER_T_STORE_PORT)
1232 #define L_LBMR_PSER_T (gint) sizeof(lbmr_pser_t)
1233
1234 #define LBMR_PSER_OPT_FLAG 0x8000
1235 #define LBMR_HDR_EXT_TYPE_UME_PROXY_SRC_ELECT_DEP_ELECT 0
1236 #define LBMR_HDR_EXT_TYPE_UME_PROXY_SRC_ELECT_DEP_REELECT 1
1237
1238 typedef struct
1239 {
1240     lbm_uint16_t type;
1241     lbm_uint16_t optlen;
1242 } lbmr_pser_optlen_t;
1243 #define O_LBMR_PSER_OPTLEN_T_TYPE OFFSETOF(lbmr_pser_optlen_t, type)
1244 #define L_LBMR_PSER_OPTLEN_T_TYPE SIZEOF(lbmr_pser_optlen_t, type)
1245 #define O_LBMR_PSER_OPTLEN_T_OPTLEN OFFSETOF(lbmr_pser_optlen_t, optlen)
1246 #define L_LBMR_PSER_OPTLEN_T_OPTLEN SIZEOF(lbmr_pser_optlen_t, optlen)
1247 #define L_LBMR_PSER_OPTLEN_T (gint) sizeof(lbmr_pser_optlen_t)
1248
1249 typedef struct
1250 {
1251     lbm_uint8_t len;
1252     lbm_uint8_t type;
1253 } lbmr_pser_opt_hdr_t;
1254 #define O_LBMR_PSER_OPT_HDR_T_LEN OFFSETOF(lbmr_pser_opt_hdr_t, len)
1255 #define L_LBMR_PSER_OPT_HDR_T_LEN SIZEOF(lbmr_pser_opt_hdr_t, len)
1256 #define O_LBMR_PSER_OPT_HDR_T_TYPE OFFSETOF(lbmr_pser_opt_hdr_t, type)
1257 #define L_LBMR_PSER_OPT_HDR_T_TYPE SIZEOF(lbmr_pser_opt_hdr_t, type)
1258 #define L_LBMR_PSER_OPT_HDR_T (gint) sizeof(lbmr_pser_opt_hdr_t)
1259
1260 #define LBMR_PSER_OPT_SRC_CTXINST_TYPE 0x00
1261 #define LBMR_PSER_OPT_STORE_CTXINST_TYPE 0x01
1262
1263 typedef struct
1264 {
1265     lbm_uint8_t len;
1266     lbm_uint8_t type;
1267     lbm_uint8_t ctxinst[LBM_CONTEXT_INSTANCE_BLOCK_SZ];
1268 } lbmr_pser_opt_ctxinst_t;
1269 #define O_LBMR_PSER_OPT_CTXINST_T_LEN OFFSETOF(lbmr_pser_opt_ctxinst_t, len)
1270 #define L_LBMR_PSER_OPT_CTXINST_T_LEN SIZEOF(lbmr_pser_opt_ctxinst_t, len)
1271 #define O_LBMR_PSER_OPT_CTXINST_T_TYPE OFFSETOF(lbmr_pser_opt_ctxinst_t, type)
1272 #define L_LBMR_PSER_OPT_CTXINST_T_TYPE SIZEOF(lbmr_pser_opt_ctxinst_t, type)
1273 #define O_LBMR_PSER_OPT_CTXINST_T_CTXINST OFFSETOF(lbmr_pser_opt_ctxinst_t, ctxinst)
1274 #define L_LBMR_PSER_OPT_CTXINST_T_CTXINST SIZEOF(lbmr_pser_opt_ctxinst_t, ctxinst)
1275 #define L_LBMR_PSER_OPT_CTXINST_T (gint) sizeof(lbmr_pser_opt_ctxinst_t)
1276
1277 /* LBMR (extended) gateway message */
1278 typedef struct
1279 {
1280     lbm_uint8_t ver_type;
1281     lbm_uint8_t ext_type;
1282     lbm_uint16_t len;
1283     lbm_uint16_t type;
1284     lbm_uint16_t reserved;
1285 } lbmr_tnwg_t;
1286 #define O_LBMR_TNWG_T_VER_TYPE OFFSETOF(lbmr_tnwg_t, ver_type)
1287 #define L_LBMR_TNWG_T_VER_TYPE SIZEOF(lbmr_tnwg_t, ver_type)
1288 #define O_LBMR_TNWG_T_EXT_TYPE OFFSETOF(lbmr_tnwg_t, ext_type)
1289 #define L_LBMR_TNWG_T_EXT_TYPE SIZEOF(lbmr_tnwg_t, ext_type)
1290 #define O_LBMR_TNWG_T_LEN OFFSETOF(lbmr_tnwg_t, len)
1291 #define L_LBMR_TNWG_T_LEN SIZEOF(lbmr_tnwg_t, len)
1292 #define O_LBMR_TNWG_T_TYPE OFFSETOF(lbmr_tnwg_t, type)
1293 #define L_LBMR_TNWG_T_TYPE SIZEOF(lbmr_tnwg_t, type)
1294 #define O_LBMR_TNWG_T_RESERVED OFFSETOF(lbmr_tnwg_t, reserved)
1295 #define L_LBMR_TNWG_T_RESERVED SIZEOF(lbmr_tnwg_t, reserved)
1296 #define L_LBMR_TNWG_T (gint) sizeof(lbmr_tnwg_t)
1297
1298 #define LBMR_TNWG_TYPE_INTEREST 0x0000
1299 #define LBMR_TNWG_TYPE_CTXINFO  0x0001
1300 #define LBMR_TNWG_TYPE_TRREQ    0x0002
1301
1302 /* LBMR (extended) gateway message - interest header */
1303 typedef struct
1304 {
1305     lbm_uint16_t len;
1306     lbm_uint16_t count;
1307 } lbmr_tnwg_interest_t;
1308 #define O_LBMR_TNWG_INTEREST_T_LEN OFFSETOF(lbmr_tnwg_interest_t, len)
1309 #define L_LBMR_TNWG_INTEREST_T_LEN SIZEOF(lbmr_tnwg_interest_t, len)
1310 #define O_LBMR_TNWG_INTEREST_T_COUNT OFFSETOF(lbmr_tnwg_interest_t, count)
1311 #define L_LBMR_TNWG_INTEREST_T_COUNT SIZEOF(lbmr_tnwg_interest_t, count)
1312 #define L_LBMR_TNWG_INTEREST_T (gint) sizeof(lbmr_tnwg_interest_t)
1313
1314 /* LBMR (extended) gateway message - interest record */
1315 typedef struct
1316 {
1317     lbm_uint16_t len;
1318     lbm_uint8_t flags;
1319     lbm_uint8_t pattype;
1320     lbm_uint32_t domain_id;
1321 } lbmr_tnwg_interest_rec_t;
1322 #define O_LBMR_TNWG_INTEREST_REC_T_LEN OFFSETOF(lbmr_tnwg_interest_rec_t, len)
1323 #define L_LBMR_TNWG_INTEREST_REC_T_LEN SIZEOF(lbmr_tnwg_interest_rec_t, len)
1324 #define O_LBMR_TNWG_INTEREST_REC_T_FLAGS OFFSETOF(lbmr_tnwg_interest_rec_t, flags)
1325 #define L_LBMR_TNWG_INTEREST_REC_T_FLAGS SIZEOF(lbmr_tnwg_interest_rec_t, flags)
1326 #define O_LBMR_TNWG_INTEREST_REC_T_PATTYPE OFFSETOF(lbmr_tnwg_interest_rec_t, pattype)
1327 #define L_LBMR_TNWG_INTEREST_REC_T_PATTYPE SIZEOF(lbmr_tnwg_interest_rec_t, pattype)
1328 #define O_LBMR_TNWG_INTEREST_REC_T_DOMAIN_ID OFFSETOF(lbmr_tnwg_interest_rec_t, domain_id)
1329 #define L_LBMR_TNWG_INTEREST_REC_T_DOMAIN_ID SIZEOF(lbmr_tnwg_interest_rec_t, domain_id)
1330 #define L_LBMR_TNWG_INTEREST_REC_T (gint) sizeof(lbmr_tnwg_interest_rec_t)
1331
1332 #define LBMR_TNWG_INTEREST_REC_PATTERN_FLAG 0x80
1333 #define LBMR_TNWG_INTEREST_REC_CANCEL_FLAG  0x40
1334 #define LBMR_TNWG_INTEREST_REC_REFRESH_FLAG 0x20
1335
1336 /* LBMR (extended) gateway message - ctxinfo header */
1337 typedef struct
1338 {
1339     lbm_uint16_t len;
1340     lbm_uint8_t hop_count;
1341     lbm_uint8_t reserved;
1342     lbm_uint32_t flags1;
1343     lbm_uint32_t flags2;
1344 } lbmr_tnwg_ctxinfo_t;
1345 #define O_LBMR_TNWG_CTXINFO_T_LEN OFFSETOF(lbmr_tnwg_ctxinfo_t, len)
1346 #define L_LBMR_TNWG_CTXINFO_T_LEN SIZEOF(lbmr_tnwg_ctxinfo_t, len)
1347 #define O_LBMR_TNWG_CTXINFO_T_HOP_COUNT OFFSETOF(lbmr_tnwg_ctxinfo_t, hop_count)
1348 #define L_LBMR_TNWG_CTXINFO_T_HOP_COUNT SIZEOF(lbmr_tnwg_ctxinfo_t, hop_count)
1349 #define O_LBMR_TNWG_CTXINFO_T_RESERVED OFFSETOF(lbmr_tnwg_ctxinfo_t, reserved)
1350 #define L_LBMR_TNWG_CTXINFO_T_RESERVED SIZEOF(lbmr_tnwg_ctxinfo_t, reserved)
1351 #define O_LBMR_TNWG_CTXINFO_T_FLAGS1 OFFSETOF(lbmr_tnwg_ctxinfo_t, flags1)
1352 #define L_LBMR_TNWG_CTXINFO_T_FLAGS1 SIZEOF(lbmr_tnwg_ctxinfo_t, flags1)
1353 #define O_LBMR_TNWG_CTXINFO_T_FLAGS2 OFFSETOF(lbmr_tnwg_ctxinfo_t, flags2)
1354 #define L_LBMR_TNWG_CTXINFO_T_FLAGS2 SIZEOF(lbmr_tnwg_ctxinfo_t, flags2)
1355 #define L_LBMR_TNWG_CTXINFO_T (gint) sizeof(lbmr_tnwg_ctxinfo_t)
1356
1357 #define LBMR_TNWG_CTXINFO_QUERY_FLAG 0x80000000
1358 #define LBMR_TNWG_CTXINFO_TNWG_SRC_FLAG 0x40000000
1359 #define LBMR_TNWG_CTXINFO_TNWG_RCV_FLAG 0x20000000
1360 #define LBMR_TNWG_CTXINFO_PROXY_FLAG 0x10000000
1361
1362 /* LBMR (extended) gateway message - topic res request header */
1363 typedef struct
1364 {
1365     lbm_uint16_t len;
1366 } lbmr_tnwg_trreq_t;
1367 #define O_LBMR_TNWG_TRREQ_T_LEN OFFSETOF(lbmr_tnwg_trreq_t, len)
1368 #define L_LBMR_TNWG_TRREQ_T_LEN SIZEOF(lbmr_tnwg_trreq_t, len)
1369 #define L_LBMR_TNWG_TRREQ_T (gint) sizeof(lbmr_tnwg_trreq_t)
1370
1371 /* LBMR (extended) gateway message - basic option */
1372 typedef struct
1373 {
1374     lbm_uint8_t type;
1375     lbm_uint8_t len;
1376     lbm_uint16_t flags;
1377 } lbmr_tnwg_opt_t;
1378 #define O_LBMR_TNWG_OPT_T_TYPE OFFSETOF(lbmr_tnwg_opt_t, type)
1379 #define L_LBMR_TNWG_OPT_T_TYPE SIZEOF(lbmr_tnwg_opt_t, type)
1380 #define O_LBMR_TNWG_OPT_T_LEN OFFSETOF(lbmr_tnwg_opt_t, len)
1381 #define L_LBMR_TNWG_OPT_T_LEN SIZEOF(lbmr_tnwg_opt_t, len)
1382 #define O_LBMR_TNWG_OPT_T_FLAGS OFFSETOF(lbmr_tnwg_opt_t, flags)
1383 #define L_LBMR_TNWG_OPT_T_FLAGS SIZEOF(lbmr_tnwg_opt_t, flags)
1384 #define L_LBMR_TNWG_OPT_T (gint) sizeof(lbmr_tnwg_opt_t)
1385
1386 #define LBMR_TNWG_OPT_IGNORE_FLAG 0x8000
1387
1388 /* LBMR (extended) gateway message - ctxinst option */
1389 typedef struct
1390 {
1391     lbm_uint8_t type;
1392     lbm_uint8_t len;
1393     lbm_uint16_t flags;
1394     lbm_uint8_t instance[LBM_CONTEXT_INSTANCE_BLOCK_SZ];
1395 } lbmr_tnwg_opt_ctxinst_t;
1396 #define O_LBMR_TNWG_OPT_CTXINST_T_TYPE OFFSETOF(lbmr_tnwg_opt_ctxinst_t, type)
1397 #define L_LBMR_TNWG_OPT_CTXINST_T_TYPE SIZEOF(lbmr_tnwg_opt_ctxinst_t, type)
1398 #define O_LBMR_TNWG_OPT_CTXINST_T_LEN OFFSETOF(lbmr_tnwg_opt_ctxinst_t, len)
1399 #define L_LBMR_TNWG_OPT_CTXINST_T_LEN SIZEOF(lbmr_tnwg_opt_ctxinst_t, len)
1400 #define O_LBMR_TNWG_OPT_CTXINST_T_FLAGS OFFSETOF(lbmr_tnwg_opt_ctxinst_t, flags)
1401 #define L_LBMR_TNWG_OPT_CTXINST_T_FLAGS SIZEOF(lbmr_tnwg_opt_ctxinst_t, flags)
1402 #define O_LBMR_TNWG_OPT_CTXINST_T_INSTANCE OFFSETOF(lbmr_tnwg_opt_ctxinst_t, instance)
1403 #define L_LBMR_TNWG_OPT_CTXINST_T_INSTANCE SIZEOF(lbmr_tnwg_opt_ctxinst_t, instance)
1404 #define L_LBMR_TNWG_OPT_CTXINST_T (gint) sizeof(lbmr_tnwg_opt_ctxinst_t)
1405
1406 #define LBMR_TNWG_OPT_CTXINST_TYPE 0x00
1407
1408 /* LBMR (extended) gateway message - address option */
1409 typedef struct
1410 {
1411     lbm_uint8_t type;
1412     lbm_uint8_t len;
1413     lbm_uint16_t flags;
1414     lbm_uint16_t port;
1415     lbm_uint16_t res;
1416     lbm_uint32_t ip;
1417 } lbmr_tnwg_opt_address_t;
1418 #define O_LBMR_TNWG_OPT_ADDRESS_T_TYPE OFFSETOF(lbmr_tnwg_opt_address_t, type)
1419 #define L_LBMR_TNWG_OPT_ADDRESS_T_TYPE SIZEOF(lbmr_tnwg_opt_address_t, type)
1420 #define O_LBMR_TNWG_OPT_ADDRESS_T_LEN OFFSETOF(lbmr_tnwg_opt_address_t, len)
1421 #define L_LBMR_TNWG_OPT_ADDRESS_T_LEN SIZEOF(lbmr_tnwg_opt_address_t, len)
1422 #define O_LBMR_TNWG_OPT_ADDRESS_T_FLAGS OFFSETOF(lbmr_tnwg_opt_address_t, flags)
1423 #define L_LBMR_TNWG_OPT_ADDRESS_T_FLAGS SIZEOF(lbmr_tnwg_opt_address_t, flags)
1424 #define O_LBMR_TNWG_OPT_ADDRESS_T_PORT OFFSETOF(lbmr_tnwg_opt_address_t, port)
1425 #define L_LBMR_TNWG_OPT_ADDRESS_T_PORT SIZEOF(lbmr_tnwg_opt_address_t, port)
1426 #define O_LBMR_TNWG_OPT_ADDRESS_T_RES OFFSETOF(lbmr_tnwg_opt_address_t, res)
1427 #define L_LBMR_TNWG_OPT_ADDRESS_T_RES SIZEOF(lbmr_tnwg_opt_address_t, res)
1428 #define O_LBMR_TNWG_OPT_ADDRESS_T_IP OFFSETOF(lbmr_tnwg_opt_address_t, ip)
1429 #define L_LBMR_TNWG_OPT_ADDRESS_T_IP SIZEOF(lbmr_tnwg_opt_address_t, ip)
1430 #define L_LBMR_TNWG_OPT_ADDRESS_T (gint) sizeof(lbmr_tnwg_opt_address_t)
1431
1432 #define LBMR_TNWG_OPT_ADDRESS_TYPE 0x01
1433
1434 /* LBMR (extended) gateway message - domain option */
1435 typedef struct
1436 {
1437     lbm_uint8_t type;
1438     lbm_uint8_t len;
1439     lbm_uint16_t flags;
1440     lbm_uint32_t domain_id;
1441 } lbmr_tnwg_opt_domain_t;
1442 #define O_LBMR_TNWG_OPT_DOMAIN_T_TYPE OFFSETOF(lbmr_tnwg_opt_domain_t, type)
1443 #define L_LBMR_TNWG_OPT_DOMAIN_T_TYPE SIZEOF(lbmr_tnwg_opt_domain_t, type)
1444 #define O_LBMR_TNWG_OPT_DOMAIN_T_LEN OFFSETOF(lbmr_tnwg_opt_domain_t, len)
1445 #define L_LBMR_TNWG_OPT_DOMAIN_T_LEN SIZEOF(lbmr_tnwg_opt_domain_t, len)
1446 #define O_LBMR_TNWG_OPT_DOMAIN_T_FLAGS OFFSETOF(lbmr_tnwg_opt_domain_t, flags)
1447 #define L_LBMR_TNWG_OPT_DOMAIN_T_FLAGS SIZEOF(lbmr_tnwg_opt_domain_t, flags)
1448 #define O_LBMR_TNWG_OPT_DOMAIN_T_DOMAIN_ID OFFSETOF(lbmr_tnwg_opt_domain_t, domain_id)
1449 #define L_LBMR_TNWG_OPT_DOMAIN_T_DOMAIN_ID SIZEOF(lbmr_tnwg_opt_domain_t, domain_id)
1450 #define L_LBMR_TNWG_OPT_DOMAIN_T (gint) sizeof(lbmr_tnwg_opt_domain_t)
1451
1452 #define LBMR_TNWG_OPT_DOMAIN_TYPE 0x02
1453
1454 /* LBMR (extended) gateway message - name option (a base option) */
1455 #define LBMR_TNWG_OPT_NAME_TYPE 0x03
1456
1457 /* LBMR (extended) remote domain route message */
1458 typedef struct
1459 {
1460     lbm_uint8_t ver_type;
1461     lbm_uint8_t ext_type;
1462     lbm_uint16_t num_domains;
1463     lbm_uint32_t ip;
1464     lbm_uint16_t port;
1465     lbm_uint16_t reserved;
1466     lbm_uint32_t length;
1467     /* lbm_uint32_t domains[num_domains]; */
1468 } lbmr_remote_domain_route_hdr_t;
1469 #define O_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T_VER_TYPE OFFSETOF(lbmr_remote_domain_route_hdr_t, ver_type)
1470 #define L_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T_VER_TYPE SIZEOF(lbmr_remote_domain_route_hdr_t, ver_type)
1471 #define O_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T_EXT_TYPE OFFSETOF(lbmr_remote_domain_route_hdr_t, ext_type)
1472 #define L_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T_EXT_TYPE SIZEOF(lbmr_remote_domain_route_hdr_t, ext_type)
1473 #define O_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T_NUM_DOMAINS OFFSETOF(lbmr_remote_domain_route_hdr_t, num_domains)
1474 #define L_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T_NUM_DOMAINS SIZEOF(lbmr_remote_domain_route_hdr_t, num_domains)
1475 #define O_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T_IP OFFSETOF(lbmr_remote_domain_route_hdr_t, ip)
1476 #define L_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T_IP SIZEOF(lbmr_remote_domain_route_hdr_t, ip)
1477 #define O_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T_PORT OFFSETOF(lbmr_remote_domain_route_hdr_t, port)
1478 #define L_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T_PORT SIZEOF(lbmr_remote_domain_route_hdr_t, port)
1479 #define O_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T_RESERVED OFFSETOF(lbmr_remote_domain_route_hdr_t, reserved)
1480 #define L_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T_RESERVED SIZEOF(lbmr_remote_domain_route_hdr_t, reserved)
1481 #define O_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T_LENGTH OFFSETOF(lbmr_remote_domain_route_hdr_t, length)
1482 #define L_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T_LENGTH SIZEOF(lbmr_remote_domain_route_hdr_t, length)
1483 #define L_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T (gint) sizeof(lbmr_remote_domain_route_hdr_t)
1484
1485 /* LBMR (extended) remote context information message */
1486 typedef struct
1487 {
1488     lbm_uint8_t ver_type;
1489     lbm_uint8_t ext_type;
1490     lbm_uint16_t len;
1491     lbm_uint16_t num_recs;
1492     lbm_uint16_t reserved;
1493 } lbmr_rctxinfo_t;
1494 #define O_LBMR_RCTXINFO_T_VER_TYPE OFFSETOF(lbmr_rctxinfo_t, ver_type)
1495 #define L_LBMR_RCTXINFO_T_VER_TYPE SIZEOF(lbmr_rctxinfo_t, ver_type)
1496 #define O_LBMR_RCTXINFO_T_EXT_TYPE OFFSETOF(lbmr_rctxinfo_t, ext_type)
1497 #define L_LBMR_RCTXINFO_T_EXT_TYPE SIZEOF(lbmr_rctxinfo_t, ext_type)
1498 #define O_LBMR_RCTXINFO_T_LEN OFFSETOF(lbmr_rctxinfo_t, len)
1499 #define L_LBMR_RCTXINFO_T_LEN SIZEOF(lbmr_rctxinfo_t, len)
1500 #define O_LBMR_RCTXINFO_T_NUM_RECS OFFSETOF(lbmr_rctxinfo_t, num_recs)
1501 #define L_LBMR_RCTXINFO_T_NUM_RECS SIZEOF(lbmr_rctxinfo_t, num_recs)
1502 #define O_LBMR_RCTXINFO_T_RESERVED OFFSETOF(lbmr_rctxinfo_t, reserved)
1503 #define L_LBMR_RCTXINFO_T_RESERVED SIZEOF(lbmr_rctxinfo_t, reserved)
1504 #define L_LBMR_RCTXINFO_T (gint) sizeof(lbmr_rctxinfo_t)
1505
1506 /* LBMR (extended) remote context information record */
1507 typedef struct
1508 {
1509     lbm_uint16_t len;
1510     lbm_uint16_t flags;
1511 } lbmr_rctxinfo_rec_t;
1512 #define O_LBMR_RCTXINFO_REC_T_LEN OFFSETOF(lbmr_rctxinfo_rec_t, len)
1513 #define L_LBMR_RCTXINFO_REC_T_LEN SIZEOF(lbmr_rctxinfo_rec_t, len)
1514 #define O_LBMR_RCTXINFO_REC_T_FLAGS OFFSETOF(lbmr_rctxinfo_rec_t, flags)
1515 #define L_LBMR_RCTXINFO_REC_T_FLAGS SIZEOF(lbmr_rctxinfo_rec_t, flags)
1516 #define L_LBMR_RCTXINFO_REC_T (gint) sizeof(lbmr_rctxinfo_rec_t)
1517
1518 #define LBMR_RCTXINFO_REC_FLAG_QUERY 0x8000
1519
1520 /* LBMR (extended) remote context information record option */
1521 typedef struct
1522 {
1523     lbm_uint8_t type;
1524     lbm_uint8_t len;
1525     lbm_uint16_t flags;
1526 } lbmr_rctxinfo_rec_opt_t;
1527 #define O_LBMR_RCTXINFO_REC_OPT_T_TYPE OFFSETOF(lbmr_rctxinfo_rec_opt_t, type)
1528 #define L_LBMR_RCTXINFO_REC_OPT_T_TYPE SIZEOF(lbmr_rctxinfo_rec_opt_t, type)
1529 #define O_LBMR_RCTXINFO_REC_OPT_T_LEN OFFSETOF(lbmr_rctxinfo_rec_opt_t, len)
1530 #define L_LBMR_RCTXINFO_REC_OPT_T_LEN SIZEOF(lbmr_rctxinfo_rec_opt_t, len)
1531 #define O_LBMR_RCTXINFO_REC_OPT_T_FLAGS OFFSETOF(lbmr_rctxinfo_rec_opt_t, flags)
1532 #define L_LBMR_RCTXINFO_REC_OPT_T_FLAGS SIZEOF(lbmr_rctxinfo_rec_opt_t, flags)
1533 #define L_LBMR_RCTXINFO_REC_OPT_T (gint) sizeof(lbmr_rctxinfo_rec_opt_t)
1534
1535 /* LBMR (extended) remote context information record address option */
1536 typedef struct
1537 {
1538     lbm_uint8_t type;
1539     lbm_uint8_t len;
1540     lbm_uint16_t flags;
1541     lbm_uint32_t domain_id;
1542     lbm_uint32_t ip;
1543     lbm_uint16_t port;
1544     lbm_uint16_t res;
1545 } lbmr_rctxinfo_rec_address_opt_t;
1546 #define O_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_TYPE OFFSETOF(lbmr_rctxinfo_rec_address_opt_t, type)
1547 #define L_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_TYPE SIZEOF(lbmr_rctxinfo_rec_address_opt_t, type)
1548 #define O_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_LEN OFFSETOF(lbmr_rctxinfo_rec_address_opt_t, len)
1549 #define L_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_LEN SIZEOF(lbmr_rctxinfo_rec_address_opt_t, len)
1550 #define O_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_FLAGS OFFSETOF(lbmr_rctxinfo_rec_address_opt_t, flags)
1551 #define L_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_FLAGS SIZEOF(lbmr_rctxinfo_rec_address_opt_t, flags)
1552 #define O_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_DOMAIN_ID OFFSETOF(lbmr_rctxinfo_rec_address_opt_t, domain_id)
1553 #define L_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_DOMAIN_ID SIZEOF(lbmr_rctxinfo_rec_address_opt_t, domain_id)
1554 #define O_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_IP OFFSETOF(lbmr_rctxinfo_rec_address_opt_t, ip)
1555 #define L_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_IP SIZEOF(lbmr_rctxinfo_rec_address_opt_t, ip)
1556 #define O_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_PORT OFFSETOF(lbmr_rctxinfo_rec_address_opt_t, port)
1557 #define L_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_PORT SIZEOF(lbmr_rctxinfo_rec_address_opt_t, port)
1558 #define O_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_RES OFFSETOF(lbmr_rctxinfo_rec_address_opt_t, res)
1559 #define L_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_RES SIZEOF(lbmr_rctxinfo_rec_address_opt_t, res)
1560 #define L_LBMR_RCTXINFO_REC_ADDRESS_OPT_T (gint) sizeof(lbmr_rctxinfo_rec_address_opt_t)
1561
1562 #define LBMR_RCTXINFO_OPT_ADDRESS_TYPE 0x01
1563
1564 /* LBMR (extended) remote context information record instance option */
1565 typedef struct
1566 {
1567     lbm_uint8_t type;
1568     lbm_uint8_t len;
1569     lbm_uint16_t flags;
1570     lbm_uint8_t instance[LBM_CONTEXT_INSTANCE_BLOCK_SZ];
1571 } lbmr_rctxinfo_rec_instance_opt_t;
1572 #define O_LBMR_RCTXINFO_REC_INSTANCE_OPT_T_TYPE OFFSETOF(lbmr_rctxinfo_rec_instance_opt_t, type)
1573 #define L_LBMR_RCTXINFO_REC_INSTANCE_OPT_T_TYPE SIZEOF(lbmr_rctxinfo_rec_instance_opt_t, type)
1574 #define O_LBMR_RCTXINFO_REC_INSTANCE_OPT_T_LEN OFFSETOF(lbmr_rctxinfo_rec_instance_opt_t, len)
1575 #define L_LBMR_RCTXINFO_REC_INSTANCE_OPT_T_LEN SIZEOF(lbmr_rctxinfo_rec_instance_opt_t, len)
1576 #define O_LBMR_RCTXINFO_REC_INSTANCE_OPT_T_FLAGS OFFSETOF(lbmr_rctxinfo_rec_instance_opt_t, flags)
1577 #define L_LBMR_RCTXINFO_REC_INSTANCE_OPT_T_FLAGS SIZEOF(lbmr_rctxinfo_rec_instance_opt_t, flags)
1578 #define O_LBMR_RCTXINFO_REC_INSTANCE_OPT_T_INSTANCE OFFSETOF(lbmr_rctxinfo_rec_instance_opt_t, instance)
1579 #define L_LBMR_RCTXINFO_REC_INSTANCE_OPT_T_INSTANCE SIZEOF(lbmr_rctxinfo_rec_instance_opt_t, instance)
1580 #define L_LBMR_RCTXINFO_REC_INSTANCE_OPT_T (gint) sizeof(lbmr_rctxinfo_rec_instance_opt_t)
1581
1582 #define LBMR_RCTXINFO_OPT_INSTANCE_TYPE 0x02
1583
1584 /* LBMR (extended) remote context information record odomain option */
1585 typedef struct
1586 {
1587     lbm_uint8_t type;
1588     lbm_uint8_t len;
1589     lbm_uint16_t flags;
1590     lbm_uint32_t domain_id;
1591 } lbmr_rctxinfo_rec_odomain_opt_t;
1592 #define O_LBMR_RCTXINFO_REC_ODOMAIN_OPT_T_TYPE OFFSETOF(lbmr_rctxinfo_rec_odomain_opt_t, type)
1593 #define L_LBMR_RCTXINFO_REC_ODOMAIN_OPT_T_TYPE SIZEOF(lbmr_rctxinfo_rec_odomain_opt_t, type)
1594 #define O_LBMR_RCTXINFO_REC_ODOMAIN_OPT_T_LEN OFFSETOF(lbmr_rctxinfo_rec_odomain_opt_t, len)
1595 #define L_LBMR_RCTXINFO_REC_ODOMAIN_OPT_T_LEN SIZEOF(lbmr_rctxinfo_rec_odomain_opt_t, len)
1596 #define O_LBMR_RCTXINFO_REC_ODOMAIN_OPT_T_FLAGS OFFSETOF(lbmr_rctxinfo_rec_odomain_opt_t, flags)
1597 #define L_LBMR_RCTXINFO_REC_ODOMAIN_OPT_T_FLAGS SIZEOF(lbmr_rctxinfo_rec_odomain_opt_t, flags)
1598 #define O_LBMR_RCTXINFO_REC_ODOMAIN_OPT_T_DOMAIN_ID OFFSETOF(lbmr_rctxinfo_rec_odomain_opt_t, domain_id)
1599 #define L_LBMR_RCTXINFO_REC_ODOMAIN_OPT_T_DOMAIN_ID SIZEOF(lbmr_rctxinfo_rec_odomain_opt_t, domain_id)
1600 #define L_LBMR_RCTXINFO_REC_ODOMAIN_OPT_T (gint) sizeof(lbmr_rctxinfo_rec_odomain_opt_t)
1601
1602 #define LBMR_RCTXINFO_OPT_ODOMAIN_TYPE 0x03
1603
1604 /* LBMR (extended) remote context information record name option */
1605 typedef struct
1606 {
1607     lbm_uint8_t type;
1608     lbm_uint8_t len;
1609     lbm_uint16_t flags;
1610 } lbmr_rctxinfo_rec_name_opt_t;
1611 #define O_LBMR_RCTXINFO_REC_NAME_OPT_T_TYPE OFFSETOF(lbmr_rctxinfo_rec_name_opt_t, type)
1612 #define L_LBMR_RCTXINFO_REC_NAME_OPT_T_TYPE SIZEOF(lbmr_rctxinfo_rec_name_opt_t, type)
1613 #define O_LBMR_RCTXINFO_REC_NAME_OPT_T_LEN OFFSETOF(lbmr_rctxinfo_rec_name_opt_t, len)
1614 #define L_LBMR_RCTXINFO_REC_NAME_OPT_T_LEN SIZEOF(lbmr_rctxinfo_rec_name_opt_t, len)
1615 #define O_LBMR_RCTXINFO_REC_NAME_OPT_T_FLAGS OFFSETOF(lbmr_rctxinfo_rec_name_opt_t, flags)
1616 #define L_LBMR_RCTXINFO_REC_NAME_OPT_T_FLAGS SIZEOF(lbmr_rctxinfo_rec_name_opt_t, flags)
1617 #define L_LBMR_RCTXINFO_REC_NAME_OPT_T (gint) sizeof(lbmr_rctxinfo_rec_name_opt_t)
1618
1619 #define LBMR_RCTXINFO_OPT_NAME_TYPE 0x04
1620
1621 /* Queue management headers (may appear in LBMR or LBMC packets) */
1622 typedef struct
1623 {
1624     lbm_uint8_t ver_type;
1625     lbm_uint8_t ext_type;
1626 } lbmr_umq_qmgmt_hdr_t;
1627 #define O_LBMR_UMQ_QMGMT_HDR_T_VER_TYPE OFFSETOF(lbmr_umq_qmgmt_hdr_t, ver_type)
1628 #define L_LBMR_UMQ_QMGMT_HDR_T_VER_TYPE SIZEOF(lbmr_umq_qmgmt_hdr_t, ver_type)
1629 #define O_LBMR_UMQ_QMGMT_HDR_T_EXT_TYPE OFFSETOF(lbmr_umq_qmgmt_hdr_t, ext_type)
1630 #define L_LBMR_UMQ_QMGMT_HDR_T_EXT_TYPE SIZEOF(lbmr_umq_qmgmt_hdr_t, ext_type)
1631 #define L_LBMR_UMQ_QMGMT_HDR_T (gint) sizeof(lbmr_umq_qmgmt_hdr_t)
1632
1633 typedef struct
1634 {
1635     lbm_uint8_t filler1;
1636     lbm_uint8_t filler2;
1637     lbm_uint8_t flags;
1638     lbm_uint8_t pckt_type;
1639     lbm_uint8_t cfgsig[20];
1640     lbm_uint32_t queue_id;
1641     lbm_uint32_t queue_ver;
1642     lbm_uint32_t ip;
1643     lbm_uint16_t port;
1644     lbm_uint16_t inst_idx;
1645     lbm_uint16_t grp_idx;
1646     lbm_uint16_t pckt_type_dep16;
1647 } umq_qmgmt_hdr_t;
1648 #define O_UMQ_QMGMT_HDR_T_FLAGS OFFSETOF(umq_qmgmt_hdr_t, flags)
1649 #define L_UMQ_QMGMT_HDR_T_FLAGS SIZEOF(umq_qmgmt_hdr_t, flags)
1650 #define O_UMQ_QMGMT_HDR_T_PCKT_TYPE OFFSETOF(umq_qmgmt_hdr_t, pckt_type)
1651 #define L_UMQ_QMGMT_HDR_T_PCKT_TYPE SIZEOF(umq_qmgmt_hdr_t, pckt_type)
1652 #define O_UMQ_QMGMT_HDR_T_CFGSIG OFFSETOF(umq_qmgmt_hdr_t, cfgsig)
1653 #define L_UMQ_QMGMT_HDR_T_CFGSIG SIZEOF(umq_qmgmt_hdr_t, cfgsig)
1654 #define O_UMQ_QMGMT_HDR_T_QUEUE_ID OFFSETOF(umq_qmgmt_hdr_t, queue_id)
1655 #define L_UMQ_QMGMT_HDR_T_QUEUE_ID SIZEOF(umq_qmgmt_hdr_t, queue_id)
1656 #define O_UMQ_QMGMT_HDR_T_QUEUE_VER OFFSETOF(umq_qmgmt_hdr_t, queue_ver)
1657 #define L_UMQ_QMGMT_HDR_T_QUEUE_VER SIZEOF(umq_qmgmt_hdr_t, queue_ver)
1658 #define O_UMQ_QMGMT_HDR_T_IP OFFSETOF(umq_qmgmt_hdr_t, ip)
1659 #define L_UMQ_QMGMT_HDR_T_IP SIZEOF(umq_qmgmt_hdr_t, ip)
1660 #define O_UMQ_QMGMT_HDR_T_PORT OFFSETOF(umq_qmgmt_hdr_t, port)
1661 #define L_UMQ_QMGMT_HDR_T_PORT SIZEOF(umq_qmgmt_hdr_t, port)
1662 #define O_UMQ_QMGMT_HDR_T_INST_IDX OFFSETOF(umq_qmgmt_hdr_t, inst_idx)
1663 #define L_UMQ_QMGMT_HDR_T_INST_IDX SIZEOF(umq_qmgmt_hdr_t, inst_idx)
1664 #define O_UMQ_QMGMT_HDR_T_GRP_IDX OFFSETOF(umq_qmgmt_hdr_t, grp_idx)
1665 #define L_UMQ_QMGMT_HDR_T_GRP_IDX SIZEOF(umq_qmgmt_hdr_t, grp_idx)
1666 #define O_UMQ_QMGMT_HDR_T_PCKT_TYPE_DEP16 OFFSETOF(umq_qmgmt_hdr_t, pckt_type_dep16)
1667 #define L_UMQ_QMGMT_HDR_T_PCKT_TYPE_DEP16 SIZEOF(umq_qmgmt_hdr_t, pckt_type_dep16)
1668 #define L_UMQ_QMGMT_HDR_T (gint) sizeof(umq_qmgmt_hdr_t)
1669
1670 #define UMQ_QMGMT_HDR_I_FLAG 0x80
1671 #define UMQ_QMGMT_HDR_N_FLAG 0x40
1672 #define UMQ_QMGMT_HDR_IL_L_FLAG 0x20
1673 #define UMQ_QMGMT_HDR_IL_K_FLAG 0x10
1674
1675 typedef struct
1676 {
1677     lbm_uint32_t highest_rcr_tsp;
1678 } umq_qmgmt_il_hdr_t;
1679 #define O_UMQ_QMGMT_IL_HDR_T_HIGHEST_RCR_TSP OFFSETOF(umq_qmgmt_il_hdr_t, highest_rcr_tsp)
1680 #define L_UMQ_QMGMT_IL_HDR_T_HIGHEST_RCR_TSP SIZEOF(umq_qmgmt_il_hdr_t, highest_rcr_tsp)
1681 #define L_UMQ_QMGMT_IL_HDR_T (gint) sizeof(umq_qmgmt_il_hdr_t)
1682
1683 typedef struct
1684 {
1685     lbm_uint32_t ip;
1686     lbm_uint16_t port;
1687     lbm_uint16_t inst_idx;
1688     lbm_uint16_t grp_idx;
1689     lbm_uint16_t flags;
1690 } umq_qmgmt_il_inst_hdr_t;
1691 #define O_UMQ_QMGMT_IL_INST_HDR_T_IP OFFSETOF(umq_qmgmt_il_inst_hdr_t, ip)
1692 #define L_UMQ_QMGMT_IL_INST_HDR_T_IP SIZEOF(umq_qmgmt_il_inst_hdr_t, ip)
1693 #define O_UMQ_QMGMT_IL_INST_HDR_T_PORT OFFSETOF(umq_qmgmt_il_inst_hdr_t, port)
1694 #define L_UMQ_QMGMT_IL_INST_HDR_T_PORT SIZEOF(umq_qmgmt_il_inst_hdr_t, port)
1695 #define O_UMQ_QMGMT_IL_INST_HDR_T_INST_IDX OFFSETOF(umq_qmgmt_il_inst_hdr_t, inst_idx)
1696 #define L_UMQ_QMGMT_IL_INST_HDR_T_INST_IDX SIZEOF(umq_qmgmt_il_inst_hdr_t, inst_idx)
1697 #define O_UMQ_QMGMT_IL_INST_HDR_T_GRP_IDX OFFSETOF(umq_qmgmt_il_inst_hdr_t, grp_idx)
1698 #define L_UMQ_QMGMT_IL_INST_HDR_T_GRP_IDX SIZEOF(umq_qmgmt_il_inst_hdr_t, grp_idx)
1699 #define O_UMQ_QMGMT_IL_INST_HDR_T_FLAGS OFFSETOF(umq_qmgmt_il_inst_hdr_t, flags)
1700 #define L_UMQ_QMGMT_IL_INST_HDR_T_FLAGS SIZEOF(umq_qmgmt_il_inst_hdr_t, flags)
1701 #define L_UMQ_QMGMT_IL_INST_HDR_T (gint) sizeof(umq_qmgmt_il_inst_hdr_t)
1702
1703 #define UMQ_QMGMT_HDR_IL_INST_M_FLAG 0x8000
1704 #define UMQ_QMGMT_HDR_IL_INST_Q_FLAG 0x4000
1705 #define UMQ_QMGMT_HDR_IL_INST_P_FLAG 0x2000
1706
1707 typedef struct
1708 {
1709     lbm_uint32_t queue_new_ver;
1710 } umq_qmgmt_ec_hdr_t;
1711 #define O_UMQ_QMGMT_EC_HDR_T_QUEUE_NEW_VER OFFSETOF(umq_qmgmt_ec_hdr_t, queue_new_ver)
1712 #define L_UMQ_QMGMT_EC_HDR_T_QUEUE_NEW_VER SIZEOF(umq_qmgmt_ec_hdr_t, queue_new_ver)
1713 #define L_UMQ_QMGMT_EC_HDR_T (gint) sizeof(umq_qmgmt_ec_hdr_t)
1714
1715 typedef struct
1716 {
1717     lbm_uint32_t highest_rcr_tsp;
1718     lbm_uint32_t age;
1719 } umq_qmgmt_ev_hdr_t;
1720 #define O_UMQ_QMGMT_EV_HDR_T_HIGHEST_RCR_TSP OFFSETOF(umq_qmgmt_ev_hdr_t, highest_rcr_tsp)
1721 #define L_UMQ_QMGMT_EV_HDR_T_HIGHEST_RCR_TSP SIZEOF(umq_qmgmt_ev_hdr_t, highest_rcr_tsp)
1722 #define O_UMQ_QMGMT_EV_HDR_T_AGE OFFSETOF(umq_qmgmt_ev_hdr_t, age)
1723 #define L_UMQ_QMGMT_EV_HDR_T_AGE SIZEOF(umq_qmgmt_ev_hdr_t, age)
1724 #define L_UMQ_QMGMT_EV_HDR_T (gint) sizeof(umq_qmgmt_ev_hdr_t)
1725
1726 typedef struct
1727 {
1728     lbm_uint32_t highest_rcr_tsp;
1729 } umq_qmgmt_qro_hdr_t;
1730 #define O_UMQ_QMGMT_QRO_HDR_T_HIGHEST_RCR_TSP OFFSETOF(umq_qmgmt_qro_hdr_t, highest_rcr_tsp)
1731 #define L_UMQ_QMGMT_QRO_HDR_T_HIGHEST_RCR_TSP SIZEOF(umq_qmgmt_qro_hdr_t, highest_rcr_tsp)
1732 #define L_UMQ_QMGMT_QRO_HDR_T (gint) sizeof(umq_qmgmt_qro_hdr_t)
1733
1734 #define UMQ_QMGMT_HDR_PCKT_TYPE_IL 0x1
1735 #define UMQ_QMGMT_HDR_PCKT_TYPE_JR 0x2
1736 #define UMQ_QMGMT_HDR_PCKT_TYPE_JREJ 0x3
1737 #define UMQ_QMGMT_HDR_PCKT_TYPE_IKA 0x4
1738 #define UMQ_QMGMT_HDR_PCKT_TYPE_EC 0x5
1739 #define UMQ_QMGMT_HDR_PCKT_TYPE_EV 0x6
1740 #define UMQ_QMGMT_HDR_PCKT_TYPE_CNIL 0x7
1741 #define UMQ_QMGMT_HDR_PCKT_TYPE_QRO 0x8
1742
1743 #define LBMR_VERSION_0 0x00
1744 #define LBMR_VERSION_1 0x01
1745 #define LBMR_VERSION_GATEWAY LBMR_VERSION_1
1746 #define LBMR_VERSION LBMR_VERSION_0
1747
1748 /*----------------------------------------------------------------------------*/
1749 /* Value translation tables.                                                  */
1750 /*----------------------------------------------------------------------------*/
1751
1752 static const value_string lbmr_packet_type[] =
1753 {
1754     { LBMR_HDR_TYPE_NORMAL, "NORMAL" },
1755     { LBMR_HDR_TYPE_WC_TQRS, "WC-TQR" },
1756     { LBMR_HDR_TYPE_UCAST_RCV_ALIVE, "Rcv Alive" },
1757     { LBMR_HDR_TYPE_UCAST_SRC_ALIVE, "Src Alive" },
1758     { LBMR_HDR_TYPE_TOPIC_MGMT, "Topic Mgmt" },
1759     { LBMR_HDR_TYPE_QUEUE_RES, "UMQ" },
1760     { LBMR_HDR_TYPE_EXT, "Extended" },
1761     { 0x0, NULL }
1762 };
1763
1764 static const value_string lbmr_ext_packet_type[] =
1765 {
1766     { LBMR_HDR_EXT_TYPE_UME_PROXY_SRC_ELECT, "Proxy Source Election" },
1767     { LBMR_HDR_EXT_TYPE_UMQ_QUEUE_MGMT, "Queue Management" },
1768     { LBMR_HDR_EXT_TYPE_CONTEXT_INFO, "Context Information" },
1769     { LBMR_HDR_EXT_TYPE_TOPIC_RES_REQUEST, "Topic Resolution Request" },
1770     { LBMR_HDR_EXT_TYPE_TNWG_MSG, "Gateway Message" },
1771     { LBMR_HDR_EXT_TYPE_REMOTE_DOMAIN_ROUTE, "Remote Domain Route" },
1772     { LBMR_HDR_EXT_TYPE_REMOTE_CONTEXT_INFO, "Remote Context Information" },
1773     { 0x0, NULL }
1774 };
1775
1776 static const value_string lbmr_transport_type[] =
1777 {
1778     { LBMR_TRANSPORT_TCP, "TCP" },
1779     { LBMR_TRANSPORT_LBTSMX, "LBT-SMX" },
1780     { LBMR_TRANSPORT_LBTRU, "LBT-RU" },
1781     { LBMR_TRANSPORT_LBTRM, "LBT-RM" },
1782     { LBMR_TRANSPORT_LBTIPC, "LBT-IPC" },
1783     { LBMR_TRANSPORT_LBTRDMA, "LBT-RDMA" },
1784     { 0x0, NULL }
1785 };
1786
1787 static const value_string lbmr_tmr_type[] =
1788 {
1789     { LBMR_TMR_LEAVE_TOPIC, "Leave Topic" },
1790     { LBMR_TMR_TOPIC_USE, "Topic Use" },
1791     { 0x0, NULL }
1792 };
1793
1794 static const value_string lbmr_topic_option_type[] =
1795 {
1796     { LBMR_TOPIC_OPT_LEN_TYPE, "Option Length" },
1797     { LBMR_TOPIC_OPT_UME_TYPE, "UME" },
1798     { LBMR_TOPIC_OPT_UME_STORE_TYPE, "UME Store" },
1799     { LBMR_TOPIC_OPT_UME_STORE_GROUP_TYPE, "UME Store Group" },
1800     { LBMR_TOPIC_OPT_LATEJOIN_TYPE, "Late Join" },
1801     { LBMR_TOPIC_OPT_UMQ_RCRIDX_TYPE, "UMQ Receiver Control Record Index" },
1802     { LBMR_TOPIC_OPT_UMQ_QINFO_TYPE, "UMQ Queue Info" },
1803     { LBMR_TOPIC_OPT_COST_TYPE, "Cost" },
1804     { LBMR_TOPIC_OPT_OTID_TYPE, "Originating Transport" },
1805     { LBMR_TOPIC_OPT_CTXINST_TYPE, "Context Instance" },
1806     { LBMR_TOPIC_OPT_CTXINSTS_TYPE, "Store Context Instance" },
1807     { LBMR_TOPIC_OPT_ULB_TYPE, "UMQ ULB" },
1808     { LBMR_TOPIC_OPT_CTXINSTQ_TYPE, "Queue Context Instance" },
1809     { LBMR_TOPIC_OPT_DOMAIN_ID_TYPE, "Domain ID" },
1810     { LBMR_TOPIC_OPT_EXFUNC_TYPE, "Extended Functionality" },
1811     { 0x0, NULL }
1812 };
1813
1814 static const value_string lbmr_pser_dependent_type[] =
1815 {
1816     { LBMR_HDR_EXT_TYPE_UME_PROXY_SRC_ELECT_DEP_ELECT, "Election" },
1817     { LBMR_HDR_EXT_TYPE_UME_PROXY_SRC_ELECT_DEP_REELECT, "Re-election" },
1818     { 0x0, NULL }
1819 };
1820
1821 static const value_string lbmr_option_type[] =
1822 {
1823     { LBMR_LBMR_OPT_LEN_TYPE, "Option length" },
1824     { LBMR_LBMR_OPT_SRC_ID_TYPE, "Source ID" },
1825     { LBMR_LBMR_OPT_SRC_TYPE_TYPE, "Source type" },
1826     { LBMR_LBMR_OPT_VERSION_TYPE, "Version" },
1827     { LBMR_LBMR_OPT_LOCAL_DOMAIN_TYPE, "Local Domain" },
1828     { 0x0, NULL }
1829 };
1830
1831 static const value_string lbmr_pser_option_type[] =
1832 {
1833     { LBMR_PSER_OPT_SRC_CTXINST_TYPE, "Source context instance" },
1834     { LBMR_PSER_OPT_STORE_CTXINST_TYPE, "Store context instance" },
1835     { 0x0, NULL }
1836 };
1837
1838 static const value_string lbmr_option_source_type[] =
1839 {
1840     { LBMR_LBMR_OPT_SRC_TYPE_SRC_TYPE_APPLICATION, "Application" },
1841     { LBMR_LBMR_OPT_SRC_TYPE_SRC_TYPE_TNWGD, "Gateway" },
1842     { LBMR_LBMR_OPT_SRC_TYPE_SRC_TYPE_STORE, "Store" },
1843     { 0x0, NULL }
1844 };
1845
1846 static const value_string lbmr_tnwg_function_type[] =
1847 {
1848     { LBMR_TNWG_TYPE_INTEREST, "Interest" },
1849     { LBMR_TNWG_TYPE_CTXINFO, "Context information" },
1850     { LBMR_TNWG_TYPE_TRREQ, "Topic res request" },
1851     { 0x0, NULL }
1852 };
1853
1854 static const value_string lbmr_tnwg_option_type[] =
1855 {
1856     { LBMR_TNWG_OPT_CTXINST_TYPE, "Context instance" },
1857     { LBMR_TNWG_OPT_ADDRESS_TYPE, "Address" },
1858     { LBMR_TNWG_OPT_DOMAIN_TYPE, "Domain" },
1859     { LBMR_TNWG_OPT_NAME_TYPE, "Name" },
1860     { 0x0, NULL }
1861 };
1862
1863 static const value_string umq_qmgmt_packet_type[] =
1864 {
1865     { UMQ_QMGMT_HDR_PCKT_TYPE_IL, "Instance List" },
1866     { UMQ_QMGMT_HDR_PCKT_TYPE_JR, "Join Request" },
1867     { UMQ_QMGMT_HDR_PCKT_TYPE_JREJ, "Join Request Rejection" },
1868     { UMQ_QMGMT_HDR_PCKT_TYPE_IKA, "Instance Keepalive" },
1869     { UMQ_QMGMT_HDR_PCKT_TYPE_EC, "Election Call" },
1870     { UMQ_QMGMT_HDR_PCKT_TYPE_EV, "Election Vote" },
1871     { UMQ_QMGMT_HDR_PCKT_TYPE_CNIL, "Confirm New Instance List" },
1872     { UMQ_QMGMT_HDR_PCKT_TYPE_QRO, "Queue resume operation" },
1873     { 0x0, NULL }
1874 };
1875
1876 static const value_string lbmr_rctxinfo_option_type[] =
1877 {
1878     { LBMR_RCTXINFO_OPT_ADDRESS_TYPE, "Address" },
1879     { LBMR_RCTXINFO_OPT_INSTANCE_TYPE, "Instance" },
1880     { LBMR_RCTXINFO_OPT_ODOMAIN_TYPE, "Originating Domain" },
1881     { LBMR_RCTXINFO_OPT_NAME_TYPE, "Name" },
1882     { 0x0, NULL }
1883 };
1884
1885 /*----------------------------------------------------------------------------*/
1886 /* Preferences.                                                               */
1887 /*----------------------------------------------------------------------------*/
1888
1889 /* Preferences default values. */
1890 #define LBMR_DEFAULT_MC_INCOMING_UDP_PORT 12965
1891 #define LBMR_DEFAULT_MC_INCOMING_UDP_PORT_STRING MAKESTRING(LBMR_DEFAULT_MC_INCOMING_UDP_PORT)
1892 #define LBMR_DEFAULT_MC_OUTGOING_UDP_PORT 12965
1893 #define LBMR_DEFAULT_MC_OUTGOING_UDP_PORT_STRING MAKESTRING(LBMR_DEFAULT_MC_OUTGOING_UDP_PORT)
1894 #define LBMR_DEFAULT_MC_INCOMING_ADDRESS "224.9.10.11"
1895 #define LBMR_DEFAULT_MC_OUTGOING_ADDRESS "224.9.10.11"
1896 #define LBMR_DEFAULT_UC_PORT_HIGH 14406
1897 #define LBMR_DEFAULT_UC_PORT_HIGH_STRING MAKESTRING(LBMR_DEFAULT_UC_PORT_HIGH)
1898 #define LBMR_DEFAULT_UC_PORT_LOW 14402
1899 #define LBMR_DEFAULT_UC_PORT_LOW_STRING MAKESTRING(LBMR_DEFAULT_UC_PORT_LOW)
1900 #define LBMR_DEFAULT_UC_DEST_PORT 15380
1901 #define LBMR_DEFAULT_UC_DEST_PORT_STRING MAKESTRING(LBMR_DEFAULT_UC_DEST_PORT)
1902 #define LBMR_DEFAULT_UC_ADDRESS "0.0.0.0"
1903
1904 /* Global preferences variables (altered by the preferences dialog). */
1905 static guint32 global_lbmr_mc_incoming_udp_port = LBMR_DEFAULT_MC_INCOMING_UDP_PORT;
1906 static guint32 global_lbmr_mc_outgoing_udp_port  = LBMR_DEFAULT_MC_OUTGOING_UDP_PORT;
1907 static const char * global_lbmr_mc_incoming_address = LBMR_DEFAULT_MC_INCOMING_ADDRESS;
1908 static const char * global_lbmr_mc_outgoing_address = LBMR_DEFAULT_MC_OUTGOING_ADDRESS;
1909 static guint32 global_lbmr_uc_port_high = LBMR_DEFAULT_UC_PORT_HIGH;
1910 static guint32 global_lbmr_uc_port_low = LBMR_DEFAULT_UC_PORT_LOW;
1911 static guint32 global_lbmr_uc_dest_port = LBMR_DEFAULT_UC_DEST_PORT;
1912 static const char * global_lbmr_uc_address = LBMR_DEFAULT_UC_ADDRESS;
1913 static gboolean global_lbmr_use_tag = FALSE;
1914
1915 /* Local preferences variables (used by the dissector). */
1916 static guint32 lbmr_mc_incoming_udp_port = LBMR_DEFAULT_MC_INCOMING_UDP_PORT;
1917 static guint32 lbmr_mc_outgoing_udp_port = LBMR_DEFAULT_MC_OUTGOING_UDP_PORT;
1918 static guint32 lbmr_mc_incoming_address_host = 0;
1919 static guint32 lbmr_mc_outgoing_address_host = 0;
1920 static guint32 lbmr_uc_port_high = LBMR_DEFAULT_UC_PORT_HIGH;
1921 static guint32 lbmr_uc_port_low = LBMR_DEFAULT_UC_PORT_LOW;
1922 static guint32 lbmr_uc_dest_port = LBMR_DEFAULT_UC_DEST_PORT;
1923 static guint32 lbmr_uc_address_host = 0;
1924 static gboolean lbmr_use_tag = FALSE;
1925
1926 typedef struct
1927 {
1928     char * name;
1929     guint32 mc_outgoing_udp_port;
1930     guint32 mc_incoming_udp_port;
1931     char * mc_incoming_address;
1932     guint32 mc_incoming_address_val_h;
1933     char * mc_outgoing_address;
1934     guint32 mc_outgoing_address_val_h;
1935     guint32 uc_port_high;
1936     guint32 uc_port_low;
1937     guint32 uc_dest_port;
1938     char * uc_address;
1939     guint32 uc_address_val_h;
1940 } lbmr_tag_entry_t;
1941
1942 static lbmr_tag_entry_t * lbmr_tag_entry = NULL;
1943 static guint lbmr_tag_count = 0;
1944
1945 UAT_CSTRING_CB_DEF(lbmr_tag, name, lbmr_tag_entry_t)
1946 UAT_DEC_CB_DEF(lbmr_tag, mc_outgoing_udp_port, lbmr_tag_entry_t)
1947 UAT_DEC_CB_DEF(lbmr_tag, mc_incoming_udp_port, lbmr_tag_entry_t)
1948 UAT_IPV4_MC_CB_DEF(lbmr_tag, mc_incoming_address, lbmr_tag_entry_t)
1949 UAT_IPV4_MC_CB_DEF(lbmr_tag, mc_outgoing_address, lbmr_tag_entry_t)
1950 UAT_DEC_CB_DEF(lbmr_tag, uc_port_high, lbmr_tag_entry_t)
1951 UAT_DEC_CB_DEF(lbmr_tag, uc_port_low, lbmr_tag_entry_t)
1952 UAT_DEC_CB_DEF(lbmr_tag, uc_dest_port, lbmr_tag_entry_t)
1953 UAT_IPV4_CB_DEF(lbmr_tag, uc_address, lbmr_tag_entry_t)
1954 static uat_field_t lbmr_tag_array[] =
1955 {
1956     UAT_FLD_CSTRING(lbmr_tag, name, "Tag name", "Tag name"),
1957     UAT_FLD_DEC(lbmr_tag, mc_incoming_udp_port, "Incoming multicast UDP port", "Incoming UDP port"),
1958     UAT_FLD_IPV4_MC(lbmr_tag, mc_incoming_address, "Incoming multicast address", "Incoming multicast address"),
1959     UAT_FLD_DEC(lbmr_tag, mc_outgoing_udp_port, "Outgoing UDP port", "Outgoing UDP port"),
1960     UAT_FLD_IPV4_MC(lbmr_tag, mc_outgoing_address, "Outgoing multicast address", "Outgoing multicast address"),
1961     UAT_FLD_DEC(lbmr_tag, uc_port_low, "Unicast UDP port low", "Unicast UDP port low"),
1962     UAT_FLD_DEC(lbmr_tag, uc_port_high, "Unicast UDP port high", "Unicast UDP port high"),
1963     UAT_FLD_DEC(lbmr_tag, uc_dest_port, "Unicast UDP destination port", "Unicast UDP destination port"),
1964     UAT_FLD_IPV4(lbmr_tag, uc_address, "Unicast resolver address", "Unicast resolver address"),
1965     UAT_END_FIELDS
1966 };
1967
1968 /*----------------------------------------------------------------------------*/
1969 /* UAT callback functions.                                                    */
1970 /*----------------------------------------------------------------------------*/
1971 static gboolean lbmr_tag_update_cb(void * record, char * * error_string)
1972 {
1973     lbmr_tag_entry_t * tag = (lbmr_tag_entry_t *)record;
1974
1975     if (tag->name == NULL)
1976     {
1977         *error_string = g_strdup_printf("Tag name can't be empty");
1978         return FALSE;
1979     }
1980     else
1981     {
1982         g_strstrip(tag->name);
1983         if (tag->name[0] == 0)
1984         {
1985             *error_string = g_strdup_printf("Tag name can't be empty");
1986             return FALSE;
1987         }
1988     }
1989     return TRUE;
1990 }
1991
1992 static void * lbmr_tag_copy_cb(void * destination, const void * source, size_t length _U_)
1993 {
1994     const lbmr_tag_entry_t * src = (const lbmr_tag_entry_t *)source;
1995     lbmr_tag_entry_t * dest = (lbmr_tag_entry_t *)destination;
1996
1997     dest->name = g_strdup(src->name);
1998     dest->mc_outgoing_udp_port = src->mc_outgoing_udp_port;
1999     dest->mc_incoming_udp_port = src->mc_incoming_udp_port;
2000     dest->mc_incoming_address = g_strdup(src->mc_incoming_address);
2001     dest->mc_incoming_address_val_h = src->mc_incoming_address_val_h;
2002     dest->mc_outgoing_address = g_strdup(src->mc_outgoing_address);
2003     dest->mc_outgoing_address_val_h = src->mc_outgoing_address_val_h;
2004     dest->uc_port_high = src->uc_port_high;
2005     dest->uc_port_low = src->uc_port_low;
2006     dest->uc_dest_port = src->uc_dest_port;
2007     dest->uc_address = g_strdup(src->uc_address);
2008     dest->uc_address_val_h = src->uc_address_val_h;
2009     return (dest);
2010 }
2011
2012 static void lbmr_tag_free_cb(void * record)
2013 {
2014     lbmr_tag_entry_t * tag = (lbmr_tag_entry_t *)record;
2015
2016     if (tag->name != NULL)
2017     {
2018         g_free(tag->name);
2019         tag->name = NULL;
2020     }
2021     if (tag->mc_incoming_address != NULL)
2022     {
2023         g_free(tag->mc_incoming_address);
2024         tag->mc_incoming_address = NULL;
2025     }
2026     if (tag->mc_outgoing_address != NULL)
2027     {
2028         g_free(tag->mc_outgoing_address);
2029         tag->mc_outgoing_address = NULL;
2030     }
2031     if (tag->uc_address != NULL)
2032     {
2033         g_free(tag->uc_address);
2034         tag->uc_address = NULL;
2035     }
2036 }
2037
2038 static gboolean lbmr_match_packet(packet_info * pinfo, const lbmr_tag_entry_t * entry)
2039 {
2040     guint32 dest_addr_h;
2041     guint32 src_addr_h;
2042
2043     if ((pinfo->dst.type != AT_IPv4) || (pinfo->dst.len != 4) ||
2044         (pinfo->src.type != AT_IPv4) || (pinfo->src.len != 4))
2045         return (FALSE);
2046     dest_addr_h = pntoh32(pinfo->dst.data);
2047     src_addr_h = pntoh32(pinfo->src.data);
2048
2049     if (IN_MULTICAST(dest_addr_h))
2050     {
2051         /* Check multicast topic resolution values. */
2052         if ((dest_addr_h != entry->mc_incoming_address_val_h) && (dest_addr_h != entry->mc_outgoing_address_val_h))
2053         {
2054             /* No match. */
2055             return (FALSE);
2056         }
2057         /* Check for the correct port. */
2058         if ((dest_addr_h == entry->mc_incoming_address_val_h) && (pinfo->destport != entry->mc_incoming_udp_port))
2059         {
2060             /* Wrong incoming port. */
2061             return (FALSE);
2062         }
2063         if ((dest_addr_h == entry->mc_outgoing_address_val_h) && (pinfo->destport != entry->mc_outgoing_udp_port))
2064         {
2065             /* Wrong outgoing port. */
2066             return (FALSE);
2067         }
2068         /* Must be one of ours. */
2069         return (TRUE);
2070     }
2071     else
2072     {
2073         /* Check unicast topic resolution values. */
2074         /* Address should be either not specified, or match the src or dest address of the packet. */
2075         if ((entry->uc_address_val_h == 0) || (entry->uc_address_val_h == dest_addr_h) || (entry->uc_address_val_h == src_addr_h))
2076         {
2077             if (((pinfo->destport == entry->uc_dest_port) || (pinfo->srcport == entry->uc_dest_port))
2078                 && (((pinfo->destport <= entry->uc_port_high) && (pinfo->destport >= entry->uc_port_low))
2079                     || ((pinfo->srcport <= entry->uc_port_high) && (pinfo->srcport >= entry->uc_port_low))))
2080             {
2081                 /* One of ours, so handle it. */
2082                 return (TRUE);
2083             }
2084         }
2085     }
2086     return (FALSE);
2087 }
2088
2089 static char * lbmr_tag_find(packet_info * pinfo)
2090 {
2091     guint idx;
2092     lbmr_tag_entry_t * tag = NULL;
2093
2094     if (!lbmr_use_tag)
2095     {
2096         return (NULL);
2097     }
2098     for (idx = 0; idx < lbmr_tag_count; ++idx)
2099     {
2100         tag = &(lbmr_tag_entry[idx]);
2101         if (lbmr_match_packet(pinfo, tag))
2102         {
2103             return tag->name;
2104         }
2105     }
2106     return (NULL);
2107 }
2108
2109 /*----------------------------------------------------------------------------*/
2110 /* Handles of all types.                                                      */
2111 /*----------------------------------------------------------------------------*/
2112 /* Protocol handle */
2113 static int proto_lbmr = -1;
2114
2115 /* Dissector handle */
2116 static dissector_handle_t lbmr_dissector_handle;
2117
2118 /* Dissector tree handles */
2119 static gint ett_lbmr = -1;
2120 static gint ett_lbmr_hdr = -1;
2121 static gint ett_lbmr_tqrs = -1;
2122 static gint ett_lbmr_tqr = -1;
2123 static gint ett_lbmr_tirs = -1;
2124 static gint ett_lbmr_tir = -1;
2125 static gint ett_lbmr_tir_tcp = -1;
2126 static gint ett_lbmr_tir_lbtrm = -1;
2127 static gint ett_lbmr_tir_lbtru = -1;
2128 static gint ett_lbmr_tir_lbtipc = -1;
2129 static gint ett_lbmr_tir_lbtrdma = -1;
2130 static gint ett_lbmr_tir_lbtsmx = -1;
2131 static gint ett_lbmr_topts = -1;
2132 static gint ett_lbmr_topt_len = -1;
2133 static gint ett_lbmr_topt_ume = -1;
2134 static gint ett_lbmr_topt_ume_flags = -1;
2135 static gint ett_lbmr_topt_ume_store = -1;
2136 static gint ett_lbmr_topt_ume_store_flags = -1;
2137 static gint ett_lbmr_topt_ume_store_group = -1;
2138 static gint ett_lbmr_topt_ume_store_group_flags = -1;
2139 static gint ett_lbmr_topt_latejoin = -1;
2140 static gint ett_lbmr_topt_latejoin_flags = -1;
2141 static gint ett_lbmr_topt_umq_rcridx = -1;
2142 static gint ett_lbmr_topt_umq_rcridx_flags = -1;
2143 static gint ett_lbmr_topt_umq_qinfo = -1;
2144 static gint ett_lbmr_topt_umq_qinfo_flags = -1;
2145 static gint ett_lbmr_topt_cost = -1;
2146 static gint ett_lbmr_topt_cost_flags = -1;
2147 static gint ett_lbmr_topt_otid = -1;
2148 static gint ett_lbmr_topt_otid_flags = -1;
2149 static gint ett_lbmr_topt_ctxinst = -1;
2150 static gint ett_lbmr_topt_ctxinst_flags = -1;
2151 static gint ett_lbmr_topt_ctxinsts = -1;
2152 static gint ett_lbmr_topt_ctxinsts_flags = -1;
2153 static gint ett_lbmr_topt_ulb = -1;
2154 static gint ett_lbmr_topt_ulb_flags = -1;
2155 static gint ett_lbmr_topt_ctxinstq = -1;
2156 static gint ett_lbmr_topt_ctxinstq_flags = -1;
2157 static gint ett_lbmr_topt_domain_id = -1;
2158 static gint ett_lbmr_topt_domain_id_flags = -1;
2159 static gint ett_lbmr_topt_exfunc = -1;
2160 static gint ett_lbmr_topt_exfunc_flags = -1;
2161 static gint ett_lbmr_topt_exfunc_functionality_flags = -1;
2162 static gint ett_lbmr_topt_unknown = -1;
2163 static gint ett_lbmr_tmb = -1;
2164 static gint ett_lbmr_tmrs = -1;
2165 static gint ett_lbmr_tmr = -1;
2166 static gint ett_lbmr_tmr_flags = -1;
2167 static gint ett_lbmr_pser_flags = -1;
2168 static gint ett_lbmr_pser_opts = -1;
2169 static gint ett_lbmr_pser_opt_len = -1;
2170 static gint ett_lbmr_pser_opt_ctxinst = -1;
2171 static gint ett_lbmr_qqrs = -1;
2172 static gint ett_lbmr_qirs = -1;
2173 static gint ett_lbmr_qir = -1;
2174 static gint ett_lbmr_qir_options = -1;
2175 static gint ett_lbmr_qir_grp_blk = -1;
2176 static gint ett_lbmr_qir_queue_blk = -1;
2177 static gint ett_lbmr_qir_grp = -1;
2178 static gint ett_lbmr_qir_queue = -1;
2179 static gint ett_lbmr_topic_res_request_flags = -1;
2180 static gint ett_lbmr_ctxinfo_flags = -1;
2181 static gint ett_lbmr_tnwg = -1;
2182 static gint ett_lbmr_tnwg_interest = -1;
2183 static gint ett_lbmr_tnwg_interest_rec = -1;
2184 static gint ett_lbmr_tnwg_interest_rec_flags = -1;
2185 static gint ett_lbmr_tnwg_ctxinfo = -1;
2186 static gint ett_lbmr_tnwg_ctxinfo_flags1 = -1;
2187 static gint ett_lbmr_tnwg_trreq = -1;
2188 static gint ett_lbmr_tnwg_ctxinst_opt = -1;
2189 static gint ett_lbmr_tnwg_ctxinst_opt_flags = -1;
2190 static gint ett_lbmr_tnwg_address_opt = -1;
2191 static gint ett_lbmr_tnwg_address_opt_flags = -1;
2192 static gint ett_lbmr_tnwg_domain_opt = -1;
2193 static gint ett_lbmr_tnwg_domain_opt_flags = -1;
2194 static gint ett_lbmr_tnwg_name_opt = -1;
2195 static gint ett_lbmr_tnwg_name_opt_flags = -1;
2196 static gint ett_lbmr_tnwg_unknown_opt = -1;
2197 static gint ett_lbmr_tnwg_unknown_opt_flags = -1;
2198 static gint ett_lbmr_remote_domain_route_hdr = -1;
2199 static gint ett_lbmr_rctxinfo = -1;
2200 static gint ett_lbmr_rctxinfo_rec = -1;
2201 static gint ett_lbmr_rctxinfo_rec_flags = -1;
2202 static gint ett_lbmr_rctxinfo_rec_address = -1;
2203 static gint ett_lbmr_rctxinfo_rec_instance = -1;
2204 static gint ett_lbmr_rctxinfo_rec_odomain = -1;
2205 static gint ett_lbmr_rctxinfo_rec_name = -1;
2206 static gint ett_lbmr_rctxinfo_rec_unknown = -1;
2207 static gint ett_qmgmt_flags = -1;
2208 static gint ett_qmgmt_il = -1;
2209 static gint ett_qmgmt_il_inst = -1;
2210 static gint ett_qmgmt_il_inst_flags = -1;
2211 static gint ett_qmgmt_ec = -1;
2212 static gint ett_qmgmt_ev = -1;
2213 static gint ett_qmgmt_qro = -1;
2214 static gint ett_lbmr_opts = -1;
2215 static gint ett_lbmr_opt_src_id = -1;
2216 static gint ett_lbmr_opt_src_id_flags = -1;
2217 static gint ett_lbmr_opt_len = -1;
2218 static gint ett_lbmr_opt_src_type = -1;
2219 static gint ett_lbmr_opt_src_type_flags = -1;
2220 static gint ett_lbmr_opt_version = -1;
2221 static gint ett_lbmr_opt_version_flags = -1;
2222 static gint ett_lbmr_opt_local_domain = -1;
2223 static gint ett_lbmr_opt_local_domain_flags = -1;
2224 static gint ett_lbmr_opt_unknown = -1;
2225
2226 /* Dissector field handles */
2227 static int hf_lbmr_tag = -1;
2228 static int hf_lbmr_hdr = -1;
2229 static int hf_lbmr_hdr_ver = -1;
2230 static int hf_lbmr_hdr_opt = -1;
2231 static int hf_lbmr_hdr_type = -1;
2232 static int hf_lbmr_hdr_tqrs = -1;
2233 static int hf_lbmr_hdr_tirs = -1;
2234 static int hf_lbmr_hdr_qqrs = -1;
2235 static int hf_lbmr_hdr_qirs = -1;
2236 static int hf_lbmr_hdr_ext_type = -1;
2237 static int hf_lbmr_tqrs = -1;
2238 static int hf_lbmr_tqr = -1;
2239 static int hf_lbmr_tqr_pattern_type = -1;
2240 static int hf_lbmr_tqr_pattern = -1;
2241 static int hf_lbmr_tqr_name = -1;
2242 static int hf_lbmr_tirs = -1;
2243 static int hf_lbmr_tir = -1;
2244 static int hf_lbmr_tir_transport_opts = -1;
2245 static int hf_lbmr_tir_transport_type = -1;
2246 static int hf_lbmr_tir_tlen = -1;
2247 static int hf_lbmr_tir_ttl = -1;
2248 static int hf_lbmr_tir_index = -1;
2249 static int hf_lbmr_tir_name = -1;
2250 static int hf_lbmr_tir_tcp = -1;
2251 static int hf_lbmr_tir_tcp_ip = -1;
2252 static int hf_lbmr_tir_tcp_session_id = -1;
2253 static int hf_lbmr_tir_tcp_port = -1;
2254 static int hf_lbmr_tir_lbtrm = -1;
2255 static int hf_lbmr_tir_lbtrm_src_addr = -1;
2256 static int hf_lbmr_tir_lbtrm_mcast_addr = -1;
2257 static int hf_lbmr_tir_lbtrm_session_id = -1;
2258 static int hf_lbmr_tir_lbtrm_udp_dest_port = -1;
2259 static int hf_lbmr_tir_lbtrm_src_ucast_port = -1;
2260 static int hf_lbmr_tir_lbtru = -1;
2261 static int hf_lbmr_tir_lbtru_ip = -1;
2262 static int hf_lbmr_tir_lbtru_port = -1;
2263 static int hf_lbmr_tir_lbtru_session_id = -1;
2264 static int hf_lbmr_tir_lbtipc = -1;
2265 static int hf_lbmr_tir_lbtipc_host_id = -1;
2266 static int hf_lbmr_tir_lbtipc_session_id = -1;
2267 static int hf_lbmr_tir_lbtipc_xport_id = -1;
2268 static int hf_lbmr_tir_lbtrdma = -1;
2269 static int hf_lbmr_tir_lbtrdma_ip = -1;
2270 static int hf_lbmr_tir_lbtrdma_session_id = -1;
2271 static int hf_lbmr_tir_lbtrdma_port = -1;
2272 static int hf_lbmr_tir_lbtsmx = -1;
2273 static int hf_lbmr_tir_lbtsmx_host_id = -1;
2274 static int hf_lbmr_tir_lbtsmx_session_id = -1;
2275 static int hf_lbmr_tir_lbtsmx_xport_id = -1;
2276 static int hf_lbmr_tir_channel = -1;
2277 static int hf_lbmr_tir_unknown_transport = -1;
2278 static int hf_lbmr_topts = -1;
2279 static int hf_lbmr_topt_len = -1;
2280 static int hf_lbmr_topt_len_type = -1;
2281 static int hf_lbmr_topt_len_len = -1;
2282 static int hf_lbmr_topt_len_total_len = -1;
2283 static int hf_lbmr_topt_ume = -1;
2284 static int hf_lbmr_topt_ume_type = -1;
2285 static int hf_lbmr_topt_ume_len = -1;
2286 static int hf_lbmr_topt_ume_flags = -1;
2287 static int hf_lbmr_topt_ume_flags_ignore = -1;
2288 static int hf_lbmr_topt_ume_flags_latejoin = -1;
2289 static int hf_lbmr_topt_ume_flags_store = -1;
2290 static int hf_lbmr_topt_ume_flags_qccap = -1;
2291 static int hf_lbmr_topt_ume_flags_acktosrc = -1;
2292 static int hf_lbmr_topt_ume_store_tcp_port = -1;
2293 static int hf_lbmr_topt_ume_src_tcp_port = -1;
2294 static int hf_lbmr_topt_ume_store_tcp_addr = -1;
2295 static int hf_lbmr_topt_ume_src_tcp_addr = -1;
2296 static int hf_lbmr_topt_ume_src_reg_id = -1;
2297 static int hf_lbmr_topt_ume_transport_idx = -1;
2298 static int hf_lbmr_topt_ume_high_seqnum = -1;
2299 static int hf_lbmr_topt_ume_low_seqnum = -1;
2300 static int hf_lbmr_topt_ume_store = -1;
2301 static int hf_lbmr_topt_ume_store_type = -1;
2302 static int hf_lbmr_topt_ume_store_len = -1;
2303 static int hf_lbmr_topt_ume_store_flags = -1;
2304 static int hf_lbmr_topt_ume_store_flags_ignore = -1;
2305 static int hf_lbmr_topt_ume_store_grp_idx = -1;
2306 static int hf_lbmr_topt_ume_store_store_tcp_port = -1;
2307 static int hf_lbmr_topt_ume_store_store_idx = -1;
2308 static int hf_lbmr_topt_ume_store_store_ip_addr = -1;
2309 static int hf_lbmr_topt_ume_store_src_reg_id = -1;
2310 static int hf_lbmr_topt_ume_store_group = -1;
2311 static int hf_lbmr_topt_ume_store_group_type = -1;
2312 static int hf_lbmr_topt_ume_store_group_len = -1;
2313 static int hf_lbmr_topt_ume_store_group_flags = -1;
2314 static int hf_lbmr_topt_ume_store_group_flags_ignore = -1;
2315 static int hf_lbmr_topt_ume_store_group_grp_idx = -1;
2316 static int hf_lbmr_topt_ume_store_group_grp_sz = -1;
2317 static int hf_lbmr_topt_ume_store_group_reserved = -1;
2318 static int hf_lbmr_topt_latejoin = -1;
2319 static int hf_lbmr_topt_latejoin_type = -1;
2320 static int hf_lbmr_topt_latejoin_len = -1;
2321 static int hf_lbmr_topt_latejoin_flags = -1;
2322 static int hf_lbmr_topt_latejoin_flags_ignore = -1;
2323 static int hf_lbmr_topt_latejoin_flags_acktosrc = -1;
2324 static int hf_lbmr_topt_latejoin_src_tcp_port = -1;
2325 static int hf_lbmr_topt_latejoin_reserved = -1;
2326 static int hf_lbmr_topt_latejoin_src_ip_addr = -1;
2327 static int hf_lbmr_topt_latejoin_transport_idx = -1;
2328 static int hf_lbmr_topt_latejoin_high_seqnum = -1;
2329 static int hf_lbmr_topt_latejoin_low_seqnum = -1;
2330 static int hf_lbmr_topt_umq_rcridx = -1;
2331 static int hf_lbmr_topt_umq_rcridx_type = -1;
2332 static int hf_lbmr_topt_umq_rcridx_len = -1;
2333 static int hf_lbmr_topt_umq_rcridx_flags = -1;
2334 static int hf_lbmr_topt_umq_rcridx_flags_ignore = -1;
2335 static int hf_lbmr_topt_umq_rcridx_rcr_idx = -1;
2336 static int hf_lbmr_topt_umq_qinfo = -1;
2337 static int hf_lbmr_topt_umq_qinfo_type = -1;
2338 static int hf_lbmr_topt_umq_qinfo_len = -1;
2339 static int hf_lbmr_topt_umq_qinfo_flags = -1;
2340 static int hf_lbmr_topt_umq_qinfo_flags_ignore = -1;
2341 static int hf_lbmr_topt_umq_qinfo_flags_queue = -1;
2342 static int hf_lbmr_topt_umq_qinfo_flags_rcvlisten = -1;
2343 static int hf_lbmr_topt_umq_qinfo_flags_control = -1;
2344 static int hf_lbmr_topt_umq_qinfo_flags_srcrcvlisten = -1;
2345 static int hf_lbmr_topt_umq_qinfo_flags_participants_only = -1;
2346 static int hf_lbmr_topt_umq_qinfo_queue = -1;
2347 static int hf_lbmr_topt_cost = -1;
2348 static int hf_lbmr_topt_cost_type = -1;
2349 static int hf_lbmr_topt_cost_len = -1;
2350 static int hf_lbmr_topt_cost_flags = -1;
2351 static int hf_lbmr_topt_cost_flags_ignore = -1;
2352 static int hf_lbmr_topt_cost_hop_count = -1;
2353 static int hf_lbmr_topt_cost_cost = -1;
2354 static int hf_lbmr_topt_otid = -1;
2355 static int hf_lbmr_topt_otid_type = -1;
2356 static int hf_lbmr_topt_otid_len = -1;
2357 static int hf_lbmr_topt_otid_flags = -1;
2358 static int hf_lbmr_topt_otid_flags_ignore = -1;
2359 static int hf_lbmr_topt_otid_originating_transport = -1;
2360 static int hf_lbmr_topt_ctxinst = -1;
2361 static int hf_lbmr_topt_ctxinst_type = -1;
2362 static int hf_lbmr_topt_ctxinst_len = -1;
2363 static int hf_lbmr_topt_ctxinst_flags = -1;
2364 static int hf_lbmr_topt_ctxinst_flags_ignore = -1;
2365 static int hf_lbmr_topt_ctxinst_res = -1;
2366 static int hf_lbmr_topt_ctxinst_ctxinst = -1;
2367 static int hf_lbmr_topt_ctxinsts = -1;
2368 static int hf_lbmr_topt_ctxinsts_type = -1;
2369 static int hf_lbmr_topt_ctxinsts_len = -1;
2370 static int hf_lbmr_topt_ctxinsts_flags = -1;
2371 static int hf_lbmr_topt_ctxinsts_flags_ignore = -1;
2372 static int hf_lbmr_topt_ctxinsts_idx = -1;
2373 static int hf_lbmr_topt_ctxinsts_ctxinst = -1;
2374 static int hf_lbmr_topt_ulb = -1;
2375 static int hf_lbmr_topt_ulb_type = -1;
2376 static int hf_lbmr_topt_ulb_len = -1;
2377 static int hf_lbmr_topt_ulb_flags = -1;
2378 static int hf_lbmr_topt_ulb_flags_ignore = -1;
2379 static int hf_lbmr_topt_ulb_queue_id = -1;
2380 static int hf_lbmr_topt_ulb_regid = -1;
2381 static int hf_lbmr_topt_ulb_ulb_src_id = -1;
2382 static int hf_lbmr_topt_ulb_src_ip_addr = -1;
2383 static int hf_lbmr_topt_ulb_src_tcp_port = -1;
2384 static int hf_lbmr_topt_ulb_reserved = -1;
2385 static int hf_lbmr_topt_ctxinstq = -1;
2386 static int hf_lbmr_topt_ctxinstq_type = -1;
2387 static int hf_lbmr_topt_ctxinstq_len = -1;
2388 static int hf_lbmr_topt_ctxinstq_flags = -1;
2389 static int hf_lbmr_topt_ctxinstq_flags_ignore = -1;
2390 static int hf_lbmr_topt_ctxinstq_idx = -1;
2391 static int hf_lbmr_topt_ctxinstq_ctxinst = -1;
2392 static int hf_lbmr_topt_domain_id = -1;
2393 static int hf_lbmr_topt_domain_id_type = -1;
2394 static int hf_lbmr_topt_domain_id_len = -1;
2395 static int hf_lbmr_topt_domain_id_flags = -1;
2396 static int hf_lbmr_topt_domain_id_flags_ignore = -1;
2397 static int hf_lbmr_topt_domain_id_domain_id = -1;
2398 static int hf_lbmr_topt_exfunc = -1;
2399 static int hf_lbmr_topt_exfunc_type = -1;
2400 static int hf_lbmr_topt_exfunc_len = -1;
2401 static int hf_lbmr_topt_exfunc_flags = -1;
2402 static int hf_lbmr_topt_exfunc_flags_ignore = -1;
2403 static int hf_lbmr_topt_exfunc_src_tcp_port = -1;
2404 static int hf_lbmr_topt_exfunc_reserved = -1;
2405 static int hf_lbmr_topt_exfunc_src_ip_addr = -1;
2406 static int hf_lbmr_topt_exfunc_functionality_flags = -1;
2407 static int hf_lbmr_topt_exfunc_functionality_flags_lj = -1;
2408 static int hf_lbmr_topt_exfunc_functionality_flags_ume = -1;
2409 static int hf_lbmr_topt_exfunc_functionality_flags_umq = -1;
2410 static int hf_lbmr_topt_exfunc_functionality_flags_ulb = -1;
2411 static int hf_lbmr_topt_unknown = -1;
2412 static int hf_lbmr_topt_unknown_type = -1;
2413 static int hf_lbmr_topt_unknown_len = -1;
2414 static int hf_lbmr_topt_unknown_flags = -1;
2415 static int hf_lbmr_topt_unknown_data = -1;
2416 static int hf_lbmr_qqr = -1;
2417 static int hf_lbmr_qqr_name = -1;
2418 static int hf_lbmr_qirs = -1;
2419 static int hf_lbmr_qir = -1;
2420 static int hf_lbmr_qir_queue_name = -1;
2421 static int hf_lbmr_qir_topic_name = -1;
2422 static int hf_lbmr_qir_queue_id = -1;
2423 static int hf_lbmr_qir_queue_ver = -1;
2424 static int hf_lbmr_qir_queue_prev_ver = -1;
2425 static int hf_lbmr_qir_option_flag = -1;
2426 static int hf_lbmr_qir_grp_blks = -1;
2427 static int hf_lbmr_qir_queue_blks = -1;
2428 static int hf_lbmr_qir_grps = -1;
2429 static int hf_lbmr_qir_grp_blk = -1;
2430 static int hf_lbmr_qir_grp_blk_grp_idx = -1;
2431 static int hf_lbmr_qir_grp_blk_grp_sz = -1;
2432 static int hf_lbmr_qir_queues = -1;
2433 static int hf_lbmr_qir_queue_blk = -1;
2434 static int hf_lbmr_qir_queue_blk_ip = -1;
2435 static int hf_lbmr_qir_queue_blk_port = -1;
2436 static int hf_lbmr_qir_queue_blk_idx = -1;
2437 static int hf_lbmr_qir_queue_blk_grp_idx = -1;
2438 static int hf_lbmr_qir_queue_blk_reserved = -1;
2439 static int hf_lbmr_tmb = -1;
2440 static int hf_lbmr_tmb_len = -1;
2441 static int hf_lbmr_tmb_tmrs = -1;
2442 static int hf_lbmr_tmb_tmr_list = -1;
2443 static int hf_lbmr_tmr = -1;
2444 static int hf_lbmr_tmr_len = -1;
2445 static int hf_lbmr_tmr_type = -1;
2446 static int hf_lbmr_tmr_flags = -1;
2447 static int hf_lbmr_tmr_flags_response = -1;
2448 static int hf_lbmr_tmr_flags_wildcard_pcre = -1;
2449 static int hf_lbmr_tmr_flags_wildcard_regex = -1;
2450 static int hf_lbmr_tmr_name = -1;
2451 static int hf_lbmr_pser_dep_type = -1;
2452 static int hf_lbmr_pser_len = -1;
2453 static int hf_lbmr_pser_flags = -1;
2454 static int hf_lbmr_pser_flags_option = -1;
2455 static int hf_lbmr_pser_source_ip = -1;
2456 static int hf_lbmr_pser_store_ip = -1;
2457 static int hf_lbmr_pser_transport_idx = -1;
2458 static int hf_lbmr_pser_topic_idx = -1;
2459 static int hf_lbmr_pser_source_port = -1;
2460 static int hf_lbmr_pser_store_port = -1;
2461 static int hf_lbmr_pser_topic = -1;
2462 static int hf_lbmr_pser_opts = -1;
2463 static int hf_lbmr_pser_optlen = -1;
2464 static int hf_lbmr_pser_optlen_type = -1;
2465 static int hf_lbmr_pser_optlen_optlen = -1;
2466 static int hf_lbmr_pser_opt_ctxinst = -1;
2467 static int hf_lbmr_pser_opt_ctxinst_len = -1;
2468 static int hf_lbmr_pser_opt_ctxinst_type = -1;
2469 static int hf_lbmr_pser_opt_ctxinst_ctxinst = -1;
2470 static int hf_lbmr_opts = -1;
2471 static int hf_lbmr_opt_len = -1;
2472 static int hf_lbmr_opt_len_type = -1;
2473 static int hf_lbmr_opt_len_len = -1;
2474 static int hf_lbmr_opt_len_total_len = -1;
2475 static int hf_lbmr_opt_src_id = -1;
2476 static int hf_lbmr_opt_src_id_type = -1;
2477 static int hf_lbmr_opt_src_id_len = -1;
2478 static int hf_lbmr_opt_src_id_flags = -1;
2479 static int hf_lbmr_opt_src_id_flags_ignore = -1;
2480 static int hf_lbmr_opt_src_id_src_id = -1;
2481 static int hf_lbmr_opt_src_type = -1;
2482 static int hf_lbmr_opt_src_type_type = -1;
2483 static int hf_lbmr_opt_src_type_len = -1;
2484 static int hf_lbmr_opt_src_type_flags = -1;
2485 static int hf_lbmr_opt_src_type_flags_ignore = -1;
2486 static int hf_lbmr_opt_src_type_src_type = -1;
2487 static int hf_lbmr_opt_version = -1;
2488 static int hf_lbmr_opt_version_type = -1;
2489 static int hf_lbmr_opt_version_len = -1;
2490 static int hf_lbmr_opt_version_flags = -1;
2491 static int hf_lbmr_opt_version_flags_ignore = -1;
2492 static int hf_lbmr_opt_version_flags_ume = -1;
2493 static int hf_lbmr_opt_version_flags_umq = -1;
2494 static int hf_lbmr_opt_version_version = -1;
2495 static int hf_lbmr_opt_local_domain = -1;
2496 static int hf_lbmr_opt_local_domain_type = -1;
2497 static int hf_lbmr_opt_local_domain_len = -1;
2498 static int hf_lbmr_opt_local_domain_flags = -1;
2499 static int hf_lbmr_opt_local_domain_flags_ignore = -1;
2500 static int hf_lbmr_opt_local_domain_local_domain_id = -1;
2501 static int hf_lbmr_opt_unknown = -1;
2502 static int hf_lbmr_opt_unknown_type = -1;
2503 static int hf_lbmr_opt_unknown_len = -1;
2504 static int hf_lbmr_opt_unknown_flags = -1;
2505 static int hf_lbmr_opt_unknown_data = -1;
2506 static int hf_lbmr_topic_res_request_flags = -1;
2507 static int hf_lbmr_topic_res_request_flags_gw_remote_interest = -1;
2508 static int hf_lbmr_topic_res_request_flags_context_query = -1;
2509 static int hf_lbmr_topic_res_request_flags_context_advertisement = -1;
2510 static int hf_lbmr_topic_res_request_flags_gateway_meta = -1;
2511 static int hf_lbmr_topic_res_request_flags_advertisement = -1;
2512 static int hf_lbmr_topic_res_request_flags_query = -1;
2513 static int hf_lbmr_topic_res_request_flags_wildcard_query = -1;
2514 static int hf_lbmr_ctxinfo_len = -1;
2515 static int hf_lbmr_ctxinfo_hop_count = -1;
2516 static int hf_lbmr_ctxinfo_flags = -1;
2517 static int hf_lbmr_ctxinfo_flags_query = -1;
2518 static int hf_lbmr_ctxinfo_flags_ip = -1;
2519 static int hf_lbmr_ctxinfo_flags_instance = -1;
2520 static int hf_lbmr_ctxinfo_flags_tnwg_src = -1;
2521 static int hf_lbmr_ctxinfo_flags_tnwg_rcv = -1;
2522 static int hf_lbmr_ctxinfo_flags_proxy = -1;
2523 static int hf_lbmr_ctxinfo_flags_name = -1;
2524 static int hf_lbmr_ctxinfo_port = -1;
2525 static int hf_lbmr_ctxinfo_ip = -1;
2526 static int hf_lbmr_ctxinfo_instance = -1;
2527 static int hf_lbmr_ctxinfo_name = -1;
2528 static int hf_lbmr_tnwg_len = -1;
2529 static int hf_lbmr_tnwg_type = -1;
2530 static int hf_lbmr_tnwg_reserved = -1;
2531 static int hf_lbmr_tnwg_interest = -1;
2532 static int hf_lbmr_tnwg_interest_len = -1;
2533 static int hf_lbmr_tnwg_interest_count = -1;
2534 static int hf_lbmr_tnwg_interest_rec = -1;
2535 static int hf_lbmr_tnwg_interest_rec_len = -1;
2536 static int hf_lbmr_tnwg_interest_rec_flags = -1;
2537 static int hf_lbmr_tnwg_interest_rec_flags_pattern = -1;
2538 static int hf_lbmr_tnwg_interest_rec_flags_cancel = -1;
2539 static int hf_lbmr_tnwg_interest_rec_flags_refresh = -1;
2540 static int hf_lbmr_tnwg_interest_rec_pattype = -1;
2541 static int hf_lbmr_tnwg_interest_rec_domain_id = -1;
2542 static int hf_lbmr_tnwg_interest_rec_symbol = -1;
2543 static int hf_lbmr_tnwg_ctxinfo = -1;
2544 static int hf_lbmr_tnwg_ctxinfo_len = -1;
2545 static int hf_lbmr_tnwg_ctxinfo_hop_count = -1;
2546 static int hf_lbmr_tnwg_ctxinfo_reserved = -1;
2547 static int hf_lbmr_tnwg_ctxinfo_flags1 = -1;
2548 static int hf_lbmr_tnwg_ctxinfo_flags1_query = -1;
2549 static int hf_lbmr_tnwg_ctxinfo_flags1_tnwg_src = -1;
2550 static int hf_lbmr_tnwg_ctxinfo_flags1_tnwg_rcv = -1;
2551 static int hf_lbmr_tnwg_ctxinfo_flags1_proxy = -1;
2552 static int hf_lbmr_tnwg_ctxinfo_flags2 = -1;
2553 static int hf_lbmr_tnwg_trreq = -1;
2554 static int hf_lbmr_tnwg_trreq_len = -1;
2555 static int hf_lbmr_tnwg_opt = -1;
2556 static int hf_lbmr_tnwg_opt_type = -1;
2557 static int hf_lbmr_tnwg_opt_len = -1;
2558 static int hf_lbmr_tnwg_opt_flags = -1;
2559 static int hf_lbmr_tnwg_opt_flags_ignore = -1;
2560 static int hf_lbmr_tnwg_opt_data = -1;
2561 static int hf_lbmr_tnwg_opt_ctxinst = -1;
2562 static int hf_lbmr_tnwg_opt_ctxinst_type = -1;
2563 static int hf_lbmr_tnwg_opt_ctxinst_len = -1;
2564 static int hf_lbmr_tnwg_opt_ctxinst_flags = -1;
2565 static int hf_lbmr_tnwg_opt_ctxinst_flags_ignore = -1;
2566 static int hf_lbmr_tnwg_opt_ctxinst_instance = -1;
2567 static int hf_lbmr_tnwg_opt_address = -1;
2568 static int hf_lbmr_tnwg_opt_address_type = -1;
2569 static int hf_lbmr_tnwg_opt_address_len = -1;
2570 static int hf_lbmr_tnwg_opt_address_flags = -1;
2571 static int hf_lbmr_tnwg_opt_address_flags_ignore = -1;
2572 static int hf_lbmr_tnwg_opt_address_port = -1;
2573 static int hf_lbmr_tnwg_opt_address_res = -1;
2574 static int hf_lbmr_tnwg_opt_address_ip = -1;
2575 static int hf_lbmr_tnwg_opt_domain = -1;
2576 static int hf_lbmr_tnwg_opt_domain_type = -1;
2577 static int hf_lbmr_tnwg_opt_domain_len = -1;
2578 static int hf_lbmr_tnwg_opt_domain_flags = -1;
2579 static int hf_lbmr_tnwg_opt_domain_flags_ignore = -1;
2580 static int hf_lbmr_tnwg_opt_domain_domain_id = -1;
2581 static int hf_lbmr_tnwg_opt_name = -1;
2582 static int hf_lbmr_tnwg_opt_name_type = -1;
2583 static int hf_lbmr_tnwg_opt_name_len = -1;
2584 static int hf_lbmr_tnwg_opt_name_flags = -1;
2585 static int hf_lbmr_tnwg_opt_name_flags_ignore = -1;
2586 static int hf_lbmr_tnwg_opt_name_name = -1;
2587 static int hf_lbmr_remote_domain_route_hdr_num_domains = -1;
2588 static int hf_lbmr_remote_domain_route_hdr_ip = -1;
2589 static int hf_lbmr_remote_domain_route_hdr_port = -1;
2590 static int hf_lbmr_remote_domain_route_hdr_reserved = -1;
2591 static int hf_lbmr_remote_domain_route_hdr_length = -1;
2592 static int hf_lbmr_remote_domain_route_hdr_domain = -1;
2593 static int hf_lbmr_rctxinfo_len = -1;
2594 static int hf_lbmr_rctxinfo_num_recs = -1;
2595 static int hf_lbmr_rctxinfo_reserved = -1;
2596 static int hf_lbmr_rctxinfo_rec = -1;
2597 static int hf_lbmr_rctxinfo_rec_len = -1;
2598 static int hf_lbmr_rctxinfo_rec_flags = -1;
2599 static int hf_lbmr_rctxinfo_rec_flags_query = -1;
2600 static int hf_lbmr_rctxinfo_rec_address = -1;
2601 static int hf_lbmr_rctxinfo_rec_address_type = -1;
2602 static int hf_lbmr_rctxinfo_rec_address_len = -1;
2603 static int hf_lbmr_rctxinfo_rec_address_flags = -1;
2604 static int hf_lbmr_rctxinfo_rec_address_domain_id = -1;
2605 static int hf_lbmr_rctxinfo_rec_address_ip = -1;
2606 static int hf_lbmr_rctxinfo_rec_address_port = -1;
2607 static int hf_lbmr_rctxinfo_rec_address_res = -1;
2608 static int hf_lbmr_rctxinfo_rec_instance = -1;
2609 static int hf_lbmr_rctxinfo_rec_instance_type = -1;
2610 static int hf_lbmr_rctxinfo_rec_instance_len = -1;
2611 static int hf_lbmr_rctxinfo_rec_instance_flags = -1;
2612 static int hf_lbmr_rctxinfo_rec_instance_instance = -1;
2613 static int hf_lbmr_rctxinfo_rec_odomain = -1;
2614 static int hf_lbmr_rctxinfo_rec_odomain_type = -1;
2615 static int hf_lbmr_rctxinfo_rec_odomain_len = -1;
2616 static int hf_lbmr_rctxinfo_rec_odomain_flags = -1;
2617 static int hf_lbmr_rctxinfo_rec_odomain_domain_id = -1;
2618 static int hf_lbmr_rctxinfo_rec_name = -1;
2619 static int hf_lbmr_rctxinfo_rec_name_type = -1;
2620 static int hf_lbmr_rctxinfo_rec_name_len = -1;
2621 static int hf_lbmr_rctxinfo_rec_name_flags = -1;
2622 static int hf_lbmr_rctxinfo_rec_name_name = -1;
2623 static int hf_lbmr_rctxinfo_rec_unknown = -1;
2624 static int hf_lbmr_rctxinfo_rec_unknown_type = -1;
2625 static int hf_lbmr_rctxinfo_rec_unknown_len = -1;
2626 static int hf_lbmr_rctxinfo_rec_unknown_flags = -1;
2627 static int hf_lbmr_rctxinfo_rec_unknown_data = -1;
2628 static int hf_qmgmt_flags = -1;
2629 static int hf_qmgmt_flags_i_flag = -1;
2630 static int hf_qmgmt_flags_n_flag = -1;
2631 static int hf_qmgmt_flags_il_l_flag = -1;
2632 static int hf_qmgmt_flags_il_k_flag = -1;
2633 static int hf_qmgmt_pckt_type = -1;
2634 static int hf_qmgmt_cfgsig = -1;
2635 static int hf_qmgmt_queue_id = -1;
2636 static int hf_qmgmt_queue_ver = -1;
2637 static int hf_qmgmt_ip = -1;
2638 static int hf_qmgmt_port = -1;
2639 static int hf_qmgmt_inst_idx = -1;
2640 static int hf_qmgmt_grp_idx = -1;
2641 static int hf_qmgmt_pckt_type_dep16 = -1;
2642 static int hf_qmgmt_il_num_insts = -1;
2643 static int hf_qmgmt_jrej_code = -1;
2644 static int hf_qmgmt_ev_bias = -1;
2645 static int hf_qmgmt_il = -1;
2646 static int hf_qmgmt_il_highest_rcr_tsp = -1;
2647 static int hf_qmgmt_il_inst = -1;
2648 static int hf_qmgmt_il_inst_ip = -1;
2649 static int hf_qmgmt_il_inst_port = -1;
2650 static int hf_qmgmt_il_inst_inst_idx = -1;
2651 static int hf_qmgmt_il_inst_grp_idx = -1;
2652 static int hf_qmgmt_il_inst_flags = -1;
2653 static int hf_qmgmt_il_inst_flags_m_flag = -1;
2654 static int hf_qmgmt_il_inst_flags_q_flag = -1;
2655 static int hf_qmgmt_il_inst_flags_p_flag = -1;
2656 static int hf_qmgmt_ec = -1;
2657 static int hf_qmgmt_ec_queue_new_ver = -1;
2658 static int hf_qmgmt_ev = -1;
2659 static int hf_qmgmt_ev_highest_rcr_tsp = -1;
2660 static int hf_qmgmt_ev_age = -1;
2661 static int hf_qmgmt_qro = -1;
2662 static int hf_qmgmt_qro_highest_rcr_tsp = -1;
2663 static int hf_qmgmt_qname = -1;
2664
2665 /* Expert info handles */
2666 static expert_field ei_lbmr_analysis_length_incorrect = EI_INIT;
2667 static expert_field ei_lbmr_analysis_invalid_value = EI_INIT;
2668 static expert_field ei_lbmr_analysis_zero_len_option = EI_INIT;
2669
2670
2671 /* Tap handles */
2672 static int lbmr_topic_advertisement_tap_handle = -1;
2673 static int lbmr_topic_query_tap_handle = -1;
2674 static int lbmr_pattern_query_tap_handle = -1;
2675 static int lbmr_queue_advertisement_tap_handle = -1;
2676 static int lbmr_queue_query_tap_handle = -1;
2677
2678 #define LBMR_TOPIC_ADVERTISEMENT_TAP_STRING "lbm_lbmr_topic_advertisement"
2679 #define LBMR_TOPIC_QUERY_TAP_STRING "lbm_lbmr_topic_query"
2680 #define LBMR_PATTERN_QUERY_TAP_STRING "lbm_lbmr_pattern_query"
2681 #define LBMR_QUEUE_ADVERTISEMENT_TAP_STRING "lbm_lbmr_queue_advertisement"
2682 #define LBMR_QUEUE_QUERY_TAP_STRING "lbm_lbmr_queue_query"
2683
2684 /*----------------------------------------------------------------------------*/
2685 /* Statistics.                                                                */
2686 /*----------------------------------------------------------------------------*/
2687 /* Statistics structures */
2688 struct tqr_node_t_stct;
2689 struct tqr_node_t_stct
2690 {
2691     char * topic;
2692     struct tqr_node_t_stct * next;
2693 };
2694 typedef struct tqr_node_t_stct tqr_node_t;
2695
2696 struct wctqr_node_t_stct;
2697 struct wctqr_node_t_stct
2698 {
2699     guint8 type;
2700     char * pattern;
2701     struct wctqr_node_t_stct * next;
2702 };
2703 typedef struct wctqr_node_t_stct wctqr_node_t;
2704
2705 struct tir_node_t_stct;
2706 struct tir_node_t_stct
2707 {
2708     char * topic;
2709     char * source_string;
2710     guint32 idx;
2711     struct tir_node_t_stct * next;
2712 };
2713 typedef struct tir_node_t_stct tir_node_t;
2714
2715 typedef struct
2716 {
2717     gint tqr_count;
2718     tqr_node_t * tqr;
2719     gint tir_count;
2720     tir_node_t * tir;
2721     gint wctqr_count;
2722     wctqr_node_t * wctqr;
2723 } lbmr_topic_contents_t;
2724
2725 struct qqr_node_t_stct;
2726 struct qqr_node_t_stct
2727 {
2728     char * queue;
2729     struct qqr_node_t_stct * next;
2730 };
2731 typedef struct qqr_node_t_stct qqr_node_t;
2732
2733 struct qir_node_t_stct;
2734 struct qir_node_t_stct
2735 {
2736     char * queue;
2737     char * topic;
2738     guint16 port;
2739     struct qir_node_t_stct * next;
2740 };
2741 typedef struct qir_node_t_stct qir_node_t;
2742
2743 typedef struct
2744 {
2745     gint qqr_count;
2746     qqr_node_t * qqr;
2747     gint qir_count;
2748     qir_node_t * qir;
2749 } lbmr_queue_contents_t;
2750
2751 typedef struct
2752 {
2753     gint type;
2754     union
2755     {
2756         lbmr_topic_contents_t topic;
2757         lbmr_queue_contents_t queue;
2758     } contents;
2759 } lbmr_contents_t;
2760
2761 #define LBMR_CONTENTS_TOPIC 0
2762 #define LBMR_CONTENTS_QUEUE 1
2763
2764 /* Statistics titles */
2765 static const gchar * lbmr_stat_tree_name_topic_ads_topic = "29West/Topics/Advertisements by Topic";
2766 static const gchar * lbmr_stat_tree_name_topic_ads_source = "29West/Topics/Advertisements by Source";
2767 static const gchar * lbmr_stat_tree_name_topic_ads_transport = "29West/Topics/Advertisements by Transport";
2768 static const gchar * lbmr_stat_tree_name_topic_queries_topic = "29West/Topics/Queries by Topic";
2769 static const gchar * lbmr_stat_tree_name_topic_queries_receiver  = "29West/Topics/Queries by Receiver";
2770 static const gchar * lbmr_stat_tree_name_topic_queries_pattern = "29West/Topics/Wildcard Queries by Pattern";
2771 static const gchar * lbmr_stat_tree_name_topic_queries_pattern_receiver = "29West/Topics/Wildcard Queries by Receiver";
2772 static const gchar * lbmr_stat_tree_name_queue_ads_queue = "29West/Queues/Advertisements by Queue";
2773 static const gchar * lbmr_stat_tree_name_queue_ads_source = "29West/Queues/Advertisements by Source";
2774 static const gchar * lbmr_stat_tree_name_queue_queries_queue = "29West/Queues/Queries by Queue";
2775 static const gchar * lbmr_stat_tree_name_queue_queries_receiver = "29West/Queues/Queries by Receiver";
2776
2777 /* Statistics handles */
2778 static int lbmr_stats_tree_handle_topic_ads_topic = -1;
2779 static int lbmr_stats_tree_handle_topic_ads_source = -1;
2780 static int lbmr_stats_tree_handle_topic_ads_transport = -1;
2781 static int lbmr_stats_tree_handle_topic_queries_topic = -1;
2782 static int lbmr_stats_tree_handle_topic_queries_receiver = -1;
2783 static int lbmr_stats_tree_handle_topic_queries_pattern = -1;
2784 static int lbmr_stats_tree_handle_topic_queries_pattern_receiver = -1;
2785 static int lbmr_stats_tree_handle_queue_ads_queue = -1;
2786 static int lbmr_stats_tree_handle_queue_ads_source = -1;
2787 static int lbmr_stats_tree_handle_queue_queries_queue = -1;
2788 static int lbmr_stats_tree_handle_queue_queries_receiver = -1;
2789
2790 /*----------------------------------------------------------------------------*/
2791 /* Statistics tree utility functions.                                         */
2792 /*----------------------------------------------------------------------------*/
2793
2794 static void add_contents_tqr(lbmr_contents_t * contents, const char * topic)
2795 {
2796     tqr_node_t * node = NULL;
2797
2798     node = wmem_new(wmem_packet_scope(), tqr_node_t);
2799     node->topic = wmem_strdup(wmem_packet_scope(), topic);
2800     node->next = contents->contents.topic.tqr;
2801     contents->contents.topic.tqr = node;
2802     contents->contents.topic.tqr_count++;
2803 }
2804
2805 static void add_contents_wctqr(lbmr_contents_t * contents, unsigned char type, const char * pattern)
2806 {
2807     wctqr_node_t * node = NULL;
2808
2809     node = wmem_new(wmem_packet_scope(), wctqr_node_t);
2810     node->type = type;
2811     node->pattern = wmem_strdup(wmem_packet_scope(), pattern);
2812     node->next = contents->contents.topic.wctqr;
2813     contents->contents.topic.wctqr = node;
2814     contents->contents.topic.wctqr_count++;
2815 }
2816
2817 static void add_contents_tir(lbmr_contents_t * contents, const char * topic, char * source, guint32 topic_index)
2818 {
2819     tir_node_t * node = NULL;
2820
2821     node = wmem_new(wmem_packet_scope(), tir_node_t);
2822     node->topic = wmem_strdup(wmem_packet_scope(), topic);
2823     node->source_string = source;
2824     node->idx = topic_index;
2825     node->next = contents->contents.topic.tir;
2826     contents->contents.topic.tir = node;
2827     contents->contents.topic.tir_count++;
2828 }
2829
2830 static void add_contents_qqr(lbmr_contents_t * contents, const char * queue)
2831 {
2832     qqr_node_t * node = NULL;
2833
2834     node = wmem_new(wmem_packet_scope(), qqr_node_t);
2835     node->queue = wmem_strdup(wmem_packet_scope(), queue);
2836     node->next = contents->contents.queue.qqr;
2837     contents->contents.queue.qqr = node;
2838     contents->contents.queue.qqr_count++;
2839 }
2840
2841 static void add_contents_qir(lbmr_contents_t * contents, const char * queue, const char * topic, guint16 port)
2842 {
2843     qir_node_t * node = NULL;
2844
2845     node = wmem_new(wmem_packet_scope(), qir_node_t);
2846     node->queue = wmem_strdup(wmem_packet_scope(), queue);
2847     node->topic = wmem_strdup(wmem_packet_scope(), topic);
2848     node->port = port;
2849     node->next = contents->contents.queue.qir;
2850     contents->contents.queue.qir = node;
2851     contents->contents.queue.qir_count++;
2852 }
2853
2854 /*----------------------------------------------------------------------------*/
2855 /*  Topic advertisements by Topic:                                            */
2856 /*  Topic name                                                                */
2857 /*    - Source address                                                        */
2858 /*      - Source string (including topic index)                               */
2859 /*----------------------------------------------------------------------------*/
2860
2861 static void lbmr_topic_ads_topic_stats_tree_init(stats_tree * tree)
2862 {
2863     lbmr_stats_tree_handle_topic_ads_topic = stats_tree_create_node(tree, lbmr_stat_tree_name_topic_ads_topic, 0, TRUE);
2864 }
2865
2866 static int lbmr_topic_ads_topic_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data)
2867 {
2868     const lbm_lbmr_topic_advertisement_tap_info_t * info = (const lbm_lbmr_topic_advertisement_tap_info_t *) data;
2869     int topic_node;
2870     int source_node;
2871     gchar * full_source_string;
2872
2873     tick_stat_node(tree, lbmr_stat_tree_name_topic_ads_topic, 0, FALSE);
2874     topic_node = tick_stat_node(tree, info->topic, lbmr_stats_tree_handle_topic_ads_topic, TRUE);
2875     source_node = tick_stat_node(tree, address_to_str(wmem_packet_scope(), &pinfo->net_src), topic_node, TRUE);
2876     full_source_string = wmem_strdup_printf(wmem_packet_scope(), "%s[%" G_GUINT32_FORMAT "]", info->source, info->topic_index);
2877     tick_stat_node(tree, full_source_string, source_node, TRUE);
2878     return (1);
2879 }
2880
2881 /*----------------------------------------------------------------------------*/
2882 /*  Topic advertisements by Source:                                           */
2883 /*  Source address                                                            */
2884 /*    - Topic name                                                            */
2885 /*      - Source string (including topic index)                               */
2886 /*----------------------------------------------------------------------------*/
2887
2888 static void lbmr_topic_ads_source_stats_tree_init(stats_tree * tree)
2889 {
2890     lbmr_stats_tree_handle_topic_ads_source = stats_tree_create_node(tree, lbmr_stat_tree_name_topic_ads_source, 0, TRUE);
2891 }
2892
2893 static int lbmr_topic_ads_source_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data)
2894 {
2895     const lbm_lbmr_topic_advertisement_tap_info_t * info = (const lbm_lbmr_topic_advertisement_tap_info_t *) data;
2896     int source_node;
2897     int topic_node;
2898     gchar * full_source_string;
2899
2900     tick_stat_node(tree, lbmr_stat_tree_name_topic_ads_source, 0, FALSE);
2901     source_node = tick_stat_node(tree, address_to_str(wmem_packet_scope(), &pinfo->net_src), lbmr_stats_tree_handle_topic_ads_source, TRUE);
2902     topic_node = tick_stat_node(tree, info->topic, source_node, TRUE);
2903     full_source_string = wmem_strdup_printf(wmem_packet_scope(), "%s[%" G_GUINT32_FORMAT "]", info->source, info->topic_index);
2904     tick_stat_node(tree, full_source_string, topic_node, TRUE);
2905     return (1);
2906 }
2907
2908 /*----------------------------------------------------------------------------*/
2909 /*  Topic advertisements by Transport:                                        */
2910 /*  Source string                                                             */
2911 /*    - Topic name (including topic index)                                    */
2912 /*----------------------------------------------------------------------------*/
2913
2914 static void lbmr_topic_ads_transport_stats_tree_init(stats_tree * tree)
2915 {
2916     lbmr_stats_tree_handle_topic_ads_transport = stats_tree_create_node(tree, lbmr_stat_tree_name_topic_ads_transport, 0, TRUE);
2917 }
2918
2919 static int lbmr_topic_ads_transport_stats_tree_packet(stats_tree * tree, packet_info * pinfo _U_, epan_dissect_t * edt _U_, const void * data)
2920 {
2921     const lbm_lbmr_topic_advertisement_tap_info_t * info = (const lbm_lbmr_topic_advertisement_tap_info_t *) data;
2922     int transport_node;
2923     gchar * full_source_string;
2924
2925     tick_stat_node(tree, lbmr_stat_tree_name_topic_ads_transport, 0, FALSE);
2926     transport_node = tick_stat_node(tree, info->source, lbmr_stats_tree_handle_topic_ads_transport, TRUE);
2927     full_source_string = wmem_strdup_printf(wmem_packet_scope(), "%s [%" G_GUINT32_FORMAT "]", info->topic, info->topic_index);
2928     tick_stat_node(tree, full_source_string, transport_node, TRUE);
2929     return (1);
2930 }
2931
2932 /*----------------------------------------------------------------------------*/
2933 /*  Topic queries by Topic:                                                   */
2934 /*  Topic name                                                                */
2935 /*    - Receiver address                                                      */
2936 /*----------------------------------------------------------------------------*/
2937
2938 static void lbmr_topic_queries_topic_stats_tree_init(stats_tree * tree)
2939 {
2940     lbmr_stats_tree_handle_topic_queries_topic = stats_tree_create_node(tree, lbmr_stat_tree_name_topic_queries_topic, 0, TRUE);
2941 }
2942
2943 static int lbmr_topic_queries_topic_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data)
2944 {
2945     const lbm_lbmr_topic_query_tap_info_t * info = (const lbm_lbmr_topic_query_tap_info_t *) data;
2946     int topic_node;
2947
2948     tick_stat_node(tree, lbmr_stat_tree_name_topic_queries_topic, 0, FALSE);
2949     topic_node = tick_stat_node(tree, info->topic, lbmr_stats_tree_handle_topic_queries_topic, TRUE);
2950     tick_stat_node(tree, address_to_str(wmem_packet_scope(), &pinfo->net_src), topic_node, TRUE);
2951     return (1);
2952 }
2953
2954 /*----------------------------------------------------------------------------*/
2955 /*  Topic queries by Receiver:                                                */
2956 /*  Receiver address                                                          */
2957 /*    - Topic name                                                            */
2958 /*----------------------------------------------------------------------------*/
2959
2960 static void lbmr_topic_queries_receiver_stats_tree_init(stats_tree * tree)
2961 {
2962     lbmr_stats_tree_handle_topic_queries_receiver = stats_tree_create_node(tree, lbmr_stat_tree_name_topic_queries_receiver, 0, TRUE);
2963 }
2964
2965 static int lbmr_topic_queries_receiver_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data)
2966 {
2967     const lbm_lbmr_topic_query_tap_info_t * info = (const lbm_lbmr_topic_query_tap_info_t *) data;
2968     int receiver_node;
2969
2970     tick_stat_node(tree, lbmr_stat_tree_name_topic_queries_receiver, 0, FALSE);
2971     receiver_node = tick_stat_node(tree, address_to_str(wmem_packet_scope(), &pinfo->net_src), lbmr_stats_tree_handle_topic_queries_receiver, TRUE);
2972     tick_stat_node(tree, info->topic, receiver_node, TRUE);
2973     return (1);
2974 }
2975
2976 /*----------------------------------------------------------------------------*/
2977 /*  Topic queries by Pattern:                                                 */
2978 /*  Pattern                                                                   */
2979 /*    - Receiver address                                                      */
2980 /*----------------------------------------------------------------------------*/
2981
2982 static void lbmr_topic_queries_pattern_stats_tree_init(stats_tree * tree)
2983 {
2984     lbmr_stats_tree_handle_topic_queries_pattern = stats_tree_create_node(tree, lbmr_stat_tree_name_topic_queries_pattern, 0, TRUE);
2985 }
2986
2987 static int lbmr_topic_queries_pattern_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data)
2988 {
2989     const lbm_lbmr_pattern_query_tap_info_t * info = (const lbm_lbmr_pattern_query_tap_info_t *) data;
2990     int pattern_node;
2991     char * pattern_str;
2992
2993     tick_stat_node(tree, lbmr_stat_tree_name_topic_queries_pattern, 0, FALSE);
2994     pattern_str = wmem_strdup_printf(wmem_packet_scope(), "%s (%s)",
2995         info->pattern,
2996         val_to_str(info->type, lbm_wildcard_pattern_type_short, "UNKN[0x%02x]"));
2997     pattern_node = tick_stat_node(tree, pattern_str, lbmr_stats_tree_handle_topic_queries_pattern, TRUE);
2998     tick_stat_node(tree, address_to_str(wmem_packet_scope(), &pinfo->net_src), pattern_node, TRUE);
2999     return (1);
3000 }
3001
3002 /*----------------------------------------------------------------------------*/
3003 /*  Topic queries by Pattern:                                                 */
3004 /*  Receiver address                                                          */
3005 /*    - Patternme                                                             */
3006 /*----------------------------------------------------------------------------*/
3007
3008 static void lbmr_topic_queries_pattern_receiver_stats_tree_init(stats_tree * tree)
3009 {
3010     lbmr_stats_tree_handle_topic_queries_pattern_receiver = stats_tree_create_node(tree, lbmr_stat_tree_name_topic_queries_pattern_receiver, 0, TRUE);
3011 }
3012
3013 static int lbmr_topic_queries_pattern_receiver_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data)
3014 {
3015     const lbm_lbmr_pattern_query_tap_info_t * info = (const lbm_lbmr_pattern_query_tap_info_t *) data;
3016     int receiver_node;
3017     char * pattern_str;
3018
3019     tick_stat_node(tree, lbmr_stat_tree_name_topic_queries_pattern_receiver, 0, FALSE);
3020     receiver_node = tick_stat_node(tree, address_to_str(wmem_packet_scope(), &pinfo->net_src), lbmr_stats_tree_handle_topic_queries_pattern_receiver, TRUE);
3021     pattern_str = wmem_strdup_printf(wmem_packet_scope(), "%s (%s)",
3022         info->pattern,
3023         val_to_str(info->type, lbm_wildcard_pattern_type_short, "UNKN[0x%02x]"));
3024     tick_stat_node(tree, pattern_str, receiver_node, TRUE);
3025     return (1);
3026 }
3027
3028 /*----------------------------------------------------------------------------*/
3029 /*  Queue advertisements by Queue:                                            */
3030 /*  Queue name                                                                */
3031 /*    - Source address and port                                               */
3032 /*----------------------------------------------------------------------------*/
3033
3034 static void lbmr_queue_ads_queue_stats_tree_init(stats_tree * tree)
3035 {
3036     lbmr_stats_tree_handle_queue_ads_queue = stats_tree_create_node(tree, lbmr_stat_tree_name_queue_ads_queue, 0, TRUE);
3037 }
3038
3039 static int lbmr_queue_ads_queue_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data)
3040 {
3041     const lbm_lbmr_queue_advertisement_tap_info_t * info = (const lbm_lbmr_queue_advertisement_tap_info_t *) data;
3042     int queue_node;
3043     gchar * str;
3044
3045     tick_stat_node(tree, lbmr_stat_tree_name_queue_ads_queue, 0, FALSE);
3046     queue_node = tick_stat_node(tree, info->queue, lbmr_stats_tree_handle_queue_ads_queue, TRUE);
3047     str = wmem_strdup_printf(wmem_packet_scope(), "%s:%" G_GUINT16_FORMAT, address_to_str(wmem_packet_scope(), &pinfo->net_src), info->port);
3048     tick_stat_node(tree, str, queue_node, TRUE);
3049     return (1);
3050 }
3051
3052 /*----------------------------------------------------------------------------*/
3053 /*  Queue advertisements by Source:                                           */
3054 /*  Source address                                                            */
3055 /*    - Queue name and port                                                   */
3056 /*----------------------------------------------------------------------------*/
3057
3058 static void lbmr_queue_ads_source_stats_tree_init(stats_tree * tree)
3059 {
3060     lbmr_stats_tree_handle_queue_ads_source = stats_tree_create_node(tree, lbmr_stat_tree_name_queue_ads_source, 0, TRUE);
3061 }
3062
3063 static int lbmr_queue_ads_source_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data)
3064 {
3065     const lbm_lbmr_queue_advertisement_tap_info_t * info = (const lbm_lbmr_queue_advertisement_tap_info_t *) data;
3066     int source_node;
3067     gchar * str;
3068
3069     tick_stat_node(tree, lbmr_stat_tree_name_queue_ads_source, 0, FALSE);
3070     source_node = tick_stat_node(tree, address_to_str(wmem_packet_scope(), &pinfo->net_src), lbmr_stats_tree_handle_queue_ads_source, TRUE);
3071     str = wmem_strdup_printf(wmem_packet_scope(), "%s:%" G_GUINT16_FORMAT, info->queue, info->port);
3072     tick_stat_node(tree, str, source_node, TRUE);
3073     return (1);
3074 }
3075
3076 /*----------------------------------------------------------------------------*/
3077 /*  Queue queries by Queue:                                                   */
3078 /*  Queue name                                                                */
3079 /*    - Receiver address                                                      */
3080 /*----------------------------------------------------------------------------*/
3081
3082 static void lbmr_queue_queries_queue_stats_tree_init(stats_tree * tree)
3083 {
3084     lbmr_stats_tree_handle_queue_queries_queue = stats_tree_create_node(tree, lbmr_stat_tree_name_queue_queries_queue, 0, TRUE);
3085 }
3086
3087 static int lbmr_queue_queries_queue_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data)
3088 {
3089     const lbm_lbmr_queue_query_tap_info_t * info = (const lbm_lbmr_queue_query_tap_info_t *) data;
3090     int queue_node = 0;
3091
3092     tick_stat_node(tree, lbmr_stat_tree_name_queue_queries_queue, 0, FALSE);
3093     queue_node = tick_stat_node(tree, info->queue, lbmr_stats_tree_handle_queue_queries_queue, TRUE);
3094     tick_stat_node(tree, address_to_str(wmem_packet_scope(), &pinfo->net_src), queue_node, TRUE);
3095     return (1);
3096 }
3097
3098 /*----------------------------------------------------------------------------*/
3099 /*  Queue queries by Receiver:                                                */
3100 /*  Receiver address                                                          */
3101 /*    - Queue name                                                            */
3102 /*----------------------------------------------------------------------------*/
3103
3104 static void lbmr_queue_queries_receiver_stats_tree_init(stats_tree * tree)
3105 {
3106     lbmr_stats_tree_handle_queue_queries_receiver = stats_tree_create_node(tree, lbmr_stat_tree_name_queue_queries_receiver, 0, TRUE);
3107 }
3108
3109 static int lbmr_queue_queries_receiver_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data)
3110 {
3111     const lbm_lbmr_queue_query_tap_info_t * info = (const lbm_lbmr_queue_query_tap_info_t *) data;
3112     int receiver_node;
3113
3114     tick_stat_node(tree, lbmr_stat_tree_name_queue_queries_receiver, 0, FALSE);
3115     receiver_node = tick_stat_node(tree, address_to_str(wmem_packet_scope(), &pinfo->net_src), lbmr_stats_tree_handle_queue_queries_receiver, TRUE);
3116     tick_stat_node(tree, info->queue, receiver_node, TRUE);
3117     return (1);
3118 }
3119
3120 /*----------------------------------------------------------------------------*/
3121 /* Dissector functions.                                                       */
3122 /*----------------------------------------------------------------------------*/
3123
3124 /*----------------------------------------------------------------------------*/
3125 /* LBMR TNWG option dissection functions.                                     */
3126 /*----------------------------------------------------------------------------*/
3127 static int dissect_lbmr_tnwg_ctxinst_opt(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3128 {
3129     proto_tree * opt_tree = NULL;
3130     proto_item * opt_item = NULL;
3131     guint8 opt_len = 0;
3132     static const int * flags[] =
3133     {
3134         &hf_lbmr_tnwg_opt_ctxinst_flags_ignore,
3135         NULL
3136     };
3137
3138     opt_len = tvb_get_guint8(tvb, offset + O_LBMR_TNWG_OPT_CTXINST_T_LEN);
3139     opt_item = proto_tree_add_item(tree, hf_lbmr_tnwg_opt_ctxinst, tvb, offset, opt_len, ENC_NA);
3140     opt_tree = proto_item_add_subtree(opt_item, ett_lbmr_tnwg_ctxinst_opt);
3141     proto_tree_add_item(opt_tree, hf_lbmr_tnwg_opt_ctxinst_type, tvb, offset + O_LBMR_TNWG_OPT_CTXINST_T_TYPE, L_LBMR_TNWG_OPT_CTXINST_T_TYPE, ENC_BIG_ENDIAN);
3142     proto_tree_add_item(opt_tree, hf_lbmr_tnwg_opt_ctxinst_len, tvb, offset + O_LBMR_TNWG_OPT_CTXINST_T_LEN, L_LBMR_TNWG_OPT_CTXINST_T_LEN, ENC_BIG_ENDIAN);
3143     proto_tree_add_bitmask(opt_tree, tvb, offset + O_LBMR_TNWG_OPT_CTXINST_T_FLAGS, hf_lbmr_tnwg_opt_ctxinst_flags, ett_lbmr_tnwg_ctxinst_opt_flags, flags, ENC_BIG_ENDIAN);
3144     proto_tree_add_item(opt_tree, hf_lbmr_tnwg_opt_ctxinst_instance, tvb, offset + O_LBMR_TNWG_OPT_CTXINST_T_INSTANCE, L_LBMR_TNWG_OPT_CTXINST_T_INSTANCE, ENC_NA);
3145     return ((int) opt_len);
3146 }
3147
3148 static int dissect_lbmr_tnwg_address_opt(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3149 {
3150     proto_tree * opt_tree = NULL;
3151     proto_item * opt_item = NULL;
3152     guint8 opt_len = 0;
3153     static const int * flags[] =
3154     {
3155         &hf_lbmr_tnwg_opt_address_flags_ignore,
3156         NULL
3157     };
3158
3159     opt_len = tvb_get_guint8(tvb, offset + O_LBMR_TNWG_OPT_ADDRESS_T_LEN);
3160     opt_item = proto_tree_add_item(tree, hf_lbmr_tnwg_opt_address, tvb, offset, opt_len, ENC_NA);
3161     opt_tree = proto_item_add_subtree(opt_item, ett_lbmr_tnwg_address_opt);
3162     proto_tree_add_item(opt_tree, hf_lbmr_tnwg_opt_address_type, tvb, offset + O_LBMR_TNWG_OPT_ADDRESS_T_TYPE, L_LBMR_TNWG_OPT_ADDRESS_T_TYPE, ENC_BIG_ENDIAN);
3163     proto_tree_add_item(opt_tree, hf_lbmr_tnwg_opt_address_len, tvb, offset + O_LBMR_TNWG_OPT_ADDRESS_T_LEN, L_LBMR_TNWG_OPT_ADDRESS_T_LEN, ENC_BIG_ENDIAN);
3164     proto_tree_add_bitmask(opt_tree, tvb, offset + O_LBMR_TNWG_OPT_ADDRESS_T_FLAGS, hf_lbmr_tnwg_opt_address_flags, ett_lbmr_tnwg_address_opt_flags, flags, ENC_BIG_ENDIAN);
3165     proto_tree_add_item(opt_tree, hf_lbmr_tnwg_opt_address_port, tvb, offset + O_LBMR_TNWG_OPT_ADDRESS_T_PORT, L_LBMR_TNWG_OPT_ADDRESS_T_PORT, ENC_BIG_ENDIAN);
3166     proto_tree_add_item(opt_tree, hf_lbmr_tnwg_opt_address_res, tvb, offset + O_LBMR_TNWG_OPT_ADDRESS_T_RES, L_LBMR_TNWG_OPT_ADDRESS_T_RES, ENC_BIG_ENDIAN);
3167     proto_tree_add_item(opt_tree, hf_lbmr_tnwg_opt_address_ip, tvb, offset + O_LBMR_TNWG_OPT_ADDRESS_T_IP, L_LBMR_TNWG_OPT_ADDRESS_T_IP, ENC_BIG_ENDIAN);
3168     return ((int)opt_len);
3169 }
3170
3171 static int dissect_lbmr_tnwg_domain_opt(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3172 {
3173     proto_tree * opt_tree = NULL;
3174     proto_item * opt_item = NULL;
3175     guint8 opt_len = 0;
3176     static const int * flags[] =
3177     {
3178         &hf_lbmr_tnwg_opt_domain_flags_ignore,
3179         NULL
3180     };
3181
3182     opt_len = tvb_get_guint8(tvb, offset + O_LBMR_TNWG_OPT_DOMAIN_T_LEN);
3183     opt_item = proto_tree_add_item(tree, hf_lbmr_tnwg_opt_domain, tvb, offset, opt_len, ENC_NA);
3184     opt_tree = proto_item_add_subtree(opt_item, ett_lbmr_tnwg_domain_opt);
3185     proto_tree_add_item(opt_tree, hf_lbmr_tnwg_opt_domain_type, tvb, offset + O_LBMR_TNWG_OPT_DOMAIN_T_TYPE, L_LBMR_TNWG_OPT_DOMAIN_T_TYPE, ENC_BIG_ENDIAN);
3186     proto_tree_add_item(opt_tree, hf_lbmr_tnwg_opt_domain_len, tvb, offset + O_LBMR_TNWG_OPT_DOMAIN_T_LEN, L_LBMR_TNWG_OPT_DOMAIN_T_LEN, ENC_BIG_ENDIAN);
3187     proto_tree_add_bitmask(opt_tree, tvb, offset + O_LBMR_TNWG_OPT_DOMAIN_T_FLAGS, hf_lbmr_tnwg_opt_domain_flags, ett_lbmr_tnwg_domain_opt_flags, flags, ENC_BIG_ENDIAN);
3188     proto_tree_add_item(opt_tree, hf_lbmr_tnwg_opt_domain_domain_id, tvb, offset + O_LBMR_TNWG_OPT_DOMAIN_T_DOMAIN_ID, L_LBMR_TNWG_OPT_DOMAIN_T_DOMAIN_ID, ENC_BIG_ENDIAN);
3189     return ((int)opt_len);
3190 }
3191
3192 static int dissect_lbmr_tnwg_name_opt(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3193 {
3194     proto_tree * opt_tree = NULL;
3195     proto_item * opt_item = NULL;
3196     guint8 opt_len = 0;
3197     static const int * flags[] =
3198     {
3199         &hf_lbmr_tnwg_opt_name_flags_ignore,
3200         NULL
3201     };
3202     guint32 name_len = 0;
3203
3204     opt_len = tvb_get_guint8(tvb, offset + O_LBMR_TNWG_OPT_T_LEN);
3205     name_len = opt_len - L_LBMR_TNWG_OPT_T;
3206     opt_item = proto_tree_add_item(tree, hf_lbmr_tnwg_opt_name, tvb, offset, opt_len, ENC_NA);
3207     opt_tree = proto_item_add_subtree(opt_item, ett_lbmr_tnwg_name_opt);
3208     proto_tree_add_item(opt_tree, hf_lbmr_tnwg_opt_name_type, tvb, offset + O_LBMR_TNWG_OPT_T_TYPE, L_LBMR_TNWG_OPT_T_TYPE, ENC_BIG_ENDIAN);
3209     proto_tree_add_item(opt_tree, hf_lbmr_tnwg_opt_name_len, tvb, offset + O_LBMR_TNWG_OPT_T_LEN, L_LBMR_TNWG_OPT_T_LEN, ENC_BIG_ENDIAN);
3210     proto_tree_add_bitmask(opt_tree, tvb, offset + O_LBMR_TNWG_OPT_T_FLAGS, hf_lbmr_tnwg_opt_name_flags, ett_lbmr_tnwg_name_opt_flags, flags, ENC_BIG_ENDIAN);
3211     proto_tree_add_item(opt_tree, hf_lbmr_tnwg_opt_name_name, tvb, offset + L_LBMR_TNWG_OPT_T, name_len, ENC_ASCII|ENC_NA);
3212     return ((int)opt_len);
3213 }
3214
3215 static int dissect_lbmr_tnwg_unknown_opt(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3216 {
3217     proto_tree * opt_tree = NULL;
3218     proto_item * opt_item = NULL;
3219     guint8 opt_len = 0;
3220     static const int * flags[] =
3221     {
3222         &hf_lbmr_tnwg_opt_flags_ignore,
3223         NULL
3224     };
3225     guint32 data_len = 0;
3226
3227     opt_len = tvb_get_guint8(tvb, offset + O_LBMR_TNWG_OPT_T_LEN);
3228     data_len = opt_len - L_LBMR_TNWG_OPT_T;
3229     opt_item = proto_tree_add_item(tree, hf_lbmr_tnwg_opt, tvb, offset, opt_len, ENC_NA);
3230     opt_tree = proto_item_add_subtree(opt_item, ett_lbmr_tnwg_unknown_opt);
3231     proto_tree_add_item(opt_tree, hf_lbmr_tnwg_opt_type, tvb, offset + O_LBMR_TNWG_OPT_T_TYPE, L_LBMR_TNWG_OPT_T_TYPE, ENC_BIG_ENDIAN);
3232     proto_tree_add_item(opt_tree, hf_lbmr_tnwg_opt_len, tvb, offset + O_LBMR_TNWG_OPT_T_LEN, L_LBMR_TNWG_OPT_T_LEN, ENC_BIG_ENDIAN);
3233     proto_tree_add_bitmask(opt_tree, tvb, offset + O_LBMR_TNWG_OPT_T_FLAGS, hf_lbmr_tnwg_opt_flags, ett_lbmr_tnwg_unknown_opt_flags, flags, ENC_BIG_ENDIAN);
3234     proto_tree_add_item(opt_tree, hf_lbmr_tnwg_opt_data, tvb, offset + L_LBMR_TNWG_OPT_T, data_len, ENC_NA);
3235     return ((int)opt_len);
3236 }
3237
3238 static int dissect_lbmr_tnwg_opts(tvbuff_t * tvb, int offset, int length, packet_info * pinfo, proto_tree * tree)
3239 {
3240     int len_remaining = length;
3241     int curr_offset = offset;
3242     int dissected_len = 0;
3243     guint8 type = 0;
3244     int len_used = 0;
3245
3246     while (len_remaining >= L_LBMR_TNWG_OPT_T)
3247     {
3248         type = tvb_get_guint8(tvb, curr_offset);
3249         switch (type)
3250         {
3251             case LBMR_TNWG_OPT_CTXINST_TYPE:
3252                 dissected_len += dissect_lbmr_tnwg_ctxinst_opt(tvb, curr_offset, pinfo, tree);
3253                 break;
3254             case LBMR_TNWG_OPT_ADDRESS_TYPE:
3255                 dissected_len += dissect_lbmr_tnwg_address_opt(tvb, curr_offset, pinfo, tree);
3256                 break;
3257             case LBMR_TNWG_OPT_DOMAIN_TYPE:
3258                 dissected_len += dissect_lbmr_tnwg_domain_opt(tvb, curr_offset, pinfo, tree);
3259                 break;
3260             case LBMR_TNWG_OPT_NAME_TYPE:
3261                 dissected_len += dissect_lbmr_tnwg_name_opt(tvb, curr_offset, pinfo, tree);
3262                 break;
3263             default:
3264                 dissected_len += dissect_lbmr_tnwg_unknown_opt(tvb, curr_offset, pinfo, tree);
3265                 break;
3266         }
3267         len_remaining -= dissected_len;
3268         len_used += dissected_len;
3269         curr_offset += dissected_len;
3270     }
3271     return (len_used);
3272 }
3273
3274 /*----------------------------------------------------------------------------*/
3275 /* LBMR TNWG Interest dissection functions.                                   */
3276 /*----------------------------------------------------------------------------*/
3277 static int dissect_lbmr_tnwg_interest_rec(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3278 {
3279     proto_tree * rec_tree = NULL;
3280     proto_item * rec_item = NULL;
3281     guint16 rec_len = 0;
3282     gint string_len = 0;
3283     static const int * flags[] =
3284     {
3285         &hf_lbmr_tnwg_interest_rec_flags_pattern,
3286         &hf_lbmr_tnwg_interest_rec_flags_cancel,
3287         &hf_lbmr_tnwg_interest_rec_flags_refresh,
3288         NULL
3289     };
3290
3291     rec_len = tvb_get_ntohs(tvb, offset + O_LBMR_TNWG_INTEREST_REC_T_LEN);
3292     string_len = rec_len - L_LBMR_TNWG_INTEREST_REC_T;
3293
3294     rec_item = proto_tree_add_item(tree, hf_lbmr_tnwg_interest_rec, tvb, offset, rec_len, ENC_NA);
3295     rec_tree = proto_item_add_subtree(rec_item, ett_lbmr_tnwg_interest_rec);
3296     proto_tree_add_item(rec_tree, hf_lbmr_tnwg_interest_rec_len, tvb, offset + O_LBMR_TNWG_INTEREST_REC_T_LEN, L_LBMR_TNWG_INTEREST_REC_T_LEN, ENC_BIG_ENDIAN);
3297     proto_tree_add_bitmask(rec_tree, tvb, offset + O_LBMR_TNWG_INTEREST_REC_T_FLAGS, hf_lbmr_tnwg_interest_rec_flags, ett_lbmr_tnwg_interest_rec_flags, flags, ENC_BIG_ENDIAN);
3298     proto_tree_add_item(rec_tree, hf_lbmr_tnwg_interest_rec_pattype, tvb, offset + O_LBMR_TNWG_INTEREST_REC_T_PATTYPE, L_LBMR_TNWG_INTEREST_REC_T_PATTYPE, ENC_BIG_ENDIAN);
3299     proto_tree_add_item(rec_tree, hf_lbmr_tnwg_interest_rec_domain_id, tvb, offset + O_LBMR_TNWG_INTEREST_REC_T_DOMAIN_ID, L_LBMR_TNWG_INTEREST_REC_T_DOMAIN_ID, ENC_BIG_ENDIAN);
3300     proto_tree_add_item(rec_tree, hf_lbmr_tnwg_interest_rec_symbol, tvb, offset + L_LBMR_TNWG_INTEREST_REC_T, string_len, ENC_ASCII|ENC_NA);
3301     return ((int)rec_len);
3302 }
3303
3304 static int dissect_lbmr_tnwg_interest(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree)
3305 {
3306     proto_tree * int_tree = NULL;
3307     proto_item * int_item = NULL;
3308     guint16 rec_count = 0;
3309     int curr_offset = 0;
3310     int len = 0;
3311     int len_remaining = 0;
3312     int len_dissected = 0;
3313
3314     len_remaining = tvb_get_ntohs(tvb, offset + O_LBMR_TNWG_INTEREST_T_LEN);
3315     rec_count = tvb_get_ntohs(tvb, offset + O_LBMR_TNWG_INTEREST_T_COUNT);
3316     int_item = proto_tree_add_item(tree, hf_lbmr_tnwg_interest, tvb, offset, len_remaining, ENC_NA);
3317     int_tree = proto_item_add_subtree(int_item, ett_lbmr_tnwg_interest);
3318     proto_tree_add_item(int_tree, hf_lbmr_tnwg_interest_len, tvb, offset + O_LBMR_TNWG_INTEREST_T_LEN, L_LBMR_TNWG_INTEREST_T_LEN, ENC_BIG_ENDIAN);
3319     proto_tree_add_item(int_tree, hf_lbmr_tnwg_interest_count, tvb, offset + O_LBMR_TNWG_INTEREST_T_COUNT, L_LBMR_TNWG_INTEREST_T_COUNT, ENC_BIG_ENDIAN);
3320
3321     curr_offset = offset + L_LBMR_TNWG_INTEREST_T;
3322     len = L_LBMR_TNWG_INTEREST_T;
3323     while (rec_count > 0)
3324     {
3325         len_dissected = dissect_lbmr_tnwg_interest_rec(tvb, curr_offset, pinfo, int_tree);
3326         curr_offset += len_dissected;
3327         len += len_dissected;
3328         rec_count--;
3329     }
3330     return (len);
3331 }
3332
3333 /*----------------------------------------------------------------------------*/
3334 /* LBMR TNWG ContextInfo dissection functions.                                */
3335 /*----------------------------------------------------------------------------*/
3336 static int dissect_lbmr_tnwg_ctxinfo(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree)
3337 {
3338     proto_tree * ctxinfo_tree = NULL;
3339     proto_item * ctxinfo_item = NULL;
3340     static const int * flags1[] =
3341     {
3342         &hf_lbmr_tnwg_ctxinfo_flags1_query,
3343         &hf_lbmr_tnwg_ctxinfo_flags1_tnwg_src,
3344         &hf_lbmr_tnwg_ctxinfo_flags1_tnwg_rcv,
3345         &hf_lbmr_tnwg_ctxinfo_flags1_proxy,
3346         NULL
3347     };
3348     guint16 reclen = 0;
3349     guint16 len_remaining = 0;
3350     int len_used = 0;
3351
3352     reclen = tvb_get_ntohs(tvb, offset + O_LBMR_TNWG_CTXINFO_T_LEN);
3353     len_remaining = reclen;
3354     ctxinfo_item = proto_tree_add_item(tree, hf_lbmr_tnwg_ctxinfo, tvb, offset, (gint)reclen, ENC_NA);
3355     ctxinfo_tree = proto_item_add_subtree(ctxinfo_item, ett_lbmr_tnwg_ctxinfo);
3356     proto_tree_add_item(ctxinfo_tree, hf_lbmr_tnwg_ctxinfo_len, tvb, offset + O_LBMR_TNWG_CTXINFO_T_LEN, L_LBMR_TNWG_CTXINFO_T_LEN, ENC_BIG_ENDIAN);
3357     proto_tree_add_item(ctxinfo_tree, hf_lbmr_tnwg_ctxinfo_hop_count, tvb, offset + O_LBMR_TNWG_CTXINFO_T_HOP_COUNT, L_LBMR_TNWG_CTXINFO_T_HOP_COUNT, ENC_BIG_ENDIAN);
3358     proto_tree_add_item(ctxinfo_tree, hf_lbmr_tnwg_ctxinfo_reserved, tvb, offset + O_LBMR_TNWG_CTXINFO_T_RESERVED, L_LBMR_TNWG_CTXINFO_T_RESERVED, ENC_BIG_ENDIAN);
3359     proto_tree_add_bitmask(ctxinfo_tree, tvb, offset + O_LBMR_TNWG_CTXINFO_T_FLAGS1, hf_lbmr_tnwg_ctxinfo_flags1, ett_lbmr_tnwg_ctxinfo_flags1, flags1, ENC_BIG_ENDIAN);
3360     proto_tree_add_item(ctxinfo_tree, hf_lbmr_tnwg_ctxinfo_flags2, tvb, offset + O_LBMR_TNWG_CTXINFO_T_FLAGS2, L_LBMR_TNWG_CTXINFO_T_FLAGS2, ENC_BIG_ENDIAN);
3361     offset += L_LBMR_TNWG_CTXINFO_T;
3362     len_remaining -= L_LBMR_TNWG_CTXINFO_T;
3363     len_used = L_LBMR_TNWG_CTXINFO_T;
3364     if (len_remaining >= L_LBMR_TNWG_OPT_T)
3365     {
3366         len_used += dissect_lbmr_tnwg_opts(tvb, offset, len_remaining, pinfo, ctxinfo_tree);
3367     }
3368     return (len_used);
3369 }
3370
3371 /*----------------------------------------------------------------------------*/
3372 /* LBMR TNWG TopicRes Request dissection functions.                           */
3373 /*----------------------------------------------------------------------------*/
3374 static int dissect_lbmr_tnwg_trreq(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree)
3375 {
3376     proto_tree * trreq_tree = NULL;
3377     proto_item * trreq_item = NULL;
3378     guint16 reclen = 0;
3379     guint16 len_remaining = 0;
3380     int len_used = 0;
3381
3382     reclen = tvb_get_ntohs(tvb, offset + O_LBMR_TNWG_TRREQ_T_LEN);
3383     len_remaining = reclen;
3384
3385     trreq_item = proto_tree_add_item(tree, hf_lbmr_tnwg_trreq, tvb, offset, (gint)reclen, ENC_NA);
3386     trreq_tree = proto_item_add_subtree(trreq_item, ett_lbmr_tnwg_trreq);
3387     proto_tree_add_item(trreq_tree, hf_lbmr_tnwg_trreq_len, tvb, offset + O_LBMR_TNWG_TRREQ_T_LEN, L_LBMR_TNWG_TRREQ_T_LEN, ENC_BIG_ENDIAN);
3388
3389     offset += L_LBMR_TNWG_TRREQ_T;
3390     len_remaining -= L_LBMR_TNWG_TRREQ_T;
3391     len_used = L_LBMR_TNWG_TRREQ_T;
3392     if (len_remaining >= L_LBMR_TNWG_OPT_T)
3393     {
3394         len_used += dissect_lbmr_tnwg_opts(tvb, offset, len_remaining, pinfo, trreq_tree);
3395     }
3396     return (len_used);
3397 }
3398
3399 /*----------------------------------------------------------------------------*/
3400 /* LBMR TNWG dissection functions.                                            */
3401 /*----------------------------------------------------------------------------*/
3402 static int dissect_lbmr_tnwg(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree)
3403 {
3404     guint16 type = 0;
3405     int curr_offset = 0;
3406     int len_dissected = 0;
3407     proto_item * type_item = NULL;
3408
3409     type = tvb_get_ntohs(tvb, offset + O_LBMR_TNWG_T_TYPE);
3410     proto_tree_add_item(tree, hf_lbmr_tnwg_len, tvb, offset + O_LBMR_TNWG_T_LEN, L_LBMR_TNWG_T_LEN, ENC_BIG_ENDIAN);
3411     type_item = proto_tree_add_item(tree, hf_lbmr_tnwg_type, tvb, offset + O_LBMR_TNWG_T_TYPE, L_LBMR_TNWG_T_TYPE, ENC_BIG_ENDIAN);
3412     proto_tree_add_item(tree, hf_lbmr_tnwg_reserved, tvb, offset + O_LBMR_TNWG_T_RESERVED, L_LBMR_TNWG_T_RESERVED, ENC_BIG_ENDIAN);
3413     len_dissected = L_LBMR_TNWG_T;
3414     curr_offset = offset + L_LBMR_TNWG_T;
3415     switch (type)
3416     {
3417         case LBMR_TNWG_TYPE_INTEREST:
3418             len_dissected += dissect_lbmr_tnwg_interest(tvb, curr_offset, pinfo, tree);
3419             break;
3420         case LBMR_TNWG_TYPE_CTXINFO:
3421             len_dissected += dissect_lbmr_tnwg_ctxinfo(tvb, curr_offset, pinfo, tree);
3422             break;
3423         case LBMR_TNWG_TYPE_TRREQ:
3424             len_dissected += dissect_lbmr_tnwg_trreq(tvb, curr_offset, pinfo, tree);
3425             break;
3426         default:
3427             expert_add_info_format(pinfo, type_item, &ei_lbmr_analysis_invalid_value, "Unknown LBMR TNWG type 0x%04x", type);
3428             break;
3429     }
3430     return ((int)len_dissected);
3431 }
3432
3433 /*----------------------------------------------------------------------------*/
3434 /* LBMR Topic Management dissection functions.                                */
3435 /*----------------------------------------------------------------------------*/
3436 static int dissect_lbmr_tmr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3437 {
3438     gint namelen = 0;
3439     int name_offset = 0;
3440     char * name = NULL;
3441     proto_item * ti = NULL;
3442     proto_tree * tinfo_tree = NULL;
3443     static const int * flags[] =
3444     {
3445         &hf_lbmr_tmr_flags_response,
3446         &hf_lbmr_tmr_flags_wildcard_pcre,
3447         &hf_lbmr_tmr_flags_wildcard_regex,
3448         NULL
3449     };
3450     guint16 tmr_len;
3451     guint8 tmr_type;
3452     guint8 tmr_flags;
3453     const char * info_string = "";
3454
3455     tmr_len = tvb_get_ntohs(tvb, offset + O_LBMR_TMR_T_LEN);
3456     tmr_type = tvb_get_guint8(tvb, offset + O_LBMR_TMR_T_TYPE);
3457     tmr_flags = tvb_get_guint8(tvb, offset + O_LBMR_TMR_T_FLAGS);
3458     name_offset = offset + L_LBMR_TMR_T;
3459
3460     name = tvb_get_stringz_enc(wmem_packet_scope(), tvb, name_offset, &namelen, ENC_ASCII);
3461
3462     switch (tmr_type)
3463     {
3464         case LBMR_TMR_LEAVE_TOPIC:
3465         default:
3466             break;
3467         case LBMR_TMR_TOPIC_USE:
3468             if (tmr_flags & LBMR_TMR_FLAG_RESPONSE)
3469             {
3470                 info_string = " Response";
3471             }
3472             else
3473             {
3474                 info_string = " Query";
3475             }
3476             break;
3477     }
3478     ti = proto_tree_add_none_format(tree, hf_lbmr_tmr, tvb, offset, tmr_len, "%s: %s%s, Length %" G_GUINT16_FORMAT,
3479         name, val_to_str(tmr_type, lbmr_tmr_type, "Unknown (0x%02x)"), info_string, tmr_len);
3480     tinfo_tree = proto_item_add_subtree(ti, ett_lbmr_tmr);
3481     proto_tree_add_item(tinfo_tree, hf_lbmr_tmr_len, tvb, offset + O_LBMR_TMR_T_LEN, L_LBMR_TMR_T_LEN, ENC_BIG_ENDIAN);
3482     proto_tree_add_item(tinfo_tree, hf_lbmr_tmr_type, tvb, offset + O_LBMR_TMR_T_TYPE, L_LBMR_TMR_T_TYPE, ENC_BIG_ENDIAN);
3483     proto_tree_add_bitmask(tinfo_tree, tvb, offset + O_LBMR_TMR_T_FLAGS, hf_lbmr_tmr_flags, ett_lbmr_tmr_flags, flags, ENC_BIG_ENDIAN);
3484     proto_tree_add_item(tinfo_tree, hf_lbmr_tmr_name, tvb, name_offset, namelen, ENC_ASCII|ENC_NA);
3485     return ((int) tmr_len);
3486 }
3487
3488 static int dissect_lbmr_tmb(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree)
3489 {
3490     int tmr_len = 0;
3491     proto_tree * tmb_tree = NULL;
3492     proto_item * ti = NULL;
3493     proto_tree * tmr_tree = NULL;
3494     proto_item * tmr_ti = NULL;
3495     int tmr_count = 0;
3496     guint16 tmrs;
3497     int len_dissected;
3498
3499     tmrs = tvb_get_ntohs(tvb, offset + O_LBMR_TMB_T_TMRS);
3500     ti = proto_tree_add_item(tree, hf_lbmr_tmb, tvb, offset, -1, ENC_NA);
3501     tmb_tree = proto_item_add_subtree(ti, ett_lbmr_tmb);
3502     proto_tree_add_item(tmb_tree, hf_lbmr_tmb_len, tvb, offset + O_LBMR_TMB_T_LEN, L_LBMR_TMB_T_LEN, ENC_BIG_ENDIAN);
3503     proto_tree_add_item(tmb_tree, hf_lbmr_tmb_tmrs, tvb, offset + O_LBMR_TMB_T_TMRS, L_LBMR_TMB_T_TMRS, ENC_BIG_ENDIAN);
3504     tmr_ti = proto_tree_add_item(tmb_tree, hf_lbmr_tmb_tmr_list, tvb, offset + L_LBMR_TMB_T, -1, ENC_NA);
3505     tmr_tree = proto_item_add_subtree(tmr_ti, ett_lbmr_tmrs);
3506
3507     offset += L_LBMR_TMB_T;
3508     len_dissected = L_LBMR_TMB_T;
3509     while (tmr_count < tmrs)
3510     {
3511         tmr_len = dissect_lbmr_tmr(tvb, offset, pinfo, tmr_tree);
3512         len_dissected += tmr_len;
3513         offset += tmr_len;
3514         tmr_count++;
3515     }
3516     return (len_dissected);
3517 }
3518
3519 /*----------------------------------------------------------------------------*/
3520 /* LBMR Topic Query Record dissection functions.                              */
3521 /*----------------------------------------------------------------------------*/
3522 static int dissect_lbmr_tqr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, gboolean wildcard_tqr, lbmr_contents_t * contents)
3523 {
3524     gint namelen = 0;
3525     guint reclen = 0;
3526     char * name = NULL;
3527     guint8 pattern_type;
3528     proto_item * tqr_item = NULL;
3529     proto_tree * tqr_tree = NULL;
3530     gint name_offset = offset;
3531
3532     if (wildcard_tqr)
3533     {
3534         pattern_type = tvb_get_guint8(tvb, offset);
3535         name_offset++;
3536         reclen++;
3537     }
3538     name = tvb_get_stringz_enc(wmem_packet_scope(), tvb, name_offset, &namelen, ENC_ASCII);
3539     reclen += namelen;
3540
3541     if (wildcard_tqr)
3542     {
3543         tqr_item = proto_tree_add_none_format(tree, hf_lbmr_tqr, tvb, offset, reclen, "Wildcard TQR: %s", name);
3544     }
3545     else
3546     {
3547         tqr_item = proto_tree_add_none_format(tree, hf_lbmr_tqr, tvb, offset, reclen, "TQR: %s", name);
3548     }
3549     tqr_tree = proto_item_add_subtree(tqr_item, ett_lbmr_tqr);
3550     if (wildcard_tqr)
3551     {
3552         proto_tree_add_item(tqr_tree, hf_lbmr_tqr_pattern_type, tvb, offset, 1, ENC_BIG_ENDIAN);
3553         proto_tree_add_item(tqr_tree, hf_lbmr_tqr_pattern, tvb, offset, namelen, ENC_ASCII|ENC_NA);
3554         add_contents_wctqr(contents, pattern_type, name);
3555     }
3556     else
3557     {
3558         proto_tree_add_item(tqr_tree, hf_lbmr_tqr_name, tvb, offset, namelen, ENC_ASCII|ENC_NA);
3559         add_contents_tqr(contents, name);
3560     }
3561     return (reclen);
3562 }
3563
3564 static int dissect_lbmr_tqrs(tvbuff_t * tvb, int offset, guint8 tqr_count, packet_info * pinfo, proto_tree * tree,
3565     gboolean wildcard_tqr, lbmr_contents_t * contents)
3566 {
3567     int start_offset = 0;
3568     int tqr_len = 0;
3569     proto_tree * tqrs_tree = NULL;
3570     proto_item * ti = NULL;
3571     int len = 0;
3572
3573     start_offset = offset;
3574     if (wildcard_tqr)
3575     {
3576         ti = proto_tree_add_none_format(tree, hf_lbmr_tqrs, tvb, start_offset, -1, "Wildcard TQRs");
3577     }
3578     else
3579     {
3580         ti = proto_tree_add_none_format(tree, hf_lbmr_tqrs, tvb, start_offset, -1, "TQRs");
3581     }
3582     tqrs_tree = proto_item_add_subtree(ti, ett_lbmr_tqrs);
3583     while (tqr_count-- > 0)
3584     {
3585         tqr_len = dissect_lbmr_tqr(tvb, offset, pinfo, tqrs_tree, wildcard_tqr, contents);
3586         len += tqr_len;
3587         offset += tqr_len;
3588     }
3589     proto_item_set_len(ti, len);
3590     return (len);
3591 }
3592
3593 /*----------------------------------------------------------------------------*/
3594 /* LBMR Topic Information Record dissection functions.                        */
3595 /*----------------------------------------------------------------------------*/
3596 static int dissect_lbmr_tir_options(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree)
3597 {
3598     guint8 opt_type = 0;
3599     guint8 opt_len = 0;
3600     int opt_total_len = 0;
3601     int opt_remaining_len = 0;
3602     int curr_offset = offset;
3603     proto_item * oi = NULL;
3604     proto_tree * otree = NULL;
3605     proto_item * optlen_item = NULL;
3606     proto_tree * optlen_tree = NULL;
3607     static const int * opt_ume_flags[] =
3608     {
3609         &hf_lbmr_topt_ume_flags_ignore,
3610         &hf_lbmr_topt_ume_flags_latejoin,
3611         &hf_lbmr_topt_ume_flags_store,
3612         &hf_lbmr_topt_ume_flags_qccap,
3613         &hf_lbmr_topt_ume_flags_acktosrc,
3614         NULL
3615     };
3616     static const int * opt_ume_store_flags[] =
3617     {
3618         &hf_lbmr_topt_ume_store_flags_ignore,
3619         NULL
3620     };
3621     static const int * opt_ume_store_group_flags[] =
3622     {
3623         &hf_lbmr_topt_ume_store_group_flags_ignore,
3624         NULL
3625     };
3626     static const int * opt_latejoin_flags[] =
3627     {
3628         &hf_lbmr_topt_latejoin_flags_ignore,
3629         &hf_lbmr_topt_latejoin_flags_acktosrc,
3630         NULL
3631     };
3632     static const int * opt_umq_rcridx_flags[] =
3633     {
3634         &hf_lbmr_topt_umq_rcridx_flags_ignore,
3635         NULL
3636     };
3637     static const int * opt_umq_qinfo_flags[] =
3638     {
3639         &hf_lbmr_topt_umq_qinfo_flags_ignore,
3640         &hf_lbmr_topt_umq_qinfo_flags_queue,
3641         &hf_lbmr_topt_umq_qinfo_flags_rcvlisten,
3642         &hf_lbmr_topt_umq_qinfo_flags_control,
3643         &hf_lbmr_topt_umq_qinfo_flags_srcrcvlisten,
3644         &hf_lbmr_topt_umq_qinfo_flags_participants_only,
3645         NULL
3646     };
3647     static const int * opt_cost_flags[] =
3648     {
3649         &hf_lbmr_topt_cost_flags_ignore,
3650         NULL
3651     };
3652     static const int * opt_otid_flags[] =
3653     {
3654         &hf_lbmr_topt_otid_flags_ignore,
3655         NULL
3656     };
3657     static const int * opt_ctxinst_flags[] =
3658     {
3659         &hf_lbmr_topt_ctxinst_flags_ignore,
3660         NULL
3661     };
3662     static const int * opt_ctxinsts_flags[] =
3663     {
3664         &hf_lbmr_topt_ctxinsts_flags_ignore,
3665         NULL
3666     };
3667     static const int * opt_ulb_flags[] =
3668     {
3669         &hf_lbmr_topt_ulb_flags_ignore,
3670         NULL
3671     };
3672     static const int * opt_ctxinstq_flags[] =
3673     {
3674         &hf_lbmr_topt_ctxinstq_flags_ignore,
3675         NULL
3676     };
3677     static const int * opt_domain_id_flags[] =
3678     {
3679         &hf_lbmr_topt_domain_id_flags_ignore,
3680         NULL
3681     };
3682     static const int * opt_exfunc_flags[] =
3683     {
3684         &hf_lbmr_topt_exfunc_flags_ignore,
3685         NULL
3686     };
3687     static const int * opt_exfunc_functionality_flags[] =
3688     {
3689         &hf_lbmr_topt_exfunc_functionality_flags_ulb,
3690         &hf_lbmr_topt_exfunc_functionality_flags_umq,
3691         &hf_lbmr_topt_exfunc_functionality_flags_ume,
3692         &hf_lbmr_topt_exfunc_functionality_flags_lj,
3693         NULL
3694     };
3695     int len = 0;
3696
3697     opt_total_len = (int)tvb_get_ntohs(tvb, curr_offset + O_LBMR_TOPIC_OPT_LEN_T_TOTAL_LEN);
3698     opt_remaining_len = opt_total_len;
3699
3700     oi = proto_tree_add_none_format(tree, hf_lbmr_topts, tvb, curr_offset, opt_total_len, "Options: %d bytes", opt_total_len);
3701     otree = proto_item_add_subtree(oi, ett_lbmr_topts);
3702     optlen_item = proto_tree_add_item(otree, hf_lbmr_topt_len, tvb, curr_offset, L_LBMR_TOPIC_OPT_LEN_T, ENC_NA);
3703     optlen_tree = proto_item_add_subtree(optlen_item, ett_lbmr_topt_len);
3704     proto_tree_add_item(optlen_tree, hf_lbmr_topt_len_type, tvb, curr_offset + O_LBMR_TOPIC_OPT_LEN_T_TYPE, L_LBMR_TOPIC_OPT_LEN_T_TYPE, ENC_BIG_ENDIAN);
3705     proto_tree_add_item(optlen_tree, hf_lbmr_topt_len_len, tvb, curr_offset + O_LBMR_TOPIC_OPT_LEN_T_LEN, L_LBMR_TOPIC_OPT_LEN_T_LEN, ENC_BIG_ENDIAN);
3706     proto_tree_add_item(optlen_tree, hf_lbmr_topt_len_total_len, tvb, curr_offset + O_LBMR_TOPIC_OPT_LEN_T_TOTAL_LEN, L_LBMR_TOPIC_OPT_LEN_T_TOTAL_LEN, ENC_BIG_ENDIAN);
3707     len = L_LBMR_TOPIC_OPT_LEN_T;
3708     curr_offset += L_LBMR_TOPIC_OPT_LEN_T;
3709     opt_remaining_len -= L_LBMR_TOPIC_OPT_LEN_T;
3710     while (opt_remaining_len > 0)
3711     {
3712         proto_item * opt_item = NULL;
3713         proto_tree * opt_tree = NULL;
3714         proto_item * ei_item = NULL;
3715         int qname_len;
3716
3717         opt_type = tvb_get_guint8(tvb, curr_offset + O_LBMR_TOPIC_OPT_T_TYPE);
3718         opt_len = tvb_get_guint8(tvb, curr_offset + O_LBMR_TOPIC_OPT_T_LEN);
3719         if (opt_len == 0)
3720         {
3721             opt_item = proto_tree_add_item(otree, hf_lbmr_topt_unknown, tvb, curr_offset + O_LBMR_TOPIC_OPT_T_TYPE, opt_len, ENC_NA);
3722             opt_tree = proto_item_add_subtree(opt_item, ett_lbmr_topt_unknown);
3723             proto_tree_add_item(opt_tree, hf_lbmr_topt_unknown_type, tvb, curr_offset + O_LBMR_TOPIC_OPT_T_TYPE, L_LBMR_TOPIC_OPT_T_TYPE, ENC_BIG_ENDIAN);
3724             ei_item = proto_tree_add_item(opt_tree, hf_lbmr_topt_unknown_len, tvb, curr_offset + O_LBMR_TOPIC_OPT_T_LEN, L_LBMR_TOPIC_OPT_T_LEN, ENC_BIG_ENDIAN);
3725             proto_tree_add_item(opt_tree, hf_lbmr_topt_unknown_flags, tvb, curr_offset + O_LBMR_TOPIC_OPT_T_FLAGS, L_LBMR_TOPIC_OPT_T_FLAGS, ENC_BIG_ENDIAN);
3726             if (((int) opt_len) > L_LBMR_TOPIC_OPT_T)
3727             {
3728                 proto_tree_add_item(opt_tree, hf_lbmr_topt_unknown_data, tvb, curr_offset + L_LBMR_TOPIC_OPT_T, ((int) opt_len) - L_LBMR_TOPIC_OPT_T, ENC_NA);
3729             }
3730             expert_add_info_format(pinfo, ei_item, &ei_lbmr_analysis_zero_len_option, "Zero-length LBMR option");
3731             return (len);
3732         }
3733         switch (opt_type)
3734         {
3735             case LBMR_TOPIC_OPT_UME_TYPE:
3736                 opt_item = proto_tree_add_item(otree, hf_lbmr_topt_ume, tvb, curr_offset + O_LBMR_TOPIC_OPT_T_TYPE, opt_len, ENC_NA);
3737                 opt_tree = proto_item_add_subtree(opt_item, ett_lbmr_topt_ume);
3738                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ume_type, tvb, curr_offset + O_LBMR_TOPIC_OPT_UME_T_TYPE, L_LBMR_TOPIC_OPT_UME_T_TYPE, ENC_BIG_ENDIAN);
3739                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ume_len, tvb, curr_offset + O_LBMR_TOPIC_OPT_UME_T_LEN, L_LBMR_TOPIC_OPT_UME_T_LEN, ENC_BIG_ENDIAN);
3740                 proto_tree_add_bitmask(opt_tree, tvb, curr_offset + O_LBMR_TOPIC_OPT_UME_T_FLAGS, hf_lbmr_topt_ume_flags, ett_lbmr_topt_ume_flags, opt_ume_flags, ENC_BIG_ENDIAN);
3741                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ume_store_tcp_port, tvb, curr_offset + O_LBMR_TOPIC_OPT_UME_T_STORE_TCP_PORT, L_LBMR_TOPIC_OPT_UME_T_STORE_TCP_PORT, ENC_BIG_ENDIAN);
3742                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ume_src_tcp_port, tvb, curr_offset + O_LBMR_TOPIC_OPT_UME_T_SRC_TCP_PORT, L_LBMR_TOPIC_OPT_UME_T_SRC_TCP_PORT, ENC_BIG_ENDIAN);
3743                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ume_store_tcp_addr, tvb, curr_offset + O_LBMR_TOPIC_OPT_UME_T_STORE_TCP_ADDR, L_LBMR_TOPIC_OPT_UME_T_STORE_TCP_ADDR, ENC_BIG_ENDIAN);
3744                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ume_src_tcp_addr, tvb, curr_offset + O_LBMR_TOPIC_OPT_UME_T_SRC_TCP_ADDR, L_LBMR_TOPIC_OPT_UME_T_SRC_TCP_ADDR, ENC_BIG_ENDIAN);
3745                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ume_src_reg_id, tvb, curr_offset + O_LBMR_TOPIC_OPT_UME_T_SRC_REG_ID, L_LBMR_TOPIC_OPT_UME_T_SRC_REG_ID, ENC_BIG_ENDIAN);
3746                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ume_transport_idx, tvb, curr_offset + O_LBMR_TOPIC_OPT_UME_T_TRANSPORT_IDX, L_LBMR_TOPIC_OPT_UME_T_TRANSPORT_IDX, ENC_BIG_ENDIAN);
3747                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ume_high_seqnum, tvb, curr_offset + O_LBMR_TOPIC_OPT_UME_T_HIGH_SEQNUM, L_LBMR_TOPIC_OPT_UME_T_HIGH_SEQNUM, ENC_BIG_ENDIAN);
3748                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ume_low_seqnum, tvb, curr_offset + O_LBMR_TOPIC_OPT_UME_T_LOW_SEQNUM, L_LBMR_TOPIC_OPT_UME_T_LOW_SEQNUM, ENC_BIG_ENDIAN);
3749                 break;
3750             case LBMR_TOPIC_OPT_UME_STORE_TYPE:
3751                 opt_item = proto_tree_add_item(otree, hf_lbmr_topt_ume_store, tvb, curr_offset + O_LBMR_TOPIC_OPT_T_TYPE, opt_len, ENC_NA);
3752                 opt_tree = proto_item_add_subtree(opt_item, ett_lbmr_topt_ume_store);
3753                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ume_store_type, tvb, curr_offset + O_LBMR_TOPIC_OPT_UME_STORE_T_TYPE, L_LBMR_TOPIC_OPT_UME_STORE_T_TYPE, ENC_BIG_ENDIAN);
3754                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ume_store_len, tvb, curr_offset + O_LBMR_TOPIC_OPT_UME_STORE_T_LEN, L_LBMR_TOPIC_OPT_UME_STORE_T_LEN, ENC_BIG_ENDIAN);
3755                 proto_tree_add_bitmask(opt_tree, tvb, curr_offset + O_LBMR_TOPIC_OPT_UME_STORE_T_FLAGS, hf_lbmr_topt_ume_store_flags, ett_lbmr_topt_ume_store_flags, opt_ume_store_flags, ENC_BIG_ENDIAN);
3756                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ume_store_grp_idx, tvb, curr_offset + O_LBMR_TOPIC_OPT_UME_STORE_T_GRP_IDX, L_LBMR_TOPIC_OPT_UME_STORE_T_GRP_IDX, ENC_BIG_ENDIAN);
3757                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ume_store_store_tcp_port, tvb, curr_offset + O_LBMR_TOPIC_OPT_UME_STORE_T_STORE_TCP_PORT, L_LBMR_TOPIC_OPT_UME_STORE_T_STORE_TCP_PORT, ENC_BIG_ENDIAN);
3758                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ume_store_store_idx, tvb, curr_offset + O_LBMR_TOPIC_OPT_UME_STORE_T_STORE_IDX, L_LBMR_TOPIC_OPT_UME_STORE_T_STORE_IDX, ENC_BIG_ENDIAN);
3759                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ume_store_store_ip_addr, tvb, curr_offset + O_LBMR_TOPIC_OPT_UME_STORE_T_STORE_IP_ADDR, L_LBMR_TOPIC_OPT_UME_STORE_T_STORE_IP_ADDR, ENC_BIG_ENDIAN);
3760                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ume_store_src_reg_id, tvb, curr_offset + O_LBMR_TOPIC_OPT_UME_STORE_T_SRC_REG_ID, L_LBMR_TOPIC_OPT_UME_STORE_T_SRC_REG_ID, ENC_BIG_ENDIAN);
3761                 break;
3762             case LBMR_TOPIC_OPT_UME_STORE_GROUP_TYPE:
3763                 opt_item = proto_tree_add_item(otree, hf_lbmr_topt_ume_store_group, tvb, curr_offset + O_LBMR_TOPIC_OPT_T_TYPE, opt_len, ENC_NA);
3764                 opt_tree = proto_item_add_subtree(opt_item, ett_lbmr_topt_ume_store_group);
3765                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ume_store_group_type, tvb, curr_offset + O_LBMR_TOPIC_OPT_UME_STORE_GROUP_T_TYPE, L_LBMR_TOPIC_OPT_UME_STORE_GROUP_T_TYPE, ENC_BIG_ENDIAN);
3766                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ume_store_group_len, tvb, curr_offset + O_LBMR_TOPIC_OPT_UME_STORE_GROUP_T_LEN, L_LBMR_TOPIC_OPT_UME_STORE_GROUP_T_LEN, ENC_BIG_ENDIAN);
3767                 proto_tree_add_bitmask(opt_tree, tvb, curr_offset + O_LBMR_TOPIC_OPT_UME_STORE_GROUP_T_FLAGS, hf_lbmr_topt_ume_store_group_flags, ett_lbmr_topt_ume_store_group_flags, opt_ume_store_group_flags, ENC_BIG_ENDIAN);
3768                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ume_store_group_grp_idx, tvb, curr_offset + O_LBMR_TOPIC_OPT_UME_STORE_GROUP_T_GRP_IDX, L_LBMR_TOPIC_OPT_UME_STORE_GROUP_T_GRP_IDX, ENC_BIG_ENDIAN);
3769                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ume_store_group_grp_sz, tvb, curr_offset + O_LBMR_TOPIC_OPT_UME_STORE_GROUP_T_GRP_SZ, L_LBMR_TOPIC_OPT_UME_STORE_GROUP_T_GRP_SZ, ENC_BIG_ENDIAN);
3770                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ume_store_group_reserved, tvb, curr_offset + O_LBMR_TOPIC_OPT_UME_STORE_GROUP_T_RESERVED, L_LBMR_TOPIC_OPT_UME_STORE_GROUP_T_RESERVED, ENC_BIG_ENDIAN);
3771                 break;
3772             case LBMR_TOPIC_OPT_LATEJOIN_TYPE:
3773                 opt_item = proto_tree_add_item(otree, hf_lbmr_topt_latejoin, tvb, curr_offset + O_LBMR_TOPIC_OPT_T_TYPE, opt_len, ENC_NA);
3774                 opt_tree = proto_item_add_subtree(opt_item, ett_lbmr_topt_latejoin);
3775                 proto_tree_add_item(opt_tree, hf_lbmr_topt_latejoin_type, tvb, curr_offset + O_LBMR_TOPIC_OPT_LATEJOIN_T_TYPE, L_LBMR_TOPIC_OPT_LATEJOIN_T_TYPE, ENC_BIG_ENDIAN);
3776                 proto_tree_add_item(opt_tree, hf_lbmr_topt_latejoin_len, tvb, curr_offset + O_LBMR_TOPIC_OPT_LATEJOIN_T_LEN, L_LBMR_TOPIC_OPT_LATEJOIN_T_LEN, ENC_BIG_ENDIAN);
3777                 proto_tree_add_bitmask(opt_tree, tvb, curr_offset + O_LBMR_TOPIC_OPT_LATEJOIN_T_FLAGS, hf_lbmr_topt_latejoin_flags, ett_lbmr_topt_latejoin_flags, opt_latejoin_flags, ENC_BIG_ENDIAN);
3778                 proto_tree_add_item(opt_tree, hf_lbmr_topt_latejoin_src_tcp_port, tvb, curr_offset + O_LBMR_TOPIC_OPT_LATEJOIN_T_SRC_TCP_PORT, L_LBMR_TOPIC_OPT_LATEJOIN_T_SRC_TCP_PORT, ENC_BIG_ENDIAN);
3779                 proto_tree_add_item(opt_tree, hf_lbmr_topt_latejoin_reserved, tvb, curr_offset + O_LBMR_TOPIC_OPT_LATEJOIN_T_RESERVED, L_LBMR_TOPIC_OPT_LATEJOIN_T_RESERVED, ENC_BIG_ENDIAN);
3780                 proto_tree_add_item(opt_tree, hf_lbmr_topt_latejoin_src_ip_addr, tvb, curr_offset + O_LBMR_TOPIC_OPT_LATEJOIN_T_SRC_IP_ADDR, L_LBMR_TOPIC_OPT_LATEJOIN_T_SRC_IP_ADDR, ENC_BIG_ENDIAN);
3781                 proto_tree_add_item(opt_tree, hf_lbmr_topt_latejoin_transport_idx, tvb, curr_offset + O_LBMR_TOPIC_OPT_LATEJOIN_T_TRANSPORT_IDX, L_LBMR_TOPIC_OPT_LATEJOIN_T_TRANSPORT_IDX, ENC_BIG_ENDIAN);
3782                 proto_tree_add_item(opt_tree, hf_lbmr_topt_latejoin_high_seqnum, tvb, curr_offset + O_LBMR_TOPIC_OPT_LATEJOIN_T_HIGH_SEQNUM, L_LBMR_TOPIC_OPT_LATEJOIN_T_HIGH_SEQNUM, ENC_BIG_ENDIAN);
3783                 proto_tree_add_item(opt_tree, hf_lbmr_topt_latejoin_low_seqnum, tvb, curr_offset + O_LBMR_TOPIC_OPT_LATEJOIN_T_LOW_SEQNUM, L_LBMR_TOPIC_OPT_LATEJOIN_T_LOW_SEQNUM, ENC_BIG_ENDIAN);
3784                 break;
3785             case LBMR_TOPIC_OPT_UMQ_RCRIDX_TYPE:
3786                 opt_item = proto_tree_add_item(otree, hf_lbmr_topt_umq_rcridx, tvb, curr_offset + O_LBMR_TOPIC_OPT_T_TYPE, opt_len, ENC_NA);
3787                 opt_tree = proto_item_add_subtree(opt_item, ett_lbmr_topt_umq_rcridx);
3788                 proto_tree_add_item(opt_tree, hf_lbmr_topt_umq_rcridx_type, tvb, curr_offset + O_LBMR_TOPIC_OPT_UMQ_RCRIDX_T_TYPE, L_LBMR_TOPIC_OPT_UMQ_RCRIDX_T_TYPE, ENC_BIG_ENDIAN);
3789                 proto_tree_add_item(opt_tree, hf_lbmr_topt_umq_rcridx_len, tvb, curr_offset + O_LBMR_TOPIC_OPT_UMQ_RCRIDX_T_LEN, L_LBMR_TOPIC_OPT_UMQ_RCRIDX_T_LEN, ENC_BIG_ENDIAN);
3790                 proto_tree_add_bitmask(opt_tree, tvb, curr_offset + O_LBMR_TOPIC_OPT_UMQ_RCRIDX_T_FLAGS, hf_lbmr_topt_umq_rcridx_flags, ett_lbmr_topt_umq_rcridx_flags, opt_umq_rcridx_flags, ENC_BIG_ENDIAN);
3791                 proto_tree_add_item(opt_tree, hf_lbmr_topt_umq_rcridx_rcr_idx, tvb, curr_offset + O_LBMR_TOPIC_OPT_UMQ_RCRIDX_T_RCR_IDX, L_LBMR_TOPIC_OPT_UMQ_RCRIDX_T_RCR_IDX, ENC_BIG_ENDIAN);
3792                 break;
3793             case LBMR_TOPIC_OPT_UMQ_QINFO_TYPE:
3794                 opt_item = proto_tree_add_item(otree, hf_lbmr_topt_umq_qinfo, tvb, curr_offset + O_LBMR_TOPIC_OPT_T_TYPE, opt_len, ENC_NA);
3795                 opt_tree = proto_item_add_subtree(opt_item, ett_lbmr_topt_umq_qinfo);
3796                 proto_tree_add_item(opt_tree, hf_lbmr_topt_umq_qinfo_type, tvb, curr_offset + O_LBMR_TOPIC_OPT_T_TYPE, L_LBMR_TOPIC_OPT_T_TYPE, ENC_BIG_ENDIAN);
3797                 proto_tree_add_item(opt_tree, hf_lbmr_topt_umq_qinfo_len, tvb, curr_offset + O_LBMR_TOPIC_OPT_T_LEN, L_LBMR_TOPIC_OPT_T_LEN, ENC_BIG_ENDIAN);
3798                 qname_len = opt_len - L_LBMR_TOPIC_OPT_T;
3799                 proto_tree_add_bitmask(opt_tree, tvb, curr_offset + O_LBMR_TOPIC_OPT_T_FLAGS, hf_lbmr_topt_umq_qinfo_flags, ett_lbmr_topt_umq_qinfo_flags, opt_umq_qinfo_flags, ENC_BIG_ENDIAN);
3800                 proto_tree_add_item(opt_tree, hf_lbmr_topt_umq_qinfo_queue, tvb, curr_offset + L_LBMR_TOPIC_OPT_T, qname_len, ENC_ASCII|ENC_NA);
3801                 break;
3802             case LBMR_TOPIC_OPT_COST_TYPE:
3803                 opt_item = proto_tree_add_item(otree, hf_lbmr_topt_cost, tvb, curr_offset + O_LBMR_TOPIC_OPT_T_TYPE, opt_len, ENC_NA);
3804                 opt_tree = proto_item_add_subtree(opt_item, ett_lbmr_topt_cost);
3805                 proto_tree_add_item(opt_tree, hf_lbmr_topt_cost_type, tvb, curr_offset + O_LBMR_TOPIC_OPT_COST_T_TYPE, L_LBMR_TOPIC_OPT_COST_T_TYPE, ENC_BIG_ENDIAN);
3806                 proto_tree_add_item(opt_tree, hf_lbmr_topt_cost_len, tvb, curr_offset + O_LBMR_TOPIC_OPT_COST_T_LEN, L_LBMR_TOPIC_OPT_COST_T_LEN, ENC_BIG_ENDIAN);
3807                 proto_tree_add_bitmask(opt_tree, tvb, curr_offset + O_LBMR_TOPIC_OPT_COST_T_FLAGS, hf_lbmr_topt_cost_flags, ett_lbmr_topt_cost_flags, opt_cost_flags, ENC_BIG_ENDIAN);
3808                 proto_tree_add_item(opt_tree, hf_lbmr_topt_cost_hop_count, tvb, curr_offset + O_LBMR_TOPIC_OPT_COST_T_HOP_COUNT, L_LBMR_TOPIC_OPT_COST_T_HOP_COUNT, ENC_BIG_ENDIAN);
3809                 proto_tree_add_item(opt_tree, hf_lbmr_topt_cost_cost, tvb, curr_offset + O_LBMR_TOPIC_OPT_COST_T_COST, L_LBMR_TOPIC_OPT_COST_T_COST, ENC_BIG_ENDIAN);
3810                 break;
3811             case LBMR_TOPIC_OPT_OTID_TYPE:
3812                 opt_item = proto_tree_add_item(otree, hf_lbmr_topt_otid, tvb, curr_offset + O_LBMR_TOPIC_OPT_T_TYPE, opt_len, ENC_NA);
3813                 opt_tree = proto_item_add_subtree(opt_item, ett_lbmr_topt_otid);
3814                 proto_tree_add_item(opt_tree, hf_lbmr_topt_otid_type, tvb, curr_offset + O_LBMR_TOPIC_OPT_OTID_T_TYPE, L_LBMR_TOPIC_OPT_OTID_T_TYPE, ENC_BIG_ENDIAN);
3815                 proto_tree_add_item(opt_tree, hf_lbmr_topt_otid_len, tvb, curr_offset + O_LBMR_TOPIC_OPT_OTID_T_LEN, L_LBMR_TOPIC_OPT_OTID_T_LEN, ENC_BIG_ENDIAN);
3816                 proto_tree_add_bitmask(opt_tree, tvb, curr_offset + O_LBMR_TOPIC_OPT_OTID_T_FLAGS, hf_lbmr_topt_otid_flags, ett_lbmr_topt_otid_flags, opt_otid_flags, ENC_BIG_ENDIAN);
3817                 proto_tree_add_item(opt_tree, hf_lbmr_topt_otid_originating_transport, tvb, curr_offset + O_LBMR_TOPIC_OPT_OTID_T_ORIGINATING_TRANSPORT, L_LBMR_TOPIC_OPT_OTID_T_ORIGINATING_TRANSPORT, ENC_NA);
3818                 break;
3819             case LBMR_TOPIC_OPT_CTXINST_TYPE:
3820                 opt_item = proto_tree_add_item(otree, hf_lbmr_topt_ctxinst, tvb, curr_offset + O_LBMR_TOPIC_OPT_T_TYPE, opt_len, ENC_NA);
3821                 opt_tree = proto_item_add_subtree(opt_item, ett_lbmr_topt_ctxinst);
3822                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ctxinst_type, tvb, curr_offset + O_LBMR_TOPIC_OPT_CTXINST_T_TYPE, L_LBMR_TOPIC_OPT_CTXINST_T_TYPE, ENC_BIG_ENDIAN);
3823                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ctxinst_len, tvb, curr_offset + O_LBMR_TOPIC_OPT_CTXINST_T_LEN, L_LBMR_TOPIC_OPT_CTXINST_T_LEN, ENC_BIG_ENDIAN);
3824                 proto_tree_add_bitmask(opt_tree, tvb, curr_offset + O_LBMR_TOPIC_OPT_CTXINST_T_FLAGS, hf_lbmr_topt_ctxinst_flags, ett_lbmr_topt_ctxinst_flags, opt_ctxinst_flags, ENC_BIG_ENDIAN);
3825                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ctxinst_res, tvb, curr_offset + O_LBMR_TOPIC_OPT_CTXINST_T_RES, L_LBMR_TOPIC_OPT_CTXINST_T_RES, ENC_BIG_ENDIAN);
3826                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ctxinst_ctxinst, tvb, curr_offset + O_LBMR_TOPIC_OPT_CTXINST_T_CTXINST, L_LBMR_TOPIC_OPT_CTXINST_T_CTXINST, ENC_NA);
3827                 break;
3828             case LBMR_TOPIC_OPT_CTXINSTS_TYPE:
3829                 opt_item = proto_tree_add_item(otree, hf_lbmr_topt_ctxinsts, tvb, curr_offset + O_LBMR_TOPIC_OPT_T_TYPE, opt_len, ENC_NA);
3830                 opt_tree = proto_item_add_subtree(opt_item, ett_lbmr_topt_ctxinsts);
3831                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ctxinsts_type, tvb, curr_offset + O_LBMR_TOPIC_OPT_CTXINSTS_T_TYPE, L_LBMR_TOPIC_OPT_CTXINSTS_T_TYPE, ENC_BIG_ENDIAN);
3832                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ctxinsts_len, tvb, curr_offset + O_LBMR_TOPIC_OPT_CTXINSTS_T_LEN, L_LBMR_TOPIC_OPT_CTXINSTS_T_LEN, ENC_BIG_ENDIAN);
3833                 proto_tree_add_bitmask(opt_tree, tvb, curr_offset + O_LBMR_TOPIC_OPT_CTXINSTS_T_FLAGS, hf_lbmr_topt_ctxinsts_flags, ett_lbmr_topt_ctxinsts_flags, opt_ctxinsts_flags, ENC_BIG_ENDIAN);
3834                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ctxinsts_idx, tvb, curr_offset + O_LBMR_TOPIC_OPT_CTXINSTS_T_IDX, L_LBMR_TOPIC_OPT_CTXINSTS_T_IDX, ENC_BIG_ENDIAN);
3835                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ctxinsts_ctxinst, tvb, curr_offset + O_LBMR_TOPIC_OPT_CTXINSTS_T_CTXINST, L_LBMR_TOPIC_OPT_CTXINSTS_T_CTXINST, ENC_NA);
3836                 break;
3837             case LBMR_TOPIC_OPT_ULB_TYPE:
3838                 opt_item = proto_tree_add_item(otree, hf_lbmr_topt_ulb, tvb, curr_offset + O_LBMR_TOPIC_OPT_T_TYPE, opt_len, ENC_NA);
3839                 opt_tree = proto_item_add_subtree(opt_item, ett_lbmr_topt_ulb);
3840                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ulb_type, tvb, curr_offset + O_LBMR_TOPIC_OPT_ULB_T_TYPE, L_LBMR_TOPIC_OPT_ULB_T_TYPE, ENC_BIG_ENDIAN);
3841                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ulb_len, tvb, curr_offset + O_LBMR_TOPIC_OPT_ULB_T_LEN, L_LBMR_TOPIC_OPT_ULB_T_LEN, ENC_BIG_ENDIAN);
3842                 proto_tree_add_bitmask(opt_tree, tvb, curr_offset + O_LBMR_TOPIC_OPT_ULB_T_FLAGS, hf_lbmr_topt_ulb_flags, ett_lbmr_topt_ulb_flags, opt_ulb_flags, ENC_BIG_ENDIAN);
3843                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ulb_queue_id, tvb, curr_offset + O_LBMR_TOPIC_OPT_ULB_T_QUEUE_ID, L_LBMR_TOPIC_OPT_ULB_T_QUEUE_ID, ENC_BIG_ENDIAN);
3844                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ulb_regid, tvb, curr_offset + O_LBMR_TOPIC_OPT_ULB_T_REGID, L_LBMR_TOPIC_OPT_ULB_T_REGID, ENC_BIG_ENDIAN);
3845                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ulb_ulb_src_id, tvb, curr_offset + O_LBMR_TOPIC_OPT_ULB_T_ULB_SRC_ID, L_LBMR_TOPIC_OPT_ULB_T_ULB_SRC_ID, ENC_BIG_ENDIAN);
3846                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ulb_src_ip_addr, tvb, curr_offset + O_LBMR_TOPIC_OPT_ULB_T_SRC_IP_ADDR, L_LBMR_TOPIC_OPT_ULB_T_SRC_IP_ADDR, ENC_BIG_ENDIAN);
3847                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ulb_src_tcp_port, tvb, curr_offset + O_LBMR_TOPIC_OPT_ULB_T_SRC_TCP_PORT, L_LBMR_TOPIC_OPT_ULB_T_SRC_TCP_PORT, ENC_BIG_ENDIAN);
3848                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ulb_reserved, tvb, curr_offset + O_LBMR_TOPIC_OPT_ULB_T_RESERVED, L_LBMR_TOPIC_OPT_ULB_T_RESERVED, ENC_BIG_ENDIAN);
3849                 break;
3850             case LBMR_TOPIC_OPT_CTXINSTQ_TYPE:
3851                 opt_item = proto_tree_add_item(otree, hf_lbmr_topt_ctxinstq, tvb, curr_offset + O_LBMR_TOPIC_OPT_T_TYPE, opt_len, ENC_NA);
3852                 opt_tree = proto_item_add_subtree(opt_item, ett_lbmr_topt_ctxinstq);
3853                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ctxinstq_type, tvb, curr_offset + O_LBMR_TOPIC_OPT_CTXINSTQ_T_TYPE, L_LBMR_TOPIC_OPT_CTXINSTQ_T_TYPE, ENC_BIG_ENDIAN);
3854                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ctxinstq_len, tvb, curr_offset + O_LBMR_TOPIC_OPT_CTXINSTQ_T_LEN, L_LBMR_TOPIC_OPT_CTXINSTQ_T_LEN, ENC_BIG_ENDIAN);
3855                 proto_tree_add_bitmask(opt_tree, tvb, curr_offset + O_LBMR_TOPIC_OPT_CTXINSTQ_T_FLAGS, hf_lbmr_topt_ctxinstq_flags, ett_lbmr_topt_ctxinstq_flags, opt_ctxinstq_flags, ENC_BIG_ENDIAN);
3856                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ctxinstq_idx, tvb, curr_offset + O_LBMR_TOPIC_OPT_CTXINSTQ_T_IDX, L_LBMR_TOPIC_OPT_CTXINSTQ_T_IDX, ENC_BIG_ENDIAN);
3857                 proto_tree_add_item(opt_tree, hf_lbmr_topt_ctxinstq_ctxinst, tvb, curr_offset + O_LBMR_TOPIC_OPT_CTXINSTQ_T_CTXINST, L_LBMR_TOPIC_OPT_CTXINSTQ_T_CTXINST, ENC_NA);
3858                 break;
3859             case LBMR_TOPIC_OPT_DOMAIN_ID_TYPE:
3860                 opt_item = proto_tree_add_item(otree, hf_lbmr_topt_domain_id, tvb, curr_offset + O_LBMR_TOPIC_OPT_T_TYPE, opt_len, ENC_NA);
3861                 opt_tree = proto_item_add_subtree(opt_item, ett_lbmr_topt_domain_id);
3862                 proto_tree_add_item(opt_tree, hf_lbmr_topt_domain_id_type, tvb, curr_offset + O_LBMR_TOPIC_OPT_DOMAIN_ID_T_TYPE, L_LBMR_TOPIC_OPT_DOMAIN_ID_T_TYPE, ENC_BIG_ENDIAN);
3863                 proto_tree_add_item(opt_tree, hf_lbmr_topt_domain_id_len, tvb, curr_offset + O_LBMR_TOPIC_OPT_DOMAIN_ID_T_LEN, L_LBMR_TOPIC_OPT_DOMAIN_ID_T_LEN, ENC_BIG_ENDIAN);
3864                 proto_tree_add_bitmask(opt_tree, tvb, curr_offset + O_LBMR_TOPIC_OPT_DOMAIN_ID_T_FLAGS, hf_lbmr_topt_domain_id_flags, ett_lbmr_topt_domain_id_flags, opt_domain_id_flags, ENC_BIG_ENDIAN);
3865                 proto_tree_add_item(opt_tree, hf_lbmr_topt_domain_id_domain_id, tvb, curr_offset + O_LBMR_TOPIC_OPT_DOMAIN_ID_T_DOMAIN_ID, L_LBMR_TOPIC_OPT_DOMAIN_ID_T_DOMAIN_ID, ENC_BIG_ENDIAN);
3866                 break;
3867             case LBMR_TOPIC_OPT_EXFUNC_TYPE:
3868                 opt_item = proto_tree_add_item(otree, hf_lbmr_topt_exfunc, tvb, curr_offset + O_LBMR_TOPIC_OPT_T_TYPE, opt_len, ENC_NA);
3869                 opt_tree = proto_item_add_subtree(opt_item, ett_lbmr_topt_exfunc);
3870                 proto_tree_add_item(opt_tree, hf_lbmr_topt_exfunc_type, tvb, curr_offset + O_LBMR_TOPIC_OPT_EXFUNC_T_TYPE, L_LBMR_TOPIC_OPT_EXFUNC_T_TYPE, ENC_BIG_ENDIAN);
3871                 proto_tree_add_item(opt_tree, hf_lbmr_topt_exfunc_len, tvb, curr_offset + O_LBMR_TOPIC_OPT_EXFUNC_T_LEN, L_LBMR_TOPIC_OPT_EXFUNC_T_LEN, ENC_BIG_ENDIAN);
3872                 proto_tree_add_bitmask(opt_tree, tvb, curr_offset + O_LBMR_TOPIC_OPT_EXFUNC_T_FLAGS, hf_lbmr_topt_exfunc_flags, ett_lbmr_topt_exfunc_flags, opt_exfunc_flags, ENC_BIG_ENDIAN);
3873                 proto_tree_add_item(opt_tree, hf_lbmr_topt_exfunc_src_tcp_port, tvb, curr_offset + O_LBMR_TOPIC_OPT_EXFUNC_T_SRC_TCP_PORT, L_LBMR_TOPIC_OPT_EXFUNC_T_SRC_TCP_PORT, ENC_BIG_ENDIAN);
3874                 proto_tree_add_item(opt_tree, hf_lbmr_topt_exfunc_reserved, tvb, curr_offset + O_LBMR_TOPIC_OPT_EXFUNC_T_RESERVED, L_LBMR_TOPIC_OPT_EXFUNC_T_RESERVED, ENC_BIG_ENDIAN);
3875                 proto_tree_add_item(opt_tree, hf_lbmr_topt_exfunc_src_ip_addr, tvb, curr_offset + O_LBMR_TOPIC_OPT_EXFUNC_T_SRC_IP_ADDR, L_LBMR_TOPIC_OPT_EXFUNC_T_SRC_IP_ADDR, ENC_BIG_ENDIAN);
3876                 proto_tree_add_bitmask(opt_tree, tvb, curr_offset + O_LBMR_TOPIC_OPT_EXFUNC_T_FUNCTIONALITY_FLAGS, hf_lbmr_topt_exfunc_functionality_flags, ett_lbmr_topt_exfunc_functionality_flags, opt_exfunc_functionality_flags, ENC_BIG_ENDIAN);
3877                 break;
3878             default:
3879                 opt_item = proto_tree_add_item(otree, hf_lbmr_topt_unknown, tvb, curr_offset + O_LBMR_TOPIC_OPT_T_TYPE, opt_len, ENC_NA);
3880                 opt_tree = proto_item_add_subtree(opt_item, ett_lbmr_topt_unknown);
3881                 ei_item = proto_tree_add_item(opt_tree, hf_lbmr_topt_unknown_type, tvb, curr_offset + O_LBMR_TOPIC_OPT_T_TYPE, L_LBMR_TOPIC_OPT_T_TYPE, ENC_BIG_ENDIAN);
3882                 proto_tree_add_item(opt_tree, hf_lbmr_topt_unknown_len, tvb, curr_offset + O_LBMR_TOPIC_OPT_T_LEN, L_LBMR_TOPIC_OPT_T_LEN, ENC_BIG_ENDIAN);
3883                 proto_tree_add_item(opt_tree, hf_lbmr_topt_unknown_flags, tvb, curr_offset + O_LBMR_TOPIC_OPT_T_FLAGS, L_LBMR_TOPIC_OPT_T_FLAGS, ENC_BIG_ENDIAN);
3884                 if (((int) opt_len) > L_LBMR_TOPIC_OPT_T)
3885                 {
3886                     proto_tree_add_item(opt_tree, hf_lbmr_topt_unknown_data, tvb, curr_offset + L_LBMR_TOPIC_OPT_T, ((int) opt_len) - L_LBMR_TOPIC_OPT_T, ENC_NA);
3887                 }
3888                 expert_add_info_format(pinfo, ei_item, &ei_lbmr_analysis_invalid_value, "Unknown option 0x%02x", opt_type);
3889                 break;
3890         }
3891         len += opt_len;
3892         curr_offset += opt_len;
3893         opt_remaining_len -= opt_len;
3894     }
3895     return (opt_total_len);
3896 }
3897
3898 static int dissect_lbmr_tir_transport(tvbuff_t * tvb, int offset, lbm_uint8_t transport, lbm_uint8_t transport_len, const char * topic_name,
3899     guint32 topic_index, packet_info * pinfo, proto_tree * tree, lbmr_contents_t * contents, proto_item * transport_len_item)
3900 {
3901     int len = 0;
3902     guint64 channel;
3903     proto_item * channel_item = NULL;
3904     proto_item * ei_item = NULL;
3905
3906     switch (transport)
3907     {
3908         case LBMR_TRANSPORT_TCP:
3909             {
3910                 guint16 port = 0;
3911                 guint32 session_id = 0;
3912                 proto_item * tcp_item = NULL;
3913                 proto_tree * tcp_tree = NULL;
3914                 lbttcp_transport_t * lbttcp_transport = NULL;
3915
3916                 tcp_item = proto_tree_add_item(tree, hf_lbmr_tir_tcp, tvb, offset, (gint) transport_len, ENC_NA);
3917                 tcp_tree = proto_item_add_subtree(tcp_item, ett_lbmr_tir_tcp);
3918                 if ((transport_len != L_LBMR_TIR_TCP_T) && (transport_len != L_LBMR_TIR_TCP_WITH_SID_T))
3919                 {
3920                     expert_add_info_format(pinfo, transport_len_item, &ei_lbmr_analysis_length_incorrect, "Wrong transport length for LBMR TIR TCP info");
3921                     return (0);
3922                 }
3923                 if (transport_len == L_LBMR_TIR_TCP_WITH_SID_T)
3924                 {
3925                     session_id = tvb_get_ntohl(tvb, offset + O_LBMR_TIR_TCP_WITH_SID_T_SESSION_ID);
3926                     port = tvb_get_ntohs(tvb, offset + O_LBMR_TIR_TCP_WITH_SID_T_PORT);
3927                     proto_tree_add_item(tcp_tree, hf_lbmr_tir_tcp_ip, tvb, offset + O_LBMR_TIR_TCP_WITH_SID_T_IP, L_LBMR_TIR_TCP_WITH_SID_T_IP, ENC_BIG_ENDIAN);
3928                     proto_tree_add_item(tcp_tree, hf_lbmr_tir_tcp_session_id, tvb, offset + O_LBMR_TIR_TCP_WITH_SID_T_SESSION_ID, L_LBMR_TIR_TCP_WITH_SID_T_SESSION_ID, ENC_BIG_ENDIAN);
3929                     proto_tree_add_item(tcp_tree, hf_lbmr_tir_tcp_port, tvb, offset + O_LBMR_TIR_TCP_WITH_SID_T_PORT, L_LBMR_TIR_TCP_WITH_SID_T_PORT, ENC_BIG_ENDIAN);
3930                     len += L_LBMR_TIR_TCP_WITH_SID_T;
3931                 }
3932                 else
3933                 {
3934                     port = tvb_get_ntohs(tvb, offset + O_LBMR_TIR_TCP_T_PORT);
3935                     proto_tree_add_item(tcp_tree, hf_lbmr_tir_tcp_ip, tvb, offset + O_LBMR_TIR_TCP_T_IP, L_LBMR_TIR_TCP_T_IP, ENC_BIG_ENDIAN);
3936                     proto_tree_add_item(tcp_tree, hf_lbmr_tir_tcp_port, tvb, offset + O_LBMR_TIR_TCP_T_PORT, L_LBMR_TIR_TCP_T_PORT, ENC_BIG_ENDIAN);
3937                     session_id = 0;
3938                     len += L_LBMR_TIR_TCP_T;
3939                 }
3940                 lbttcp_transport = lbttcp_transport_add(&(pinfo->src), port, session_id, pinfo->fd->num);
3941                 channel = lbttcp_transport->channel;
3942                 add_contents_tir(contents, topic_name, lbttcp_transport_source_string(&(pinfo->src), port, session_id), topic_index);
3943             }
3944             break;
3945         case LBMR_TRANSPORT_LBTRM:
3946             {
3947                 guint16 src_ucast_port = 0;
3948                 guint16 udp_dest_port = 0;
3949                 guint32 session_id = 0;
3950                 proto_item * lbtrm_item = NULL;
3951                 proto_tree * lbtrm_tree = NULL;
3952                 lbtrm_transport_t * lbtrm_transport = NULL;
3953                 address multicast_group;
3954
3955                 lbtrm_item = proto_tree_add_item(tree, hf_lbmr_tir_lbtrm, tvb, offset, (gint)transport_len, ENC_NA);
3956                 lbtrm_tree = proto_item_add_subtree(lbtrm_item, ett_lbmr_tir_lbtrm);
3957                 TVB_SET_ADDRESS(&multicast_group, AT_IPv4, tvb, offset + O_LBMR_TIR_LBTRM_T_MCAST_ADDR, L_LBMR_TIR_LBTRM_T_MCAST_ADDR);
3958                 session_id = tvb_get_ntohl(tvb, offset + O_LBMR_TIR_LBTRM_T_SESSION_ID);
3959                 udp_dest_port = tvb_get_ntohs(tvb, offset + O_LBMR_TIR_LBTRM_T_UDP_DEST_PORT);
3960                 src_ucast_port = tvb_get_ntohs(tvb, offset + O_LBMR_TIR_LBTRM_T_SRC_UCAST_PORT);
3961                 proto_tree_add_item(lbtrm_tree, hf_lbmr_tir_lbtrm_src_addr, tvb, offset + O_LBMR_TIR_LBTRM_T_SRC_ADDR, L_LBMR_TIR_LBTRM_T_SRC_ADDR, ENC_BIG_ENDIAN);
3962                 proto_tree_add_item(lbtrm_tree, hf_lbmr_tir_lbtrm_mcast_addr, tvb, offset + O_LBMR_TIR_LBTRM_T_MCAST_ADDR, L_LBMR_TIR_LBTRM_T_MCAST_ADDR, ENC_BIG_ENDIAN);
3963                 proto_tree_add_item(lbtrm_tree, hf_lbmr_tir_lbtrm_session_id, tvb, offset + O_LBMR_TIR_LBTRM_T_SESSION_ID, L_LBMR_TIR_LBTRM_T_SESSION_ID, ENC_BIG_ENDIAN);
3964                 proto_tree_add_item(lbtrm_tree, hf_lbmr_tir_lbtrm_udp_dest_port, tvb, offset + O_LBMR_TIR_LBTRM_T_UDP_DEST_PORT, L_LBMR_TIR_LBTRM_T_UDP_DEST_PORT, ENC_BIG_ENDIAN);
3965                 proto_tree_add_item(lbtrm_tree, hf_lbmr_tir_lbtrm_src_ucast_port, tvb, offset + O_LBMR_TIR_LBTRM_T_SRC_UCAST_PORT, L_LBMR_TIR_LBTRM_T_SRC_UCAST_PORT, ENC_BIG_ENDIAN);
3966                 lbtrm_transport = lbtrm_transport_add(&(pinfo->src), src_ucast_port, session_id, &multicast_group, udp_dest_port, pinfo->fd->num);
3967                 channel = lbtrm_transport->channel;
3968                 add_contents_tir(contents, topic_name, lbtrm_transport_source_string(&(pinfo->src), src_ucast_port, session_id, &multicast_group, udp_dest_port), topic_index);
3969                 len += L_LBMR_TIR_LBTRM_T;
3970                 if (transport_len != L_LBMR_TIR_LBTRM_T)
3971                 {
3972                     expert_add_info_format(pinfo, transport_len_item, &ei_lbmr_analysis_length_incorrect, "Wrong transport length for LBMR TIR LBTRM info");
3973                 }
3974             }
3975             break;
3976         case LBMR_TRANSPORT_LBTRU:
3977             {
3978                 guint32 session_id;
3979                 guint16 port;
3980                 proto_item * lbtru_item = NULL;
3981                 proto_tree * lbtru_tree = NULL;
3982                 lbtru_transport_t * lbtru_transport = NULL;
3983
3984                 lbtru_item = proto_tree_add_item(tree, hf_lbmr_tir_lbtru, tvb, offset, (gint)transport_len, ENC_NA);
3985                 lbtru_tree = proto_item_add_subtree(lbtru_item, ett_lbmr_tir_lbtru);
3986                 if ((transport_len != L_LBMR_TIR_LBTRU_T) && (transport_len != L_LBMR_TIR_LBTRU_WITH_SID_T))
3987                 {
3988                     expert_add_info_format(pinfo, transport_len_item, &ei_lbmr_analysis_length_incorrect, "Wrong transport length for LBMR TIR LBTRU info");
3989                     return (0);
3990                 }
3991                 if (transport_len == L_LBMR_TIR_LBTRU_WITH_SID_T)
3992                 {
3993                     session_id = tvb_get_ntohl(tvb, offset + O_LBMR_TIR_LBTRU_WITH_SID_T_SESSION_ID);
3994                     port = tvb_get_ntohs(tvb, offset + O_LBMR_TIR_LBTRU_WITH_SID_T_PORT);
3995                     proto_tree_add_item(lbtru_tree, hf_lbmr_tir_lbtru_ip, tvb, offset + O_LBMR_TIR_LBTRU_WITH_SID_T_IP, L_LBMR_TIR_LBTRU_WITH_SID_T_IP, ENC_BIG_ENDIAN);
3996                     proto_tree_add_item(lbtru_tree, hf_lbmr_tir_lbtru_session_id, tvb, offset + O_LBMR_TIR_LBTRU_WITH_SID_T_SESSION_ID, L_LBMR_TIR_LBTRU_WITH_SID_T_SESSION_ID, ENC_BIG_ENDIAN);
3997                     proto_tree_add_item(lbtru_tree, hf_lbmr_tir_lbtru_port, tvb, offset + O_LBMR_TIR_LBTRU_WITH_SID_T_PORT, L_LBMR_TIR_LBTRU_WITH_SID_T_PORT, ENC_BIG_ENDIAN);
3998                     len += L_LBMR_TIR_LBTRU_WITH_SID_T;
3999                 }
4000                 else
4001                 {
4002                     session_id = 0;
4003                     port = tvb_get_ntohs(tvb, offset + O_LBMR_TIR_LBTRU_T_PORT);
4004                     proto_tree_add_item(lbtru_tree, hf_lbmr_tir_lbtru_ip, tvb, offset + O_LBMR_TIR_LBTRU_T_IP, L_LBMR_TIR_LBTRU_T_IP, ENC_BIG_ENDIAN);
4005                     proto_tree_add_item(lbtru_tree, hf_lbmr_tir_lbtru_port, tvb, offset + O_LBMR_TIR_LBTRU_T_PORT, L_LBMR_TIR_LBTRU_T_PORT, ENC_BIG_ENDIAN);
4006                     len += L_LBMR_TIR_LBTRU_T;
4007                 }
4008                 lbtru_transport = lbtru_transport_add(&(pinfo->src), port, session_id, pinfo->fd->num);
4009                 channel = lbtru_transport->channel;
4010                 add_contents_tir(contents, topic_name, lbtru_transport_source_string(&(pinfo->src), port, session_id), topic_index);
4011             }
4012             break;
4013         case LBMR_TRANSPORT_LBTIPC:
4014             {
4015                 guint32 host_id;
4016                 guint32 session_id;
4017                 guint16 xport_id;
4018                 proto_item * lbtipc_item = NULL;
4019                 proto_tree * lbtipc_tree = NULL;
4020                 lbtipc_transport_t * lbtipc_transport = NULL;
4021
4022                 lbtipc_item = proto_tree_add_item(tree, hf_lbmr_tir_lbtipc, tvb, offset, (gint)transport_len, ENC_NA);
4023                 lbtipc_tree = proto_item_add_subtree(lbtipc_item, ett_lbmr_tir_lbtipc);
4024                 if (transport_len != L_LBMR_TIR_LBTIPC_T)
4025                 {
4026                     expert_add_info_format(pinfo, transport_len_item, &ei_lbmr_analysis_length_incorrect, "Wrong transport length for LBMR TIR LBTIPC info");
4027                     return (0);
4028                 }
4029                 host_id = tvb_get_ntohl(tvb, offset + O_LBMR_TIR_LBTIPC_T_HOST_ID);
4030                 session_id = tvb_get_ntohl(tvb, offset + O_LBMR_TIR_LBTIPC_T_SESSION_ID);
4031                 xport_id = tvb_get_ntohs(tvb, offset + O_LBMR_TIR_LBTIPC_T_XPORT_ID);
4032                 proto_tree_add_item(lbtipc_tree, hf_lbmr_tir_lbtipc_host_id, tvb, offset + O_LBMR_TIR_LBTIPC_T_HOST_ID, L_LBMR_TIR_LBTIPC_T_HOST_ID, ENC_BIG_ENDIAN);
4033                 proto_tree_add_item(lbtipc_tree, hf_lbmr_tir_lbtipc_session_id, tvb, offset + O_LBMR_TIR_LBTIPC_T_SESSION_ID, L_LBMR_TIR_LBTIPC_T_SESSION_ID, ENC_BIG_ENDIAN);
4034                 proto_tree_add_item(lbtipc_tree, hf_lbmr_tir_lbtipc_xport_id, tvb, offset + O_LBMR_TIR_LBTIPC_T_XPORT_ID, L_LBMR_TIR_LBTIPC_T_XPORT_ID, ENC_BIG_ENDIAN);
4035                 lbtipc_transport = lbtipc_transport_add(host_id, session_id, xport_id);
4036                 channel = lbtipc_transport->channel;
4037                 add_contents_tir(contents, topic_name, lbtipc_transport_source_string(host_id, session_id, xport_id), topic_index);
4038                 len += L_LBMR_TIR_LBTIPC_T;
4039             }
4040             break;
4041         case LBMR_TRANSPORT_LBTRDMA:
4042             {
4043                 guint32 session_id;
4044                 guint16 port;
4045                 proto_item * lbtrdma_item = NULL;
4046                 proto_tree * lbtrdma_tree = NULL;
4047                 lbtrdma_transport_t * lbtrdma_transport = NULL;
4048                 address source_addr;
4049
4050                 lbtrdma_item = proto_tree_add_item(tree, hf_lbmr_tir_lbtrdma, tvb, offset, (gint)transport_len, ENC_NA);
4051                 lbtrdma_tree = proto_item_add_subtree(lbtrdma_item, ett_lbmr_tir_lbtrdma);
4052                 if (transport_len != L_LBMR_TIR_LBTRDMA_T)
4053                 {
4054                     expert_add_info_format(pinfo, transport_len_item, &ei_lbmr_analysis_length_incorrect, "Wrong transport length for LBMR TIR LBTRDMA info");
4055                     return (0);
4056                 }
4057                 TVB_SET_ADDRESS(&source_addr, AT_IPv4, tvb, offset + O_LBMR_TIR_LBTRDMA_T_IP, L_LBMR_TIR_LBTRDMA_T_IP);
4058                 session_id = tvb_get_ntohl(tvb, offset + O_LBMR_TIR_LBTRDMA_T_SESSION_ID);
4059                 port = tvb_get_ntohs(tvb, offset + O_LBMR_TIR_LBTRDMA_T_PORT);
4060                 proto_tree_add_item(lbtrdma_tree, hf_lbmr_tir_lbtrdma_ip, tvb, offset + O_LBMR_TIR_LBTRDMA_T_IP, L_LBMR_TIR_LBTRDMA_T_IP, ENC_BIG_ENDIAN);
4061                 proto_tree_add_item(lbtrdma_tree, hf_lbmr_tir_lbtrdma_session_id, tvb, offset + O_LBMR_TIR_LBTRDMA_T_SESSION_ID, L_LBMR_TIR_LBTRDMA_T_SESSION_ID, ENC_BIG_ENDIAN);
4062                 proto_tree_add_item(lbtrdma_tree, hf_lbmr_tir_lbtrdma_port, tvb, offset + O_LBMR_TIR_LBTRDMA_T_PORT, L_LBMR_TIR_LBTRDMA_T_PORT, ENC_BIG_ENDIAN);
4063                 lbtrdma_transport = lbtrdma_transport_add(&source_addr, port, session_id);
4064                 channel = lbtrdma_transport->channel;
4065                 add_contents_tir(contents, topic_name, lbtrdma_transport_source_string(&source_addr, port, session_id), topic_index);
4066                 len += L_LBMR_TIR_LBTRDMA_T;
4067             }
4068             break;
4069         case LBMR_TRANSPORT_LBTSMX:
4070             {
4071                 guint32 host_id;
4072                 guint32 session_id;
4073                 guint16 xport_id;
4074                 proto_item * lbtsmx_item = NULL;
4075                 proto_tree * lbtsmx_tree = NULL;
4076                 lbtsmx_transport_t * lbtsmx_transport = NULL;
4077
4078                 lbtsmx_item = proto_tree_add_item(tree, hf_lbmr_tir_lbtsmx, tvb, offset, (gint)transport_len, ENC_NA);
4079                 lbtsmx_tree = proto_item_add_subtree(lbtsmx_item, ett_lbmr_tir_lbtsmx);
4080                 if (transport_len != L_LBMR_TIR_LBTSMX_T)
4081                 {
4082                     expert_add_info_format(pinfo, transport_len_item, &ei_lbmr_analysis_length_incorrect, "Wrong transport length for LBMR TIR LBTSMX info");
4083                 }
4084                 host_id = tvb_get_ntohl(tvb, offset + O_LBMR_TIR_LBTSMX_T_HOST_ID);
4085                 session_id = tvb_get_ntohl(tvb, offset + O_LBMR_TIR_LBTSMX_T_SESSION_ID);
4086                 xport_id = tvb_get_ntohs(tvb, offset + O_LBMR_TIR_LBTSMX_T_XPORT_ID);
4087                 proto_tree_add_item(lbtsmx_tree, hf_lbmr_tir_lbtsmx_host_id, tvb, offset + O_LBMR_TIR_LBTSMX_T_HOST_ID, L_LBMR_TIR_LBTSMX_T_HOST_ID, ENC_BIG_ENDIAN);
4088                 proto_tree_add_item(lbtsmx_tree, hf_lbmr_tir_lbtsmx_session_id, tvb, offset + O_LBMR_TIR_LBTSMX_T_SESSION_ID, L_LBMR_TIR_LBTSMX_T_SESSION_ID, ENC_BIG_ENDIAN);
4089                 proto_tree_add_item(lbtsmx_tree, hf_lbmr_tir_lbtsmx_xport_id, tvb, offset + O_LBMR_TIR_LBTSMX_T_XPORT_ID, L_LBMR_TIR_LBTSMX_T_XPORT_ID, ENC_BIG_ENDIAN);
4090                 lbtsmx_transport = lbtsmx_transport_add(host_id, session_id, xport_id);
4091                 channel = lbtsmx_transport->channel;
4092                 add_contents_tir(contents, topic_name, lbtsmx_transport_source_string(host_id, session_id, xport_id), topic_index);
4093                 len += L_LBMR_TIR_LBTSMX_T;
4094             }
4095             break;
4096         default:
4097             ei_item = proto_tree_add_item(tree, hf_lbmr_tir_unknown_transport, tvb, offset, transport_len, ENC_NA);
4098             expert_add_info_format(pinfo, ei_item, &ei_lbmr_analysis_invalid_value, "Unknown LBMR TIR transport 0x%02x", transport);
4099             len = transport_len;
4100             channel = LBM_CHANNEL_NO_CHANNEL;
4101             break;
4102     }
4103     if (channel != LBM_CHANNEL_NO_CHANNEL)
4104     {
4105         lbm_topic_add(channel, topic_index, topic_name);
4106         channel_item = proto_tree_add_uint64(tree, hf_lbmr_tir_channel, tvb, 0, 0, channel);
4107         PROTO_ITEM_SET_GENERATED(channel_item);
4108     }
4109     return (len);
4110 }
4111
4112 static int dissect_lbmr_tir_entry(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, lbmr_contents_t * contents)
4113 {
4114     gint namelen = 0;
4115     gint reclen = 0;
4116     int dissect_len = 0;
4117     int tinfo_offset = 0;
4118     char * name = NULL;
4119     proto_item * ti = NULL;
4120     proto_tree * tinfo_tree = NULL;
4121     guint8 transport;
4122     guint8 tlen;
4123     guint16 ttl;
4124     guint32 idx;
4125     int curr_offset;
4126     proto_item * transport_len_item = NULL;
4127
4128     name = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &namelen, ENC_ASCII);
4129     reclen += namelen;
4130     curr_offset = offset + namelen;
4131     tinfo_offset = curr_offset;
4132     transport = tvb_get_guint8(tvb, curr_offset + O_LBMR_TIR_T_TRANSPORT);
4133     tlen = tvb_get_guint8(tvb, curr_offset + O_LBMR_TIR_T_TLEN);
4134     ttl = tvb_get_ntohs(tvb, curr_offset + O_LBMR_TIR_T_TTL);
4135     idx = tvb_get_ntohl(tvb, curr_offset + O_LBMR_TIR_T_INDEX);
4136     reclen += L_LBMR_TIR_T;
4137     curr_offset += L_LBMR_TIR_T;
4138
4139     ti = proto_tree_add_none_format(tree, hf_lbmr_tir, tvb, offset, reclen, "%s: %s, Length %u, Index %" G_GUINT32_FORMAT ", TTL %" G_GUINT16_FORMAT,
4140         name, val_to_str((transport & LBMR_TIR_TRANSPORT), lbmr_transport_type, "Unknown (0x%02x)"), tlen, idx, ttl);
4141     tinfo_tree = proto_item_add_subtree(ti, ett_lbmr_tir);
4142     proto_tree_add_item(tinfo_tree, hf_lbmr_tir_name, tvb, offset, namelen, ENC_ASCII|ENC_NA);
4143     proto_tree_add_item(tinfo_tree, hf_lbmr_tir_transport_opts, tvb, tinfo_offset + O_LBMR_TIR_T_TRANSPORT, L_LBMR_TIR_T_TRANSPORT, ENC_BIG_ENDIAN);
4144     proto_tree_add_item(tinfo_tree, hf_lbmr_tir_transport_type, tvb, tinfo_offset + O_LBMR_TIR_T_TRANSPORT, L_LBMR_TIR_T_TRANSPORT, ENC_BIG_ENDIAN);
4145     transport_len_item = proto_tree_add_item(tinfo_tree, hf_lbmr_tir_tlen, tvb, tinfo_offset + O_LBMR_TIR_T_TLEN, L_LBMR_TIR_T_TLEN, ENC_BIG_ENDIAN);
4146     proto_tree_add_item(tinfo_tree, hf_lbmr_tir_ttl, tvb, tinfo_offset + O_LBMR_TIR_T_TTL, L_LBMR_TIR_T_TTL, ENC_BIG_ENDIAN);
4147     proto_tree_add_item(tinfo_tree, hf_lbmr_tir_index, tvb, tinfo_offset + O_LBMR_TIR_T_INDEX, L_LBMR_TIR_T_INDEX, ENC_BIG_ENDIAN);
4148     if ((transport & LBMR_TIR_OPTIONS) != 0)
4149     {
4150         dissect_len = dissect_lbmr_tir_options(tvb, curr_offset, pinfo, tinfo_tree);
4151         reclen += dissect_len;
4152         curr_offset += dissect_len;
4153     }
4154     reclen += dissect_lbmr_tir_transport(tvb, curr_offset, (lbm_uint8_t)(transport & LBMR_TIR_TRANSPORT), tlen, name, idx, pinfo, tinfo_tree, contents, transport_len_item);
4155     proto_item_set_len(ti, reclen);
4156     return (reclen);
4157 }
4158
4159 static int dissect_lbmr_tirs(tvbuff_t * tvb, int offset, guint16 tir_count, packet_info * pinfo, proto_tree * tree,
4160     const char * name, lbmr_contents_t * contents)
4161 {
4162     int start_offset;
4163     int tir_len;
4164     proto_tree * tirs_tree = NULL;
4165     proto_item * ti = NULL;
4166     int len = 0;
4167
4168     start_offset = offset;
4169     ti = proto_tree_add_none_format(tree, hf_lbmr_tirs, tvb, start_offset, -1, "%s", name);
4170     tirs_tree = proto_item_add_subtree(ti, ett_lbmr_tirs);
4171     while (tir_count-- > 0)
4172     {
4173         tir_len = dissect_lbmr_tir_entry(tvb, offset, pinfo, tirs_tree, contents);
4174         offset += tir_len;
4175         len += tir_len;
4176     }
4177     proto_item_set_len(ti, len);
4178     return (len);
4179 }
4180
4181 /*----------------------------------------------------------------------------*/
4182 /* LBMR Queue Query Record dissection functions.                              */
4183 /*----------------------------------------------------------------------------*/
4184 static int dissect_lbmr_qqr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, lbmr_contents_t * contents)
4185 {
4186     gint namelen = 0;
4187     guint reclen = 0;
4188     char * name = NULL;
4189
4190     name = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &namelen, ENC_ASCII);
4191     reclen += namelen;
4192     add_contents_qqr(contents, name);
4193     proto_tree_add_item(tree, hf_lbmr_qqr_name, tvb, offset, namelen, ENC_ASCII|ENC_NA);
4194     return (reclen);
4195 }
4196
4197 static int dissect_lbmr_qqrs(tvbuff_t * tvb, int offset, guint8 qqr_count, packet_info * pinfo, proto_tree * tree, lbmr_contents_t * contents)
4198 {
4199     int start_offset;
4200     int qqr_len;
4201     proto_tree * qqrs_tree = NULL;
4202     proto_item * qqrs_ti = NULL;
4203     int total_len = 0;
4204
4205     start_offset = offset;
4206     qqrs_ti = proto_tree_add_item(tree, hf_lbmr_qqr, tvb, start_offset, -1, ENC_NA);
4207     qqrs_tree = proto_item_add_subtree(qqrs_ti, ett_lbmr_qqrs);
4208     while (qqr_count-- > 0)
4209     {
4210         qqr_len = dissect_lbmr_qqr(tvb, offset, pinfo, qqrs_tree, contents);
4211         total_len += qqr_len;
4212         offset += qqr_len;
4213     }
4214     proto_item_set_len(qqrs_ti, total_len);
4215     return (total_len);
4216 }
4217
4218 /*----------------------------------------------------------------------------*/
4219 /* LBMR Queue Information Record dissection functions.                        */
4220 /*----------------------------------------------------------------------------*/
4221 static int dissect_lbmr_qir_queue_blk(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, const char * queue_name,
4222     const char * topic_name, lbmr_contents_t * contents)
4223 {
4224     guint16 port = 0;
4225     proto_item * ti = NULL;
4226     proto_tree * blk_tree = NULL;
4227
4228     port = tvb_get_ntohs(tvb, offset + O_LBMR_QIR_QUEUE_BLK_T_PORT);
4229     ti = proto_tree_add_item(tree, hf_lbmr_qir_queue_blk, tvb, offset, L_LBMR_QIR_QUEUE_BLK_T, ENC_NA);
4230     blk_tree = proto_item_add_subtree(ti, ett_lbmr_qir_queue_blk);
4231     proto_tree_add_item(blk_tree, hf_lbmr_qir_queue_blk_ip, tvb, offset + O_LBMR_QIR_QUEUE_BLK_T_IP, L_LBMR_QIR_QUEUE_BLK_T_IP, ENC_BIG_ENDIAN);
4232     proto_tree_add_item(blk_tree, hf_lbmr_qir_queue_blk_port, tvb, offset + O_LBMR_QIR_QUEUE_BLK_T_PORT, L_LBMR_QIR_QUEUE_BLK_T_PORT, ENC_BIG_ENDIAN);
4233     proto_tree_add_item(blk_tree, hf_lbmr_qir_queue_blk_idx, tvb, offset + O_LBMR_QIR_QUEUE_BLK_T_IDX, L_LBMR_QIR_QUEUE_BLK_T_IDX, ENC_BIG_ENDIAN);
4234     proto_tree_add_item(blk_tree, hf_lbmr_qir_queue_blk_grp_idx, tvb, offset + O_LBMR_QIR_QUEUE_BLK_T_GRP_IDX, L_LBMR_QIR_QUEUE_BLK_T_GRP_IDX, ENC_BIG_ENDIAN);
4235     proto_tree_add_item(blk_tree, hf_lbmr_qir_queue_blk_reserved, tvb, offset + O_LBMR_QIR_QUEUE_BLK_T_RESERVED, L_LBMR_QIR_QUEUE_BLK_T_RESERVED, ENC_BIG_ENDIAN);
4236     add_contents_qir(contents, queue_name, topic_name, port);
4237     return ((int)L_LBMR_QIR_QUEUE_BLK_T);
4238 }
4239
4240 static int dissect_lbmr_qir_grp_blk(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, lbmr_contents_t * contents _U_)
4241 {
4242     proto_item * ti = NULL;
4243     proto_tree * blk_tree = NULL;
4244     guint16 idx = 0;
4245     guint16 sz = 0;
4246
4247     idx = tvb_get_ntohs(tvb, offset + O_LBMR_QIR_GRP_BLK_T_GRP_IDX);
4248     sz = tvb_get_ntohs(tvb, offset + O_LBMR_QIR_GRP_BLK_T_GRP_SZ);
4249     ti = proto_tree_add_none_format(tree, hf_lbmr_qir_grp_blk, tvb, offset, L_LBMR_QIR_GRP_BLK_T, "Group block, Index %" G_GUINT16_FORMAT ", Size %" G_GUINT16_FORMAT, idx, sz);
4250     blk_tree = proto_item_add_subtree(ti, ett_lbmr_qir_grp_blk);
4251     proto_tree_add_item(blk_tree, hf_lbmr_qir_grp_blk_grp_idx, tvb, offset + O_LBMR_QIR_GRP_BLK_T_GRP_IDX, L_LBMR_QIR_GRP_BLK_T_GRP_IDX, ENC_BIG_ENDIAN);
4252     proto_tree_add_item(blk_tree, hf_lbmr_qir_grp_blk_grp_sz, tvb, offset + O_LBMR_QIR_GRP_BLK_T_GRP_SZ, L_LBMR_QIR_GRP_BLK_T_GRP_SZ, ENC_BIG_ENDIAN);
4253     return ((int)L_LBMR_QIR_GRP_BLK_T);
4254 }
4255
4256 static int dissect_lbmr_qir_entry(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, lbmr_contents_t * contents)
4257 {
4258     gint qnamelen = 0;
4259     gint qnameoffset = 0;
4260     char * qname = NULL;
4261     gint tnamelen = 0;
4262     gint tnameoffset = 0;
4263     char * tname = NULL;
4264     gint reclen = 0;
4265     int curr_offset = 0;
4266     proto_item * qirti = NULL;
4267     proto_tree * qirtree = NULL;
4268     proto_item * grpti = NULL;
4269     proto_tree * grptree = NULL;
4270     int grplen = 0;
4271     proto_item * queueti = NULL;
4272     proto_item * queuetree = NULL;
4273     int queuelen = 0;
4274     guint32 queue_id = 0;
4275     guint16 grp_blks = 0;
4276     guint16 queue_blks = 0;
4277     guint16 have_options = 0;
4278     int optlen = 0;
4279
4280     /*
4281         queue name (null-terminated)
4282         topic name (null-terminated)
4283         lbmr_qir_t
4284         if qir.grp_blks & LBMR_QIR_OPTIONS
4285             parse options (normal topic options - though there shouldn't be any) can use dissect_lbmr_tir_options
4286         endif
4287         group blocks (lbmr_qir_grp_blk_t)
4288         queue blocks (lbmr_qir_queue_blk_t)
4289     */
4290     curr_offset = offset;
4291     qnameoffset = curr_offset;
4292     qname = tvb_get_stringz_enc(wmem_packet_scope(), tvb, qnameoffset, &qnamelen, ENC_ASCII);
4293     curr_offset += qnamelen;
4294     reclen += qnamelen;
4295     tnameoffset = curr_offset;
4296     tname = tvb_get_stringz_enc(wmem_packet_scope(), tvb, tnameoffset, &tnamelen, ENC_ASCII);
4297     curr_offset += tnamelen;
4298     reclen += tnamelen;
4299     queue_id = tvb_get_ntohl(tvb, curr_offset + O_LBMR_QIR_T_QUEUE_ID);
4300     have_options = tvb_get_ntohs(tvb, curr_offset + O_LBMR_QIR_T_GRP_BLKS);
4301     grp_blks = have_options & LBMR_QIR_GRP_BLOCKS_MASK;
4302     have_options &= LBMR_QIR_OPTIONS;
4303     queue_blks = tvb_get_ntohs(tvb, curr_offset + O_LBMR_QIR_T_QUEUE_BLKS);
4304     qirti = proto_tree_add_none_format(tree, hf_lbmr_qir, tvb, offset, reclen, "%s: %s, ID %" G_GUINT32_FORMAT, qname, tname, queue_id);
4305     qirtree = proto_item_add_subtree(qirti, ett_lbmr_qir);
4306     proto_tree_add_item(qirtree, hf_lbmr_qir_queue_name, tvb, qnameoffset, qnamelen, ENC_ASCII|ENC_NA);
4307     proto_tree_add_item(qirtree, hf_lbmr_qir_topic_name, tvb, tnameoffset, tnamelen, ENC_ASCII|ENC_NA);
4308     proto_tree_add_item(qirtree, hf_lbmr_qir_queue_id, tvb, curr_offset + O_LBMR_QIR_T_QUEUE_ID, L_LBMR_QIR_T_QUEUE_ID, ENC_BIG_ENDIAN);
4309     proto_tree_add_item(qirtree, hf_lbmr_qir_queue_ver, tvb, curr_offset + O_LBMR_QIR_T_QUEUE_VER, L_LBMR_QIR_T_QUEUE_VER, ENC_BIG_ENDIAN);
4310     proto_tree_add_item(qirtree, hf_lbmr_qir_queue_prev_ver, tvb, curr_offset + O_LBMR_QIR_T_QUEUE_PREV_VER, L_LBMR_QIR_T_QUEUE_PREV_VER, ENC_BIG_ENDIAN);
4311     proto_tree_add_item(qirtree, hf_lbmr_qir_option_flag, tvb, curr_offset + O_LBMR_QIR_T_GRP_BLKS, L_LBMR_QIR_T_GRP_BLKS, ENC_BIG_ENDIAN);
4312     proto_tree_add_item(qirtree, hf_lbmr_qir_grp_blks, tvb, curr_offset + O_LBMR_QIR_T_GRP_BLKS, L_LBMR_QIR_T_GRP_BLKS, ENC_BIG_ENDIAN);
4313     proto_tree_add_item(qirtree, hf_lbmr_qir_queue_blks, tvb, curr_offset + O_LBMR_QIR_T_QUEUE_BLKS, L_LBMR_QIR_T_QUEUE_BLKS, ENC_BIG_ENDIAN);
4314     curr_offset += L_LBMR_QIR_T;
4315     reclen += L_LBMR_QIR_T;
4316     if (have_options)
4317     {
4318         optlen = dissect_lbmr_tir_options(tvb, curr_offset, pinfo, tree);
4319         curr_offset += optlen;
4320         reclen += optlen;
4321     }
4322     if (grp_blks > 0)
4323     {
4324         grpti = proto_tree_add_item(qirtree, hf_lbmr_qir_grps, tvb, curr_offset, 1, ENC_NA);
4325         grptree = proto_item_add_subtree(grpti, ett_lbmr_qir_grp);
4326         grplen = 0;
4327         while (grp_blks-- > 0)
4328         {
4329             optlen = dissect_lbmr_qir_grp_blk(tvb, curr_offset, pinfo, grptree, contents);
4330             curr_offset += optlen;
4331             reclen += optlen;
4332             grplen += optlen;
4333         }
4334         proto_item_set_len(grpti, grplen);
4335     }
4336     if (queue_blks > 0)
4337     {
4338         queueti = proto_tree_add_item(qirtree, hf_lbmr_qir_queues, tvb, curr_offset, 1, ENC_NA);
4339         queuetree = proto_item_add_subtree(queueti, ett_lbmr_qir_queue);
4340         queuelen = 0;
4341         while (queue_blks-- > 0)
4342         {
4343             optlen = dissect_lbmr_qir_queue_blk(tvb, curr_offset, pinfo, queuetree, qname, tname, contents);
4344             curr_offset += optlen;
4345             reclen += optlen;
4346             queuelen += optlen;
4347         }
4348         proto_item_set_len(queueti, queuelen);
4349     }
4350     proto_item_set_len(qirti, reclen);
4351     return (reclen);
4352 }
4353
4354 static int dissect_lbmr_qirs(tvbuff_t * tvb, int offset, guint16 qirs, packet_info * pinfo, proto_tree * tree, lbmr_contents_t * contents)
4355 {
4356     int start_offset;
4357     int qir_len;
4358     proto_tree * qirs_tree = NULL;
4359     proto_item * qirs_ti = NULL;
4360     int len = 0;
4361
4362     start_offset = offset;
4363     qirs_ti = proto_tree_add_item(tree, hf_lbmr_qirs, tvb, start_offset, -1, ENC_NA);
4364     qirs_tree = proto_item_add_subtree(qirs_ti, ett_lbmr_qirs);
4365     while (qirs-- > 0)
4366     {
4367         qir_len = dissect_lbmr_qir_entry(tvb, offset, pinfo, qirs_tree, contents);
4368         len += qir_len;
4369         offset += qir_len;
4370     }
4371     proto_item_set_len(qirs_ti, len);
4372     return (len);
4373 }
4374
4375 /*----------------------------------------------------------------------------*/
4376 /* LBMR Proxy Source Election Record dissection functions.                    */
4377 /*----------------------------------------------------------------------------*/
4378 static int dissect_lbmr_pser(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree)
4379 {
4380     int hdr_len = 0;
4381     int len = 0;
4382     int topic_len = 0;
4383     static const int * flags[] =
4384     {
4385         &hf_lbmr_pser_flags_option,
4386         NULL
4387     };
4388     int curr_offset = offset;
4389     guint16 flags_val = 0;
4390
4391     hdr_len = (int)tvb_get_ntohs(tvb, curr_offset + O_LBMR_PSER_T_LEN);
4392     flags_val = tvb_get_ntohs(tvb, curr_offset + O_LBMR_PSER_T_FLAGS);
4393     topic_len = hdr_len - L_LBMR_PSER_T;
4394     proto_tree_add_item(tree, hf_lbmr_pser_dep_type, tvb, offset + O_LBMR_PSER_T_DEP_TYPE, L_LBMR_PSER_T_DEP_TYPE, ENC_BIG_ENDIAN);
4395     proto_tree_add_item(tree, hf_lbmr_pser_len, tvb, offset + O_LBMR_PSER_T_LEN, L_LBMR_PSER_T_LEN, ENC_BIG_ENDIAN);
4396     proto_tree_add_bitmask(tree, tvb, offset + O_LBMR_PSER_T_FLAGS, hf_lbmr_pser_flags, ett_lbmr_pser_flags, flags, ENC_BIG_ENDIAN);
4397     proto_tree_add_item(tree, hf_lbmr_pser_source_ip, tvb, offset + O_LBMR_PSER_T_SOURCE_IP, L_LBMR_PSER_T_SOURCE_IP, ENC_BIG_ENDIAN);
4398     proto_tree_add_item(tree, hf_lbmr_pser_store_ip, tvb, offset + O_LBMR_PSER_T_STORE_IP, L_LBMR_PSER_T_STORE_IP, ENC_BIG_ENDIAN);
4399     proto_tree_add_item(tree, hf_lbmr_pser_transport_idx, tvb, offset + O_LBMR_PSER_T_TRANSPORT_IDX, L_LBMR_PSER_T_TRANSPORT_IDX, ENC_BIG_ENDIAN);
4400     proto_tree_add_item(tree, hf_lbmr_pser_topic_idx, tvb, offset + O_LBMR_PSER_T_TOPIC_IDX, L_LBMR_PSER_T_TOPIC_IDX, ENC_BIG_ENDIAN);
4401     proto_tree_add_item(tree, hf_lbmr_pser_source_port, tvb, offset + O_LBMR_PSER_T_SOURCE_PORT, L_LBMR_PSER_T_SOURCE_PORT, ENC_BIG_ENDIAN);
4402     proto_tree_add_item(tree, hf_lbmr_pser_store_port, tvb, offset + O_LBMR_PSER_T_STORE_PORT, L_LBMR_PSER_T_STORE_PORT, ENC_BIG_ENDIAN);
4403     proto_tree_add_item(tree, hf_lbmr_pser_topic, tvb, offset + O_LBMR_PSER_T_TOPIC, topic_len, ENC_ASCII|ENC_NA);
4404     curr_offset += hdr_len;
4405     len = hdr_len;
4406     if ((flags_val & LBMR_PSER_OPT_FLAG) != 0)
4407     {
4408         proto_tree * opts_tree = NULL;
4409         proto_item * opts_item = NULL;
4410         proto_tree * optlen_tree = NULL;
4411         proto_tree * optlen_item = NULL;
4412         guint16 opt_len = 0;
4413
4414         opt_len = tvb_get_ntohs(tvb, curr_offset + O_LBMR_PSER_OPTLEN_T_OPTLEN);
4415         opts_item = proto_tree_add_item(tree, hf_lbmr_pser_opts, tvb, curr_offset, -1, ENC_NA);
4416         opts_tree = proto_item_add_subtree(opts_item, ett_lbmr_pser_opts);
4417         optlen_item = proto_tree_add_item(opts_tree, hf_lbmr_pser_optlen, tvb, curr_offset, L_LBMR_PSER_OPTLEN_T, ENC_NA);
4418         optlen_tree = proto_item_add_subtree(optlen_item, ett_lbmr_pser_opt_len);
4419         proto_tree_add_item(optlen_tree, hf_lbmr_pser_optlen_type, tvb, curr_offset + O_LBMR_PSER_OPTLEN_T_TYPE, L_LBMR_PSER_OPTLEN_T_TYPE, ENC_BIG_ENDIAN);
4420         proto_tree_add_item(optlen_tree, hf_lbmr_pser_optlen_optlen, tvb, curr_offset + O_LBMR_PSER_OPTLEN_T_OPTLEN, L_LBMR_PSER_OPTLEN_T_OPTLEN, ENC_BIG_ENDIAN);
4421         proto_item_set_len(opts_item, opt_len);
4422         len += L_LBMR_PSER_OPTLEN_T;
4423         curr_offset += L_LBMR_PSER_OPTLEN_T;
4424         opt_len -= L_LBMR_PSER_OPTLEN_T;
4425         while (opt_len > 0)
4426         {
4427             proto_tree * ctxinst_tree = NULL;
4428             proto_item * ctxinst_item = NULL;
4429             guint8 opt_type = tvb_get_guint8(tvb, curr_offset + O_LBMR_PSER_OPT_HDR_T_TYPE);
4430             guint8 option_len = tvb_get_guint8(tvb, curr_offset + O_LBMR_PSER_OPT_HDR_T_LEN);
4431
4432             switch (opt_type)
4433             {
4434                 case LBMR_PSER_OPT_SRC_CTXINST_TYPE:
4435                 case LBMR_PSER_OPT_STORE_CTXINST_TYPE:
4436                     ctxinst_item = proto_tree_add_item(opts_tree, hf_lbmr_pser_opt_ctxinst, tvb, curr_offset, L_LBMR_PSER_OPT_CTXINST_T, ENC_NA);
4437                     ctxinst_tree = proto_item_add_subtree(ctxinst_item, ett_lbmr_pser_opt_ctxinst);
4438                     proto_tree_add_item(ctxinst_tree, hf_lbmr_pser_opt_ctxinst_len, tvb, curr_offset + O_LBMR_PSER_OPT_CTXINST_T_LEN, L_LBMR_PSER_OPT_CTXINST_T_LEN, ENC_BIG_ENDIAN);
4439                     proto_tree_add_item(ctxinst_tree, hf_lbmr_pser_opt_ctxinst_type, tvb, curr_offset + O_LBMR_PSER_OPT_CTXINST_T_TYPE, L_LBMR_PSER_OPT_CTXINST_T_TYPE, ENC_BIG_ENDIAN);
4440                     proto_tree_add_item(ctxinst_tree, hf_lbmr_pser_opt_ctxinst_ctxinst, tvb, curr_offset + O_LBMR_PSER_OPT_CTXINST_T_CTXINST, L_LBMR_PSER_OPT_CTXINST_T_CTXINST, ENC_NA);
4441                     len += L_LBMR_PSER_OPT_CTXINST_T;
4442                     curr_offset += L_LBMR_PSER_OPT_CTXINST_T;
4443                     opt_len -= L_LBMR_PSER_OPT_CTXINST_T;
4444                     break;
4445                 default:
4446                     len += option_len;
4447                     curr_offset += option_len;
4448                     opt_len -= option_len;
4449                     expert_add_info_format(pinfo, NULL, &ei_lbmr_analysis_invalid_value, "Unknown LBMR PSER option 0x%02x", opt_type);
4450                     if (option_len == 0) {
4451                         return (len);
4452                     }
4453                     break;
4454             }
4455         }
4456     }
4457     return (len);
4458 }
4459
4460 /*----------------------------------------------------------------------------*/
4461 /* LBMR Queue Management dissection functions.                                */
4462 /*----------------------------------------------------------------------------*/
4463 int lbmr_dissect_umq_qmgmt(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree)
4464 {
4465     guint8 pckt_type = 0;
4466     int curr_offset = 0;
4467     guint16 dep16;
4468     guint16 idx;
4469     guint8 flags_val = 0;
4470     int len_dissected = 0;
4471     static const int * flags[] =
4472     {
4473         &hf_qmgmt_flags_i_flag,
4474         &hf_qmgmt_flags_n_flag,
4475         NULL
4476     };
4477     static const int * il_flags[] =
4478     {
4479         &hf_qmgmt_flags_i_flag,
4480         &hf_qmgmt_flags_n_flag,
4481         &hf_qmgmt_flags_il_l_flag,
4482         &hf_qmgmt_flags_il_k_flag,
4483         NULL
4484     };
4485
4486     flags_val = tvb_get_guint8(tvb, offset + O_UMQ_QMGMT_HDR_T_FLAGS);
4487     pckt_type = tvb_get_guint8(tvb, offset + O_UMQ_QMGMT_HDR_T_PCKT_TYPE);
4488     dep16 = tvb_get_ntohs(tvb, offset + O_UMQ_QMGMT_HDR_T_PCKT_TYPE_DEP16);
4489     if (pckt_type == UMQ_QMGMT_HDR_PCKT_TYPE_IL)
4490     {
4491         proto_tree_add_bitmask(tree, tvb, offset + O_UMQ_QMGMT_HDR_T_FLAGS, hf_qmgmt_flags, ett_qmgmt_flags, il_flags, ENC_BIG_ENDIAN);
4492     }
4493     else
4494     {
4495         proto_tree_add_bitmask(tree, tvb, offset + O_UMQ_QMGMT_HDR_T_FLAGS, hf_qmgmt_flags, ett_qmgmt_flags, flags, ENC_BIG_ENDIAN);
4496     }
4497     proto_tree_add_item(tree, hf_qmgmt_pckt_type, tvb, offset + O_UMQ_QMGMT_HDR_T_PCKT_TYPE, L_UMQ_QMGMT_HDR_T_PCKT_TYPE, ENC_BIG_ENDIAN);
4498     proto_tree_add_item(tree, hf_qmgmt_cfgsig, tvb, offset + O_UMQ_QMGMT_HDR_T_CFGSIG, L_UMQ_QMGMT_HDR_T_CFGSIG, ENC_NA);
4499     proto_tree_add_item(tree, hf_qmgmt_queue_id, tvb, offset + O_UMQ_QMGMT_HDR_T_QUEUE_ID, L_UMQ_QMGMT_HDR_T_QUEUE_ID, ENC_BIG_ENDIAN);
4500     proto_tree_add_item(tree, hf_qmgmt_queue_ver, tvb, offset + O_UMQ_QMGMT_HDR_T_QUEUE_VER, L_UMQ_QMGMT_HDR_T_QUEUE_VER, ENC_BIG_ENDIAN);
4501     proto_tree_add_item(tree, hf_qmgmt_ip, tvb, offset + O_UMQ_QMGMT_HDR_T_IP, L_UMQ_QMGMT_HDR_T_IP, ENC_BIG_ENDIAN);
4502     proto_tree_add_item(tree, hf_qmgmt_port, tvb, offset + O_UMQ_QMGMT_HDR_T_PORT, L_UMQ_QMGMT_HDR_T_PORT, ENC_BIG_ENDIAN);
4503     proto_tree_add_item(tree, hf_qmgmt_inst_idx, tvb, offset + O_UMQ_QMGMT_HDR_T_INST_IDX, L_UMQ_QMGMT_HDR_T_INST_IDX, ENC_BIG_ENDIAN);
4504     proto_tree_add_item(tree, hf_qmgmt_grp_idx, tvb, offset + O_UMQ_QMGMT_HDR_T_GRP_IDX, L_UMQ_QMGMT_HDR_T_GRP_IDX, ENC_BIG_ENDIAN);
4505     switch (pckt_type)
4506     {
4507         case UMQ_QMGMT_HDR_PCKT_TYPE_IL:
4508             proto_tree_add_item(tree, hf_qmgmt_il_num_insts, tvb, offset + O_UMQ_QMGMT_HDR_T_PCKT_TYPE_DEP16, L_UMQ_QMGMT_HDR_T_PCKT_TYPE_DEP16, ENC_BIG_ENDIAN);
4509             break;
4510         case UMQ_QMGMT_HDR_PCKT_TYPE_JREJ:
4511             proto_tree_add_item(tree, hf_qmgmt_jrej_code, tvb, offset + O_UMQ_QMGMT_HDR_T_PCKT_TYPE_DEP16, L_UMQ_QMGMT_HDR_T_PCKT_TYPE_DEP16, ENC_BIG_ENDIAN);
4512             break;
4513         case UMQ_QMGMT_HDR_PCKT_TYPE_EV:
4514             proto_tree_add_item(tree, hf_qmgmt_ev_bias, tvb, offset + O_UMQ_QMGMT_HDR_T_PCKT_TYPE_DEP16, L_UMQ_QMGMT_HDR_T_PCKT_TYPE_DEP16, ENC_BIG_ENDIAN);
4515             break;
4516         default:
4517             proto_tree_add_item(tree, hf_qmgmt_pckt_type_dep16, tvb, offset + O_UMQ_QMGMT_HDR_T_PCKT_TYPE_DEP16, L_UMQ_QMGMT_HDR_T_PCKT_TYPE_DEP16, ENC_BIG_ENDIAN);
4518             break;
4519     }
4520     len_dissected = L_UMQ_QMGMT_HDR_T;
4521     curr_offset = offset + L_UMQ_QMGMT_HDR_T;
4522     switch (pckt_type)
4523     {
4524         case UMQ_QMGMT_HDR_PCKT_TYPE_IL:
4525             {
4526                 proto_item * il_subtree_item = NULL;
4527                 proto_tree * il_subtree = NULL;
4528                 static const int * il_inst_flags[] =
4529                 {
4530                     &hf_qmgmt_il_inst_flags_m_flag,
4531                     &hf_qmgmt_il_inst_flags_q_flag,
4532                     &hf_qmgmt_il_inst_flags_p_flag,
4533                     NULL
4534                 };
4535
4536                 il_subtree_item = proto_tree_add_item(tree, hf_qmgmt_il, tvb, curr_offset, L_UMQ_QMGMT_IL_HDR_T, ENC_NA);
4537                 il_subtree = proto_item_add_subtree(il_subtree_item, ett_qmgmt_il);
4538                 proto_tree_add_item(il_subtree, hf_qmgmt_il_highest_rcr_tsp, tvb, curr_offset + O_UMQ_QMGMT_IL_HDR_T_HIGHEST_RCR_TSP, L_UMQ_QMGMT_IL_HDR_T_HIGHEST_RCR_TSP, ENC_BIG_ENDIAN);
4539                 len_dissected += L_UMQ_QMGMT_IL_HDR_T;
4540                 curr_offset += L_UMQ_QMGMT_IL_HDR_T;
4541                 for (idx = 0; idx < dep16; ++idx)
4542                 {
4543                     proto_item * il_inst_subtree_item = NULL;
4544                     proto_tree * il_inst_subtree = NULL;
4545
4546                     il_inst_subtree_item = proto_tree_add_item(tree, hf_qmgmt_il_inst, tvb, curr_offset, L_UMQ_QMGMT_IL_INST_HDR_T, ENC_NA);
4547                     il_inst_subtree = proto_item_add_subtree(il_inst_subtree_item, ett_qmgmt_il_inst);
4548                     proto_tree_add_item(il_inst_subtree, hf_qmgmt_il_inst_ip, tvb, curr_offset + O_UMQ_QMGMT_IL_INST_HDR_T_IP, L_UMQ_QMGMT_IL_INST_HDR_T_IP, ENC_BIG_ENDIAN);
4549                     proto_tree_add_item(il_inst_subtree, hf_qmgmt_il_inst_port, tvb, curr_offset + O_UMQ_QMGMT_IL_INST_HDR_T_PORT, L_UMQ_QMGMT_IL_INST_HDR_T_PORT, ENC_BIG_ENDIAN);
4550                     proto_tree_add_item(il_inst_subtree, hf_qmgmt_il_inst_inst_idx, tvb, curr_offset + O_UMQ_QMGMT_IL_INST_HDR_T_INST_IDX, L_UMQ_QMGMT_IL_INST_HDR_T_INST_IDX, ENC_BIG_ENDIAN);
4551                     proto_tree_add_item(il_inst_subtree, hf_qmgmt_il_inst_grp_idx, tvb, curr_offset + O_UMQ_QMGMT_IL_INST_HDR_T_GRP_IDX, L_UMQ_QMGMT_IL_INST_HDR_T_GRP_IDX, ENC_BIG_ENDIAN);
4552                     proto_tree_add_bitmask(il_inst_subtree, tvb, curr_offset + O_UMQ_QMGMT_IL_INST_HDR_T_FLAGS, hf_qmgmt_il_inst_flags, ett_qmgmt_il_inst_flags, il_inst_flags, ENC_BIG_ENDIAN);
4553                     len_dissected += L_UMQ_QMGMT_IL_INST_HDR_T;
4554                     curr_offset += L_UMQ_QMGMT_IL_INST_HDR_T;
4555                 }
4556             }
4557             break;
4558         case UMQ_QMGMT_HDR_PCKT_TYPE_JR:
4559             /* Nothing to do */
4560             break;
4561         case UMQ_QMGMT_HDR_PCKT_TYPE_JREJ:
4562             /* Nothing to do */
4563             break;
4564         case UMQ_QMGMT_HDR_PCKT_TYPE_IKA:
4565             /* Nothing to do */
4566             break;
4567         case UMQ_QMGMT_HDR_PCKT_TYPE_EC:
4568             {
4569                 proto_item * ec_subtree_item = NULL;
4570                 proto_tree * ec_subtree = NULL;
4571
4572                 ec_subtree_item = proto_tree_add_item(tree, hf_qmgmt_ec, tvb, curr_offset, L_UMQ_QMGMT_EC_HDR_T, ENC_NA);
4573                 ec_subtree = proto_item_add_subtree(ec_subtree_item, ett_qmgmt_ec);
4574                 proto_tree_add_item(ec_subtree, hf_qmgmt_ec_queue_new_ver, tvb, curr_offset + O_UMQ_QMGMT_EC_HDR_T_QUEUE_NEW_VER, L_UMQ_QMGMT_EC_HDR_T_QUEUE_NEW_VER, ENC_BIG_ENDIAN);
4575                 len_dissected += L_UMQ_QMGMT_EC_HDR_T;
4576                 curr_offset += L_UMQ_QMGMT_EC_HDR_T;
4577             }
4578             break;
4579         case UMQ_QMGMT_HDR_PCKT_TYPE_EV:
4580             {
4581                 proto_item * ev_subtree_item = NULL;
4582                 proto_tree * ev_subtree = NULL;
4583
4584                 ev_subtree_item = proto_tree_add_item(tree, hf_qmgmt_ev, tvb, curr_offset, L_UMQ_QMGMT_EV_HDR_T, ENC_NA);
4585                 ev_subtree = proto_item_add_subtree(ev_subtree_item, ett_qmgmt_ev);
4586                 proto_tree_add_item(ev_subtree, hf_qmgmt_ev_highest_rcr_tsp, tvb, curr_offset + O_UMQ_QMGMT_EV_HDR_T_HIGHEST_RCR_TSP, L_UMQ_QMGMT_EV_HDR_T_HIGHEST_RCR_TSP, ENC_BIG_ENDIAN);
4587                 proto_tree_add_item(ev_subtree, hf_qmgmt_ev_age, tvb, curr_offset + O_UMQ_QMGMT_EV_HDR_T_AGE, L_UMQ_QMGMT_EV_HDR_T_AGE, ENC_BIG_ENDIAN);
4588                 len_dissected += L_UMQ_QMGMT_EV_HDR_T;
4589                 curr_offset += L_UMQ_QMGMT_EV_HDR_T;
4590             }
4591             break;
4592         case UMQ_QMGMT_HDR_PCKT_TYPE_CNIL:
4593             /* Nothing to do */
4594             break;
4595         case UMQ_QMGMT_HDR_PCKT_TYPE_QRO:
4596             {
4597                 proto_item * qro_subtree_item = NULL;
4598                 proto_tree * qro_subtree = NULL;
4599
4600                 qro_subtree_item = proto_tree_add_item(tree, hf_qmgmt_qro, tvb, curr_offset, L_UMQ_QMGMT_QRO_HDR_T, ENC_NA);
4601                 qro_subtree = proto_item_add_subtree(qro_subtree_item, ett_qmgmt_qro);
4602                 proto_tree_add_item(qro_subtree, hf_qmgmt_qro_highest_rcr_tsp, tvb, curr_offset + O_UMQ_QMGMT_QRO_HDR_T_HIGHEST_RCR_TSP, L_UMQ_QMGMT_QRO_HDR_T_HIGHEST_RCR_TSP, ENC_BIG_ENDIAN);
4603                 len_dissected += L_UMQ_QMGMT_QRO_HDR_T;
4604                 curr_offset += L_UMQ_QMGMT_QRO_HDR_T;
4605             }
4606             break;
4607         default:
4608             expert_add_info_format(pinfo, NULL, &ei_lbmr_analysis_invalid_value, "Unknown LBMR QMGMT packet type 0x%02x", pckt_type);
4609             break;
4610     }
4611     if ((flags_val & UMQ_QMGMT_HDR_N_FLAG) != 0)
4612     {
4613         int qnamelen = tvb_reported_length_remaining(tvb, curr_offset);
4614         if (qnamelen > 1)
4615         {
4616             proto_tree_add_item(tree, hf_qmgmt_qname, tvb, curr_offset, qnamelen, ENC_ASCII|ENC_NA);
4617         }
4618         len_dissected += qnamelen;
4619     }
4620     return (len_dissected);
4621 }
4622
4623 /*----------------------------------------------------------------------------*/
4624 /* LBMR ContextInfo dissection functions.                                     */
4625 /*----------------------------------------------------------------------------*/
4626 static int dissect_lbmr_ctxinfo(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
4627 {
4628     guint8 reclen = 0;
4629     int name_offset = -1;
4630     int name_len = 0;
4631     static const int * flags[] =
4632     {
4633         &hf_lbmr_ctxinfo_flags_query,
4634         &hf_lbmr_ctxinfo_flags_ip,
4635         &hf_lbmr_ctxinfo_flags_instance,
4636         &hf_lbmr_ctxinfo_flags_tnwg_src,
4637         &hf_lbmr_ctxinfo_flags_tnwg_rcv,
4638         &hf_lbmr_ctxinfo_flags_proxy,
4639         &hf_lbmr_ctxinfo_flags_name,
4640         NULL
4641     };
4642
4643     reclen = tvb_get_guint8(tvb, offset + O_LBMR_CTXINFO_T_LEN);
4644     proto_tree_add_item(tree, hf_lbmr_ctxinfo_len, tvb, offset + O_LBMR_CTXINFO_T_LEN, L_LBMR_CTXINFO_T_LEN, ENC_BIG_ENDIAN);
4645     proto_tree_add_item(tree, hf_lbmr_ctxinfo_hop_count, tvb, offset + O_LBMR_CTXINFO_T_HOP_COUNT, L_LBMR_CTXINFO_T_HOP_COUNT, ENC_BIG_ENDIAN);
4646     proto_tree_add_bitmask(tree, tvb, offset + O_LBMR_CTXINFO_T_FLAGS, hf_lbmr_ctxinfo_flags, ett_lbmr_ctxinfo_flags, flags, ENC_BIG_ENDIAN);
4647     proto_tree_add_item(tree, hf_lbmr_ctxinfo_port, tvb, offset + O_LBMR_CTXINFO_T_PORT, L_LBMR_CTXINFO_T_FLAGS, ENC_BIG_ENDIAN);
4648     proto_tree_add_item(tree, hf_lbmr_ctxinfo_ip, tvb, offset + O_LBMR_CTXINFO_T_IP, L_LBMR_CTXINFO_T_IP, ENC_BIG_ENDIAN);
4649     proto_tree_add_item(tree, hf_lbmr_ctxinfo_instance, tvb, offset + O_LBMR_CTXINFO_T_INSTANCE, L_LBMR_CTXINFO_T_INSTANCE, ENC_NA);
4650     if (name_offset != -1)
4651     {
4652         proto_tree_add_item(tree, hf_lbmr_ctxinfo_name, tvb, name_offset, name_len, ENC_ASCII|ENC_NA);
4653     }
4654     return ((int)reclen);
4655 }
4656
4657 /*----------------------------------------------------------------------------*/
4658 /* LBMR Topic Res Request dissection functions.                               */
4659 /*----------------------------------------------------------------------------*/
4660 static int dissect_lbmr_topic_res_request(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
4661 {
4662     static const int * flags[] =
4663     {
4664         &hf_lbmr_topic_res_request_flags_gw_remote_interest,
4665         &hf_lbmr_topic_res_request_flags_context_query,
4666         &hf_lbmr_topic_res_request_flags_context_advertisement,
4667         &hf_lbmr_topic_res_request_flags_gateway_meta,
4668         &hf_lbmr_topic_res_request_flags_advertisement,
4669         &hf_lbmr_topic_res_request_flags_query,
4670         &hf_lbmr_topic_res_request_flags_wildcard_query,
4671         NULL
4672     };
4673
4674     proto_tree_add_bitmask(tree, tvb, offset + O_LBMR_TOPIC_RES_REQUEST_T_FLAGS, hf_lbmr_topic_res_request_flags, ett_lbmr_topic_res_request_flags, flags, ENC_BIG_ENDIAN);
4675     return (L_LBMR_TOPIC_RES_REQUEST_T);
4676 }
4677
4678 /*----------------------------------------------------------------------------*/
4679 /* LBMR Remote Domain Route dissection functions.                             */
4680 /*----------------------------------------------------------------------------*/
4681 static int dissect_lbmr_remote_domain_route(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
4682 {
4683     guint16 num_domains;
4684     int len_dissected = 0;
4685     int ofs = 0;
4686     guint16 idx;
4687
4688     num_domains = tvb_get_ntohs(tvb, offset + O_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T_NUM_DOMAINS);
4689     proto_tree_add_item(tree, hf_lbmr_remote_domain_route_hdr_num_domains, tvb, offset + O_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T_NUM_DOMAINS, L_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T_NUM_DOMAINS, ENC_BIG_ENDIAN);
4690     proto_tree_add_item(tree, hf_lbmr_remote_domain_route_hdr_ip, tvb, offset + O_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T_IP, L_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T_IP, ENC_BIG_ENDIAN);
4691     proto_tree_add_item(tree, hf_lbmr_remote_domain_route_hdr_port, tvb, offset + O_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T_PORT, L_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T_PORT, ENC_BIG_ENDIAN);
4692     proto_tree_add_item(tree, hf_lbmr_remote_domain_route_hdr_reserved, tvb, offset + O_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T_RESERVED, L_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T_RESERVED, ENC_BIG_ENDIAN);
4693     proto_tree_add_item(tree, hf_lbmr_remote_domain_route_hdr_length, tvb, offset + O_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T_LENGTH, L_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T_LENGTH, ENC_BIG_ENDIAN);
4694     len_dissected = L_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T;
4695     ofs = offset + L_LBMR_REMOTE_DOMAIN_ROUTE_HDR_T;
4696     for (idx = 0; idx < num_domains; ++idx)
4697     {
4698         proto_tree_add_item(tree, hf_lbmr_remote_domain_route_hdr_domain, tvb, ofs, sizeof(lbm_uint32_t), ENC_BIG_ENDIAN);
4699         len_dissected += (int)sizeof(lbm_uint32_t);
4700         ofs += (int)sizeof(lbm_uint32_t);
4701     }
4702     return (len_dissected);
4703 }
4704
4705 /*----------------------------------------------------------------------------*/
4706 /* LBMR Remote ContextInfo option dissection functions.                       */
4707 /*----------------------------------------------------------------------------*/
4708 static int dissect_lbmr_rctxinfo_rec_address_opt(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
4709 {
4710     proto_tree * subtree = NULL;
4711     proto_item * subtree_item = NULL;
4712
4713     subtree_item = proto_tree_add_item(tree, hf_lbmr_rctxinfo_rec_address, tvb, offset, L_LBMR_RCTXINFO_REC_ADDRESS_OPT_T, ENC_NA);
4714     subtree = proto_item_add_subtree(subtree_item, ett_lbmr_rctxinfo_rec_address);
4715     proto_tree_add_item(subtree, hf_lbmr_rctxinfo_rec_address_type, tvb, offset + O_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_TYPE, L_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_TYPE, ENC_BIG_ENDIAN);
4716     proto_tree_add_item(subtree, hf_lbmr_rctxinfo_rec_address_len, tvb, offset + O_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_LEN, L_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_LEN, ENC_BIG_ENDIAN);
4717     proto_tree_add_item(subtree, hf_lbmr_rctxinfo_rec_address_flags, tvb, offset + O_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_FLAGS, L_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_FLAGS, ENC_BIG_ENDIAN);
4718     proto_tree_add_item(subtree, hf_lbmr_rctxinfo_rec_address_domain_id, tvb, offset + O_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_DOMAIN_ID, L_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_DOMAIN_ID, ENC_BIG_ENDIAN);
4719     proto_tree_add_item(subtree, hf_lbmr_rctxinfo_rec_address_ip, tvb, offset + O_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_IP, L_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_IP, ENC_BIG_ENDIAN);
4720     proto_tree_add_item(subtree, hf_lbmr_rctxinfo_rec_address_port, tvb, offset + O_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_PORT, L_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_PORT, ENC_BIG_ENDIAN);
4721     proto_tree_add_item(subtree, hf_lbmr_rctxinfo_rec_address_res, tvb, offset + O_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_RES, L_LBMR_RCTXINFO_REC_ADDRESS_OPT_T_RES, ENC_BIG_ENDIAN);
4722     return ((int)L_LBMR_RCTXINFO_REC_ADDRESS_OPT_T);
4723 }
4724
4725 static int dissect_lbmr_rctxinfo_rec_instance_opt(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
4726 {
4727     proto_tree * subtree = NULL;
4728     proto_item * subtree_item = NULL;
4729     guint8 len = 0;
4730
4731     len = tvb_get_guint8(tvb, offset + O_LBMR_RCTXINFO_REC_INSTANCE_OPT_T_LEN);
4732     subtree_item = proto_tree_add_item(tree, hf_lbmr_rctxinfo_rec_instance, tvb, offset, (int)len, ENC_NA);
4733     subtree = proto_item_add_subtree(subtree_item, ett_lbmr_rctxinfo_rec_instance);
4734     proto_tree_add_item(subtree, hf_lbmr_rctxinfo_rec_instance_type, tvb, offset + O_LBMR_RCTXINFO_REC_INSTANCE_OPT_T_TYPE, L_LBMR_RCTXINFO_REC_INSTANCE_OPT_T_TYPE, ENC_BIG_ENDIAN);
4735     proto_tree_add_item(subtree, hf_lbmr_rctxinfo_rec_instance_len, tvb, offset + O_LBMR_RCTXINFO_REC_INSTANCE_OPT_T_LEN, L_LBMR_RCTXINFO_REC_INSTANCE_OPT_T_LEN, ENC_BIG_ENDIAN);
4736     proto_tree_add_item(subtree, hf_lbmr_rctxinfo_rec_instance_flags, tvb, offset + O_LBMR_RCTXINFO_REC_INSTANCE_OPT_T_FLAGS, L_LBMR_RCTXINFO_REC_INSTANCE_OPT_T_FLAGS, ENC_BIG_ENDIAN);
4737     proto_tree_add_item(subtree, hf_lbmr_rctxinfo_rec_instance_instance, tvb, offset + O_LBMR_RCTXINFO_REC_INSTANCE_OPT_T_INSTANCE, L_LBMR_RCTXINFO_REC_INSTANCE_OPT_T_INSTANCE, ENC_NA);
4738     return ((int)L_LBMR_RCTXINFO_REC_INSTANCE_OPT_T);
4739 }
4740
4741 static int dissect_lbmr_rctxinfo_rec_odomain_opt(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
4742 {
4743     proto_tree * subtree = NULL;
4744     proto_item * subtree_item = NULL;
4745     guint8 len = 0;
4746
4747     len = tvb_get_guint8(tvb, offset + O_LBMR_RCTXINFO_REC_ODOMAIN_OPT_T_LEN);
4748     subtree_item = proto_tree_add_item(tree, hf_lbmr_rctxinfo_rec_odomain, tvb, offset, (int)len, ENC_NA);
4749     subtree = proto_item_add_subtree(subtree_item, ett_lbmr_rctxinfo_rec_odomain);
4750     proto_tree_add_item(subtree, hf_lbmr_rctxinfo_rec_odomain_type, tvb, offset + O_LBMR_RCTXINFO_REC_ODOMAIN_OPT_T_TYPE, L_LBMR_RCTXINFO_REC_ODOMAIN_OPT_T_TYPE, ENC_BIG_ENDIAN);
4751     proto_tree_add_item(subtree, hf_lbmr_rctxinfo_rec_odomain_len, tvb, offset + O_LBMR_RCTXINFO_REC_ODOMAIN_OPT_T_LEN, L_LBMR_RCTXINFO_REC_ODOMAIN_OPT_T_LEN, ENC_BIG_ENDIAN);
4752     proto_tree_add_item(subtree, hf_lbmr_rctxinfo_rec_odomain_flags, tvb, offset + O_LBMR_RCTXINFO_REC_ODOMAIN_OPT_T_FLAGS, L_LBMR_RCTXINFO_REC_ODOMAIN_OPT_T_FLAGS, ENC_BIG_ENDIAN);
4753     proto_tree_add_item(subtree, hf_lbmr_rctxinfo_rec_odomain_domain_id, tvb, offset + O_LBMR_RCTXINFO_REC_ODOMAIN_OPT_T_DOMAIN_ID, L_LBMR_RCTXINFO_REC_ODOMAIN_OPT_T_DOMAIN_ID, ENC_BIG_ENDIAN);
4754     return ((int)L_LBMR_RCTXINFO_REC_ODOMAIN_OPT_T);
4755 }
4756
4757 static int dissect_lbmr_rctxinfo_rec_name_opt(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
4758 {
4759     proto_tree * subtree = NULL;
4760     proto_item * subtree_item = NULL;
4761     guint8 len = 0;
4762     int name_len = 0;
4763
4764     len = tvb_get_guint8(tvb, offset + O_LBMR_RCTXINFO_REC_NAME_OPT_T_LEN);
4765     subtree_item = proto_tree_add_item(tree, hf_lbmr_rctxinfo_rec_name, tvb, offset, (int)len, ENC_NA);
4766     subtree = proto_item_add_subtree(subtree_item, ett_lbmr_rctxinfo_rec_name);
4767     proto_tree_add_item(subtree, hf_lbmr_rctxinfo_rec_name_type, tvb, offset + O_LBMR_RCTXINFO_REC_NAME_OPT_T_TYPE, L_LBMR_RCTXINFO_REC_NAME_OPT_T_TYPE, ENC_BIG_ENDIAN);
4768     proto_tree_add_item(subtree, hf_lbmr_rctxinfo_rec_name_len, tvb, offset + O_LBMR_RCTXINFO_REC_NAME_OPT_T_LEN, L_LBMR_RCTXINFO_REC_NAME_OPT_T_LEN, ENC_BIG_ENDIAN);
4769     proto_tree_add_item(subtree, hf_lbmr_rctxinfo_rec_name_flags, tvb, offset + O_LBMR_RCTXINFO_REC_NAME_OPT_T_FLAGS, L_LBMR_RCTXINFO_REC_NAME_OPT_T_FLAGS, ENC_BIG_ENDIAN);
4770     name_len = ((int)len) - L_LBMR_RCTXINFO_REC_NAME_OPT_T;
4771     proto_tree_add_item(subtree, hf_lbmr_rctxinfo_rec_name_name, tvb, offset + L_LBMR_RCTXINFO_REC_NAME_OPT_T, name_len, ENC_ASCII|ENC_NA);
4772     return ((int)len);
4773 }
4774
4775 static int dissect_lbmr_rctxinfo_rec_unknown_opt(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree)
4776 {
4777     proto_tree * subtree = NULL;
4778     proto_item * subtree_item = NULL;
4779     guint8 len = 0;
4780     int data_len = 0;
4781     guint8 opt_type;
4782
4783     opt_type = tvb_get_guint8(tvb, offset + O_LBMR_RCTXINFO_REC_OPT_T_TYPE);
4784     len = tvb_get_guint8(tvb, offset + O_LBMR_RCTXINFO_REC_OPT_T_LEN);
4785     subtree_item = proto_tree_add_item(tree, hf_lbmr_rctxinfo_rec_unknown, tvb, offset, (int)len, ENC_NA);
4786     subtree = proto_item_add_subtree(subtree_item, ett_lbmr_rctxinfo_rec_unknown);
4787     proto_tree_add_item(subtree, hf_lbmr_rctxinfo_rec_unknown_type, tvb, offset + O_LBMR_RCTXINFO_REC_OPT_T_TYPE, L_LBMR_RCTXINFO_REC_OPT_T_TYPE, ENC_BIG_ENDIAN);
4788     proto_tree_add_item(subtree, hf_lbmr_rctxinfo_rec_unknown_len, tvb, offset + O_LBMR_RCTXINFO_REC_OPT_T_LEN, L_LBMR_RCTXINFO_REC_OPT_T_LEN, ENC_BIG_ENDIAN);
4789     proto_tree_add_item(subtree, hf_lbmr_rctxinfo_rec_unknown_flags, tvb, offset + O_LBMR_RCTXINFO_REC_OPT_T_FLAGS, L_LBMR_RCTXINFO_REC_OPT_T_FLAGS, ENC_BIG_ENDIAN);
4790     data_len = ((int) len) - L_LBMR_RCTXINFO_REC_OPT_T;
4791     proto_tree_add_item(subtree, hf_lbmr_rctxinfo_rec_unknown_data, tvb, offset + L_LBMR_RCTXINFO_REC_OPT_T, data_len, ENC_NA);
4792     expert_add_info_format(pinfo, subtree_item, &ei_lbmr_analysis_invalid_value, "Unknown LBMR RCTXINFO option 0x%02x", opt_type);
4793     return ((int) len);
4794 }
4795
4796 /*----------------------------------------------------------------------------*/
4797 /* LBMR Remote ContextInfo dissection functions.                              */
4798 /*----------------------------------------------------------------------------*/
4799 static int dissect_lbmr_rctxinfo_rec(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree)
4800 {
4801     proto_tree * subtree = NULL;
4802     proto_item * subtree_item = NULL;
4803     guint8 opt_type = 0;
4804     static const int * flags[] =
4805     {
4806         &hf_lbmr_rctxinfo_rec_flags_query,
4807         NULL
4808     };
4809     guint16 len = 0;
4810     int rec_len_remaining = 0;
4811     int ofs = 0;
4812     int opt_len_dissected = 0;
4813     int len_dissected = 0;
4814
4815     len = tvb_get_ntohs(tvb, offset + O_LBMR_RCTXINFO_REC_T_LEN);
4816     subtree_item = proto_tree_add_item(tree, hf_lbmr_rctxinfo_rec, tvb, offset, -1, ENC_NA);
4817     subtree = proto_item_add_subtree(subtree_item, ett_lbmr_rctxinfo_rec);
4818     proto_tree_add_item(subtree, hf_lbmr_rctxinfo_rec_len, tvb, offset + O_LBMR_RCTXINFO_REC_T_LEN, L_LBMR_RCTXINFO_REC_T_LEN, ENC_BIG_ENDIAN);
4819     proto_tree_add_bitmask(subtree, tvb, offset + O_LBMR_RCTXINFO_REC_T_FLAGS, hf_lbmr_rctxinfo_rec_flags, ett_lbmr_rctxinfo_rec_flags, flags, ENC_BIG_ENDIAN);
4820     ofs = offset + L_LBMR_RCTXINFO_REC_T;
4821     rec_len_remaining = len - L_LBMR_RCTXINFO_REC_T;
4822     len_dissected = L_LBMR_RCTXINFO_REC_T;
4823     while (rec_len_remaining > 0)
4824     {
4825         opt_type = tvb_get_guint8(tvb, ofs + O_LBMR_RCTXINFO_REC_OPT_T_TYPE);
4826         switch (opt_type)
4827         {
4828             case LBMR_RCTXINFO_OPT_ADDRESS_TYPE:
4829                 opt_len_dissected = dissect_lbmr_rctxinfo_rec_address_opt(tvb, ofs, pinfo, subtree);
4830                 break;
4831             case LBMR_RCTXINFO_OPT_INSTANCE_TYPE:
4832                 opt_len_dissected = dissect_lbmr_rctxinfo_rec_instance_opt(tvb, ofs, pinfo, subtree);
4833                 break;
4834             case LBMR_RCTXINFO_OPT_ODOMAIN_TYPE:
4835                 opt_len_dissected = dissect_lbmr_rctxinfo_rec_odomain_opt(tvb, ofs, pinfo, subtree);
4836                 break;
4837             case LBMR_RCTXINFO_OPT_NAME_TYPE:
4838                 opt_len_dissected = dissect_lbmr_rctxinfo_rec_name_opt(tvb, ofs, pinfo, subtree);
4839                 break;
4840             default:
4841                 opt_len_dissected = dissect_lbmr_rctxinfo_rec_unknown_opt(tvb, ofs, pinfo, subtree);
4842                 break;
4843         }
4844         len_dissected += opt_len_dissected;
4845         rec_len_remaining -= opt_len_dissected;
4846         ofs += opt_len_dissected;
4847     }
4848     proto_item_set_len(subtree_item, len_dissected);
4849     return (len_dissected);
4850 }
4851
4852 static int dissect_lbmr_rctxinfo(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree)
4853 {
4854     guint16 num_recs = 0;
4855     int ofs = 0;
4856     int len_dissected = 0;
4857     int rec_len_dissected = 0;
4858
4859     num_recs = tvb_get_ntohs(tvb, offset + O_LBMR_RCTXINFO_T_NUM_RECS);
4860     proto_tree_add_item(tree, hf_lbmr_rctxinfo_len, tvb, offset + O_LBMR_RCTXINFO_T_LEN, L_LBMR_RCTXINFO_T_LEN, ENC_BIG_ENDIAN);
4861     proto_tree_add_item(tree, hf_lbmr_rctxinfo_num_recs, tvb, offset + O_LBMR_RCTXINFO_T_NUM_RECS, L_LBMR_RCTXINFO_T_NUM_RECS, ENC_BIG_ENDIAN);
4862     proto_tree_add_item(tree, hf_lbmr_rctxinfo_reserved, tvb, offset + O_LBMR_RCTXINFO_T_RESERVED, L_LBMR_RCTXINFO_T_RESERVED, ENC_BIG_ENDIAN);
4863     len_dissected = L_LBMR_RCTXINFO_T;
4864     ofs = offset + L_LBMR_RCTXINFO_T;
4865     while (num_recs > 0)
4866     {
4867         rec_len_dissected = dissect_lbmr_rctxinfo_rec(tvb, ofs, pinfo, tree);
4868         ofs += rec_len_dissected;
4869         len_dissected += rec_len_dissected;
4870         num_recs--;
4871     }
4872     return (len_dissected);
4873 }
4874
4875 static proto_item * format_ver_type(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
4876 {
4877     proto_item * type_item = NULL;
4878
4879     proto_tree_add_item(tree, hf_lbmr_hdr_ver, tvb, offset + O_LBMR_HDR_T_VER_TYPE, L_LBMR_HDR_T_VER_TYPE, ENC_BIG_ENDIAN);
4880     proto_tree_add_item(tree, hf_lbmr_hdr_opt, tvb, offset + O_LBMR_HDR_T_VER_TYPE, L_LBMR_HDR_T_VER_TYPE, ENC_BIG_ENDIAN);
4881     type_item = proto_tree_add_item(tree, hf_lbmr_hdr_type, tvb, offset + O_LBMR_HDR_T_VER_TYPE, L_LBMR_HDR_T_VER_TYPE, ENC_BIG_ENDIAN);
4882     return (type_item);
4883 }
4884
4885 /*----------------------------------------------------------------------------*/
4886 /* LBMR Option dissection functions.                                          */
4887 /*----------------------------------------------------------------------------*/
4888 static int dissect_lbmr_opt_len(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
4889 {
4890     proto_tree * subtree = NULL;
4891     proto_item * subtree_item = NULL;
4892     int len = 0;
4893
4894     subtree_item = proto_tree_add_item(tree, hf_lbmr_opt_len, tvb, offset, L_LBMR_LBMR_OPT_SRC_ID_T, ENC_NA);
4895     subtree = proto_item_add_subtree(subtree_item, ett_lbmr_opt_len);
4896     proto_tree_add_item(subtree, hf_lbmr_opt_len_type, tvb, offset + O_LBMR_LBMR_OPT_LEN_T_TYPE, L_LBMR_LBMR_OPT_LEN_T_TYPE, ENC_BIG_ENDIAN);
4897     proto_tree_add_item(subtree, hf_lbmr_opt_len_len, tvb, offset + O_LBMR_LBMR_OPT_LEN_T_LEN, L_LBMR_LBMR_OPT_LEN_T_LEN, ENC_BIG_ENDIAN);
4898     proto_tree_add_item(subtree, hf_lbmr_opt_len_total_len, tvb, offset + O_LBMR_LBMR_OPT_LEN_T_TOTAL_LEN, L_LBMR_LBMR_OPT_LEN_T_TOTAL_LEN, ENC_BIG_ENDIAN);
4899     len = L_LBMR_LBMR_OPT_LEN_T;
4900     return (len);
4901 }
4902
4903 static int dissect_lbmr_opt_src_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
4904 {
4905     proto_tree * subtree = NULL;
4906     proto_item * subtree_item = NULL;
4907     static const int * flags[] =
4908     {
4909         &hf_lbmr_opt_src_id_flags_ignore,
4910         NULL
4911     };
4912
4913     subtree_item = proto_tree_add_item(tree, hf_lbmr_opt_src_id, tvb, offset, L_LBMR_LBMR_OPT_SRC_ID_T, ENC_NA);
4914     subtree = proto_item_add_subtree(subtree_item, ett_lbmr_opt_src_id);
4915     proto_tree_add_item(subtree, hf_lbmr_opt_src_id_type, tvb, offset + O_LBMR_LBMR_OPT_SRC_ID_T_TYPE, L_LBMR_LBMR_OPT_SRC_ID_T_TYPE, ENC_BIG_ENDIAN);
4916     proto_tree_add_item(subtree, hf_lbmr_opt_src_id_len, tvb, offset + O_LBMR_LBMR_OPT_SRC_ID_T_LEN, L_LBMR_LBMR_OPT_SRC_ID_T_LEN, ENC_BIG_ENDIAN);
4917     proto_tree_add_bitmask(subtree, tvb, offset + O_LBMR_LBMR_OPT_SRC_ID_T_FLAGS, hf_lbmr_opt_src_id_flags, ett_lbmr_opt_src_id_flags, flags, ENC_BIG_ENDIAN);
4918     proto_tree_add_item(subtree, hf_lbmr_opt_src_id_src_id, tvb, offset + O_LBMR_LBMR_OPT_SRC_ID_T_SRC_ID, L_LBMR_LBMR_OPT_SRC_ID_T_SRC_ID, ENC_NA);
4919     return (L_LBMR_LBMR_OPT_SRC_ID_T);
4920 }
4921
4922 static int dissect_lbmr_opt_src_type(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
4923 {
4924     proto_tree * subtree = NULL;
4925     proto_item * subtree_item = NULL;
4926     static const int * flags[] =
4927     {
4928         &hf_lbmr_opt_src_type_flags_ignore,
4929         NULL
4930     };
4931
4932     subtree_item = proto_tree_add_item(tree, hf_lbmr_opt_src_type, tvb, offset, L_LBMR_LBMR_OPT_SRC_TYPE_T, ENC_NA);
4933     subtree = proto_item_add_subtree(subtree_item, ett_lbmr_opt_src_type);
4934     proto_tree_add_item(subtree, hf_lbmr_opt_src_type_type, tvb, offset + O_LBMR_LBMR_OPT_SRC_TYPE_T_TYPE, L_LBMR_LBMR_OPT_SRC_TYPE_T_TYPE, ENC_BIG_ENDIAN);
4935     proto_tree_add_item(subtree, hf_lbmr_opt_src_type_len, tvb, offset + O_LBMR_LBMR_OPT_SRC_TYPE_T_LEN, L_LBMR_LBMR_OPT_SRC_TYPE_T_LEN, ENC_BIG_ENDIAN);
4936     proto_tree_add_bitmask(subtree, tvb, offset + O_LBMR_LBMR_OPT_SRC_TYPE_T_FLAGS, hf_lbmr_opt_src_type_flags, ett_lbmr_opt_src_type_flags, flags, ENC_BIG_ENDIAN);
4937     proto_tree_add_item(subtree, hf_lbmr_opt_src_type_src_type, tvb, offset + O_LBMR_LBMR_OPT_SRC_TYPE_T_SRC_TYPE, L_LBMR_LBMR_OPT_SRC_TYPE_T_SRC_TYPE, ENC_BIG_ENDIAN);
4938     return (L_LBMR_LBMR_OPT_SRC_TYPE_T);
4939 }
4940
4941 static int dissect_lbmr_opt_version(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
4942 {
4943     proto_tree * subtree = NULL;
4944     proto_item * subtree_item = NULL;
4945     static const int * flags[] =
4946     {
4947         &hf_lbmr_opt_version_flags_ignore,
4948         &hf_lbmr_opt_version_flags_ume,
4949         &hf_lbmr_opt_version_flags_umq,
4950         NULL
4951     };
4952
4953     subtree_item = proto_tree_add_item(tree, hf_lbmr_opt_version, tvb, offset, L_LBMR_LBMR_OPT_VERSION_T, ENC_NA);
4954     subtree = proto_item_add_subtree(subtree_item, ett_lbmr_opt_version);
4955     proto_tree_add_item(subtree, hf_lbmr_opt_version_type, tvb, offset + O_LBMR_LBMR_OPT_VERSION_T_TYPE, L_LBMR_LBMR_OPT_VERSION_T_TYPE, ENC_BIG_ENDIAN);
4956     proto_tree_add_item(subtree, hf_lbmr_opt_version_len, tvb, offset + O_LBMR_LBMR_OPT_VERSION_T_LEN, L_LBMR_LBMR_OPT_VERSION_T_LEN, ENC_BIG_ENDIAN);
4957     proto_tree_add_bitmask(subtree, tvb, offset + O_LBMR_LBMR_OPT_VERSION_T_FLAGS, hf_lbmr_opt_version_flags, ett_lbmr_opt_version_flags, flags, ENC_BIG_ENDIAN);
4958     proto_tree_add_item(subtree, hf_lbmr_opt_version_version, tvb, offset + O_LBMR_LBMR_OPT_VERSION_T_VERSION, L_LBMR_LBMR_OPT_VERSION_T_VERSION, ENC_BIG_ENDIAN);
4959     return (L_LBMR_LBMR_OPT_VERSION_T);
4960 }
4961
4962 static int dissect_lbmr_opt_local_domain(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
4963 {
4964     proto_tree * subtree = NULL;
4965     proto_item * subtree_item = NULL;
4966     static const int * flags[] =
4967     {
4968         &hf_lbmr_opt_local_domain_flags_ignore,
4969         NULL
4970     };
4971
4972     subtree_item = proto_tree_add_item(tree, hf_lbmr_opt_local_domain, tvb, offset, L_LBMR_LBMR_OPT_LOCAL_DOMAIN_T, ENC_NA);
4973     subtree = proto_item_add_subtree(subtree_item, ett_lbmr_opt_local_domain);
4974     proto_tree_add_item(subtree, hf_lbmr_opt_local_domain_type, tvb, offset + O_LBMR_LBMR_OPT_LOCAL_DOMAIN_T_TYPE, L_LBMR_LBMR_OPT_LOCAL_DOMAIN_T_TYPE, ENC_BIG_ENDIAN);
4975     proto_tree_add_item(subtree, hf_lbmr_opt_local_domain_len, tvb, offset + O_LBMR_LBMR_OPT_LOCAL_DOMAIN_T_LEN, L_LBMR_LBMR_OPT_LOCAL_DOMAIN_T_LEN, ENC_BIG_ENDIAN);
4976     proto_tree_add_bitmask(subtree, tvb, offset + O_LBMR_LBMR_OPT_LOCAL_DOMAIN_T_FLAGS, hf_lbmr_opt_local_domain_flags, ett_lbmr_opt_local_domain_flags, flags, ENC_BIG_ENDIAN);
4977     proto_tree_add_item(subtree, hf_lbmr_opt_local_domain_local_domain_id, tvb, offset + O_LBMR_LBMR_OPT_LOCAL_DOMAIN_T_LOCAL_DOMAIN_ID, L_LBMR_LBMR_OPT_LOCAL_DOMAIN_T_LOCAL_DOMAIN_ID, ENC_BIG_ENDIAN);
4978     return (L_LBMR_LBMR_OPT_LOCAL_DOMAIN_T);
4979 }
4980
4981 static int dissect_lbmr_opt_unknown(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree)
4982 {
4983     proto_tree * subtree = NULL;
4984     proto_item * subtree_item = NULL;
4985     guint8 len = 0;
4986     proto_item * type_item = NULL;
4987     guint8 opt_type = 0;
4988
4989     subtree_item = proto_tree_add_item(tree, hf_lbmr_opt_unknown, tvb, offset, -1, ENC_NA);
4990     subtree = proto_item_add_subtree(subtree_item, ett_lbmr_opt_unknown);
4991     opt_type = tvb_get_guint8(tvb, offset + O_LBMR_LBMR_OPT_HDR_T_TYPE);
4992     type_item = proto_tree_add_item(subtree, hf_lbmr_opt_unknown_type, tvb, offset + O_LBMR_LBMR_OPT_HDR_T_TYPE, L_LBMR_LBMR_OPT_HDR_T_TYPE, ENC_BIG_ENDIAN);
4993     len = tvb_get_guint8(tvb, offset + O_LBMR_LBMR_OPT_HDR_T_LEN);
4994     proto_tree_add_item(subtree, hf_lbmr_opt_unknown_len, tvb, offset + O_LBMR_LBMR_OPT_HDR_T_LEN, L_LBMR_LBMR_OPT_HDR_T_LEN, ENC_BIG_ENDIAN);
4995     proto_tree_add_item(subtree, hf_lbmr_opt_unknown_flags, tvb, offset + O_LBMR_LBMR_OPT_HDR_T_FLAGS, L_LBMR_LBMR_OPT_HDR_T_FLAGS, ENC_NA);
4996     proto_tree_add_item(subtree, hf_lbmr_opt_unknown_data, tvb, offset + L_LBMR_LBMR_OPT_HDR_T, (int) len - L_LBMR_LBMR_OPT_HDR_T, ENC_NA);
4997     proto_item_set_len(subtree_item, (int) len);
4998     expert_add_info_format(pinfo, type_item, &ei_lbmr_analysis_invalid_value, "Unknown LBMR option type 0x%02x", opt_type);
4999     return ((int) len);
5000 }
5001
5002 static int dissect_lbmr_options(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree)
5003 {
5004     proto_tree * opt_tree = NULL;
5005     proto_item * ti = NULL;
5006     int curr_offset = offset;
5007     int len = 0;
5008
5009     ti = proto_tree_add_item(tree, hf_lbmr_opts, tvb, curr_offset, -1, ENC_NA);
5010     opt_tree = proto_item_add_subtree(ti, ett_lbmr_opts);
5011     while (tvb_reported_length_remaining(tvb, curr_offset) > 0)
5012     {
5013         int opt_len;
5014         guint8 opt_type;
5015
5016         opt_type = tvb_get_guint8(tvb, curr_offset + O_LBMR_LBMR_OPT_HDR_T_TYPE);
5017         switch (opt_type)
5018         {
5019             case LBMR_LBMR_OPT_LEN_TYPE:
5020                 opt_len = dissect_lbmr_opt_len(tvb, curr_offset, pinfo, opt_tree);
5021                 break;
5022             case LBMR_LBMR_OPT_SRC_ID_TYPE:
5023                 opt_len = dissect_lbmr_opt_src_id(tvb, curr_offset, pinfo, opt_tree);
5024                 break;
5025             case LBMR_LBMR_OPT_SRC_TYPE_TYPE:
5026                 opt_len = dissect_lbmr_opt_src_type(tvb, curr_offset, pinfo, opt_tree);
5027                 break;
5028             case LBMR_LBMR_OPT_VERSION_TYPE:
5029                 opt_len = dissect_lbmr_opt_version(tvb, curr_offset, pinfo, opt_tree);
5030                 break;
5031             case LBMR_LBMR_OPT_LOCAL_DOMAIN_TYPE:
5032                 opt_len = dissect_lbmr_opt_local_domain(tvb, curr_offset, pinfo, opt_tree);
5033                 break;
5034             default:
5035                 opt_len = dissect_lbmr_opt_unknown(tvb, curr_offset, pinfo, opt_tree);
5036                 break;
5037         }
5038         len += opt_len;
5039         curr_offset += opt_len;
5040     }
5041     return (len);
5042 }
5043
5044 static void lbmr_tap_queue_packet(packet_info * pinfo, const lbmr_contents_t * contents)
5045 {
5046     const lbmr_topic_contents_t * topic;
5047     const lbmr_queue_contents_t * queue;
5048
5049     switch (contents->type)
5050     {
5051         case LBMR_CONTENTS_TOPIC:
5052             topic = &(contents->contents.topic);
5053             if (topic->tqr_count > 0)
5054             {
5055                 tqr_node_t * tqr = topic->tqr;
5056                 while (tqr != NULL)
5057                 {
5058                     lbm_lbmr_topic_query_tap_info_t * tqr_tap = wmem_new0(wmem_packet_scope(), lbm_lbmr_topic_query_tap_info_t);
5059                     tqr_tap->size = (guint16) sizeof(lbm_lbmr_topic_query_tap_info_t);
5060                     tqr_tap->topic_length = (guint8)strlen(tqr->topic);
5061                     memcpy(tqr_tap->topic, tqr->topic, tqr_tap->topic_length);
5062                     tap_queue_packet(lbmr_topic_query_tap_handle, pinfo, (void *) tqr_tap);
5063                     tqr = tqr->next;
5064                 }
5065             }
5066             if (topic->tir_count > 0)
5067             {
5068                 tir_node_t * tir = topic->tir;
5069                 while (tir != NULL)
5070                 {
5071                     lbm_lbmr_topic_advertisement_tap_info_t * tir_tap = wmem_new0(wmem_packet_scope(), lbm_lbmr_topic_advertisement_tap_info_t);
5072                     tir_tap->size = (guint16) sizeof(lbm_lbmr_topic_advertisement_tap_info_t);
5073                     tir_tap->topic_length = (guint8)strlen(tir->topic);
5074                     tir_tap->source_length = (guint8)strlen(tir->source_string);
5075                     tir_tap->topic_index = tir->idx;
5076                     memcpy(tir_tap->topic, tir->topic, tir_tap->topic_length);
5077                     memcpy(tir_tap->source, tir->source_string, tir_tap->source_length);
5078                     tap_queue_packet(lbmr_topic_advertisement_tap_handle, pinfo, (void *) tir_tap);
5079                     tir = tir->next;
5080                 }
5081             }
5082             if (topic->wctqr_count > 0)
5083             {
5084                 wctqr_node_t * wctqr = topic->wctqr;
5085                 while (wctqr != NULL)
5086                 {
5087                     lbm_lbmr_pattern_query_tap_info_t * wctqr_tap = wmem_new0(wmem_packet_scope(), lbm_lbmr_pattern_query_tap_info_t);
5088                     wctqr_tap->size = (guint16) sizeof(lbm_lbmr_pattern_query_tap_info_t);
5089                     wctqr_tap->type = wctqr->type;
5090                     wctqr_tap->pattern_length = (guint8)strlen(wctqr->pattern);
5091                     memcpy(wctqr_tap->pattern, wctqr->pattern, wctqr_tap->pattern_length);
5092                     tap_queue_packet(lbmr_pattern_query_tap_handle, pinfo, (void *) wctqr_tap);
5093                     wctqr = wctqr->next;
5094                 }
5095             }
5096             break;
5097         case LBMR_CONTENTS_QUEUE:
5098             queue = &(contents->contents.queue);
5099             if (queue->qqr_count > 0)
5100             {
5101                 qqr_node_t * qqr = queue->qqr;
5102                 while (qqr != NULL)
5103                 {
5104                     lbm_lbmr_queue_query_tap_info_t * qqr_tap = wmem_new0(wmem_packet_scope(), lbm_lbmr_queue_query_tap_info_t);
5105                     qqr_tap->size = (guint16) sizeof(lbm_lbmr_queue_query_tap_info_t);
5106                     qqr_tap->queue_length = (guint8)strlen(qqr->queue);
5107                     memcpy(qqr_tap->queue, qqr->queue, qqr_tap->queue_length);
5108                     tap_queue_packet(lbmr_queue_advertisement_tap_handle, pinfo, (void *) qqr_tap);
5109                     qqr = qqr->next;
5110                 }
5111             }
5112             if (queue->qir_count > 0)
5113             {
5114                 qir_node_t * qir = queue->qir;
5115                 while (qir != NULL)
5116                 {
5117                     lbm_lbmr_queue_advertisement_tap_info_t * qir_tap = wmem_new0(wmem_packet_scope(), lbm_lbmr_queue_advertisement_tap_info_t);
5118                     qir_tap->size = (guint16) sizeof(lbm_lbmr_queue_advertisement_tap_info_t);
5119                     qir_tap->port = qir->port;
5120                     qir_tap->queue_length = (guint8)strlen(qir->queue);
5121                     qir_tap->topic_length = (guint8)strlen(qir->topic);
5122                     memcpy(qir_tap->queue, qir->queue, qir_tap->queue_length);
5123                     memcpy(qir_tap->topic, qir->topic, qir_tap->topic_length);
5124                     tap_queue_packet(lbmr_queue_query_tap_handle, pinfo, (void *) qir_tap);
5125                     qir = qir->next;
5126                 }
5127             }
5128             break;
5129         default:
5130             break;
5131     }
5132 }
5133
5134 /*----------------------------------------------------------------------------*/
5135 /* dissect_lbmr - The dissector for LBM Topic Resolution protocol.            */
5136 /*----------------------------------------------------------------------------*/
5137 static int dissect_lbmr(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * user_data _U_)
5138 {
5139     proto_tree * lbmr_tree = NULL;
5140     proto_item * ti = NULL;
5141     int offset = 0;
5142     guint8 ver_type;
5143     guint8 ver;
5144     guint8 type;
5145     lbmr_contents_t * contents = NULL;
5146     char * tag_name = NULL;
5147     int total_len_dissected = 0;
5148     int len_dissected = 0;
5149     tvbuff_t * packet_tvb = NULL;
5150     proto_item * lbmr_hdr_item = NULL;
5151     proto_tree * lbmr_hdr_tree = NULL;
5152
5153     col_set_str(pinfo->cinfo, COL_PROTOCOL, "LBMR");
5154     if (lbmr_use_tag)
5155     {
5156         tag_name = lbmr_tag_find(pinfo);
5157     }
5158     col_clear(pinfo->cinfo, COL_INFO);
5159     if (tag_name != NULL)
5160     {
5161         col_add_fstr(pinfo->cinfo, COL_INFO, "[Tag: %s]", tag_name);
5162     }
5163     col_set_fence(pinfo->cinfo, COL_INFO);
5164
5165     ver_type = tvb_get_guint8(tvb, O_LBMR_HDR_T_VER_TYPE);
5166     ver = LBMR_HDR_VER(ver_type);
5167     type = LBMR_HDR_TYPE(ver_type);
5168     offset = 0;
5169     total_len_dissected = 0;
5170     packet_tvb = tvb;
5171
5172     if ((ver_type & LBMR_HDR_TYPE_OPTS_MASK) != 0)
5173     {
5174         guint8 opt_type;
5175         guint8 opt_len;
5176
5177         opt_type = tvb_get_guint8(tvb, -L_LBMR_LBMR_OPT_LEN_T + O_LBMR_LBMR_OPT_LEN_T_TYPE);
5178         opt_len = tvb_get_guint8(tvb, -L_LBMR_LBMR_OPT_LEN_T + O_LBMR_LBMR_OPT_LEN_T_LEN);
5179         if ((opt_type == LBMR_LBMR_OPT_LEN_TYPE) && (((gint)opt_len) == L_LBMR_LBMR_OPT_LEN_T))
5180         {
5181             gint opt_total_len = 0;
5182             gint packet_len;
5183
5184             packet_len = tvb_reported_length_remaining(tvb, 0);
5185             opt_total_len = (gint)tvb_get_ntohs(tvb, -L_LBMR_LBMR_OPT_LEN_T + O_LBMR_LBMR_OPT_LEN_T_TOTAL_LEN);
5186             if (packet_len > opt_total_len)
5187             {
5188                 gint tvb_len = packet_len - opt_total_len;
5189
5190                 packet_tvb = tvb_new_subset_length(tvb, 0, tvb_len);
5191             }
5192         }
5193     }
5194
5195     if (type == LBMR_HDR_TYPE_EXT)
5196     {
5197         guint8 ext_type = 0;
5198         const gchar * ext_string;
5199         proto_item * ext_type_item = NULL;
5200
5201         ext_type = tvb_get_guint8(tvb, O_LBMR_HDR_EXT_TYPE_T_EXT_TYPE);
5202         ext_string = val_to_str(ext_type, lbmr_ext_packet_type, "Unknown(0x%02x)");
5203         col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "ExtType %s", ext_string);
5204         if (tag_name != NULL)
5205         {
5206             ti = proto_tree_add_protocol_format(tree, proto_lbmr, tvb, O_LBMR_HDR_EXT_TYPE_T_VER_TYPE, -1, "LBM Topic Resolution Protocol (Tag: %s): Version %u, Type 0x%x (%s), ExtType %s",
5207                 tag_name, ver, type, val_to_str(type, lbmr_packet_type, "Unknown(0x%02x)"), ext_string);
5208         }
5209         else
5210         {
5211             ti = proto_tree_add_protocol_format(tree, proto_lbmr, tvb, O_LBMR_HDR_EXT_TYPE_T_VER_TYPE, -1, "LBM Topic Resolution Protocol: Version %u, Type 0x%x (%s), ExtType %s",
5212                 ver, type, val_to_str(type, lbmr_packet_type, "Unknown(0x%02x)"), ext_string);
5213         }
5214         lbmr_tree = proto_item_add_subtree(ti, ett_lbmr);
5215         if (tag_name != NULL)
5216         {
5217             proto_item * item = NULL;
5218
5219             item = proto_tree_add_string(lbmr_tree, hf_lbmr_tag, tvb, 0, 0, tag_name);
5220             PROTO_ITEM_SET_GENERATED(item);
5221         }
5222         lbmr_hdr_item = proto_tree_add_item(lbmr_tree, hf_lbmr_hdr, tvb, 0, -1, ENC_NA);
5223         lbmr_hdr_tree = proto_item_add_subtree(lbmr_hdr_item, ett_lbmr_hdr);
5224         (void) format_ver_type(tvb, 0, pinfo, lbmr_hdr_tree);
5225         ext_type_item = proto_tree_add_item(lbmr_hdr_tree, hf_lbmr_hdr_ext_type, tvb, O_LBMR_HDR_EXT_TYPE_T_EXT_TYPE, L_LBMR_HDR_EXT_TYPE_T_EXT_TYPE, ENC_BIG_ENDIAN);
5226
5227         /* ver_type and ext_type have already been processed. But their dissected length is included in the individual type dissections below. */
5228         switch (ext_type)
5229         {
5230             case LBMR_HDR_EXT_TYPE_UME_PROXY_SRC_ELECT:
5231                 len_dissected = dissect_lbmr_pser(packet_tvb, offset, pinfo, lbmr_tree);
5232                 break;
5233             case LBMR_HDR_EXT_TYPE_UMQ_QUEUE_MGMT:
5234                 offset += L_LBMR_UMQ_QMGMT_HDR_T_VER_TYPE + L_LBMR_UMQ_QMGMT_HDR_T_EXT_TYPE;
5235                 total_len_dissected += L_LBMR_UMQ_QMGMT_HDR_T_VER_TYPE + L_LBMR_UMQ_QMGMT_HDR_T_EXT_TYPE;
5236                 len_dissected = lbmr_dissect_umq_qmgmt(packet_tvb, offset - 2, pinfo, lbmr_tree);
5237                 break;
5238             case LBMR_HDR_EXT_TYPE_CONTEXT_INFO:
5239                 len_dissected = dissect_lbmr_ctxinfo(packet_tvb, offset, pinfo, lbmr_tree);
5240                 break;
5241             case LBMR_HDR_EXT_TYPE_TOPIC_RES_REQUEST:
5242                 len_dissected = dissect_lbmr_topic_res_request(packet_tvb, offset, pinfo, lbmr_tree);
5243                 break;
5244             case LBMR_HDR_EXT_TYPE_TNWG_MSG:
5245                 len_dissected = dissect_lbmr_tnwg(packet_tvb, offset, pinfo, lbmr_tree);
5246                 break;
5247             case LBMR_HDR_EXT_TYPE_REMOTE_DOMAIN_ROUTE:
5248                 len_dissected = dissect_lbmr_remote_domain_route(packet_tvb, offset, pinfo, lbmr_tree);
5249                 break;
5250             case LBMR_HDR_EXT_TYPE_REMOTE_CONTEXT_INFO:
5251                 len_dissected = dissect_lbmr_rctxinfo(packet_tvb, offset, pinfo, lbmr_tree);
5252                 break;
5253             default:
5254                 len_dissected = L_LBMR_HDR_EXT_TYPE_T_VER_TYPE + L_LBMR_HDR_EXT_TYPE_T_EXT_TYPE;
5255                 expert_add_info_format(pinfo, ext_type_item, &ei_lbmr_analysis_invalid_value, "Unknown LBMR extended type 0x%02x", ext_type);
5256                 break;
5257         }
5258         offset += len_dissected;
5259         total_len_dissected += len_dissected;
5260     }
5261     else
5262     {
5263         guint8 tqrs = 0;
5264         guint16 tirs = 0;
5265         gboolean rd_keepalive = FALSE;
5266         gboolean topic_mgmt = FALSE;
5267         gboolean client_rd_keepalive = FALSE;
5268         gboolean zero_tirs_tqrs = FALSE;
5269         proto_item * type_item = NULL;
5270
5271         tqrs = tvb_get_guint8(tvb, O_LBMR_HDR_T_TQRS);
5272         tirs = tvb_get_ntohs(tvb, O_LBMR_HDR_T_TIRS);
5273         if ((tqrs == 0) && (tirs == 0))
5274         {
5275             zero_tirs_tqrs = TRUE;
5276         }
5277         if ((type == LBMR_HDR_TYPE_NORMAL) && zero_tirs_tqrs)
5278         {
5279             rd_keepalive = TRUE;
5280         }
5281         else if (zero_tirs_tqrs && ((type == LBMR_HDR_TYPE_UCAST_RCV_ALIVE) || (type == LBMR_HDR_TYPE_UCAST_SRC_ALIVE)))
5282         {
5283             client_rd_keepalive = TRUE;
5284         }
5285         else if (type == LBMR_HDR_TYPE_TOPIC_MGMT)
5286         {
5287             topic_mgmt = TRUE;
5288         }
5289         switch (type)
5290         {
5291             case LBMR_HDR_TYPE_QUEUE_RES:
5292                 col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "QQRs %u QIRs %" G_GUINT16_FORMAT, tqrs, tirs);
5293                 break;
5294             default:
5295                 if (rd_keepalive)
5296                 {
5297                     col_append_sep_str(pinfo->cinfo, COL_INFO, " ", "Unicast Resolver Keepalive");
5298                 }
5299                 else if (client_rd_keepalive)
5300                 {
5301                     if (type == LBMR_HDR_TYPE_UCAST_RCV_ALIVE)
5302                     {
5303                         col_append_sep_str(pinfo->cinfo, COL_INFO, " ", "Receiver Alive");
5304                     }
5305                     else
5306                     {
5307                         col_append_sep_str(pinfo->cinfo, COL_INFO, " ", "Source Alive");
5308                     }
5309                 }
5310                 else if (topic_mgmt)
5311                 {
5312                     col_append_sep_str(pinfo->cinfo, COL_INFO, " ", "Topic Management");
5313                 }
5314                 else
5315                 {
5316                     col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "TQRs %u TIRs %" G_GUINT16_FORMAT, tqrs, tirs);
5317                 }
5318                 break;
5319         }
5320
5321         switch (type)
5322         {
5323             case LBMR_HDR_TYPE_QUEUE_RES:
5324                 if (tag_name != NULL)
5325                 {
5326                     ti = proto_tree_add_protocol_format(tree, proto_lbmr, tvb, O_LBMR_HDR_T_VER_TYPE, -1, "LBM Topic Resolution Protocol (Tag: %s): Version %u, Type 0x%x (%s) QQRs %u, QIRs %" G_GUINT16_FORMAT,
5327                         tag_name, ver, type, val_to_str(type, lbmr_packet_type, "Unknown(0x%02x)"), tqrs, tirs);
5328                 }
5329                 else
5330                 {
5331                     ti = proto_tree_add_protocol_format(tree, proto_lbmr, tvb, O_LBMR_HDR_T_VER_TYPE, -1, "LBM Topic Resolution Protocol: Version %u, Type 0x%x (%s) QQRs %u, QIRs %" G_GUINT16_FORMAT,
5332                         ver, type, val_to_str(type, lbmr_packet_type, "Unknown(0x%02x)"), tqrs, tirs);
5333                 }
5334                 break;
5335             default:
5336                 if (tag_name != NULL)
5337                 {
5338                     if (rd_keepalive)
5339                     {
5340                         ti = proto_tree_add_protocol_format(tree, proto_lbmr, tvb, O_LBMR_HDR_T_VER_TYPE, -1, "LBM Topic Resolution Protocol (Tag: %s): Version %u, Type 0x%x (%s) Unicast Resolver Keepalive",
5341                             tag_name, ver, type, val_to_str(type, lbmr_packet_type, "Unknown(0x%02x)"));
5342                     }
5343                     else if (topic_mgmt)
5344                     {
5345                         ti = proto_tree_add_protocol_format(tree, proto_lbmr, tvb, O_LBMR_HDR_T_VER_TYPE, -1, "LBM Topic Resolution Protocol (Tag: %s): Version %u, Type 0x%x (%s) Topic Management",
5346                             tag_name, ver, type, val_to_str(type, lbmr_packet_type, "Unknown(0x%02x)"));
5347                     }
5348                     else
5349                     {
5350                         ti = proto_tree_add_protocol_format(tree, proto_lbmr, tvb, O_LBMR_HDR_T_VER_TYPE, -1, "LBM Topic Resolution Protocol (Tag: %s): Version %u, Type 0x%x (%s) TQRs %u, TIRs %" G_GUINT16_FORMAT,
5351                             tag_name, ver, type, val_to_str(type, lbmr_packet_type, "Unknown(0x%02x)"), tqrs, tirs);
5352                     }
5353                 }
5354                 else
5355                 {
5356                     if (rd_keepalive)
5357                     {
5358                         ti = proto_tree_add_protocol_format(tree, proto_lbmr, tvb, O_LBMR_HDR_T_VER_TYPE, -1, "LBM Topic Resolution Protocol: Version %u, Type 0x%x (%s) Unicast Resolver Keepalive",
5359                             ver, type, val_to_str(type, lbmr_packet_type, "Unknown(0x%02x)"));
5360                     }
5361                     else if (topic_mgmt)
5362                     {
5363                         ti = proto_tree_add_protocol_format(tree, proto_lbmr, tvb, O_LBMR_HDR_T_VER_TYPE, -1, "LBM Topic Resolution Protocol: Version %u, Type 0x%x (%s) Topic Management",
5364                             ver, type, val_to_str(type, lbmr_packet_type, "Unknown(0x%02x)"));
5365                     }
5366                     else
5367                     {
5368                         ti = proto_tree_add_protocol_format(tree, proto_lbmr, tvb, O_LBMR_HDR_T_VER_TYPE, -1, "LBM Topic Resolution Protocol: Version %u, Type 0x%x (%s) TQRs %u, TIRs %" G_GUINT16_FORMAT,
5369                             ver, type, val_to_str(type, lbmr_packet_type, "Unknown(0x%02x)"), tqrs, tirs);
5370                     }
5371                 }
5372                 break;
5373         }
5374         lbmr_tree = proto_item_add_subtree(ti, ett_lbmr);
5375         if (tag_name != NULL)
5376         {
5377             proto_item * item;
5378             item = proto_tree_add_string(lbmr_tree, hf_lbmr_tag, tvb, 0, 0, tag_name);
5379             PROTO_ITEM_SET_GENERATED(item);
5380         }
5381         lbmr_hdr_item = proto_tree_add_item(lbmr_tree, hf_lbmr_hdr, tvb, 0, -1, ENC_NA);
5382         lbmr_hdr_tree = proto_item_add_subtree(lbmr_hdr_item, ett_lbmr_hdr);
5383         type_item = format_ver_type(tvb, 0, pinfo, lbmr_hdr_tree);
5384         switch (type)
5385         {
5386             case LBMR_HDR_TYPE_QUEUE_RES:
5387                 proto_tree_add_item(lbmr_hdr_tree, hf_lbmr_hdr_qqrs, tvb, O_LBMR_HDR_T_TQRS, L_LBMR_HDR_T_TQRS, ENC_BIG_ENDIAN);
5388                 proto_tree_add_item(lbmr_hdr_tree, hf_lbmr_hdr_qirs, tvb, O_LBMR_HDR_T_TIRS, L_LBMR_HDR_T_TIRS, ENC_BIG_ENDIAN);
5389                 break;
5390             default:
5391                 proto_tree_add_item(lbmr_hdr_tree, hf_lbmr_hdr_tqrs, tvb, O_LBMR_HDR_T_TQRS, L_LBMR_HDR_T_TQRS, ENC_BIG_ENDIAN);
5392                 proto_tree_add_item(lbmr_hdr_tree, hf_lbmr_hdr_tirs, tvb, O_LBMR_HDR_T_TIRS, L_LBMR_HDR_T_TIRS, ENC_BIG_ENDIAN);
5393                 break;
5394         }
5395
5396         offset = L_LBMR_HDR_T;
5397         total_len_dissected = L_LBMR_HDR_T;
5398         contents = wmem_new0(wmem_packet_scope(), lbmr_contents_t);
5399         switch (type)
5400         {
5401             case LBMR_HDR_TYPE_QUEUE_RES:
5402                 contents->type = LBMR_CONTENTS_QUEUE;
5403                 if (tqrs > 0)
5404                 {
5405                     len_dissected = dissect_lbmr_qqrs(packet_tvb, offset, tqrs, pinfo, lbmr_tree, contents);
5406                     total_len_dissected += len_dissected;
5407                     offset += len_dissected;
5408                 }
5409                 if (tirs > 0)
5410                 {
5411                     len_dissected = dissect_lbmr_qirs(packet_tvb, offset, tirs, pinfo, lbmr_tree, contents);
5412                     total_len_dissected += len_dissected;
5413                     offset += len_dissected;
5414                 }
5415                 lbmr_tap_queue_packet(pinfo, contents);
5416                 break;
5417             case LBMR_HDR_TYPE_NORMAL:
5418             case LBMR_HDR_TYPE_WC_TQRS:
5419                 if (!rd_keepalive)
5420                 {
5421                     contents->type = LBMR_CONTENTS_TOPIC;
5422                     if (tqrs > 0)
5423                     {
5424                         gboolean wc_tqrs = FALSE;
5425
5426                         if (type == LBMR_HDR_TYPE_WC_TQRS)
5427                         {
5428                             wc_tqrs = TRUE;
5429                         }
5430                         len_dissected = dissect_lbmr_tqrs(packet_tvb, offset, tqrs, pinfo, lbmr_tree, wc_tqrs, contents);
5431                         total_len_dissected += len_dissected;
5432                         offset += len_dissected;
5433                     }
5434                     if (tirs > 0)
5435                     {
5436                         len_dissected = dissect_lbmr_tirs(packet_tvb, offset, tirs, pinfo, lbmr_tree, "TIRs", contents);
5437                         total_len_dissected += len_dissected;
5438                         offset += len_dissected;
5439                     }
5440                     lbmr_tap_queue_packet(pinfo, contents);
5441                 }
5442                 break;
5443             case LBMR_HDR_TYPE_TOPIC_MGMT:
5444                 len_dissected = dissect_lbmr_tmb(packet_tvb, offset, pinfo, lbmr_tree);
5445                 total_len_dissected += len_dissected;
5446                 offset += len_dissected;
5447                 break;
5448             case LBMR_HDR_TYPE_UCAST_RCV_ALIVE:
5449             case LBMR_HDR_TYPE_UCAST_SRC_ALIVE:
5450                 break;
5451             default:
5452                 expert_add_info_format(pinfo, type_item, &ei_lbmr_analysis_invalid_value, "Unknown LBMR type 0x%02x", type);
5453                 break;
5454         }
5455     }
5456     if ((tvb_reported_length_remaining(tvb, offset) > 0) && ((ver_type & LBMR_HDR_TYPE_OPTS_MASK) != 0))
5457     {
5458         /* Process LBMR packet options. */
5459         len_dissected = dissect_lbmr_options(tvb, offset, pinfo, lbmr_tree);
5460         total_len_dissected += len_dissected;
5461     }
5462     return (total_len_dissected);
5463 }
5464
5465 static gboolean test_lbmr_packet(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * user_data _U_)
5466 {
5467     lbmr_tag_entry_t entry;
5468     gboolean valid_packet = FALSE;
5469
5470     /* Must be a UDP packet. */
5471     if (pinfo->ptype != PT_UDP)
5472     {
5473         return (FALSE);
5474     }
5475     /* Destination address must be IPV4 and 4 bytes in length. */
5476     if ((pinfo->dst.type != AT_IPv4) || (pinfo->dst.len != 4))
5477     {
5478         return (FALSE);
5479     }
5480
5481     if (lbmr_use_tag)
5482     {
5483         if (lbmr_tag_find(pinfo) != NULL)
5484         {
5485             valid_packet = TRUE;
5486         }
5487     }
5488     else
5489     {
5490         entry.name = NULL;
5491         entry.mc_outgoing_udp_port = lbmr_mc_outgoing_udp_port;
5492         entry.mc_incoming_udp_port = lbmr_mc_incoming_udp_port;
5493         entry.mc_incoming_address = NULL;
5494         entry.mc_incoming_address_val_h = lbmr_mc_incoming_address_host;
5495         entry.mc_outgoing_address = NULL;
5496         entry.mc_outgoing_address_val_h = lbmr_mc_outgoing_address_host;
5497         entry.uc_port_high = lbmr_uc_port_high;
5498         entry.uc_port_low = lbmr_uc_port_low;
5499         entry.uc_dest_port = lbmr_uc_dest_port;
5500         entry.uc_address = NULL;
5501         entry.uc_address_val_h = lbmr_uc_address_host;
5502         valid_packet = lbmr_match_packet(pinfo, &entry);
5503     }
5504     if (valid_packet)
5505     {
5506         dissect_lbmr(tvb, pinfo, tree, NULL);
5507         return (TRUE);
5508     }
5509     return (FALSE);
5510 }
5511
5512 /* Register all the bits needed with the filtering engine */
5513 void proto_register_lbmr(void)
5514 {
5515     static hf_register_info hf[] =
5516     {
5517         { &hf_lbmr_tag,
5518             { "Tag", "lbmr.tag", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5519         { &hf_lbmr_hdr,
5520             { "Header", "lbmr.hdr", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5521         { &hf_lbmr_hdr_ver,
5522             { "Version", "lbmr.hdr.ver", FT_UINT8, BASE_DEC, NULL, LBMR_HDR_VER_VER_MASK, NULL, HFILL } },
5523         { &hf_lbmr_hdr_opt,
5524             { "Options", "lbmr.hdr.opts", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), LBMR_HDR_TYPE_OPTS_MASK, "Set if LBMR options are present", HFILL } },
5525         { &hf_lbmr_hdr_type,
5526             { "Type", "lbmr.hdr.type", FT_UINT8, BASE_HEX, VALS(lbmr_packet_type), LBMR_HDR_VER_TYPE_MASK, NULL, HFILL } },
5527         { &hf_lbmr_hdr_tqrs,
5528             { "Topic Query Records", "lbmr.hdr.tqrs", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5529         { &hf_lbmr_hdr_tirs,
5530             { "Topic Information Records", "lbmr.hdr.tirs", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5531         { &hf_lbmr_hdr_qqrs,
5532             { "Queue Query Records", "lbmr.hdr.qqrs", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5533         { &hf_lbmr_hdr_qirs,
5534             { "Queue Information Records", "lbmr.hdr.qirs", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5535         { &hf_lbmr_hdr_ext_type,
5536             { "Extended Type", "lbmr.hdr.ext_type", FT_UINT8, BASE_HEX, VALS(lbmr_ext_packet_type), 0x0, NULL, HFILL } },
5537         { &hf_lbmr_tqrs,
5538             { "TQRs", "lbmr.tqrs", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5539         { &hf_lbmr_tqr,
5540             { "TQR", "lbmr.tqr", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5541         { &hf_lbmr_tqr_pattern_type,
5542             { "Pattern Type", "lbmr.tqr.pattern_type", FT_UINT8, BASE_DEC, VALS(lbm_wildcard_pattern_type), 0x0, NULL, HFILL } },
5543         { &hf_lbmr_tqr_pattern,
5544             { "Pattern", "lbmr.tqr.pattern", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5545         { &hf_lbmr_tqr_name,
5546             { "Topic Name", "lbmr.tqr.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5547         { &hf_lbmr_tirs,
5548             { "TIRs", "lbmr.tirs", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5549         { &hf_lbmr_tir,
5550             { "TIR", "lbmr.tir", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5551         { &hf_lbmr_tir_name,
5552             { "Topic Name", "lbmr.tir.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5553         { &hf_lbmr_tir_transport_opts,
5554             { "Transport Options Present", "lbmr.tir.transport_opts", FT_BOOLEAN, L_LBMR_TIR_T_TRANSPORT * 8, TFS(&tfs_set_notset), LBMR_TIR_OPTIONS, "Set if transport options are present", HFILL } },
5555         { &hf_lbmr_tir_transport_type,
5556             { "Transport Type", "lbmr.tir.transport_type", FT_UINT8, BASE_HEX, VALS(lbmr_transport_type), LBMR_TIR_TRANSPORT, NULL, HFILL } },
5557         { &hf_lbmr_tir_tlen,
5558             { "Transport Info Length", "lbmr.tir.tlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5559         { &hf_lbmr_tir_ttl,
5560             { "TTL", "lbmr.tir.ttl", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5561         { &hf_lbmr_tir_index,
5562             { "Index", "lbmr.tir.index", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5563         { &hf_lbmr_tir_tcp,
5564             { "TCP Transport", "lbmr.tir.tcp", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5565         { &hf_lbmr_tir_tcp_ip,
5566             { "Source IP", "lbmr.tir.tcp.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5567         { &hf_lbmr_tir_tcp_session_id,
5568             { "Session ID", "lbmr.tir.tcp.session_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5569         { &hf_lbmr_tir_tcp_port,
5570             { "Source Port", "lbmr.tir.tcp.port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5571         { &hf_lbmr_tir_lbtrm,
5572             { "LBTRM Transport", "lbmr.tir.lbtrm", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5573         { &hf_lbmr_tir_lbtrm_src_addr,
5574             { "Source IP", "lbmr.tir.lbtrm.srcip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5575         { &hf_lbmr_tir_lbtrm_mcast_addr,
5576             { "Multicast IP", "lbmr.tir.lbtrm.mcastip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5577         { &hf_lbmr_tir_lbtrm_session_id,
5578             { "Session ID", "lbmr.tir.lbtrm.sessid", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5579         { &hf_lbmr_tir_lbtrm_udp_dest_port,
5580             { "Destination Port", "lbmr.tir.lbtrm.dport", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5581         { &hf_lbmr_tir_lbtrm_src_ucast_port,
5582             { "Source Port", "lbmr.tir.lbtrm.sport", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5583         { &hf_lbmr_tir_lbtru,
5584             { "LBTRU Transport", "lbmr.tir.lbtru", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5585         { &hf_lbmr_tir_lbtru_ip,
5586             { "Source IP", "lbmr.tir.lbtru.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5587         { &hf_lbmr_tir_lbtru_port,
5588             { "Source Port", "lbmr.tir.lbtru.port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5589         { &hf_lbmr_tir_lbtru_session_id,
5590             { "Session ID", "lbmr.tir.lbtru.session_id", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5591         { &hf_lbmr_tir_lbtipc,
5592             { "LBTIPC Transport", "lbmr.tir.lbtipc", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5593         { &hf_lbmr_tir_lbtipc_host_id,
5594             { "Host ID", "lbmr.tir.lbtipc.host_id", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } },
5595         { &hf_lbmr_tir_lbtipc_session_id,
5596             { "Session ID", "lbmr.tir.lbtipc.session_id", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } },
5597         { &hf_lbmr_tir_lbtipc_xport_id,
5598             { "Transport ID", "lbmr.tir.lbtipc.xport_id", FT_UINT16, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } },
5599         { &hf_lbmr_tir_lbtrdma,
5600             { "LBTRDMA Transport", "lbmr.tir.lbtrdma", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5601         { &hf_lbmr_tir_lbtrdma_ip,
5602             { "Source IP", "lbmr.tir.lbtrdma.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5603         { &hf_lbmr_tir_lbtrdma_session_id,
5604             { "Session ID", "lbmr.tir.lbtrdma.session_id", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } },
5605         { &hf_lbmr_tir_lbtrdma_port,
5606             { "Port", "lbmr.tir.lbtrdma.port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5607         { &hf_lbmr_tir_lbtsmx,
5608             { "LBTSMX Transport", "lbmr.tir.lbtsmx", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5609         { &hf_lbmr_tir_lbtsmx_host_id,
5610             { "Host ID", "lbmr.tir.lbtsmx.host_id", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } },
5611         { &hf_lbmr_tir_lbtsmx_session_id,
5612             { "Session ID", "lbmr.tir.lbtsmx.session_id", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } },
5613         { &hf_lbmr_tir_lbtsmx_xport_id,
5614             { "Transport ID", "lbmr.tir.lbtsmx.xport_id", FT_UINT16, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } },
5615         { &hf_lbmr_tir_channel,
5616             { "Channel", "lbmr.tir.channel", FT_UINT64, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } },
5617         { &hf_lbmr_tir_unknown_transport,
5618             { "Unknown Transport", "lbmr.tir.unknown_transport", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5619         { &hf_lbmr_topts,
5620             { "Options", "lbmr.topts", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5621         { &hf_lbmr_topt_len,
5622             { "Length Option", "lbmr.topt.len", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5623         { &hf_lbmr_topt_len_type,
5624             { "Type", "lbmr.topt.len.type", FT_UINT8, BASE_DEC, VALS(lbmr_topic_option_type), 0x0, NULL, HFILL } },
5625         { &hf_lbmr_topt_len_len,
5626             { "Length", "lbmr.topt.len.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5627         { &hf_lbmr_topt_len_total_len,
5628             { "Total Length", "lbmr.topt.len.total_len", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5629         { &hf_lbmr_topt_ume,
5630             { "UME Option", "lbmr.topt.ume", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5631         { &hf_lbmr_topt_ume_type,
5632             { "Type", "lbmr.topt.ume.type", FT_UINT8, BASE_DEC, VALS(lbmr_topic_option_type), 0x0, NULL, HFILL } },
5633         { &hf_lbmr_topt_ume_len,
5634             { "Length", "lbmr.topt.ume.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5635         { &hf_lbmr_topt_ume_flags,
5636             { "Flags", "lbmr.topt.ume.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5637         { &hf_lbmr_topt_ume_flags_ignore,
5638             { "Ignore", "lbmr.topt.ume.flags.ignore", FT_BOOLEAN, L_LBMR_TOPIC_OPT_UME_T_FLAGS * 8, TFS(&lbm_ignore_flag), LBMR_TOPIC_OPT_UME_FLAG_IGNORE, NULL, HFILL } },
5639         { &hf_lbmr_topt_ume_flags_latejoin,
5640             { "Late Join", "lbmr.topt.ume.flags.latejoin", FT_BOOLEAN, L_LBMR_TOPIC_OPT_UME_T_FLAGS * 8, TFS(&tfs_set_notset), LBMR_TOPIC_OPT_UME_FLAG_LATEJOIN, "If set, the source provides late join", HFILL } },
5641         { &hf_lbmr_topt_ume_flags_store,
5642             { "Store", "lbmr.topt.ume.flags.store", FT_BOOLEAN, L_LBMR_TOPIC_OPT_UME_T_FLAGS * 8, TFS(&tfs_set_notset), LBMR_TOPIC_OPT_UME_FLAG_STORE, "If set, one or more stores are specified", HFILL } },
5643         { &hf_lbmr_topt_ume_flags_qccap,
5644             { "Q/C Capable", "lbmr.topt.ume.flags.qccap", FT_BOOLEAN, L_LBMR_TOPIC_OPT_UME_T_FLAGS * 8, TFS(&tfs_set_notset), LBMR_TOPIC_OPT_UME_FLAG_QCCAP, "If set, the source supports quorun/consensus", HFILL } },
5645         { &hf_lbmr_topt_ume_flags_acktosrc,
5646             { "Send ACKs to Source", "lbmr.topt.ume.flags.acktosrc", FT_BOOLEAN, L_LBMR_TOPIC_OPT_UME_T_FLAGS * 8, TFS(&tfs_set_notset), LBMR_TOPIC_OPT_UME_FLAG_ACKTOSRC, "If set, receivers send ACKs to the source", HFILL } },
5647         { &hf_lbmr_topt_ume_store_tcp_port,
5648             { "Store TCP Port", "lbmr.topt.ume.store_tcp_port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5649         { &hf_lbmr_topt_ume_src_tcp_port,
5650             { "Source TCP Port", "lbmr.topt.ume.src_tcp_port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5651         { &hf_lbmr_topt_ume_store_tcp_addr,
5652             { "Store TCP Address", "lbmr.topt.ume.store_tcp_addr", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5653         { &hf_lbmr_topt_ume_src_tcp_addr,
5654             { "Source TCP Address", "lbmr.topt.ume.src_tcp_addr", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5655         { &hf_lbmr_topt_ume_src_reg_id,
5656             { "Source Registration ID", "lbmr.topt.ume.src_reg_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5657         { &hf_lbmr_topt_ume_transport_idx,
5658             { "Transport Index", "lbmr.topt.ume.transport_idx", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5659         { &hf_lbmr_topt_ume_high_seqnum,
5660             { "High Sequence Number", "lbmr.topt.ume.high_seqnum", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5661         { &hf_lbmr_topt_ume_low_seqnum,
5662             { "Low Sequence Number", "lbmr.topt.ume.low_seqnum", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5663         { &hf_lbmr_topt_ume_store,
5664             { "UME Store Option", "lbmr.topt.ume_store", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5665         { &hf_lbmr_topt_ume_store_type,
5666             { "Type", "lbmr.topt.ume_store.type", FT_UINT8, BASE_DEC_HEX, VALS(lbmr_topic_option_type), 0x0, NULL, HFILL } },
5667         { &hf_lbmr_topt_ume_store_len,
5668             { "Length", "lbmr.topt.ume_store.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5669         { &hf_lbmr_topt_ume_store_flags,
5670             { "Flags", "lbmr.topt.ume_store.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5671         { &hf_lbmr_topt_ume_store_flags_ignore,
5672             { "Ignore", "lbmr.topt.ume_store.flags.ignore", FT_BOOLEAN, L_LBMR_TOPIC_OPT_UME_STORE_T_FLAGS * 8, TFS(&lbm_ignore_flag), LBMR_TOPIC_OPT_UME_STORE_FLAG_IGNORE, NULL, HFILL } },
5673         { &hf_lbmr_topt_ume_store_grp_idx,
5674             { "Group Index", "lbmr.topt.ume_store.grp_idx", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5675         { &hf_lbmr_topt_ume_store_store_tcp_port,
5676             { "Store TCP Port", "lbmr.topt.ume_store.store_tcp_port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5677         { &hf_lbmr_topt_ume_store_store_idx,
5678             { "Store Index", "lbmr.topt.ume_store.store_idx", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5679         { &hf_lbmr_topt_ume_store_store_ip_addr,
5680             { "Store IP Address", "lbmr.topt.ume_store.store_ip_addr", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5681         { &hf_lbmr_topt_ume_store_src_reg_id,
5682             { "Source Registration ID", "lbmr.topt.ume_store.src_reg_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5683         { &hf_lbmr_topt_ume_store_group,
5684             { "UME Store Group Option", "lbmr.topt.ume_store_group", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5685         { &hf_lbmr_topt_ume_store_group_type,
5686             { "Type", "lbmr.topt.ume_store_group.type", FT_UINT8, BASE_DEC_HEX, VALS(lbmr_topic_option_type), 0x0, NULL, HFILL } },
5687         { &hf_lbmr_topt_ume_store_group_len,
5688             { "Length", "lbmr.topt.ume_store_group.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5689         { &hf_lbmr_topt_ume_store_group_flags,
5690             { "Flags", "lbmr.topt.ume_store_group.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5691         { &hf_lbmr_topt_ume_store_group_flags_ignore,
5692             { "Ignore", "lbmr.topt.ume_store_group.flags.ignore", FT_BOOLEAN, L_LBMR_TOPIC_OPT_UME_STORE_GROUP_T_FLAGS * 8, TFS(&lbm_ignore_flag), LBMR_TOPIC_OPT_UME_STORE_GROUP_FLAG_IGNORE, NULL, HFILL } },
5693         { &hf_lbmr_topt_ume_store_group_grp_idx,
5694             { "Group Index", "lbmr.topt.ume_store_group.grp_idx", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5695         { &hf_lbmr_topt_ume_store_group_grp_sz,
5696             { "Group Size", "lbmr.topt.ume_store_group.grp_sz", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5697         { &hf_lbmr_topt_ume_store_group_reserved,
5698             { "Reserved", "lbmr.topt.ume_store_group.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5699         { &hf_lbmr_topt_latejoin,
5700             { "Late Join Option", "lbmr.topt.latejoin", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5701         { &hf_lbmr_topt_latejoin_type,
5702             { "Type", "lbmr.topt.latejoin.type", FT_UINT8, BASE_DEC_HEX, VALS(lbmr_topic_option_type), 0x0, NULL, HFILL } },
5703         { &hf_lbmr_topt_latejoin_len,
5704             { "Length", "lbmr.topt.latejoin.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5705         { &hf_lbmr_topt_latejoin_flags,
5706             { "Flags", "lbmr.topt.latejoin.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5707         { &hf_lbmr_topt_latejoin_flags_ignore,
5708             { "Ignore", "lbmr.topt.latejoin.flags.ignore", FT_BOOLEAN, L_LBMR_TOPIC_OPT_LATEJOIN_T_FLAGS * 8, TFS(&lbm_ignore_flag), LBMR_TOPIC_OPT_LATEJOIN_FLAG_IGNORE, NULL, HFILL } },
5709         { &hf_lbmr_topt_latejoin_flags_acktosrc,
5710             { "Send ACKs to Source", "lbmr.topt.latejoin.flags.acktosrc", FT_BOOLEAN, L_LBMR_TOPIC_OPT_LATEJOIN_T_FLAGS * 8, TFS(&tfs_set_notset), LBMR_TOPIC_OPT_LATEJOIN_FLAG_ACKTOSRC, "If set, ACKs are sent to source", HFILL } },
5711         { &hf_lbmr_topt_latejoin_src_tcp_port,
5712             { "Source TCP Port", "lbmr.topt.latejoin.src_tcp_port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5713         { &hf_lbmr_topt_latejoin_reserved,
5714             { "Reserved", "lbmr.topt.latejoin.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5715         { &hf_lbmr_topt_latejoin_src_ip_addr,
5716             { "Source IP Address", "lbmr.topt.latejoin.src_ip_addr", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5717         { &hf_lbmr_topt_latejoin_transport_idx,
5718             { "Transport Index", "lbmr.topt.latejoin.transport_idx", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5719         { &hf_lbmr_topt_latejoin_high_seqnum,
5720             { "High Sequence Number", "lbmr.topt.latejoin.high_seqnum", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5721         { &hf_lbmr_topt_latejoin_low_seqnum,
5722             { "Low Sequence Number", "lbmr.topt.latejoin.low_seqnum", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5723         { &hf_lbmr_topt_umq_rcridx,
5724             { "Receiver Control Record Index Option", "lbmr.topt.umq_rcridx", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5725         { &hf_lbmr_topt_umq_rcridx_type,
5726             { "Type", "lbmr.topt.umq_rcridx.type", FT_UINT8, BASE_DEC_HEX, VALS(lbmr_topic_option_type), 0x0, NULL, HFILL } },
5727         { &hf_lbmr_topt_umq_rcridx_len,
5728             { "Length", "lbmr.topt.umq_rcridx.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5729         { &hf_lbmr_topt_umq_rcridx_flags,
5730             { "Flags", "lbmr.topt.umq_rcridx.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5731         { &hf_lbmr_topt_umq_rcridx_flags_ignore,
5732             { "Ignore", "lbmr.topt.umq_rcridx.flags.ignore", FT_BOOLEAN, L_LBMR_TOPIC_OPT_UMQ_RCRIDX_T_FLAGS * 8, TFS(&lbm_ignore_flag), LBMR_TOPIC_OPT_UMQ_RCRIDX_FLAG_IGNORE, NULL, HFILL } },
5733         { &hf_lbmr_topt_umq_rcridx_rcr_idx,
5734             { "Receiver Control Record Index", "lbmr.topt.umq_rcridx.rcr_idx", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } },
5735         { &hf_lbmr_topt_umq_qinfo,
5736             { "Queue Info Option", "lbmr.topt.umq_qinfo", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5737         { &hf_lbmr_topt_umq_qinfo_type,
5738             { "Type", "lbmr.topt.umq_qinfo.type", FT_UINT8, BASE_DEC_HEX, VALS(lbmr_topic_option_type), 0x0, NULL, HFILL } },
5739         { &hf_lbmr_topt_umq_qinfo_len,
5740             { "Length", "lbmr.topt.umq_qinfo.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5741         { &hf_lbmr_topt_umq_qinfo_flags,
5742             { "Flags", "lbmr.topt.umq_qinfo.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5743         { &hf_lbmr_topt_umq_qinfo_flags_ignore,
5744             { "Ignore", "lbmr.topt.umq_qinfo.flags.ignore", FT_BOOLEAN, L_LBMR_TOPIC_OPT_T_FLAGS * 8, TFS(&lbm_ignore_flag), LBMR_TOPIC_OPT_UMQ_FLAG_IGNORE, NULL, HFILL } },
5745         { &hf_lbmr_topt_umq_qinfo_flags_queue,
5746             { "Queue", "lbmr.topt.umq_qinfo.flags.queue", FT_BOOLEAN, L_LBMR_TOPIC_OPT_T_FLAGS * 8, TFS(&tfs_set_notset), LBMR_TOPIC_OPT_UMQ_FLAG_QUEUE, NULL, HFILL } },
5747         { &hf_lbmr_topt_umq_qinfo_flags_rcvlisten,
5748             { "Receiver Listen", "lbmr.topt.umq_qinfo.flags.rcvlisten", FT_BOOLEAN, L_LBMR_TOPIC_OPT_T_FLAGS * 8, TFS(&tfs_set_notset), LBMR_TOPIC_OPT_UMQ_FLAG_RCVLISTEN, NULL, HFILL } },
5749         { &hf_lbmr_topt_umq_qinfo_flags_control,
5750             { "Control", "lbmr.topt.umq_qinfo.flags.control", FT_BOOLEAN, L_LBMR_TOPIC_OPT_T_FLAGS * 8, TFS(&tfs_set_notset), LBMR_TOPIC_OPT_UMQ_FLAG_CONTROL, NULL, HFILL } },
5751         { &hf_lbmr_topt_umq_qinfo_flags_srcrcvlisten,
5752             { "Source Receiver Listen", "lbmr.topt.umq_qinfo.flags.srcrcvlisten", FT_BOOLEAN, L_LBMR_TOPIC_OPT_T_FLAGS * 8, TFS(&tfs_set_notset), LBMR_TOPIC_OPT_UMQ_FLAG_SRCRCVLISTEN, NULL, HFILL } },
5753         { &hf_lbmr_topt_umq_qinfo_flags_participants_only,
5754             { "Participants Only", "lbmr.topt.umq_qinfo.flags.participants_only", FT_BOOLEAN, L_LBMR_TOPIC_OPT_T_FLAGS * 8, TFS(&tfs_set_notset), LBMR_TOPIC_OPT_UMQ_FLAG_PARTICIPANTS_ONLY, NULL, HFILL } },
5755         { &hf_lbmr_topt_umq_qinfo_queue,
5756             { "Queue", "lbmr.topt.ume_qinfo.queue", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5757         { &hf_lbmr_topt_cost,
5758             { "Cost Option", "lbmr.topt.cost", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5759         { &hf_lbmr_topt_cost_type,
5760             { "Type", "lbmr.topt.cost.type", FT_UINT8, BASE_DEC_HEX, VALS(lbmr_topic_option_type), 0x0, NULL, HFILL } },
5761         { &hf_lbmr_topt_cost_len,
5762             { "Length", "lbmr.topt.cost.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5763         { &hf_lbmr_topt_cost_flags,
5764             { "Flags", "lbmr.topt.cost.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5765         { &hf_lbmr_topt_cost_flags_ignore,
5766             { "Ignore", "lbmr.topt.cost.flags.ignore", FT_BOOLEAN, L_LBMR_TOPIC_OPT_COST_T_FLAGS * 8, TFS(&lbm_ignore_flag), LBMR_TOPIC_OPT_COST_FLAG_IGNORE, NULL, HFILL } },
5767         { &hf_lbmr_topt_cost_hop_count,
5768             { "Hop count", "lbmr.topt.cost.hop_count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5769         { &hf_lbmr_topt_cost_cost,
5770             { "Cost", "lbmr.topt.cost.cost", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5771         { &hf_lbmr_topt_otid,
5772             { "Originating Transport ID Option", "lbmr.topt.otid", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5773         { &hf_lbmr_topt_otid_type,
5774             { "Type", "lbmr.topt.otid.type", FT_UINT8, BASE_DEC_HEX, VALS(lbmr_topic_option_type), 0x0, NULL, HFILL } },
5775         { &hf_lbmr_topt_otid_len,
5776             { "Length", "lbmr.topt.otid.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5777         { &hf_lbmr_topt_otid_flags,
5778             { "Flags", "lbmr.topt.otid.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5779         { &hf_lbmr_topt_otid_flags_ignore,
5780             { "Ignore", "lbmr.topt.otid.flags.ignore", FT_BOOLEAN, L_LBMR_TOPIC_OPT_OTID_T_FLAGS * 8, TFS(&lbm_ignore_flag), LBMR_TOPIC_OPT_OTID_FLAG_IGNORE, NULL, HFILL } },
5781         { &hf_lbmr_topt_otid_originating_transport,
5782             { "Originating Transport ID", "lbmr.topt.otid.originating_transport", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5783         { &hf_lbmr_topt_ctxinst,
5784             { "Context Instance Option", "lbmr.topt.ctxinst", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5785         { &hf_lbmr_topt_ctxinst_type,
5786             { "Type", "lbmr.topt.ctxinst.type", FT_UINT8, BASE_DEC_HEX, VALS(lbmr_topic_option_type), 0x0, NULL, HFILL } },
5787         { &hf_lbmr_topt_ctxinst_len,
5788             { "Length", "lbmr.topt.ctxinst.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5789         { &hf_lbmr_topt_ctxinst_flags,
5790             { "Flags", "lbmr.topt.ctxinst.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5791         { &hf_lbmr_topt_ctxinst_flags_ignore,
5792             { "Ignore", "lbmr.topt.ctxinst.flags.ignore", FT_BOOLEAN, L_LBMR_TOPIC_OPT_CTXINST_T_FLAGS * 8, TFS(&lbm_ignore_flag), LBMR_TOPIC_OPT_CTXINST_FLAG_IGNORE, NULL, HFILL } },
5793         { &hf_lbmr_topt_ctxinst_res,
5794             { "Reserved", "lbmr.topt.ctxinst.res", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5795         { &hf_lbmr_topt_ctxinst_ctxinst,
5796             { "Context Instance", "lbmr.topt.ctxinst.ctxinst", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5797         { &hf_lbmr_topt_ctxinsts,
5798             { "Store Context Instance Option", "lbmr.topt.ctxinsts", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5799         { &hf_lbmr_topt_ctxinsts_type,
5800             { "Type", "lbmr.topt.ctxinsts.type", FT_UINT8, BASE_DEC_HEX, VALS(lbmr_topic_option_type), 0x0, NULL, HFILL } },
5801         { &hf_lbmr_topt_ctxinsts_len,
5802             { "Length", "lbmr.topt.ctxinsts.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5803         { &hf_lbmr_topt_ctxinsts_flags,
5804             { "Flags", "lbmr.topt.ctxinsts.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5805         { &hf_lbmr_topt_ctxinsts_flags_ignore,
5806             { "Ignore", "lbmr.topt.ctxinsts.flags.ignore", FT_BOOLEAN, L_LBMR_TOPIC_OPT_CTXINSTS_T_FLAGS * 8, TFS(&lbm_ignore_flag), LBMR_TOPIC_OPT_CTXINSTS_FLAG_IGNORE, NULL, HFILL } },
5807         { &hf_lbmr_topt_ctxinsts_idx,
5808             { "Index", "lbmr.topt.ctxinsts.idx", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5809         { &hf_lbmr_topt_ctxinsts_ctxinst,
5810             { "Store Context Instance", "lbmr.topt.ctxinsts.ctxinsts", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5811         { &hf_lbmr_topt_ulb,
5812             { "ULB Option", "lbmr.topt.ulb", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5813         { &hf_lbmr_topt_ulb_type,
5814             { "Type", "lbmr.topt.ulb.type", FT_UINT8, BASE_DEC_HEX, VALS(lbmr_topic_option_type), 0x0, NULL, HFILL } },
5815         { &hf_lbmr_topt_ulb_len,
5816             { "Length", "lbmr.topt.ulb.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5817         { &hf_lbmr_topt_ulb_flags,
5818             { "Flags", "lbmr.topt.ulb.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5819         { &hf_lbmr_topt_ulb_flags_ignore,
5820             { "Ignore", "lbmr.topt.ulb.flags.ignore", FT_BOOLEAN, L_LBMR_TOPIC_OPT_ULB_T_FLAGS * 8, TFS(&lbm_ignore_flag), LBMR_TOPIC_OPT_ULB_FLAG_IGNORE, NULL, HFILL } },
5821         { &hf_lbmr_topt_ulb_queue_id,
5822             { "Queue ID", "lbmr.topt.ulb.queue_id", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } },
5823         { &hf_lbmr_topt_ulb_regid,
5824             { "Registration ID", "lbmr.topt.ulb.regid", FT_UINT64, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } },
5825         { &hf_lbmr_topt_ulb_ulb_src_id,
5826             { "ULB Source ID", "lbmr.topt.ulb.ulb_src_id", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } },
5827         { &hf_lbmr_topt_ulb_src_ip_addr,
5828             { "Source IP Address", "lbmr.topt.ulb.src_ip_addr", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5829         { &hf_lbmr_topt_ulb_src_tcp_port,
5830             { "Source TCP Port", "lbmr.topt.ulb.src_tcp_port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5831         { &hf_lbmr_topt_ulb_reserved,
5832             { "Reserved", "lbmr.topt.ulb.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5833         { &hf_lbmr_topt_ctxinstq,
5834             { "Queue Context Instance Option", "lbmr.topt.ctxinstq", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5835         { &hf_lbmr_topt_ctxinstq_type,
5836             { "Type", "lbmr.topt.ctxinstq.type", FT_UINT8, BASE_DEC_HEX, VALS(lbmr_topic_option_type), 0x0, NULL, HFILL } },
5837         { &hf_lbmr_topt_ctxinstq_len,
5838             { "Length", "lbmr.topt.ctxinstq.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5839         { &hf_lbmr_topt_ctxinstq_flags,
5840             { "Flags", "lbmr.topt.ctxinstq.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5841         { &hf_lbmr_topt_ctxinstq_flags_ignore,
5842             { "Ignore", "lbmr.topt.ctxinstq.flags.ignore", FT_BOOLEAN, L_LBMR_TOPIC_OPT_CTXINSTQ_T_FLAGS * 8, TFS(&lbm_ignore_flag), LBMR_TOPIC_OPT_CTXINSTQ_FLAG_IGNORE, NULL, HFILL } },
5843         { &hf_lbmr_topt_ctxinstq_idx,
5844             { "Index", "lbmr.topt.ctxinstq.idx", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5845         { &hf_lbmr_topt_ctxinstq_ctxinst,
5846             { "Store Context Instance", "lbmr.topt.ctxinstq.ctxinstq", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5847         { &hf_lbmr_topt_domain_id,
5848             { "Domain ID Option", "lbmr.topt.domain_id", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5849         { &hf_lbmr_topt_domain_id_type,
5850             { "Type", "lbmr.topt.domain_id.type", FT_UINT8, BASE_DEC_HEX, VALS(lbmr_topic_option_type), 0x0, NULL, HFILL } },
5851         { &hf_lbmr_topt_domain_id_len,
5852             { "Length", "lbmr.topt.domain_id.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5853         { &hf_lbmr_topt_domain_id_flags,
5854             { "Flags", "lbmr.topt.domain_id.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5855         { &hf_lbmr_topt_domain_id_flags_ignore,
5856             { "Ignore", "lbmr.topt.domain_id.flags.ignore", FT_BOOLEAN, L_LBMR_TOPIC_OPT_DOMAIN_ID_T_FLAGS * 8, TFS(&lbm_ignore_flag), LBMR_TOPIC_OPT_DOMAIN_ID_FLAG_IGNORE, NULL, HFILL } },
5857         { &hf_lbmr_topt_domain_id_domain_id,
5858             { "Domain ID", "lbmr.topt.domain_id.domain_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5859         { &hf_lbmr_topt_exfunc,
5860             { "Extended Functionality Option", "lbmr.topt.exfunc", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5861         { &hf_lbmr_topt_exfunc_type,
5862             { "Type", "lbmr.topt.exfunc.type", FT_UINT8, BASE_DEC_HEX, VALS(lbmr_topic_option_type), 0x0, NULL, HFILL } },
5863         { &hf_lbmr_topt_exfunc_len,
5864             { "Length", "lbmr.topt.exfunc.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5865         { &hf_lbmr_topt_exfunc_flags,
5866             { "Flags", "lbmr.topt.exfunc.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5867         { &hf_lbmr_topt_exfunc_flags_ignore,
5868             { "Ignore", "lbmr.topt.exfunc.flags.ignore", FT_BOOLEAN, L_LBMR_TOPIC_OPT_EXFUNC_T_FLAGS * 8, TFS(&lbm_ignore_flag), LBMR_TOPIC_OPT_EXFUNC_FLAG_IGNORE, NULL, HFILL } },
5869         { &hf_lbmr_topt_exfunc_src_tcp_port,
5870             { "Source TCP Port", "lbmr.topt.exfunc.src_tcp_port", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5871         { &hf_lbmr_topt_exfunc_reserved,
5872             { "Reserved", "lbmr.topt.exfunc.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5873         { &hf_lbmr_topt_exfunc_src_ip_addr,
5874             { "Source IP Address", "lbmr.topt.exfunc.src_ip_addr", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5875         { &hf_lbmr_topt_exfunc_functionality_flags,
5876             { "Functionality Flags", "lbmr.topt.exfunc.functionality_flags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5877         { &hf_lbmr_topt_exfunc_functionality_flags_ulb,
5878             { "ULB", "lbmr.topt.exfunc.functionality_flags.ulb", FT_BOOLEAN, L_LBMR_TOPIC_OPT_EXFUNC_T_FUNCTIONALITY_FLAGS * 8, TFS(&tfs_capable_not_capable), LBM_TOPIC_OPT_EXFUNC_FFLAG_ULB, "Set if ULB supported", HFILL } },
5879         { &hf_lbmr_topt_exfunc_functionality_flags_umq,
5880             { "UMQ", "lbmr.topt.exfunc.functionality_flags.umq", FT_BOOLEAN, L_LBMR_TOPIC_OPT_EXFUNC_T_FUNCTIONALITY_FLAGS * 8, TFS(&tfs_capable_not_capable), LBM_TOPIC_OPT_EXFUNC_FFLAG_UMQ, "Set if UMQ supported", HFILL } },
5881         { &hf_lbmr_topt_exfunc_functionality_flags_ume,
5882             { "UME", "lbmr.topt.exfunc.functionality_flags.ume", FT_BOOLEAN, L_LBMR_TOPIC_OPT_EXFUNC_T_FUNCTIONALITY_FLAGS * 8, TFS(&tfs_capable_not_capable), LBM_TOPIC_OPT_EXFUNC_FFLAG_UME, "Set if UME supported", HFILL } },
5883         { &hf_lbmr_topt_exfunc_functionality_flags_lj,
5884             { "Late Join", "lbmr.topt.exfunc.functionality_flags.lj", FT_BOOLEAN, L_LBMR_TOPIC_OPT_EXFUNC_T_FUNCTIONALITY_FLAGS * 8, TFS(&tfs_capable_not_capable), LBM_TOPIC_OPT_EXFUNC_FFLAG_LJ, "Set if late join supported", HFILL } },
5885         { &hf_lbmr_topt_unknown,
5886             { "Unknown Option", "lbmr.topt.unknown", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5887         { &hf_lbmr_topt_unknown_type,
5888             { "Type", "lbmr.topt.unknown.type", FT_UINT8, BASE_DEC_HEX, VALS(lbmr_topic_option_type), 0x0, NULL, HFILL } },
5889         { &hf_lbmr_topt_unknown_len,
5890             { "Length", "lbmr.topt.unknown.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5891         { &hf_lbmr_topt_unknown_flags,
5892             { "Flags", "lbmr.topt.unknown.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5893         { &hf_lbmr_topt_unknown_data,
5894             { "Data", "lbmr.topt.unknown.data", FT_BYTES, FT_NONE, NULL, 0x0, NULL, HFILL } },
5895         { &hf_lbmr_tmb,
5896             { "Topic Management Block", "lbmr.tmb", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5897         { &hf_lbmr_tmb_len,
5898             { "Length", "lbmr.tmb.len", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5899         { &hf_lbmr_tmb_tmrs,
5900             { "Topic Management Record Count", "lbmr.tmb.tmrs", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5901         { &hf_lbmr_tmb_tmr_list,
5902             { "Topic Management Records", "lbmr.tmb.tmr_list", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5903         { &hf_lbmr_tmr,
5904             { "Topic Management Record", "lbmr.tmb.tmr", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5905         { &hf_lbmr_tmr_len,
5906             { "Length", "lbmr.tmb.tmr.len", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5907         { &hf_lbmr_tmr_type,
5908             { "TMR Type", "lbmr.tmb.tmr.type", FT_UINT8, BASE_DEC, VALS(lbmr_tmr_type), 0x0, NULL, HFILL } },
5909         { &hf_lbmr_tmr_flags,
5910             { "Flags", "lbmr.tmb.tmr.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5911         { &hf_lbmr_tmr_flags_response,
5912             { "Response", "lbmr.tmb.tmr.flags.response", FT_BOOLEAN, L_LBMR_TMR_T_FLAGS * 8, TFS(&tfs_set_notset), LBMR_TMR_FLAG_RESPONSE, "Set if this is a response", HFILL } },
5913         { &hf_lbmr_tmr_flags_wildcard_pcre,
5914             { "PCRE pattern", "lbmr.tmb.tmr.flags.wildcard_pcre", FT_BOOLEAN, L_LBMR_TMR_T_FLAGS * 8, TFS(&tfs_set_notset), LBMR_TMR_FLAG_WILDCARD_PCRE, "Set if topic is a PCRE pattern", HFILL } },
5915         { &hf_lbmr_tmr_flags_wildcard_regex,
5916             { "Regex pattern", "lbmr.tmb.tmr.flags.wildcard_regex", FT_BOOLEAN, L_LBMR_TMR_T_FLAGS * 8, TFS(&tfs_set_notset), LBMR_TMR_FLAG_WILDCARD_REGEX, "Set if topic is a Regex pattern", HFILL } },
5917         { &hf_lbmr_tmr_name,
5918             { "Topic Name", "lbmr.tmb.tmr.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5919         { &hf_lbmr_pser_dep_type,
5920             { "Dependent Type", "lbmr.pser.dep_type", FT_UINT16, BASE_DEC_HEX, VALS(lbmr_pser_dependent_type), 0x0, NULL, HFILL } },
5921         { &hf_lbmr_pser_len,
5922             { "Length", "lbmr.pser.len", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5923         { &hf_lbmr_pser_flags,
5924             { "Flags", "lbmr.pser.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5925         { &hf_lbmr_pser_flags_option,
5926             { "Option", "lbmr.pser.flags.option", FT_BOOLEAN, L_LBMR_PSER_T_FLAGS * 8, TFS(&tfs_set_notset), LBMR_PSER_OPT_FLAG, NULL, HFILL } },
5927         { &hf_lbmr_pser_source_ip,
5928             { "Source IP", "lbmr.pser.source_ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5929         { &hf_lbmr_pser_store_ip,
5930             { "Store IP", "lbmr.pser.store_ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5931         { &hf_lbmr_pser_transport_idx,
5932             { "Transport Index", "lbmr.pser.transport_idx", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5933         { &hf_lbmr_pser_topic_idx,
5934             { "Topic Index", "lbmr.pser.topic_idx", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5935         { &hf_lbmr_pser_source_port,
5936             { "Source Port", "lbmr.pser.source_port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5937         { &hf_lbmr_pser_store_port,
5938             { "Store Port", "lbmr.pser.store_port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5939         { &hf_lbmr_pser_topic,
5940             { "Topic", "lbmr.pser.topic", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5941         { &hf_lbmr_pser_opts,
5942             { "Options", "lbmr.pser.opts", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5943         { &hf_lbmr_pser_optlen,
5944             { "Option Length", "lbmr.pser.opt.optlen", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5945         { &hf_lbmr_pser_optlen_type,
5946             { "Type", "lbmr.pser.opt.optlen.type", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
5947         { &hf_lbmr_pser_optlen_optlen,
5948             { "Options Length", "lbmr.pser.opt.optlen.optlen", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5949         { &hf_lbmr_pser_opt_ctxinst,
5950             { "Context Instance Option", "lbmr.pser.opt.ctxinst", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5951         { &hf_lbmr_pser_opt_ctxinst_len,
5952             { "Length", "lbmr.pser.opt.ctxinst.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5953         { &hf_lbmr_pser_opt_ctxinst_type,
5954             { "Type", "lbmr.pser.opt.ctxinst.type", FT_UINT8, BASE_DEC_HEX, VALS(lbmr_pser_option_type), 0x0, NULL, HFILL } },
5955         { &hf_lbmr_pser_opt_ctxinst_ctxinst,
5956             { "Context Instance", "lbmr.pser.opt.ctxinst.ctxinst", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5957         { &hf_lbmr_qqr,
5958             { "QQRs", "lbmr.qqr", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5959         { &hf_lbmr_qqr_name,
5960             { "Queue name", "lbmr.qqr.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5961         { &hf_lbmr_qirs,
5962             { "QIRs", "lbmr.qirs", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5963         { &hf_lbmr_qir,
5964             { "QIR", "lbmr.qir", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5965         { &hf_lbmr_qir_queue_name,
5966             { "Queue name", "lbmr.qir.qname", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5967         { &hf_lbmr_qir_topic_name,
5968             { "Topic name", "lbmr.qir.tname", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5969         { &hf_lbmr_qir_queue_id,
5970             { "Queue ID", "lbmr.qir.queue_id", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5971         { &hf_lbmr_qir_queue_ver,
5972             { "Queue Version", "lbmr.qir.queue_ver", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5973         { &hf_lbmr_qir_queue_prev_ver,
5974             { "Queue Previous Version", "lbmr.qir.queue_prev_ver", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
5975         { &hf_lbmr_qir_option_flag,
5976             { "QIR Options Present", "lbmr.qir.opts", FT_BOOLEAN, L_LBMR_QIR_T_GRP_BLKS * 8, TFS(&tfs_set_notset), LBMR_QIR_OPTIONS, NULL, HFILL } },
5977         { &hf_lbmr_qir_grp_blks,
5978             { "Group Block Count", "lbmr.qir.grp_blks", FT_UINT16, BASE_DEC_HEX, NULL, LBMR_QIR_GRP_BLOCKS_MASK, NULL, HFILL } },
5979         { &hf_lbmr_qir_queue_blks,
5980             { "Queue Blocks", "lbmr.qir.queue_blks", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5981         { &hf_lbmr_qir_grps,
5982             { "Groups", "lbmr.qir.grps", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5983         { &hf_lbmr_qir_grp_blk,
5984             { "Group Block", "lbmr.qir.grp", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5985         { &hf_lbmr_qir_grp_blk_grp_idx,
5986             { "Group Index", "lbmr.qir.grp.grp_idx", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5987         { &hf_lbmr_qir_grp_blk_grp_sz,
5988             { "Group Size", "lbmr.qir.grp.grp_sz", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5989         { &hf_lbmr_qir_queues,
5990             { "Queues", "lbmr.qir.queues", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5991         { &hf_lbmr_qir_queue_blk,
5992             { "Queue Block", "lbmr.qir.queue", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5993         { &hf_lbmr_qir_queue_blk_ip,
5994             { "IP Address", "lbmr.qir.queue.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } },
5995         { &hf_lbmr_qir_queue_blk_port,
5996             { "Port", "lbmr.qir.queue.port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5997         { &hf_lbmr_qir_queue_blk_idx,
5998             { "Index", "lbmr.qir.queue.idx", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
5999         { &hf_lbmr_qir_queue_blk_grp_idx,
6000             { "Group Index", "lbmr.qir.queue.grp_idx", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
6001         { &hf_lbmr_qir_queue_blk_reserved,
6002             { "Reserved", "lbmr.qir.queue.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6003         { &hf_lbmr_opts,
6004             { "Options", "lbmr.opt", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6005         { &hf_lbmr_opt_len,
6006             { "Length Option", "lbmr.opt.len", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6007         { &hf_lbmr_opt_len_type,
6008             { "Type", "lbmr.opt.len.type", FT_UINT8, BASE_HEX_DEC, VALS(lbmr_option_type), 0x0, NULL, HFILL } },
6009         { &hf_lbmr_opt_len_len,
6010             { "Length", "lbmr.opt.len.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
6011         { &hf_lbmr_opt_len_total_len,
6012             { "Total Length", "lbmr.opt.len.total_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
6013         { &hf_lbmr_opt_src_id,
6014             { "Source ID Option", "lbmr.opt.src_id", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6015         { &hf_lbmr_opt_src_id_type,
6016             { "Type", "lbmr.opt.src_id.type", FT_UINT8, BASE_HEX_DEC, VALS(lbmr_option_type), 0x0, NULL, HFILL } },
6017         { &hf_lbmr_opt_src_id_len,
6018             { "Length", "lbmr.opt.src_id.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
6019         { &hf_lbmr_opt_src_id_flags,
6020             { "Flags", "lbmr.opt.src_id.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6021         { &hf_lbmr_opt_src_id_flags_ignore,
6022             { "Ignore", "lbmr.opt.src_id.flags.ignore", FT_BOOLEAN, L_LBMR_LBMR_OPT_SRC_ID_T_FLAGS * 8, TFS(&lbm_ignore_flag), LBMR_LBMR_OPT_SRC_ID_FLAG_IGNORE, NULL, HFILL } },
6023         { &hf_lbmr_opt_src_id_src_id,
6024             { "Source ID", "lbmr.opt.src_id.src_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6025         { &hf_lbmr_opt_src_type,
6026             { "Source Type Option", "lbmr.opt.src_type", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6027         { &hf_lbmr_opt_src_type_type,
6028             { "Type", "lbmr.opt.src_type.type", FT_UINT8, BASE_HEX_DEC, VALS(lbmr_option_type), 0x0, NULL, HFILL } },
6029         { &hf_lbmr_opt_src_type_len,
6030             { "Length", "lbmr.opt.src_type.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
6031         { &hf_lbmr_opt_src_type_flags,
6032             { "Flags", "lbmr.opt.src_type.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6033         { &hf_lbmr_opt_src_type_flags_ignore,
6034             { "Ignore", "lbmr.opt.src_type.flags.ignore", FT_BOOLEAN, L_LBMR_LBMR_OPT_SRC_TYPE_T_FLAGS * 8, TFS(&lbm_ignore_flag), LBMR_LBMR_OPT_SRC_TYPE_FLAG_IGNORE, NULL, HFILL } },
6035         { &hf_lbmr_opt_src_type_src_type,
6036             { "Source Type", "lbmr.opt.src_type.src_type", FT_UINT8, BASE_DEC_HEX, VALS(lbmr_option_source_type), 0x0, NULL, HFILL } },
6037         { &hf_lbmr_opt_version,
6038             { "Version Option", "lbmr.opt.version", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6039         { &hf_lbmr_opt_version_type,
6040             { "Type", "lbmr.opt.version.type", FT_UINT8, BASE_HEX_DEC, VALS(lbmr_option_type), 0x0, NULL, HFILL } },
6041         { &hf_lbmr_opt_version_len,
6042             { "Length", "lbmr.opt.version.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
6043         { &hf_lbmr_opt_version_flags,
6044             { "Flags", "lbmr.opt.version.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6045         { &hf_lbmr_opt_version_flags_ignore,
6046             { "Ignore", "lbmr.opt.version.flags.ignore", FT_BOOLEAN, L_LBMR_LBMR_OPT_VERSION_T_FLAGS * 8, TFS(&lbm_ignore_flag), LBMR_LBMR_OPT_VERSION_FLAG_IGNORE, NULL, HFILL } },
6047         { &hf_lbmr_opt_version_flags_ume,
6048             { "UME Capable", "lbmr.opt.version.flags.ume", FT_BOOLEAN, L_LBMR_LBMR_OPT_VERSION_T_FLAGS * 8, TFS(&tfs_set_notset), LBMR_LBMR_OPT_VERSION_FLAG_UME, "Set if UME capable", HFILL } },
6049         { &hf_lbmr_opt_version_flags_umq,
6050             { "UMQ Capable", "lbmr.opt.version.flags.umq", FT_BOOLEAN, L_LBMR_LBMR_OPT_VERSION_T_FLAGS * 8, TFS(&tfs_set_notset), LBMR_LBMR_OPT_VERSION_FLAG_UMQ, "Set if UMQ capable", HFILL } },
6051         { &hf_lbmr_opt_version_version,
6052             { "Version", "lbmr.opt.version.version", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6053         { &hf_lbmr_opt_local_domain,
6054             { "Local Domain Option", "lbmr.opt.local_domain", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6055         { &hf_lbmr_opt_local_domain_type,
6056             { "Type", "lbmr.opt.local_domain.type", FT_UINT8, BASE_HEX_DEC, VALS(lbmr_option_type), 0x0, NULL, HFILL } },
6057         { &hf_lbmr_opt_local_domain_len,
6058             { "Length", "lbmr.opt.local_domain.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
6059         { &hf_lbmr_opt_local_domain_flags,
6060             { "Flags", "lbmr.opt.local_domain.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6061         { &hf_lbmr_opt_local_domain_flags_ignore,
6062             { "Ignore", "lbmr.opt.local_domain.flags.ignore", FT_BOOLEAN, L_LBMR_LBMR_OPT_LOCAL_DOMAIN_T_FLAGS * 8, TFS(&lbm_ignore_flag), LBMR_LBMR_OPT_VERSION_FLAG_IGNORE, NULL, HFILL } },
6063         { &hf_lbmr_opt_local_domain_local_domain_id,
6064             { "Local Domain ID", "lbmr.opt.local_domain.local_domain_id", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6065         { &hf_lbmr_opt_unknown,
6066             { "Unknown ID Option", "lbmr.opt.unknown", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6067         { &hf_lbmr_opt_unknown_type,
6068             { "Type", "lbmr.opt.unknown.type", FT_UINT8, BASE_HEX_DEC, VALS(lbmr_option_type), 0x0, NULL, HFILL } },
6069         { &hf_lbmr_opt_unknown_len,
6070             { "Length", "lbmr.opt.unknown.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
6071         { &hf_lbmr_opt_unknown_flags,
6072             { "Flags", "lbmr.opt.unknown.flags", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6073         { &hf_lbmr_opt_unknown_data,
6074             { "Data", "lbmr.opt.unknown.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6075         { &hf_lbmr_topic_res_request_flags,
6076             { "Flags", "lbmr.topic_res_request.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6077         { &hf_lbmr_topic_res_request_flags_gw_remote_interest,
6078             { "Gateway Remote Interest", "lbmr.topic_res_request.flags.gw_remote_interest", FT_BOOLEAN, 8 * L_LBMR_TOPIC_RES_REQUEST_T_FLAGS, TFS(&tfs_set_notset), LBM_TOPIC_RES_REQUEST_GW_REMOTE_INTEREST, "Set if gateway remote interest is requested", HFILL } },
6079         { &hf_lbmr_topic_res_request_flags_context_query,
6080             { "Context Queries", "lbmr.topic_res_request.flags.context_query", FT_BOOLEAN, 8 * L_LBMR_TOPIC_RES_REQUEST_T_FLAGS, TFS(&tfs_set_notset), LBM_TOPIC_RES_REQUEST_CONTEXT_QUERY, "Set if context queries are requested", HFILL } },
6081         { &hf_lbmr_topic_res_request_flags_context_advertisement,
6082             { "Context Advertisements", "lbmr.topic_res_request.flags.context_advertisement", FT_BOOLEAN, 8 * L_LBMR_TOPIC_RES_REQUEST_T_FLAGS, TFS(&tfs_set_notset), LBM_TOPIC_RES_REQUEST_CONTEXT_ADVERTISEMENT, "Set if context advertisements are requested", HFILL } },
6083         { &hf_lbmr_topic_res_request_flags_gateway_meta,
6084             { "Gateway Meta Flag", "lbmr.topic_res_request.flags.gateway_meta", FT_BOOLEAN, 8 * L_LBMR_TOPIC_RES_REQUEST_T_FLAGS, TFS(&tfs_set_notset), LBM_TOPIC_RES_REQUEST_RESERVED1, NULL, HFILL } },
6085         { &hf_lbmr_topic_res_request_flags_advertisement,
6086             { "Advertisements", "lbmr.topic_res_request.flags.advertisement", FT_BOOLEAN, 8 * L_LBMR_TOPIC_RES_REQUEST_T_FLAGS, TFS(&tfs_set_notset), LBM_TOPIC_RES_REQUEST_ADVERTISEMENT, "Set if advertisements are requested", HFILL } },
6087         { &hf_lbmr_topic_res_request_flags_query,
6088             { "Queries", "lbmr.topic_res_request.flags.query", FT_BOOLEAN, 8 * L_LBMR_TOPIC_RES_REQUEST_T_FLAGS, TFS(&tfs_set_notset), LBM_TOPIC_RES_REQUEST_QUERY, "Set if queries are requested", HFILL } },
6089         { &hf_lbmr_topic_res_request_flags_wildcard_query,
6090             { "Wildcard Queries", "lbmr.topic_res_request.flags.wildcard_query", FT_BOOLEAN, 8 * L_LBMR_TOPIC_RES_REQUEST_T_FLAGS, TFS(&tfs_set_notset), LBM_TOPIC_RES_REQUEST_WILDCARD_QUERY, "Set if wildcard queries are requested", HFILL } },
6091         { &hf_lbmr_ctxinfo_len,
6092             { "Length", "lbmr.ctxinfo.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6093         { &hf_lbmr_ctxinfo_hop_count,
6094             { "Hop Count", "lbmr.ctxinfo.hop_count", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6095         { &hf_lbmr_ctxinfo_flags,
6096             { "Flags", "lbmr.ctxinfo.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6097         { &hf_lbmr_ctxinfo_flags_query,
6098             { "Query", "lbmr.ctxinfo.flags.query", FT_BOOLEAN, 16, TFS(&tfs_set_notset), LBMR_CTXINFO_QUERY_FLAG, "Set if query, clear if response", HFILL } },
6099         { &hf_lbmr_ctxinfo_flags_ip,
6100             { "IP Address", "lbmr.ctxinfo.flags.ip", FT_BOOLEAN, 16, TFS(&tfs_present_not_present), LBMR_CTXINFO_IP_FLAG, "Set if IP address is included", HFILL } },
6101         { &hf_lbmr_ctxinfo_flags_instance,
6102             { "Instance", "lbmr.ctxinfo.flags.instance", FT_BOOLEAN, 16, TFS(&tfs_present_not_present), LBMR_CTXINFO_INSTANCE_FLAG, "Set if context instance is included", HFILL } },
6103         { &hf_lbmr_ctxinfo_flags_tnwg_src,
6104             { "Gateway Source", "lbmr.ctxinfo.flags.tnwg_src", FT_BOOLEAN, 16, TFS(&tfs_set_notset), LBMR_CTXINFO_TNWG_SRC_FLAG, "Set if a gateway source", HFILL } },
6105         { &hf_lbmr_ctxinfo_flags_tnwg_rcv,
6106             { "Gateway Receiver", "lbmr.ctxinfo.flags.tnwg_rcv", FT_BOOLEAN, 16, TFS(&tfs_set_notset), LBMR_CTXINFO_TNWG_RCV_FLAG, "Set if a gateway receiver", HFILL } },
6107         { &hf_lbmr_ctxinfo_flags_proxy,
6108             { "Proxy", "lbmr.ctxinfo.flags.proxy", FT_BOOLEAN, 16, TFS(&tfs_set_notset), LBMR_CTXINFO_PROXY_FLAG, "Set if a proxy for another context", HFILL } },
6109         { &hf_lbmr_ctxinfo_flags_name,
6110             { "Name", "lbmr.ctxinfo.flags.name", FT_BOOLEAN, 16, TFS(&tfs_present_not_present), LBMR_CTXINFO_NAME_FLAG, "Set if context name is included", HFILL } },
6111         { &hf_lbmr_ctxinfo_port,
6112             { "Port", "lbmr.ctxinfo.port", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6113         { &hf_lbmr_ctxinfo_ip,
6114             { "IP Address", "lbmr.ctxinfo.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6115         { &hf_lbmr_ctxinfo_instance,
6116             { "Instance", "lbmr.ctxinfo.instance", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6117         { &hf_lbmr_ctxinfo_name,
6118             { "Name", "lbmr.ctxinfo.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6119         { &hf_lbmr_tnwg_len,
6120             { "Length", "lbmr.tnwg.len", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6121         { &hf_lbmr_tnwg_type,
6122             { "Type", "lbmr.tnwg.type", FT_UINT16, BASE_DEC_HEX, VALS(lbmr_tnwg_function_type), 0x0, NULL, HFILL } },
6123         { &hf_lbmr_tnwg_reserved,
6124             { "Reserved", "lbmr.tnwg.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6125         { &hf_lbmr_tnwg_interest,
6126             { "Interest", "lbmr.tnwg.interest", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6127         { &hf_lbmr_tnwg_interest_len,
6128             { "Length", "lbmr.tnwg.interest.len", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6129         { &hf_lbmr_tnwg_interest_count,
6130             { "Record Count", "lbmr.tnwg.interest.count", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6131         { &hf_lbmr_tnwg_interest_rec,
6132             { "Interest Record", "lbmr.tnwg.interest_rec", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6133         { &hf_lbmr_tnwg_interest_rec_len,
6134             { "Length", "lbmr.tnwg.interest_rec.len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
6135         { &hf_lbmr_tnwg_interest_rec_flags,
6136             { "Flags", "lbmr.tnwg.interest_rec.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6137         { &hf_lbmr_tnwg_interest_rec_flags_pattern,
6138             { "Pattern", "lbmr.tnwg.interest_rec.flags.pattern", FT_BOOLEAN, L_LBMR_TNWG_INTEREST_REC_T_FLAGS * 8, TFS(&tfs_set_notset), LBMR_TNWG_INTEREST_REC_PATTERN_FLAG, "Set if interest is for a pattern", HFILL } },
6139         { &hf_lbmr_tnwg_interest_rec_flags_cancel,
6140             { "Cancel", "lbmr.tnwg.interest_rec.flags.cancel", FT_BOOLEAN, L_LBMR_TNWG_INTEREST_REC_T_FLAGS * 8, TFS(&tfs_set_notset), LBMR_TNWG_INTEREST_REC_CANCEL_FLAG, "Set if interest is being cancelled", HFILL } },
6141         { &hf_lbmr_tnwg_interest_rec_flags_refresh,
6142             { "Refresh", "lbmr.tnwg.interest_rec.flags.refresh", FT_BOOLEAN, L_LBMR_TNWG_INTEREST_REC_T_FLAGS * 8, TFS(&tfs_set_notset), LBMR_TNWG_INTEREST_REC_REFRESH_FLAG, "Set if interest is being refreshed", HFILL } },
6143         { &hf_lbmr_tnwg_interest_rec_pattype,
6144             { "Pattern Type", "lbmr.tnwg.interest_rec.pattype", FT_UINT8, BASE_DEC_HEX, VALS(lbm_wildcard_pattern_type_short), 0x0, NULL, HFILL } },
6145         { &hf_lbmr_tnwg_interest_rec_domain_id,
6146             { "Domain ID", "lbmr.tnwg.interest_rec.domain_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
6147         { &hf_lbmr_tnwg_interest_rec_symbol,
6148             { "Symbol", "lbmr.tnwg.interest_rec.symbol", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6149         { &hf_lbmr_tnwg_ctxinfo,
6150             { "Context Information", "lbmr.tnwg.ctxinfo", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6151         { &hf_lbmr_tnwg_ctxinfo_len,
6152             { "Length", "lbmr.tnwg.ctxinfo.len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
6153         { &hf_lbmr_tnwg_ctxinfo_hop_count,
6154             { "Hop Count", "lbmr.tnwg.ctxinfo.hop_count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
6155         { &hf_lbmr_tnwg_ctxinfo_reserved,
6156             { "Reserved", "lbmr.tnwg.ctxinfo.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6157         { &hf_lbmr_tnwg_ctxinfo_flags1,
6158             { "Flags1", "lbmr.tnwg.ctxinfo.flags1", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6159         { &hf_lbmr_tnwg_ctxinfo_flags1_query,
6160             { "Query", "lbmr.tnwg.ctxinfo.flags1.query", FT_BOOLEAN, L_LBMR_TNWG_CTXINFO_T_FLAGS1 * 8, TFS(&tfs_set_notset), LBMR_TNWG_CTXINFO_QUERY_FLAG, "Set if a query, clear if a response", HFILL } },
6161         { &hf_lbmr_tnwg_ctxinfo_flags1_tnwg_src,
6162             { "TNWG Source", "lbmr.tnwg.ctxinfo.flags1.tnwg_src", FT_BOOLEAN, L_LBMR_TNWG_CTXINFO_T_FLAGS1 * 8, TFS(&tfs_set_notset), LBMR_TNWG_CTXINFO_TNWG_SRC_FLAG, "Set if a gateway source", HFILL } },
6163         { &hf_lbmr_tnwg_ctxinfo_flags1_tnwg_rcv,
6164             { "TNWG Receiver", "lbmr.tnwg.ctxinfo.flags1.tnwg_rcv", FT_BOOLEAN, L_LBMR_TNWG_CTXINFO_T_FLAGS1 * 8, TFS(&tfs_set_notset), LBMR_TNWG_CTXINFO_TNWG_RCV_FLAG, "Set if a gateway receiver", HFILL } },
6165         { &hf_lbmr_tnwg_ctxinfo_flags1_proxy,
6166             { "Proxy", "lbmr.tnwg.ctxinfo.flags1.proxy", FT_BOOLEAN, L_LBMR_TNWG_CTXINFO_T_FLAGS1 * 8, TFS(&tfs_set_notset), LBMR_TNWG_CTXINFO_PROXY_FLAG, "Set if a proxy for another context", HFILL } },
6167         { &hf_lbmr_tnwg_ctxinfo_flags2,
6168             { "Flags2", "lbmr.tnwg.ctxinfo.flags2", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6169         { &hf_lbmr_tnwg_trreq,
6170             { "Topic Res Request", "lbmr.tnwg.trreq", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6171         { &hf_lbmr_tnwg_trreq_len,
6172             { "Length", "lbmr.tnwg.trreq.len", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6173         { &hf_lbmr_tnwg_opt,
6174             { "Unknown Option", "lbmr.tnwg.opt", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6175         { &hf_lbmr_tnwg_opt_type,
6176             { "Type", "lbmr.tnwg.opt.type", FT_UINT8, BASE_HEX_DEC, VALS(lbmr_tnwg_option_type), 0x0, NULL, HFILL } },
6177         { &hf_lbmr_tnwg_opt_len,
6178             { "Length", "lbmr.tnwg.opt.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6179         { &hf_lbmr_tnwg_opt_flags,
6180             { "Flags", "lbmr.tnwg.opt.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6181         { &hf_lbmr_tnwg_opt_flags_ignore,
6182             { "Ignore", "lbmr.tnwg.opt.flags.ignore", FT_BOOLEAN, L_LBMR_TNWG_OPT_T_FLAGS * 8, TFS(&lbm_ignore_flag), LBMR_TNWG_OPT_IGNORE_FLAG, NULL, HFILL } },
6183         { &hf_lbmr_tnwg_opt_data,
6184             { "Data", "lbmr.tnwg.opt.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6185         { &hf_lbmr_tnwg_opt_ctxinst,
6186             { "Context Instance Option", "lbmr.tnwg.opt_ctxinst", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6187         { &hf_lbmr_tnwg_opt_ctxinst_type,
6188             { "Type", "lbmr.tnwg.opt_ctxinst.type", FT_UINT8, BASE_HEX_DEC, VALS(lbmr_tnwg_option_type), 0x0, NULL, HFILL } },
6189         { &hf_lbmr_tnwg_opt_ctxinst_len,
6190             { "Length", "lbmr.tnwg.opt_ctxinst.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6191         { &hf_lbmr_tnwg_opt_ctxinst_flags,
6192             { "Flags", "lbmr.tnwg.opt_ctxinst.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6193         { &hf_lbmr_tnwg_opt_ctxinst_flags_ignore,
6194             { "Ignore", "lbmr.tnwg.opt_ctxinst.flags.ignore", FT_BOOLEAN, L_LBMR_TNWG_OPT_CTXINST_T_FLAGS * 8, TFS(&lbm_ignore_flag), LBMR_TNWG_OPT_IGNORE_FLAG, NULL, HFILL } },
6195         { &hf_lbmr_tnwg_opt_ctxinst_instance,
6196             { "Context Instance", "lbmr.tnwg.opt_ctxinst.instance", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6197         { &hf_lbmr_tnwg_opt_address,
6198             { "Address Option", "lbmr.tnwg.opt_address", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6199         { &hf_lbmr_tnwg_opt_address_type,
6200             { "Type", "lbmr.tnwg.opt_address.type", FT_UINT8, BASE_HEX_DEC, VALS(lbmr_tnwg_option_type), 0x0, NULL, HFILL } },
6201         { &hf_lbmr_tnwg_opt_address_len,
6202             { "Length", "lbmr.tnwg.opt_address.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6203         { &hf_lbmr_tnwg_opt_address_flags,
6204             { "Flags", "lbmr.tnwg.opt_address.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6205         { &hf_lbmr_tnwg_opt_address_flags_ignore,
6206             { "Ignore", "lbmr.tnwg.opt_address.flags.ignore", FT_BOOLEAN, L_LBMR_TNWG_OPT_ADDRESS_T_FLAGS * 8, TFS(&lbm_ignore_flag), LBMR_TNWG_OPT_IGNORE_FLAG, NULL, HFILL } },
6207         { &hf_lbmr_tnwg_opt_address_port,
6208             { "Port", "lbmr.tnwg.opt_address.port", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6209         { &hf_lbmr_tnwg_opt_address_res,
6210             { "Reserved", "lbmr.tnwg.opt_address.res", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6211         { &hf_lbmr_tnwg_opt_address_ip,
6212             { "IP Address", "lbmr.tnwg.opt_address.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6213         { &hf_lbmr_tnwg_opt_domain,
6214             { "Domain Option", "lbmr.tnwg.opt_domain", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6215         { &hf_lbmr_tnwg_opt_domain_type,
6216             { "Type", "lbmr.tnwg.opt_domain.type", FT_UINT8, BASE_HEX_DEC, VALS(lbmr_tnwg_option_type), 0x0, NULL, HFILL } },
6217         { &hf_lbmr_tnwg_opt_domain_len,
6218             { "Length", "lbmr.tnwg.opt_domain.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6219         { &hf_lbmr_tnwg_opt_domain_flags,
6220             { "Flags", "lbmr.tnwg.opt_domain.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6221         { &hf_lbmr_tnwg_opt_domain_flags_ignore,
6222             { "Ignore", "lbmr.tnwg.opt_domain.flags.ignore", FT_BOOLEAN, L_LBMR_TNWG_OPT_DOMAIN_T_FLAGS * 8, TFS(&lbm_ignore_flag), LBMR_TNWG_OPT_IGNORE_FLAG, NULL, HFILL } },
6223         { &hf_lbmr_tnwg_opt_domain_domain_id,
6224             { "Domain ID", "lbmr.tnwg.opt_domain.domain_id", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6225         { &hf_lbmr_tnwg_opt_name,
6226             { "Name Option", "lbmr.tnwg.opt_name", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6227         { &hf_lbmr_tnwg_opt_name_type,
6228             { "Type", "lbmr.tnwg.opt_name.type", FT_UINT8, BASE_HEX_DEC, VALS(lbmr_tnwg_option_type), 0x0, NULL, HFILL } },
6229         { &hf_lbmr_tnwg_opt_name_len,
6230             { "Length", "lbmr.tnwg.opt_name.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6231         { &hf_lbmr_tnwg_opt_name_flags,
6232             { "Flags", "lbmr.tnwg.opt_name.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6233         { &hf_lbmr_tnwg_opt_name_flags_ignore,
6234             { "Ignore", "lbmr.tnwg.opt_name.flags.ignore", FT_BOOLEAN, L_LBMR_TNWG_OPT_T_FLAGS * 8, TFS(&lbm_ignore_flag), LBMR_TNWG_OPT_IGNORE_FLAG, NULL, HFILL } },
6235         { &hf_lbmr_tnwg_opt_name_name,
6236             { "Name", "lbmr.tnwg.opt_name.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6237         { &hf_lbmr_remote_domain_route_hdr_num_domains,
6238             { "Number of Domains", "lbmr.remote_domain_route.num_domains", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6239         { &hf_lbmr_remote_domain_route_hdr_ip,
6240             { "IP Address", "lbmr.remote_domain_route.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6241         { &hf_lbmr_remote_domain_route_hdr_port,
6242             { "Port", "lbmr.remote_domain_route.port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
6243         { &hf_lbmr_remote_domain_route_hdr_reserved,
6244             { "Reserved", "lbmr.remote_domain_route.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6245         { &hf_lbmr_remote_domain_route_hdr_length,
6246             { "Length", "lbmr.remote_domain_route.length", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6247         { &hf_lbmr_remote_domain_route_hdr_domain,
6248             { "Domain", "lbmr.remote_domain_route.domain", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6249         { &hf_lbmr_rctxinfo_len,
6250             { "Length", "lbmr.rctxinfo.len", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6251         { &hf_lbmr_rctxinfo_num_recs,
6252             { "Number of Records", "lbmr.rctxinfo.num_recs", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6253         { &hf_lbmr_rctxinfo_reserved,
6254             { "Reserved", "lbmr.rctxinfo.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6255         { &hf_lbmr_rctxinfo_rec,
6256             { "Remote Context Information Record", "lbmr.rctxinfo.rec", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6257         { &hf_lbmr_rctxinfo_rec_len,
6258             { "Length", "lbmr.rctxinfo.rec.len", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6259         { &hf_lbmr_rctxinfo_rec_flags,
6260             { "Flags", "lbmr.rctxinfo.rec.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6261         { &hf_lbmr_rctxinfo_rec_flags_query,
6262             { "Query", "lbmr.rctxinfo.rec.flags.query", FT_BOOLEAN, L_LBMR_RCTXINFO_REC_T_FLAGS * 8, TFS(&tfs_set_notset), LBMR_RCTXINFO_REC_FLAG_QUERY, "Set if a query, clear if a response", HFILL } },
6263         { &hf_lbmr_rctxinfo_rec_address,
6264             { "Address Option", "lbmr.rctxinfo.rec.address", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6265         { &hf_lbmr_rctxinfo_rec_address_type,
6266             { "Type", "lbmr.rctxinfo.rec.address.type", FT_UINT8, BASE_DEC_HEX, VALS(lbmr_rctxinfo_option_type), 0x0, NULL, HFILL } },
6267         { &hf_lbmr_rctxinfo_rec_address_len,
6268             { "Length", "lbmr.rctxinfo.rec.address.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6269         { &hf_lbmr_rctxinfo_rec_address_flags,
6270             { "Flags", "lbmr.rctxinfo.rec.address.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6271         { &hf_lbmr_rctxinfo_rec_address_domain_id,
6272             { "Domain ID", "lbmr.rctxinfo.rec.address.domain_id", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6273         { &hf_lbmr_rctxinfo_rec_address_ip,
6274             { "Address", "lbmr.rctxinfo.rec.address.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6275         { &hf_lbmr_rctxinfo_rec_address_port,
6276             { "Port", "lbmr.rctxinfo.rec.address.port", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6277         { &hf_lbmr_rctxinfo_rec_address_res,
6278             { "Reserved", "lbmr.rctxinfo.rec.address.res", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6279         { &hf_lbmr_rctxinfo_rec_instance,
6280             { "Instance Option", "lbmr.rctxinfo.rec.instance", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6281         { &hf_lbmr_rctxinfo_rec_instance_type,
6282             { "Type", "lbmr.rctxinfo.rec.instance.type", FT_UINT8, BASE_DEC_HEX, VALS(lbmr_rctxinfo_option_type), 0x0, NULL, HFILL } },
6283         { &hf_lbmr_rctxinfo_rec_instance_len,
6284             { "Length", "lbmr.rctxinfo.rec.instance.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6285         { &hf_lbmr_rctxinfo_rec_instance_flags,
6286             { "Flags", "lbmr.rctxinfo.rec.instance.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6287         { &hf_lbmr_rctxinfo_rec_instance_instance,
6288             { "Instance", "lbmr.rctxinfo.rec.instance.instance", FT_BYTES, FT_NONE, NULL, 0x0, NULL, HFILL } },
6289         { &hf_lbmr_rctxinfo_rec_odomain,
6290             { "Originating Domain Option", "lbmr.rctxinfo.rec.odomain", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6291         { &hf_lbmr_rctxinfo_rec_odomain_type,
6292             { "Type", "lbmr.rctxinfo.rec.odomain.type", FT_UINT8, BASE_DEC_HEX, VALS(lbmr_rctxinfo_option_type), 0x0, NULL, HFILL } },
6293         { &hf_lbmr_rctxinfo_rec_odomain_len,
6294             { "Length", "lbmr.rctxinfo.rec.odomain.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6295         { &hf_lbmr_rctxinfo_rec_odomain_flags,
6296             { "Flags", "lbmr.rctxinfo.rec.odomain.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6297         { &hf_lbmr_rctxinfo_rec_odomain_domain_id,
6298             { "Domain ID", "lbmr.rctxinfo.rec.odomain.domain_id", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6299         { &hf_lbmr_rctxinfo_rec_name,
6300             { "Name Option", "lbmr.rctxinfo.rec.name", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6301         { &hf_lbmr_rctxinfo_rec_name_type,
6302             { "Type", "lbmr.rctxinfo.rec.name.type", FT_UINT8, BASE_DEC_HEX, VALS(lbmr_rctxinfo_option_type), 0x0, NULL, HFILL } },
6303         { &hf_lbmr_rctxinfo_rec_name_len,
6304             { "Length", "lbmr.rctxinfo.rec.name.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6305         { &hf_lbmr_rctxinfo_rec_name_flags,
6306             { "Flags", "lbmr.rctxinfo.rec.name.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6307         { &hf_lbmr_rctxinfo_rec_name_name,
6308             { "Name", "lbmr.rctxinfo.rec.name.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6309         { &hf_lbmr_rctxinfo_rec_unknown,
6310             { "Unknown Option", "lbmr.rctxinfo.rec.unknown", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6311         { &hf_lbmr_rctxinfo_rec_unknown_type,
6312             { "Type", "lbmr.rctxinfo.rec.unknown.type", FT_UINT8, BASE_DEC_HEX, VALS(lbmr_rctxinfo_option_type), 0x0, NULL, HFILL } },
6313         { &hf_lbmr_rctxinfo_rec_unknown_len,
6314             { "Length", "lbmr.rctxinfo.rec.unknown.len", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6315         { &hf_lbmr_rctxinfo_rec_unknown_flags,
6316             { "Flags", "lbmr.rctxinfo.rec.unknown.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6317         { &hf_lbmr_rctxinfo_rec_unknown_data,
6318             { "Data", "lbmr.rctxinfo.rec.unknown.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6319         { &hf_qmgmt_flags,
6320             { "Flags", "lbmr.qmgmt.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6321         { &hf_qmgmt_flags_i_flag,
6322             { "Ignore", "lbmr.qmgmt.flags.i_flag", FT_BOOLEAN, L_UMQ_QMGMT_HDR_T_FLAGS * 8, TFS(&lbm_ignore_flag), UMQ_QMGMT_HDR_I_FLAG, NULL, HFILL } },
6323         { &hf_qmgmt_flags_n_flag,
6324             { "Queue Name", "lbmr.qmgmt.flags.n_flag", FT_BOOLEAN, L_UMQ_QMGMT_HDR_T_FLAGS * 8, TFS(&tfs_present_not_present), UMQ_QMGMT_HDR_N_FLAG, "Set if queue name is present", HFILL } },
6325         { &hf_qmgmt_flags_il_l_flag,
6326             { "New Instance List", "lbmr.qmgmt.flags.il_l_flag", FT_BOOLEAN, L_UMQ_QMGMT_HDR_T_FLAGS * 8, TFS(&tfs_set_notset), UMQ_QMGMT_HDR_IL_L_FLAG, "Set if contains a new instance list", HFILL } },
6327         { &hf_qmgmt_flags_il_k_flag,
6328             { "Keepalive Requested", "lbmr.qmgmt.flags.il_k_flag", FT_BOOLEAN, L_UMQ_QMGMT_HDR_T_FLAGS * 8, TFS(&tfs_set_notset), UMQ_QMGMT_HDR_IL_K_FLAG, "Set if a keepalive requester", HFILL } },
6329         { &hf_qmgmt_pckt_type,
6330             { "Packet Type", "lbmr.qmgmt.pckt_type", FT_UINT8, BASE_HEX_DEC, VALS(umq_qmgmt_packet_type), 0x0, NULL, HFILL } },
6331         { &hf_qmgmt_cfgsig,
6332             { "Configuration Signature", "lbmr.qmgmt.cfg_sig", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6333         { &hf_qmgmt_queue_id,
6334             { "Queue ID", "lbmr.qmgmt.queue_id", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } },
6335         { &hf_qmgmt_queue_ver,
6336             { "Queue Version", "lbmr.qmgmt.queue_ver", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } },
6337         { &hf_qmgmt_ip,
6338             { "IP Address", "lbmr.qmgmt.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6339         { &hf_qmgmt_port,
6340             { "Port", "lbmr.qmgmt.port", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6341         { &hf_qmgmt_inst_idx,
6342             { "Instance Index", "lbmr.qmgmt.inst_idx", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6343         { &hf_qmgmt_grp_idx,
6344             { "Group Index", "lbmr.qmgmt.grp_idx", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6345         { &hf_qmgmt_pckt_type_dep16,
6346             { "Packet-Type Dependent Data", "lbmr.qmgmt.pckt_type_dep16", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6347         { &hf_qmgmt_il_num_insts,
6348             { "Number of IL Instances", "lbmr.qmgmt.il_num_insts", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6349         { &hf_qmgmt_jrej_code,
6350             { "Join Rejection Code", "lbmr.qmgmt.jrej_code", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6351         { &hf_qmgmt_ev_bias,
6352             { "EV Bias", "lbmr.qmgmt.ev_bias", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6353         { &hf_qmgmt_il,
6354             { "Instance List Header", "lbmr.qmgmt.il", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6355         { &hf_qmgmt_il_highest_rcr_tsp,
6356             { "Highest RCR TSP", "lbmr.qmgmt.il.highest_rcr_tsp", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } },
6357         { &hf_qmgmt_il_inst,
6358             { "Instance Header", "lbmr.qmgmt.il_inst", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6359         { &hf_qmgmt_il_inst_ip,
6360             { "IP", "lbmr.qmgmt.il_inst.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6361         { &hf_qmgmt_il_inst_port,
6362             { "Port", "lbmr.qmgmt.il_inst.port", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6363         { &hf_qmgmt_il_inst_inst_idx,
6364             { "Instance Index", "lbmr.qmgmt.il_inst.inst_idx", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6365         { &hf_qmgmt_il_inst_grp_idx,
6366             { "Group Index", "lbmr.qmgmt.il_inst.grp_idx", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6367         { &hf_qmgmt_il_inst_flags,
6368             { "Flags", "lbmr.qmgmt.il_inst.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } },
6369         { &hf_qmgmt_il_inst_flags_m_flag,
6370             { "Master", "lbmr.qmgmt.il_inst.flags.m_flag", FT_BOOLEAN, L_UMQ_QMGMT_IL_INST_HDR_T_FLAGS * 8, TFS(&tfs_set_notset), UMQ_QMGMT_HDR_IL_INST_M_FLAG, "Set if the master queue", HFILL } },
6371         { &hf_qmgmt_il_inst_flags_q_flag,
6372             { "Queue Election Master", "lbmr.qmgmt.il_inst.flags.q_flag", FT_BOOLEAN, L_UMQ_QMGMT_IL_INST_HDR_T_FLAGS * 8, TFS(&tfs_set_notset), UMQ_QMGMT_HDR_IL_INST_Q_FLAG, "Set if a queue election master", HFILL } },
6373         { &hf_qmgmt_il_inst_flags_p_flag,
6374             { "Post Election Master", "lbmr.qmgmt.il_inst.flags.p_flag", FT_BOOLEAN, L_UMQ_QMGMT_IL_INST_HDR_T_FLAGS * 8, TFS(&tfs_set_notset), UMQ_QMGMT_HDR_IL_INST_P_FLAG, "Set if a post election master", HFILL } },
6375         { &hf_qmgmt_ec,
6376             { "Election Call Header", "lbmr.qmgmt.ec", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6377         { &hf_qmgmt_ec_queue_new_ver,
6378             { "Queue New Version", "lbmr.qmgmt.ec.queue_new_ver", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } },
6379         { &hf_qmgmt_ev,
6380             { "Election Vote Header", "lbmr.qmgmt.ev", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6381         { &hf_qmgmt_ev_highest_rcr_tsp,
6382             { "Highest RCR TSP", "lbmr.qmgmt.ev.highest_rcr_tsp", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } },
6383         { &hf_qmgmt_ev_age,
6384             { "Age", "lbmr.qmgmt.ev.age", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } },
6385         { &hf_qmgmt_qro,
6386             { "Queue Resume Operation Header", "lbmr.qmgmt.qro", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
6387         { &hf_qmgmt_qro_highest_rcr_tsp,
6388             { "Highest RCR TSP", "lbmr.qmgmt.qro.highest_rcr_tsp", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } },
6389         { &hf_qmgmt_qname,
6390             { "Queue Name", "lbmr.qmgmt.qname", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }
6391     };
6392     static gint * ett[] =
6393     {
6394         &ett_lbmr,
6395         &ett_lbmr_hdr,
6396         &ett_lbmr_opts,
6397         &ett_lbmr_opt_src_id,
6398         &ett_lbmr_opt_src_id_flags,
6399         &ett_lbmr_opt_len,
6400         &ett_lbmr_opt_src_type,
6401         &ett_lbmr_opt_src_type_flags,
6402         &ett_lbmr_opt_version,
6403         &ett_lbmr_opt_version_flags,
6404         &ett_lbmr_opt_local_domain,
6405         &ett_lbmr_opt_local_domain_flags,
6406         &ett_lbmr_opt_unknown,
6407         &ett_lbmr_tqrs,
6408         &ett_lbmr_tqr,
6409         &ett_lbmr_tirs,
6410         &ett_lbmr_tir,
6411         &ett_lbmr_tir_tcp,
6412         &ett_lbmr_tir_lbtrm,
6413         &ett_lbmr_tir_lbtru,
6414         &ett_lbmr_tir_lbtipc,
6415         &ett_lbmr_tir_lbtrdma,
6416         &ett_lbmr_tir_lbtsmx,
6417         &ett_lbmr_topts,
6418         &ett_lbmr_topt_len,
6419         &ett_lbmr_topt_ume,
6420         &ett_lbmr_topt_ume_flags,
6421         &ett_lbmr_topt_ume_store,
6422         &ett_lbmr_topt_ume_store_flags,
6423         &ett_lbmr_topt_ume_store_group,
6424         &ett_lbmr_topt_ume_store_group_flags,
6425         &ett_lbmr_topt_latejoin,
6426         &ett_lbmr_topt_latejoin_flags,
6427         &ett_lbmr_topt_umq_rcridx,
6428         &ett_lbmr_topt_umq_rcridx_flags,
6429         &ett_lbmr_topt_umq_qinfo,
6430         &ett_lbmr_topt_umq_qinfo_flags,
6431         &ett_lbmr_topt_cost,
6432         &ett_lbmr_topt_cost_flags,
6433         &ett_lbmr_topt_otid,
6434         &ett_lbmr_topt_otid_flags,
6435         &ett_lbmr_topt_ctxinst,
6436         &ett_lbmr_topt_ctxinst_flags,
6437         &ett_lbmr_topt_ctxinsts,
6438         &ett_lbmr_topt_ctxinsts_flags,
6439         &ett_lbmr_topt_ulb,
6440         &ett_lbmr_topt_ulb_flags,
6441         &ett_lbmr_topt_ctxinstq,
6442         &ett_lbmr_topt_ctxinstq_flags,
6443         &ett_lbmr_topt_domain_id,
6444         &ett_lbmr_topt_domain_id_flags,
6445         &ett_lbmr_topt_exfunc,
6446         &ett_lbmr_topt_exfunc_flags,
6447         &ett_lbmr_topt_exfunc_functionality_flags,
6448         &ett_lbmr_topt_unknown,
6449         &ett_lbmr_tmb,
6450         &ett_lbmr_tmrs,
6451         &ett_lbmr_tmr,
6452         &ett_lbmr_tmr_flags,
6453         &ett_lbmr_pser_flags,
6454         &ett_lbmr_pser_opts,
6455         &ett_lbmr_pser_opt_len,
6456         &ett_lbmr_pser_opt_ctxinst,
6457         &ett_lbmr_qqrs,
6458         &ett_lbmr_qirs,
6459         &ett_lbmr_qir,
6460         &ett_lbmr_qir_options,
6461         &ett_lbmr_qir_grp_blk,
6462         &ett_lbmr_qir_queue_blk,
6463         &ett_lbmr_qir_grp,
6464         &ett_lbmr_qir_queue,
6465         &ett_lbmr_topic_res_request_flags,
6466         &ett_lbmr_ctxinfo_flags,
6467         &ett_lbmr_tnwg,
6468         &ett_lbmr_tnwg_interest,
6469         &ett_lbmr_tnwg_interest_rec,
6470         &ett_lbmr_tnwg_interest_rec_flags,
6471         &ett_lbmr_tnwg_ctxinfo,
6472         &ett_lbmr_tnwg_ctxinfo_flags1,
6473         &ett_lbmr_tnwg_trreq,
6474         &ett_lbmr_tnwg_ctxinst_opt,
6475         &ett_lbmr_tnwg_ctxinst_opt_flags,
6476         &ett_lbmr_tnwg_address_opt,
6477         &ett_lbmr_tnwg_address_opt_flags,
6478         &ett_lbmr_tnwg_domain_opt,
6479         &ett_lbmr_tnwg_domain_opt_flags,
6480         &ett_lbmr_tnwg_name_opt,
6481         &ett_lbmr_tnwg_name_opt_flags,
6482         &ett_lbmr_tnwg_unknown_opt,
6483         &ett_lbmr_tnwg_unknown_opt_flags,
6484         &ett_lbmr_remote_domain_route_hdr,
6485         &ett_lbmr_rctxinfo,
6486         &ett_lbmr_rctxinfo_rec,
6487         &ett_lbmr_rctxinfo_rec_flags,
6488         &ett_lbmr_rctxinfo_rec_address,
6489         &ett_lbmr_rctxinfo_rec_instance,
6490         &ett_lbmr_rctxinfo_rec_odomain,
6491         &ett_lbmr_rctxinfo_rec_name,
6492         &ett_lbmr_rctxinfo_rec_unknown,
6493         &ett_qmgmt_flags,
6494         &ett_qmgmt_il,
6495         &ett_qmgmt_il_inst,
6496         &ett_qmgmt_il_inst_flags,
6497         &ett_qmgmt_ec,
6498         &ett_qmgmt_ev,
6499         &ett_qmgmt_qro
6500     };
6501     static ei_register_info ei[] =
6502     {
6503         { &ei_lbmr_analysis_length_incorrect, { "lbmr.analysis.length_incorrect", PI_MALFORMED, PI_ERROR, "Header length incorrect", EXPFILL } },
6504         { &ei_lbmr_analysis_invalid_value, { "lbmr.analysis.invalid_value", PI_UNDECODED, PI_WARN, "Invalid value", EXPFILL } },
6505         { &ei_lbmr_analysis_zero_len_option, { "lbmr.analysis.zero_len_option", PI_MALFORMED, PI_ERROR, "Zero-length LBMR option", EXPFILL } },
6506     };
6507     module_t * lbmr_module;
6508     struct in_addr addr;
6509     uat_t * tag_uat;
6510     expert_module_t * expert_lbmr;
6511
6512     proto_lbmr = proto_register_protocol("LBM Topic Resolution Protocol",
6513         "LBMR", "lbmr");
6514
6515     proto_register_field_array(proto_lbmr, hf, array_length(hf));
6516     proto_register_subtree_array(ett, array_length(ett));
6517     expert_lbmr = expert_register_protocol(proto_lbmr);
6518     expert_register_field_array(expert_lbmr, ei, array_length(ei));
6519
6520     lbmr_module = prefs_register_protocol_subtree("29West", proto_lbmr, proto_reg_handoff_lbmr);
6521     prefs_register_uint_preference(lbmr_module,
6522         "mc_incoming_port",
6523         "Incoming multicast UDP port (default " LBMR_DEFAULT_MC_INCOMING_UDP_PORT_STRING ")",
6524         "Set the UDP port for incoming multicast topic resolution (context resolver_multicast_incoming_port)",
6525         10,
6526         &global_lbmr_mc_incoming_udp_port);
6527     inet_aton(LBMR_DEFAULT_MC_INCOMING_ADDRESS, &addr);
6528     lbmr_mc_incoming_address_host = g_ntohl(addr.s_addr);
6529     prefs_register_string_preference(lbmr_module,
6530         "mc_incoming_address",
6531         "Incoming multicast address (default " LBMR_DEFAULT_MC_INCOMING_ADDRESS ")",
6532         "Set the multicast address for incoming multicast topic resolution (context resolver_multicast_incoming_address)",
6533         &global_lbmr_mc_incoming_address);
6534     prefs_register_uint_preference(lbmr_module,
6535         "mc_outgoing_port",
6536         "Outgoing multicast UDP port (default " LBMR_DEFAULT_MC_OUTGOING_UDP_PORT_STRING ")",
6537         "Set the UDP port for outgoing multicast topic resolution (context resolver_multicast_outgoing_port)",
6538         10,
6539         &global_lbmr_mc_outgoing_udp_port);
6540     inet_aton(LBMR_DEFAULT_MC_OUTGOING_ADDRESS, &addr);
6541     lbmr_mc_outgoing_address_host = g_ntohl(addr.s_addr);
6542     prefs_register_string_preference(lbmr_module,
6543         "mc_outgoing_address",
6544         "Outgoing multicast address (default " LBMR_DEFAULT_MC_OUTGOING_ADDRESS ")",
6545         "Set the multicast address for outgoing multicast topic resolution (context resolver_multicast_outgoing_address)",
6546         &global_lbmr_mc_outgoing_address);
6547     prefs_register_uint_preference(lbmr_module,
6548         "uc_port_low",
6549         "Unicast UDP port low (default " LBMR_DEFAULT_UC_PORT_LOW_STRING ")",
6550         "Set the low UDP port for unicast topic resolution (context resolver_unicast_port_low)",
6551         10,
6552         &global_lbmr_uc_port_low);
6553     prefs_register_uint_preference(lbmr_module,
6554         "uc_port_high",
6555         "Unicast UDP port high (default " LBMR_DEFAULT_UC_PORT_HIGH_STRING ")",
6556         "Set the high UDP port for unicast topic resolution (context resolver_unicast_port_high)",
6557         10,
6558         &global_lbmr_uc_port_high);
6559     prefs_register_uint_preference(lbmr_module,
6560         "uc_dest_port",
6561         "Unicast UDP destination port (default " LBMR_DEFAULT_UC_DEST_PORT_STRING ")",
6562         "Set the destination port for unicast topic resolution (context resolver_unicast_destination_port)",
6563         10,
6564         &global_lbmr_uc_dest_port);
6565     inet_aton(LBMR_DEFAULT_UC_ADDRESS, &addr);
6566     lbmr_uc_address_host = g_ntohl(addr.s_addr);
6567     prefs_register_string_preference(lbmr_module,
6568         "uc_address",
6569         "Unicast resolver address (default " LBMR_DEFAULT_UC_ADDRESS ")",
6570         "Set the address of the unicast resolver daemon (context resolver_unicast_address)",
6571         &global_lbmr_uc_address);
6572     prefs_register_bool_preference(lbmr_module,
6573         "use_lbmr_domain",
6574         "Use LBMR tag table",
6575         "Use table of LBMR tags to decode the packet instead of above values",
6576         &global_lbmr_use_tag);
6577     tag_uat = uat_new("LBMR tag definitions",
6578         sizeof(lbmr_tag_entry_t),
6579         "lbmr_domains",
6580         TRUE,
6581         (void * *)&lbmr_tag_entry,
6582         &lbmr_tag_count,
6583         UAT_AFFECTS_DISSECTION,
6584         NULL,
6585         lbmr_tag_copy_cb,
6586         lbmr_tag_update_cb,
6587         lbmr_tag_free_cb,
6588         NULL,
6589         lbmr_tag_array);
6590     prefs_register_uat_preference(lbmr_module,
6591         "tnw_lbmr_tags",
6592         "LBMR Tags",
6593         "A table to define LBMR tags",
6594         tag_uat);
6595
6596     lbmr_topic_advertisement_tap_handle = register_tap(LBMR_TOPIC_ADVERTISEMENT_TAP_STRING);
6597     lbmr_topic_query_tap_handle = register_tap(LBMR_TOPIC_QUERY_TAP_STRING);
6598     lbmr_pattern_query_tap_handle = register_tap(LBMR_PATTERN_QUERY_TAP_STRING);
6599     lbmr_queue_advertisement_tap_handle = register_tap(LBMR_QUEUE_ADVERTISEMENT_TAP_STRING);
6600     lbmr_queue_query_tap_handle = register_tap(LBMR_QUEUE_QUERY_TAP_STRING);
6601
6602     stats_tree_register(LBMR_TOPIC_ADVERTISEMENT_TAP_STRING,
6603         "lbmr_topic_ads_topic",
6604         lbmr_stat_tree_name_topic_ads_topic,
6605         0,
6606         lbmr_topic_ads_topic_stats_tree_packet,
6607         lbmr_topic_ads_topic_stats_tree_init,
6608         NULL);
6609     stats_tree_register(LBMR_TOPIC_ADVERTISEMENT_TAP_STRING,
6610         "lbmr_topic_ads_source",
6611         lbmr_stat_tree_name_topic_ads_source,
6612         0,
6613         lbmr_topic_ads_source_stats_tree_packet,
6614         lbmr_topic_ads_source_stats_tree_init,
6615         NULL);
6616     stats_tree_register(LBMR_TOPIC_ADVERTISEMENT_TAP_STRING,
6617         "lbmr_topic_ads_transport",
6618         lbmr_stat_tree_name_topic_ads_transport,
6619         0,
6620         lbmr_topic_ads_transport_stats_tree_packet,
6621         lbmr_topic_ads_transport_stats_tree_init,
6622         NULL);
6623     stats_tree_register(LBMR_TOPIC_QUERY_TAP_STRING,
6624         "lbmr_topic_queries_topic",
6625         lbmr_stat_tree_name_topic_queries_topic,
6626         0,
6627         lbmr_topic_queries_topic_stats_tree_packet,
6628         lbmr_topic_queries_topic_stats_tree_init,
6629         NULL);
6630     stats_tree_register(LBMR_TOPIC_QUERY_TAP_STRING,
6631         "lbmr_topic_queries_receiver",
6632         lbmr_stat_tree_name_topic_queries_receiver,
6633         0,
6634         lbmr_topic_queries_receiver_stats_tree_packet,
6635         lbmr_topic_queries_receiver_stats_tree_init,
6636         NULL);
6637     stats_tree_register(LBMR_PATTERN_QUERY_TAP_STRING,
6638         "lbmr_topic_queries_pattern",
6639         lbmr_stat_tree_name_topic_queries_pattern,
6640         0,
6641         lbmr_topic_queries_pattern_stats_tree_packet,
6642         lbmr_topic_queries_pattern_stats_tree_init,
6643         NULL);
6644     stats_tree_register(LBMR_PATTERN_QUERY_TAP_STRING,
6645         "lbmr_topic_queries_pattern_receiver",
6646         lbmr_stat_tree_name_topic_queries_pattern_receiver,
6647         0,
6648         lbmr_topic_queries_pattern_receiver_stats_tree_packet,
6649         lbmr_topic_queries_pattern_receiver_stats_tree_init,
6650         NULL);
6651     stats_tree_register(LBMR_QUEUE_ADVERTISEMENT_TAP_STRING,
6652         "lbmr_queue_ads_queue",
6653         lbmr_stat_tree_name_queue_ads_queue,
6654         0,
6655         lbmr_queue_ads_queue_stats_tree_packet,
6656         lbmr_queue_ads_queue_stats_tree_init,
6657         NULL);
6658     stats_tree_register(LBMR_QUEUE_ADVERTISEMENT_TAP_STRING,
6659         "lbmr_queue_ads_source",
6660         lbmr_stat_tree_name_queue_ads_source,
6661         0,
6662         lbmr_queue_ads_source_stats_tree_packet,
6663         lbmr_queue_ads_source_stats_tree_init,
6664         NULL);
6665     stats_tree_register(LBMR_QUEUE_QUERY_TAP_STRING,
6666         "lbmr_queue_queries_queue",
6667         lbmr_stat_tree_name_queue_queries_queue,
6668         0,
6669         lbmr_queue_queries_queue_stats_tree_packet,
6670         lbmr_queue_queries_queue_stats_tree_init,
6671         NULL);
6672     stats_tree_register(LBMR_QUEUE_QUERY_TAP_STRING,
6673         "lbmr_queue_queries_receiver",
6674         lbmr_stat_tree_name_queue_queries_receiver,
6675         0,
6676         lbmr_queue_queries_receiver_stats_tree_packet,
6677         lbmr_queue_queries_receiver_stats_tree_init,
6678         NULL);
6679
6680     lbm_topic_init();
6681     lbtsmx_transport_init();
6682     lbtipc_transport_init();
6683     lbtrdma_transport_init();
6684 }
6685
6686 /* The registration hand-off routine */
6687 void proto_reg_handoff_lbmr(void)
6688 {
6689     static gboolean already_registered = FALSE;
6690     struct in_addr addr;
6691
6692     if (!already_registered)
6693     {
6694         lbmr_dissector_handle = new_create_dissector_handle(dissect_lbmr, proto_lbmr);
6695         dissector_add_for_decode_as("udp.port", lbmr_dissector_handle);
6696         heur_dissector_add("udp", test_lbmr_packet, "LBM Topic Resolution over UDP", "lbmr_udp", proto_lbmr, HEURISTIC_ENABLE);
6697     }
6698
6699     lbmr_mc_incoming_udp_port = global_lbmr_mc_incoming_udp_port;
6700     lbmr_mc_outgoing_udp_port = global_lbmr_mc_outgoing_udp_port;
6701     inet_aton(global_lbmr_mc_incoming_address, &addr);
6702     lbmr_mc_incoming_address_host = g_ntohl(addr.s_addr);
6703
6704     inet_aton(global_lbmr_mc_outgoing_address, &addr);
6705     lbmr_mc_outgoing_address_host = g_ntohl(addr.s_addr);
6706
6707     /* Make sure the low port is <= the high port. If not, don't change them. */
6708     if (global_lbmr_uc_port_low <= global_lbmr_uc_port_high)
6709     {
6710         lbmr_uc_port_high = global_lbmr_uc_port_high;
6711         lbmr_uc_port_low = global_lbmr_uc_port_low;
6712     }
6713     lbmr_uc_dest_port = global_lbmr_uc_dest_port;
6714     inet_aton(global_lbmr_uc_address, &addr);
6715     lbmr_uc_address_host = g_ntohl(addr.s_addr);
6716     lbmr_use_tag = global_lbmr_use_tag;
6717
6718     already_registered = TRUE;
6719 }
6720
6721 /*
6722  * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
6723  *
6724  * Local variables:
6725  * c-basic-offset: 4
6726  * tab-width: 8
6727  * indent-tabs-mode: nil
6728  * End:
6729  *
6730  * vi: set shiftwidth=4 tabstop=8 expandtab:
6731  * :indentSize=4:tabSize=8:noTabs=true:
6732  */