| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
packet-asterix.h
1/* packet-asterix.h
2 *
3 * Common definitions for ASTERIX dissector
4 *
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
8 *
9 * SPDX-License-Identifier: GPL-2.0-or-later
10 */
11
12#ifndef __PACKET_ASTERIX_H__
13#define __PACKET_ASTERIX_H__
14
15#include <epan/packet.h>
16#include <epan/expert.h>
17
18#define MAX_UAP_NAME_LENGTH 255
19
20 module_t *asterix_module;
21 expert_module_t* expert_asterix;
22 typedef struct {
23 unsigned cat;
24 int *edition_default_value;
25 const enum_val_t *edition_enums;
26 const char *edition_name;
27 const char *edition_desc;
28 bool cat_basic;
29} dialog_cat_struct;
30
31 typedef struct {
32 unsigned cat;
33 unsigned ed;
34 const char *edition_name;
35 const char *edition_desc;
36 int *int_default_value;
37 const enum_val_t *int_enums;
38} dialog_int_struct;
39
40typedef int (*ttt)(tvbuff_t *, unsigned, proto_tree *, int);
41 typedef struct {
42 const ttt *table_pointer;
43 int** table_pointer_expand;
44 unsigned int table_size;
45 char uap_name[MAX_UAP_NAME_LENGTH];
46} table_params;
47
48 typedef struct {
49 unsigned int start_index;
50 unsigned int end_index;
51} uap_table_indexes;
52
53static bool asterix_extended_end (tvbuff_t *tvb, unsigned offset);
54static unsigned asterix_get_unsigned_value(tvbuff_t *tvb, unsigned offset, unsigned bytes);
55static int asterix_get_signed_value(tvbuff_t *tvb, unsigned offset, unsigned bytes);
56static int get_signed_int(unsigned value, unsigned bits);
57static unsigned asterix_dissect_fspec (tvbuff_t *tvb, unsigned offset, proto_tree *tree);
58static bool asterix_field_exists (tvbuff_t *tvb, unsigned offset, unsigned bitIndex);
59static unsigned asterix_fspec_len (tvbuff_t *tvb, unsigned offset);
60static bool asterix_fspec_check (unsigned fspec_len, unsigned list_length, proto_item *ti);
61static void get_expansion_table(unsigned int cat, int ed, table_params *table);
62static unsigned asterix_parse_re_field (tvbuff_t *tvb, unsigned offset, proto_tree *tree, unsigned fspec_len, unsigned cat);
63static void print_octal_string (tvbuff_t *tvb, unsigned offset, unsigned bit_offset, unsigned bit_size, unsigned byte_size, proto_tree *tree, int expand_var);
64static void print_icao_string (tvbuff_t *tvb, unsigned offset, unsigned bit_offset, unsigned bit_size, unsigned byte_size, proto_tree *tree, int expand_var);
65static void check_spare_bits (tvbuff_t *tvb, unsigned bit_offset, unsigned bit_size, proto_item *item);
66
67static expert_field ei_asterix_overflow;
68static expert_field hf_asterix_spare_error;
69static expert_field hf_asterix_fx_error;
70static expert_field hf_asterix_fspec_error;
71
72enum interpretations_depth_e {
73 depth_10 = 10,
74 depth_15 = 15,
75 depth_20 = 20,
76 depth_25 = 25,
77 depth_30 = 30
78};
79
80static const enum_val_t interpretations_level_enum_vals[] = {
81 {"interpretations_depth_10", "depth 10", depth_10},
82 {"interpretations_depth_15", "depth 15", depth_15},
83 {"interpretations_depth_20", "depth 20", depth_20},
84 {"interpretations_depth_25", "depth 25", depth_25},
85 {"interpretations_depth_30", "depth 30", depth_30},
86 {NULL, NULL, 0}
87};
88
89#endif /* __PACKET_ASTERIX_H__ */
expert.h
packet.h
_proto_node
Definition proto.h:907
dialog_cat_struct
Definition packet-asterix.h:22
dialog_int_struct
Definition packet-asterix.h:31
enum_val_t
Definition params.h:23
expert_field
Definition expert.h:39
expert_module
Definition expert.c:48
pref_module
Definition prefs-int.h:27
table_params
Definition packet-asterix.h:41
tvbuff
Definition tvbuff-int.h:35
uap_table_indexes
Definition packet-asterix.h:48