Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-lapsat.c
blob0e6161f5c2ede0383143c0de14f716515ac5a0a6
1 /* packet-lapsat.c
3 * Routines for GMR-1 LAPSat dissection in wireshark.
5 * Link Access Procedures (LAP) for the Satellite Channel (LAPSat).
6 * LAPSat is the protocol for signalling transfer between an Access
7 * Terminal (MES) and a Gateway Station (GS) in the GeoMobile (GMR-1) network.
9 * Copyright (c) 2011 Sylvain Munaut <tnt@246tNt.com>
10 * Inspired on LAPDm code by Duncan Salerno <duncan.salerno@googlemail.com>
12 * References:
13 * [1] ETSI TS 101 376-4-6 V1.2.1 - GMR-1 04.006
15 * Wireshark - Network traffic analyzer
16 * By Gerald Combs <gerald@wireshark.org>
17 * Copyright 1998 Gerald Combs
19 * SPDX-License-Identifier: GPL-2.0-or-later
22 #include "config.h"
24 #include <epan/packet.h>
25 #include <epan/reassemble.h>
26 #include <epan/conversation.h>
28 void proto_register_lapsat(void);
30 static int proto_lapsat;
32 static reassembly_table lapsat_reassembly_table;
34 static dissector_table_t lapsat_sapi_dissector_table;
36 static int ett_lapsat;
37 static int ett_lapsat_address;
38 static int ett_lapsat_control;
39 static int ett_lapsat_fragment;
40 static int ett_lapsat_fragments;
42 static int hf_lapsat_addr;
43 static int hf_lapsat_addr_sst;
44 static int hf_lapsat_addr_cr;
45 static int hf_lapsat_addr_sapi;
46 static int hf_lapsat_addr_si;
47 static int hf_lapsat_addr_lpd;
48 static int hf_lapsat_addr_lfi;
50 static int hf_lapsat_ctl;
51 static int hf_lapsat_ctl_ftype_i;
52 static int hf_lapsat_ctl_ftype_s_u;
53 static int hf_lapsat_ctl_s_ftype;
54 static int hf_lapsat_ctl_u_modifier_cmd;
55 static int hf_lapsat_ctl_u_modifier_resp;
56 static int hf_lapsat_ctl_n_r;
57 static int hf_lapsat_ctl_n_s;
58 static int hf_lapsat_ctl_p;
59 static int hf_lapsat_ctl_f;
60 static int hf_lapsat_ctl_mii;
62 static int hf_lapsat_payload_last_nibble;
64 static int hf_lapsat_len;
66 static int hf_lapsat_fragment_data;
67 static int hf_lapsat_fragments;
68 static int hf_lapsat_fragment;
69 static int hf_lapsat_fragment_overlap;
70 static int hf_lapsat_fragment_overlap_conflicts;
71 static int hf_lapsat_fragment_multiple_tails;
72 static int hf_lapsat_fragment_too_long_fragment;
73 static int hf_lapsat_fragment_error;
74 static int hf_lapsat_fragment_count;
75 static int hf_lapsat_reassembled_in;
76 static int hf_lapsat_reassembled_length;
79 #define LAPSAT_HEADER_LEN 3
81 #define LAPSAT_SAPI_RR_CC_MM 0
82 #define LAPSAT_SAPI_SMS 3
86 * Address field bits
89 #define LAPSAT_SST 0x01 /* SACCH status bit */
90 #define LAPSAT_CR 0x02 /* Command/Response bit */
91 #define LAPSAT_SAPI_MSK 0x0c /* Service Access Point Identifier */
92 #define LAPSAT_SAPI_SHIFT 2
93 #define LAPSAT_SI 0x10 /* Segment Indicator */
94 #define LAPSAT_LPD_MSK 0x60 /* DL for LAPSat or SMS-CB */
95 #define LAPSAT_LPD_SHIFT 6
96 #define LAPSAT_LFI 0x80 /* Length Field Indicator */
98 static const value_string lapsat_addr_sst_vals[] = {
99 { 0, "FACCH and all other messages" },
100 { 1, "SACCH message" },
101 { 0 , NULL }
104 static const value_string lapsat_addr_sapi_vals[] = {
105 { LAPSAT_SAPI_RR_CC_MM, "RR/MM/CC" },
106 { LAPSAT_SAPI_SMS, "SMS/SS" },
107 { 0, NULL }
110 static const value_string lapsat_addr_lpd_vals[] = {
111 { 0, "Normal GMR-1" },
112 { 1, "Cell broadcast service" },
113 { 0, NULL }
116 static const value_string lapsat_addr_si_vals[] = {
117 { 0, "Complete/Last Segment of L3 message" },
118 { 1, "Segment only" },
119 { 0, NULL }
122 static const value_string lapsat_addr_lfi_vals[] = {
123 { 0, "Length Field not present (all data valid)" },
124 { 1, "Length Field present" },
125 { 0, NULL }
130 * Frame types
133 #define LAPSAT_CTL_TYPE_S 0x001
134 #define LAPSAT_CTL_TYPE_U 0x003
135 #define LAPSAT_CTL_TYPE_S_U_MSK 0x003
137 #define LAPSAT_CTL_TYPE_I 0x000
138 #define LAPSAT_CTL_TYPE_I_MSK 0x001
140 static const value_string lapsat_ctl_ftype_vals[] = {
141 { LAPSAT_CTL_TYPE_I, "Information frame" },
142 { LAPSAT_CTL_TYPE_S, "Supervisory frame" },
143 { LAPSAT_CTL_TYPE_U, "Unnumbered frame" },
144 { 0, NULL }
149 * S-format frame types
152 #define LAPSAT_CTL_S_FTYPE_MSK 0x00c
154 #define LAPSAT_RR 0x000
155 #define LAPSAT_GREJ 0x008
157 static const value_string lapsat_ctl_s_ftype_vals[] = {
158 { LAPSAT_RR >> 2, "Receiver ready" },
159 { LAPSAT_GREJ >> 2, "Group reject" },
160 { 0, NULL}
165 * U-format modifiers
168 #define LAPSAT_CTL_U_MODIFIER_MSK 0x18c
170 #define LAPSAT_SABM 0x08c
171 #define LAPSAT_DM 0x00c
172 #define LAPSAT_DISC 0x100
173 #define LAPSAT_UA 0x180
174 #define LAPSAT_UI 0x000
176 static const value_string lapsat_ctl_u_modifier_vals_cmd[] = {
177 { LAPSAT_SABM >> 2, "Set Asynchronous Balanced Mode" },
178 { LAPSAT_DISC >> 2, "Disconnect" },
179 { LAPSAT_UI >> 2, "Unnumbered Information" },
180 { 0, NULL}
183 static const value_string lapsat_ctl_u_modifier_vals_resp[] = {
184 { LAPSAT_DM >> 2, "Disconnected mode" },
185 { LAPSAT_UA >> 2, "Unnumbered Acknowledge" },
186 { 0, NULL}
191 * Control fields
194 #define LAPSAT_CTL_P_F 0x040
195 #define LAPSAT_CTL_MII 0x200
196 #define LAPSAT_CTL_N_R_MSK 0xf80
197 #define LAPSAT_CTL_N_R_SHIFT 7
198 #define LAPSAT_CTL_N_S_MSK 0x03e
199 #define LAPSAT_CTL_N_S_SHIFT 1
203 * Fragment stuff
207 static const fragment_items lapsat_frag_items = {
208 /* Fragment subtrees */
209 &ett_lapsat_fragment,
210 &ett_lapsat_fragments,
211 /* Fragment fields */
212 &hf_lapsat_fragments,
213 &hf_lapsat_fragment,
214 &hf_lapsat_fragment_overlap,
215 &hf_lapsat_fragment_overlap_conflicts,
216 &hf_lapsat_fragment_multiple_tails,
217 &hf_lapsat_fragment_too_long_fragment,
218 &hf_lapsat_fragment_error,
219 &hf_lapsat_fragment_count,
220 /* Reassembled in field */
221 &hf_lapsat_reassembled_in,
222 /* Reassembled length field */
223 &hf_lapsat_reassembled_length,
224 /* Reassembled data field */
225 NULL,
226 /* Tag */
227 "fragments"
232 * Main dissection functions
235 static uint16_t
236 dissect_control(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int is_response)
238 proto_tree *ctl_tree;
239 proto_item *ctl_ti;
240 uint16_t ctl, poll_final;
241 const char *frame_type;
242 char *info;
244 info = (char *)wmem_alloc(pinfo->pool, 80);
246 /* Grab complete control field */
247 ctl = tvb_get_ntohs(tvb, 1) >> 4;
249 poll_final = ctl & LAPSAT_CTL_P_F;
251 /* Generate small 'descriptive' text */
252 switch (ctl & LAPSAT_CTL_TYPE_S_U_MSK) {
253 case LAPSAT_CTL_TYPE_S:
255 * Supervisory frame.
257 switch (ctl & LAPSAT_CTL_S_FTYPE_MSK) {
258 case LAPSAT_RR:
259 frame_type = "RR";
260 break;
261 case LAPSAT_GREJ:
262 frame_type = "GREJ";
263 break;
264 default:
265 frame_type = "Unknown";
266 break;
269 snprintf(info, 80, "S%s, func=%s, N(R)=%u",
270 poll_final ? (is_response ? " F" : " P") : "",
271 frame_type,
272 (ctl & LAPSAT_CTL_N_R_MSK) >> LAPSAT_CTL_N_R_SHIFT);
274 break;
276 case LAPSAT_CTL_TYPE_U:
278 * Unnumbered frame
280 switch (ctl & LAPSAT_CTL_U_MODIFIER_MSK) {
281 case LAPSAT_SABM:
282 frame_type = (ctl & LAPSAT_CTL_MII) ?
283 "SABM, MII=1" : "SABM, MII=0";
284 break;
285 case LAPSAT_DM:
286 frame_type = "DM";
287 break;
288 case LAPSAT_DISC:
289 frame_type = "DISC";
290 break;
291 case LAPSAT_UA:
292 frame_type = "UA";
293 break;
294 case LAPSAT_UI:
295 frame_type = "UI";
296 break;
297 default:
298 frame_type = "Unknown";
299 break;
302 snprintf(info, 80, "U%s, func=%s",
303 poll_final ? (is_response ? " F" : " P") : "",
304 frame_type);
306 break;
308 default:
310 * Information frame
312 snprintf(info, 80, "I%s, N(R)=%u, N(S)=%u",
313 poll_final ? " P" : "",
314 (ctl & LAPSAT_CTL_N_R_MSK) >> LAPSAT_CTL_N_R_SHIFT,
315 (ctl & LAPSAT_CTL_N_S_MSK) >> LAPSAT_CTL_N_S_SHIFT);
317 break;
320 /* Add info */
321 col_add_str(pinfo->cinfo, COL_INFO, info);
323 /* Create item & subtree */
324 ctl_ti = proto_tree_add_uint_format_value(
325 tree, hf_lapsat_ctl,
326 tvb, 1, 2, (uint32_t)ctl,
327 "%s (0x%03x)", info, ctl
330 ctl_tree = proto_item_add_subtree(ctl_ti, ett_lapsat_control);
332 /* Add all fields */
333 switch (ctl & LAPSAT_CTL_TYPE_S_U_MSK) {
334 case LAPSAT_CTL_TYPE_S:
336 * Supervisory frame.
339 proto_tree_add_item(ctl_tree, hf_lapsat_ctl_ftype_s_u,
340 tvb, 1, 2, ENC_BIG_ENDIAN);
342 proto_tree_add_item(ctl_tree, hf_lapsat_ctl_s_ftype,
343 tvb, 1, 2, ENC_BIG_ENDIAN);
345 proto_tree_add_item(ctl_tree, hf_lapsat_ctl_n_r,
346 tvb, 1, 2, ENC_BIG_ENDIAN);
348 if (poll_final)
349 proto_tree_add_item(ctl_tree,
350 is_response ? hf_lapsat_ctl_f : hf_lapsat_ctl_p,
351 tvb, 1, 2, ENC_BIG_ENDIAN);
353 break;
355 case LAPSAT_CTL_TYPE_U:
357 * Unnumbered frame
360 proto_tree_add_item(ctl_tree, hf_lapsat_ctl_ftype_s_u,
361 tvb, 1, 2, ENC_BIG_ENDIAN);
363 proto_tree_add_item(ctl_tree,
364 is_response ? hf_lapsat_ctl_u_modifier_resp :
365 hf_lapsat_ctl_u_modifier_cmd,
366 tvb, 1, 2, ENC_BIG_ENDIAN);
368 if (poll_final)
369 proto_tree_add_item(ctl_tree,
370 is_response ? hf_lapsat_ctl_f : hf_lapsat_ctl_p,
371 tvb, 1, 2, ENC_BIG_ENDIAN);
373 if (((ctl & LAPSAT_CTL_U_MODIFIER_MSK) == LAPSAT_SABM) &&
374 (ctl & LAPSAT_CTL_MII))
375 proto_tree_add_item(ctl_tree, hf_lapsat_ctl_mii,
376 tvb, 1, 2, ENC_BIG_ENDIAN);
378 break;
380 default:
382 * Information frame
385 proto_tree_add_item(ctl_tree, hf_lapsat_ctl_ftype_i,
386 tvb, 1, 2, ENC_BIG_ENDIAN);
388 proto_tree_add_item(ctl_tree, hf_lapsat_ctl_n_r,
389 tvb, 1, 2, ENC_BIG_ENDIAN);
391 proto_tree_add_item(ctl_tree, hf_lapsat_ctl_n_s,
392 tvb, 1, 2, ENC_BIG_ENDIAN);
394 if (poll_final)
395 proto_tree_add_item(ctl_tree, hf_lapsat_ctl_p,
396 tvb, 1, 2, ENC_BIG_ENDIAN);
398 break;
401 return ctl;
404 static int
405 dissect_lapsat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dissector_data _U_)
407 proto_tree *lapsat_tree, *addr_tree;
408 proto_item *lapsat_ti, *addr_ti;
409 tvbuff_t *payload;
410 uint8_t addr, sapi, cr;
411 uint16_t control;
412 unsigned int hlen, is_response = 0, plen;
414 /* Check that there's enough data */
415 if (tvb_captured_length(tvb) < LAPSAT_HEADER_LEN)
416 return 0;
418 /* Set protocol column */
419 col_set_str(pinfo->cinfo, COL_PROTOCOL, "LAPSat");
421 /* Grab a couple of fields */
422 addr = tvb_get_uint8(tvb, 0);
424 sapi = (addr & LAPSAT_SAPI_MSK) >> LAPSAT_SAPI_SHIFT;
426 cr = addr & LAPSAT_CR;
427 if (pinfo->p2p_dir == P2P_DIR_RECV) {
428 is_response = cr ? false : true;
430 else if (pinfo->p2p_dir == P2P_DIR_SENT) {
431 is_response = cr ? true : false;
434 hlen = LAPSAT_HEADER_LEN;
436 if (addr & LAPSAT_LFI)
437 hlen++;
439 /* FIXME if "S func=GREJ", extend */
441 /* Create LAPSat tree */
442 lapsat_ti = proto_tree_add_item(tree, proto_lapsat, tvb, 0, hlen, ENC_NA);
443 lapsat_tree = proto_item_add_subtree(lapsat_ti, ett_lapsat);
445 /* Dissect address field */
446 addr_ti = proto_tree_add_item(lapsat_tree, hf_lapsat_addr, tvb, 0, 1, ENC_BIG_ENDIAN);
447 addr_tree = proto_item_add_subtree(addr_ti, ett_lapsat_address);
449 proto_tree_add_item(addr_tree, hf_lapsat_addr_sst, tvb, 0, 1, ENC_BIG_ENDIAN);
450 proto_tree_add_item(addr_tree, hf_lapsat_addr_cr, tvb, 0, 1, ENC_BIG_ENDIAN);
451 proto_tree_add_item(addr_tree, hf_lapsat_addr_sapi, tvb, 0, 1, ENC_BIG_ENDIAN);
452 proto_tree_add_item(addr_tree, hf_lapsat_addr_si, tvb, 0, 1, ENC_BIG_ENDIAN);
453 proto_tree_add_item(addr_tree, hf_lapsat_addr_lpd, tvb, 0, 1, ENC_BIG_ENDIAN);
454 proto_tree_add_item(addr_tree, hf_lapsat_addr_lfi, tvb, 0, 1, ENC_BIG_ENDIAN);
456 /* Dissect control field */
457 control = dissect_control(tvb, pinfo, lapsat_tree, is_response);
459 /* Last payload nibble */
460 proto_tree_add_item(lapsat_tree, hf_lapsat_payload_last_nibble, tvb, 2, 1, ENC_BIG_ENDIAN);
462 /* Optional length field */
463 if (addr & LAPSAT_LFI)
464 proto_tree_add_item(lapsat_tree, hf_lapsat_len, tvb, 3, 1, ENC_BIG_ENDIAN);
466 /* If frame is "S func=GREJ", then add Na(R) & Nb(R) */
467 /* FIXME */
469 /* Get the payload */
470 plen = (addr & LAPSAT_LFI) ?
471 tvb_get_uint8(tvb, 3) : tvb_captured_length(tvb) - hlen;
473 if (!plen)
474 return 3; /* No point in doing more if there is no payload */
476 if ((plen + hlen) == tvb_captured_length(tvb)) {
477 /* Need to integrate the last nibble */
478 uint8_t *data = (uint8_t *)tvb_memdup(pinfo->pool, tvb, hlen, plen);
479 data[plen-1] |= tvb_get_uint8(tvb, 2) << 4;
480 payload = tvb_new_child_real_data(tvb, data, plen, plen);
481 } else {
482 /* Last nibble doesn't need merging */
483 payload = tvb_new_subset_length(tvb, hlen, plen);
486 add_new_data_source(pinfo, payload, "LAPSat Payload");
488 /* Handle fragments */
489 if ((control & LAPSAT_CTL_TYPE_I_MSK) == LAPSAT_CTL_TYPE_I) {
491 * Potentially fragmented I frames
493 fragment_head *fd_m = NULL;
494 tvbuff_t *reassembled = NULL;
495 uint32_t fragment_id;
496 bool save_fragmented = pinfo->fragmented;
498 /* Is this a fragment ? */
499 pinfo->fragmented = !!(addr & LAPSAT_SI);
501 /* Rely on caller to provide a way to group fragments */
502 fragment_id = (conversation_get_id_from_elements(pinfo, CONVERSATION_GSMTAP, USE_LAST_ENDPOINT) << 3) | (sapi << 1) | pinfo->p2p_dir;
504 /* Fragment reconstruction helpers */
505 fd_m = fragment_add_seq_next(
506 &lapsat_reassembly_table,
507 payload, 0,
508 pinfo,
509 fragment_id, /* To group fragments */
510 NULL,
511 plen,
512 !!(addr & LAPSAT_SI) /* More fragment ? */
515 reassembled = process_reassembled_data(
516 payload, 0, pinfo,
517 "Reassembled LAPSat", fd_m, &lapsat_frag_items,
518 NULL, lapsat_tree
521 /* Reassembled into this packet ? */
522 if (fd_m && pinfo->num == fd_m->reassembled_in) {
523 /* Yes, so handoff to upper layers */
524 if (!dissector_try_uint(lapsat_sapi_dissector_table, sapi,
525 reassembled, pinfo, tree))
526 call_data_dissector(reassembled, pinfo, tree);
527 } else {
528 /* No, just add infos */
529 col_append_str(pinfo->cinfo, COL_INFO, " (Fragment)");
530 proto_tree_add_item(lapsat_tree, hf_lapsat_fragment_data, payload, 0, -1, ENC_NA);
533 /* Now reset fragmentation information in pinfo */
534 pinfo->fragmented = save_fragmented;
535 } else {
537 * Whole frame
539 if (!dissector_try_uint(lapsat_sapi_dissector_table, sapi, payload, pinfo, tree))
540 call_data_dissector(payload, pinfo, tree);
542 return tvb_captured_length(tvb);
545 void
546 proto_register_lapsat(void)
548 static hf_register_info hf[] = {
549 /* Address field */
550 { &hf_lapsat_addr,
551 { "Address Field", "lapsat.address",
552 FT_UINT8, BASE_HEX, NULL, 0x00,
553 NULL, HFILL },
555 { &hf_lapsat_addr_sst,
556 { "SST", "lapsat.address.sst",
557 FT_UINT8, BASE_DEC, VALS(lapsat_addr_sst_vals), LAPSAT_SST,
558 "SACCH status bit", HFILL },
560 { &hf_lapsat_addr_cr,
561 { "C/R", "lapsat.address.cr",
562 FT_UINT8, BASE_DEC, NULL, LAPSAT_CR,
563 "Command/response bit", HFILL },
565 { &hf_lapsat_addr_sapi,
566 { "SAPI", "lapsat.address.sapi",
567 FT_UINT8, BASE_DEC, VALS(lapsat_addr_sapi_vals), LAPSAT_SAPI_MSK,
568 "Service access point identifier", HFILL },
570 { &hf_lapsat_addr_si,
571 { "SI", "lapsat.address.si",
572 FT_UINT8, BASE_DEC, VALS(lapsat_addr_si_vals), LAPSAT_SI,
573 "Segment Indicator", HFILL },
575 { &hf_lapsat_addr_lpd,
576 { "LPD", "lapsat.address.lpd",
577 FT_UINT8, BASE_DEC, VALS(lapsat_addr_lpd_vals), LAPSAT_LPD_MSK,
578 "Link Protocol Discriminator", HFILL },
580 { &hf_lapsat_addr_lfi,
581 { "LFI", "lapsat.address.lfi",
582 FT_UINT8, BASE_DEC, VALS(lapsat_addr_lfi_vals), LAPSAT_LFI,
583 "Length Field Indicator", HFILL },
586 /* Control field */
587 { &hf_lapsat_ctl,
588 { "Control Field", "lapsat.control_field",
589 FT_UINT16, BASE_HEX, NULL, 0x00,
590 NULL, HFILL }
592 { &hf_lapsat_ctl_ftype_i,
593 { "Frame type", "lapsat.control.ftype",
594 FT_UINT16, BASE_DEC, VALS(lapsat_ctl_ftype_vals), LAPSAT_CTL_TYPE_I_MSK << 4,
595 NULL, HFILL }
597 { &hf_lapsat_ctl_ftype_s_u,
598 { "Frame type", "lapsat.control.ftype",
599 FT_UINT16, BASE_DEC, VALS(lapsat_ctl_ftype_vals), LAPSAT_CTL_TYPE_S_U_MSK << 4,
600 NULL, HFILL }
602 { &hf_lapsat_ctl_s_ftype,
603 { "Supervisory frame type", "lapsat.control.s_ftype",
604 FT_UINT16, BASE_DEC, VALS(lapsat_ctl_s_ftype_vals), LAPSAT_CTL_S_FTYPE_MSK << 4,
605 NULL, HFILL }
607 { &hf_lapsat_ctl_u_modifier_cmd,
608 { "Command", "lapsat.control.u_modifier_cmd",
609 FT_UINT16, BASE_HEX, VALS(lapsat_ctl_u_modifier_vals_cmd),
610 LAPSAT_CTL_U_MODIFIER_MSK << 4,
611 NULL, HFILL }
613 { &hf_lapsat_ctl_u_modifier_resp,
614 { "Response", "lapsat.control.u_modifier_resp",
615 FT_UINT16, BASE_HEX, VALS(lapsat_ctl_u_modifier_vals_resp),
616 LAPSAT_CTL_U_MODIFIER_MSK << 4,
617 NULL, HFILL }
619 { &hf_lapsat_ctl_n_r,
620 { "N(R)", "lapsat.control.n_r",
621 FT_UINT16, BASE_DEC, NULL, LAPSAT_CTL_N_R_MSK << 4,
622 NULL, HFILL }
624 { &hf_lapsat_ctl_n_s,
625 { "N(S)", "lapsat.control.n_s",
626 FT_UINT16, BASE_DEC, NULL, LAPSAT_CTL_N_S_MSK << 4,
627 NULL, HFILL }
629 { &hf_lapsat_ctl_p,
630 { "Poll", "lapsat.control.p",
631 FT_BOOLEAN, 16, NULL, LAPSAT_CTL_P_F << 4,
632 NULL, HFILL }
634 { &hf_lapsat_ctl_f,
635 { "Final", "lapsat.control.f",
636 FT_BOOLEAN, 16, NULL, LAPSAT_CTL_P_F << 4,
637 NULL, HFILL }
639 { &hf_lapsat_ctl_mii,
640 { "MII", "lapsat.control.mii",
641 FT_BOOLEAN, 16, NULL, LAPSAT_CTL_MII << 4,
642 "Mobile Identity Indicator", HFILL }
645 /* Payload last nibble */
646 { &hf_lapsat_payload_last_nibble,
647 { "Payload last nibble", "lapsat.payload.last_nibble",
648 FT_UINT8, BASE_HEX, NULL, 0x0f,
649 NULL, HFILL }
652 /* Length field */
653 { &hf_lapsat_len,
654 { "Length Field", "lapsat.length",
655 FT_UINT8, BASE_DEC, NULL, 0x00,
656 NULL, HFILL },
659 /* Fragment reassembly */
660 { &hf_lapsat_fragment_data,
661 { "Fragment Data", "lapsat.fragment_data",
662 FT_BYTES, BASE_NONE, NULL, 0x00,
663 NULL, HFILL }
665 { &hf_lapsat_fragments,
666 { "Message fragments", "lapsat.fragments",
667 FT_NONE, BASE_NONE, NULL, 0x00,
668 "LAPSat Message fragments", HFILL }
670 { &hf_lapsat_fragment,
671 { "Message fragment", "lapsat.fragment",
672 FT_FRAMENUM, BASE_NONE, NULL, 0x00,
673 "LAPSat Message fragment", HFILL }
675 { &hf_lapsat_fragment_overlap,
676 { "Message fragment overlap", "lapsat.fragment.overlap",
677 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
678 "LAPSat Message fragment overlaps with other fragment(s)", HFILL }
680 { &hf_lapsat_fragment_overlap_conflicts,
681 { "Message fragment overlapping with conflicting data",
682 "lapsat.fragment.overlap.conflicts",
683 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
684 "LAPSat Message fragment overlaps with conflicting data", HFILL }
686 { &hf_lapsat_fragment_multiple_tails,
687 { "Message has multiple tail fragments", "lapsat.fragment.multiple_tails",
688 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
689 "LAPSat Message fragment has multiple tail fragments", HFILL }
691 { &hf_lapsat_fragment_too_long_fragment,
692 { "Message fragment too long", "lapsat.fragment.too_long_fragment",
693 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
694 "LAPSat Message fragment data goes beyond the packet end", HFILL }
696 { &hf_lapsat_fragment_error,
697 { "Message defragmentation error", "lapsat.fragment.error",
698 FT_FRAMENUM, BASE_NONE, NULL, 0x00,
699 "LAPSat Message defragmentation error due to illegal fragments", HFILL }
701 { &hf_lapsat_fragment_count,
702 { "Message fragment count", "lapsat.fragment.count",
703 FT_UINT32, BASE_DEC, NULL, 0x00,
704 NULL, HFILL }
706 { &hf_lapsat_reassembled_in,
707 { "Reassembled in", "lapsat.reassembled.in",
708 FT_FRAMENUM, BASE_NONE, NULL, 0x00,
709 "LAPSat Message has been reassembled in this packet.", HFILL }
711 { &hf_lapsat_reassembled_length,
712 { "Reassembled LAPSat length", "lapsat.reassembled.length",
713 FT_UINT32, BASE_DEC, NULL, 0x00,
714 "The total length of the reassembled payload", HFILL }
718 static int *ett[] = {
719 &ett_lapsat,
720 &ett_lapsat_address,
721 &ett_lapsat_control,
722 &ett_lapsat_fragment,
723 &ett_lapsat_fragments,
726 proto_lapsat = proto_register_protocol("Link Access Procedure, Satellite channel (LAPSat)", "LAPSat", "lapsat");
728 proto_register_field_array (proto_lapsat, hf, array_length(hf));
729 proto_register_subtree_array(ett, array_length(ett));
731 register_dissector("lapsat", dissect_lapsat, proto_lapsat);
733 lapsat_sapi_dissector_table = register_dissector_table("lapsat.sapi", "LAPSat SAPI", proto_lapsat, FT_UINT8, BASE_DEC);
735 reassembly_table_register(&lapsat_reassembly_table,
736 &addresses_reassembly_table_functions);
741 * Editor modelines - https://www.wireshark.org/tools/modelines.html
743 * Local variables:
744 * c-basic-offset: 8
745 * tab-width: 8
746 * indent-tabs-mode: t
747 * End:
749 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
750 * :indentSize=8:tabSize=8:noTabs=false: