summaryrefslogtreecommitdiffstats
path: root/plugins/epan/wimaxasncp/wimaxasncp_dict.h
blob: 6f136522aad5a4a2c9c5fade604fdcc9afa12840 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*
 ** wimaxasncp_dict.h
 ** WIMAXASNCP Dictionary Import Routines
 **
 ** (c) 2007, Stephen Croll <stephen.d.croll@gmail.com>
 **
 ** SPDX-License-Identifier: LGPL-2.0-or-later
 */

#ifndef _WIMAXASNCP_DICT_H_
#define _WIMAXASNCP_DICT_H_

/* -------------------------------------------------------------------------
 * NWG versions
 * ------------------------------------------------------------------------- */

#define WIMAXASNCP_NWGVER_R10_V100  0
#define WIMAXASNCP_NWGVER_R10_V120  1
#define WIMAXASNCP_NWGVER_R10_V121  2
#define WIMAXASNCP_NWGVER_NUM       3

/* -------------------------------------------------------------------------
 * decode types
 * ------------------------------------------------------------------------- */

enum
{
    WIMAXASNCP_TLV_UNKNOWN,
    WIMAXASNCP_TLV_TBD,
    WIMAXASNCP_TLV_COMPOUND,
    WIMAXASNCP_TLV_BYTES,
    WIMAXASNCP_TLV_ENUM8,
    WIMAXASNCP_TLV_ENUM16,
    WIMAXASNCP_TLV_ENUM32,
    WIMAXASNCP_TLV_ETHER,
    WIMAXASNCP_TLV_ASCII_STRING,
    WIMAXASNCP_TLV_FLAG0,
    WIMAXASNCP_TLV_BITFLAGS8,
    WIMAXASNCP_TLV_BITFLAGS16,
    WIMAXASNCP_TLV_BITFLAGS32,
    WIMAXASNCP_TLV_ID,
    WIMAXASNCP_TLV_HEX8,
    WIMAXASNCP_TLV_HEX16,
    WIMAXASNCP_TLV_HEX32,
    WIMAXASNCP_TLV_DEC8,
    WIMAXASNCP_TLV_DEC16,
    WIMAXASNCP_TLV_DEC32,
    WIMAXASNCP_TLV_IP_ADDRESS,   /* Note: IPv4 or IPv6, determined by length */
    WIMAXASNCP_TLV_IPV4_ADDRESS,
    WIMAXASNCP_TLV_PROTOCOL_LIST,
    WIMAXASNCP_TLV_PORT_RANGE_LIST,
    WIMAXASNCP_TLV_IP_ADDRESS_MASK_LIST,
    WIMAXASNCP_TLV_EAP,
    WIMAXASNCP_TLV_VENDOR_SPECIFIC
};

/* -------------------------------------------------------------------------
 * structures and functions
 * ------------------------------------------------------------------------- */

struct _wimaxasncp_dict_namecode_t {
    gchar *name;
    guint code;
    struct _wimaxasncp_dict_namecode_t *next;
};

typedef struct _wimaxasncp_dict_namecode_t wimaxasncp_dict_enum_t;

typedef struct _wimaxasncp_dict_tlv_t {
    guint16 type;
    gchar *name;
    gchar *description;
    gint decoder;
    guint since;
    int hf_root;
    int hf_value;
    int hf_ipv4;
    int hf_ipv6;
    int hf_bsid;
    int hf_protocol;
    int hf_port_low;
    int hf_port_high;
    int hf_ipv4_mask;
    int hf_ipv6_mask;
    int hf_vendor_id;
    int hf_vendor_rest_of_info;
    value_string *enum_vs;
    wimaxasncp_dict_enum_t *enums;
    struct _wimaxasncp_dict_tlv_t *next;
} wimaxasncp_dict_tlv_t;

typedef struct _wimaxasncp_dict_xmlpi_t {
    gchar *name;
    gchar *key;
    gchar *value;
    struct _wimaxasncp_dict_xmlpi_t *next;
} wimaxasncp_dict_xmlpi_t;

typedef struct _wimaxasncp_dict_t {
    wimaxasncp_dict_tlv_t *tlvs;
    wimaxasncp_dict_xmlpi_t *xmlpis;
} wimaxasncp_dict_t;

extern void wimaxasncp_dict_print(
    FILE *fh, wimaxasncp_dict_t *d);

extern wimaxasncp_dict_t *wimaxasncp_dict_scan(
    const gchar *system_directory, const gchar *filename, int dbg,
    gchar **error);

extern void wimaxasncp_dict_free(
    wimaxasncp_dict_t *d);

#endif