| Wireshark 4.7.3 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 typedef struct {
21 unsigned cat;
22 int *edition_default_value;
23 const enum_val_t *edition_enums;
24 const char *edition_name;
25 const char *edition_desc;
26 bool cat_basic;
27} dialog_cat_struct;
28
29 typedef struct {
30 unsigned cat;
31 unsigned ed;
32 const char *edition_name;
33 const char *edition_desc;
34 int *int_default_value;
35 const enum_val_t *int_enums;
36} dialog_int_struct;
37
38 typedef int (*ttt)(tvbuff_t *, unsigned, proto_tree *, int);
39 typedef struct {
40 const ttt *table_pointer;
41 const int* const * table_pointer_expand;
42 unsigned int table_size;
43 char uap_name[MAX_UAP_NAME_LENGTH];
44} table_params;
45
46 typedef struct {
47 unsigned int start_index;
48 unsigned int end_index;
49} uap_table_indexes;
50
51 static bool asterix_extended_end (tvbuff_t *tvb, unsigned offset);
52 static unsigned asterix_get_unsigned_value(tvbuff_t *tvb, unsigned offset, unsigned bytes);
53 static int asterix_get_signed_value(tvbuff_t *tvb, unsigned offset, unsigned bytes);
54 static int get_signed_int(unsigned value, unsigned bits);
55 static unsigned asterix_dissect_fspec (tvbuff_t *tvb, unsigned offset, proto_tree *tree);
56 static bool asterix_field_exists (tvbuff_t *tvb, unsigned offset, unsigned bitIndex);
57 static unsigned asterix_fspec_len (tvbuff_t *tvb, unsigned offset);
58 static bool asterix_fspec_check (unsigned fspec_len, unsigned list_length, proto_item *ti);
59 static void get_expansion_table(unsigned int cat, int ed, table_params *table);
60 static unsigned asterix_parse_re_field (tvbuff_t *tvb, unsigned offset, proto_tree *tree, unsigned fspec_len, unsigned cat);
61 static void print_octal_string (tvbuff_t *tvb, unsigned offset, unsigned bit_offset, unsigned bit_size, unsigned byte_size, proto_tree *tree, int expand_var);
62 static void print_icao_string (tvbuff_t *tvb, unsigned offset, unsigned bit_offset, unsigned bit_size, unsigned byte_size, proto_tree *tree, int expand_var);
63 static void check_spare_bits (tvbuff_t *tvb, unsigned bit_offset, unsigned bit_size, proto_item *item);
64
65 static expert_field ei_asterix_overflow;
66/* TODO: these should have an 'ei_' prefix, but usage is inside generated_dissector python module? */
67 static expert_field hf_asterix_spare_error;
68 static expert_field hf_asterix_fx_error;
69 static expert_field hf_asterix_fspec_error;
70
71 enum interpretations_depth_e {
72 depth_10 = 10,
73 depth_15 = 15,
74 depth_20 = 20,
75 depth_25 = 25,
76 depth_30 = 30
77};
78
79 static const enum_val_t interpretations_level_enum_vals[] = {
80 {"interpretations_depth_10", "depth 10", depth_10},
81 {"interpretations_depth_15", "depth 15", depth_15},
82 {"interpretations_depth_20", "depth 20", depth_20},
83 {"interpretations_depth_25", "depth 25", depth_25},
84 {"interpretations_depth_30", "depth 30", depth_30},
85 {NULL, NULL, 0}
86};
87
88#endif /* __PACKET_ASTERIX_H__ */
expert.h
proto_item
proto_node proto_item
Definition proto.h:927
packet.h
dialog_cat_struct
Definition packet-asterix.h:20
dialog_int_struct
Definition packet-asterix.h:29
enum_val_t
Defines a single named value within an enumerated preference or option type.
Definition params.h:16
expert_field
Pairs an expert info index with its associated header field index for registration and display.
Definition expert.h:41
table_params
Definition packet-asterix.h:39
uap_table_indexes
Definition packet-asterix.h:46