Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
packet-asap+enrp-common.h
1/* packet-asap+enrp-common.h
2 * Common routines for
3 * Aggregate Server Access Protocol (ASAP) and
4 * Endpoint Handlespace Redundancy Protocol (ENRP)
5 * It is hopefully (needs testing) compliant to
6 * RFC 5352
7 * RFC 5354
8 * RFC 5356
9 * https://tools.ietf.org/html/draft-dreibholz-rserpool-asap-hropt-27
10 * https://tools.ietf.org/html/draft-dreibholz-rserpool-delay-26
11 * https://tools.ietf.org/html/draft-dreibholz-rserpool-enrp-takeover-21
12 *
13 * Copyright 2008-2021 Thomas Dreibholz <dreibh [AT] iem.uni-due.de>
14 * Copyright 2004-2007 Michael Tüxen <tuexen [AT] fh-muenster.de>
15 *
16 * Wireshark - Network traffic analyzer
17 * By Gerald Combs <[email protected]>
18 * Copyright 1998 Gerald Combs
19 *
20 * Copied from README.developer
21 *
22 * SPDX-License-Identifier: GPL-2.0-or-later
23 */
24
25#ifndef __PACKET_ASAP_ENRP_COMMON_H__
26#define __PACKET_ASAP_ENRP_COMMON_H__
27
28#include <epan/packet.h>
29
30
31#define UNRECOGNIZED_PARAMETER_CAUSE_CODE 0x1
32#define UNRECONGNIZED_MESSAGE_CAUSE_CODE 0x2
33#define INVALID_VALUES 0x3
34#define NON_UNIQUE_PE_IDENTIFIER 0x4
35#define POOLING_POLICY_INCONSISTENT_CAUSE_CODE 0x5
36#define LACK_OF_RESOURCES_CAUSE_CODE 0x6
37#define INCONSISTENT_TRANSPORT_TYPE_CAUSE_CODE 0x7
38#define INCONSISTENT_DATA_CONTROL_CONFIGURATION_CAUSE_CODE 0x8
39#define UNKNOWN_POOL_HANDLE 0x9
40#define REJECTION_DUE_TO_SECURITY_CAUSE_CODE 0xa
41
42extern const value_string cause_code_values[];
43
44
45#define ROUND_ROBIN_POLICY 0x00000001
46#define WEIGHTED_ROUND_ROBIN_POLICY 0x00000002
47#define RANDOM_POLICY 0x00000003
48#define WEIGHTED_RANDOM_POLICY 0x00000004
49#define PRIORITY_POLICY 0x00000005
50#define LEAST_USED_POLICY 0x40000001
51#define LEAST_USED_WITH_DEG_POLICY 0x40000002
52#define PRIORITY_LEAST_USED_POLICY 0x40000003
53#define RANDOMIZED_LEAST_USED_POLICY 0x40000004
54
55#define PRIORITY_LEAST_USED_DEG_POLICY 0xb0001003
56#define WEIGHTED_RANDOM_DPF_POLICY 0xb0002001
57#define LEAST_USED_DPF_POLICY 0xb0002002
58
59extern const value_string policy_type_values[];
60
61
62#define TRANSPORT_USE_DATA_ONLY 0
63#define TRANSPORT_USE_DATA_PLUS_CONTROL 1
64
65extern const value_string transport_use_values[];
66
67
68#define IPV4_ADDRESS_PARAMETER_TYPE 0x01
69#define IPV6_ADDRESS_PARAMETER_TYPE 0x02
70#define DCCP_TRANSPORT_PARAMETER_TYPE 0x03
71#define SCTP_TRANSPORT_PARAMETER_TYPE 0x04
72#define TCP_TRANSPORT_PARAMETER_TYPE 0x05
73#define UDP_TRANSPORT_PARAMETER_TYPE 0x06
74#define UDP_LITE_TRANSPORT_PARAMETER_TYPE 0x07
75#define POOL_MEMBER_SELECTION_POLICY_PARAMETER_TYPE 0x08
76#define POOL_HANDLE_PARAMETER_TYPE 0x09
77#define POOL_ELEMENT_PARAMETER_TYPE 0x0a
78#define SERVER_INFORMATION_PARAMETER_TYPE 0x0b
79#define OPERATION_ERROR_PARAMETER_TYPE 0x0c
80#define COOKIE_PARAMETER_TYPE 0x0d
81#define PE_IDENTIFIER_PARAMETER_TYPE 0x0e
82#define PE_CHECKSUM_PARAMETER_TYPE 0x0f
83#define HANDLE_RESOLUTION_OPTION_PARAMETER_TYPE 0x803f
84
85extern const value_string parameter_type_values[];
86
87
88#define CAUSE_CODE_LENGTH 2
89#define CAUSE_LENGTH_LENGTH 2
90#define CAUSE_HEADER_LENGTH (CAUSE_CODE_LENGTH + CAUSE_LENGTH_LENGTH)
91
92#define CAUSE_HEADER_OFFSET 0
93#define CAUSE_CODE_OFFSET CAUSE_HEADER_OFFSET
94#define CAUSE_LENGTH_OFFSET (CAUSE_CODE_OFFSET + CAUSE_CODE_LENGTH)
95#define CAUSE_INFO_OFFSET (CAUSE_LENGTH_OFFSET + CAUSE_LENGTH_LENGTH)
96
97
98#define PARAMETER_TYPE_LENGTH 2
99#define PARAMETER_LENGTH_LENGTH 2
100#define PARAMETER_HEADER_LENGTH (PARAMETER_TYPE_LENGTH + PARAMETER_LENGTH_LENGTH)
101
102#define PARAMETER_HEADER_OFFSET 0
103#define PARAMETER_TYPE_OFFSET PARAMETER_HEADER_OFFSET
104#define PARAMETER_LENGTH_OFFSET (PARAMETER_TYPE_OFFSET + PARAMETER_TYPE_LENGTH)
105#define PARAMETER_VALUE_OFFSET (PARAMETER_LENGTH_OFFSET + PARAMETER_LENGTH_LENGTH)
106
107#define IPV4_ADDRESS_LENGTH 4
108#define IPV4_ADDRESS_OFFSET PARAMETER_VALUE_OFFSET
109
110#define IPV6_ADDRESS_LENGTH 16
111#define IPV6_ADDRESS_OFFSET PARAMETER_VALUE_OFFSET
112
113#define DCCP_PORT_LENGTH 2
114#define DCCP_RESERVED_LENGTH 2
115#define DCCP_SERVICE_CODE_LENGTH 4
116#define DCCP_PORT_OFFSET PARAMETER_VALUE_OFFSET
117#define DCCP_RESERVED_OFFSET (DCCP_PORT_OFFSET + DCCP_PORT_LENGTH)
118#define DCCP_SERVICE_CODE_OFFSET (DCCP_RESERVED_OFFSET + DCCP_RESERVED_LENGTH)
119#define DCCP_ADDRESS_OFFSET (DCCP_SERVICE_CODE_OFFSET + DCCP_SERVICE_CODE_LENGTH)
120
121#define SCTP_PORT_LENGTH 2
122#define SCTP_TRANSPORT_USE_LENGTH 2
123#define SCTP_PORT_OFFSET PARAMETER_VALUE_OFFSET
124#define SCTP_TRANSPORT_USE_OFFSET (SCTP_PORT_OFFSET + SCTP_PORT_LENGTH)
125#define SCTP_ADDRESS_OFFSET (SCTP_TRANSPORT_USE_OFFSET + SCTP_TRANSPORT_USE_LENGTH)
126
127#define TCP_PORT_LENGTH 2
128#define TCP_TRANSPORT_USE_LENGTH 2
129#define TCP_PORT_OFFSET PARAMETER_VALUE_OFFSET
130#define TCP_TRANSPORT_USE_OFFSET (TCP_PORT_OFFSET + TCP_PORT_LENGTH)
131#define TCP_ADDRESS_OFFSET (TCP_TRANSPORT_USE_OFFSET + TCP_TRANSPORT_USE_LENGTH)
132
133#define UDP_PORT_LENGTH 2
134#define UDP_RESERVED_LENGTH 2
135#define UDP_PORT_OFFSET PARAMETER_VALUE_OFFSET
136#define UDP_RESERVED_OFFSET (UDP_PORT_OFFSET + UDP_PORT_LENGTH)
137#define UDP_ADDRESS_OFFSET (UDP_RESERVED_OFFSET + UDP_RESERVED_LENGTH)
138
139#define UDP_LITE_PORT_LENGTH 2
140#define UDP_LITE_RESERVED_LENGTH 2
141#define UDP_LITE_PORT_OFFSET PARAMETER_VALUE_OFFSET
142#define UDP_LITE_RESERVED_OFFSET (UDP_LITE_PORT_OFFSET + UDP_LITE_PORT_LENGTH)
143#define UDP_LITE_ADDRESS_OFFSET (UDP_LITE_RESERVED_OFFSET + UDP_LITE_RESERVED_LENGTH)
144
145
146#define POLICY_TYPE_LENGTH 4
147#define POLICY_WEIGHT_LENGTH 4
148#define POLICY_PRIORITY_LENGTH 4
149#define POLICY_LOAD_LENGTH 4
150#define POLICY_DEGRADATION_LENGTH 4
151#define POLICY_LUDPF_LOADDPF_LENGTH 4
152#define POLICY_LUDPF_DISTANCE_LENGTH 4
153#define POLICY_WRANDDPF_WEIGHTDPF_LENGTH 4
154#define POLICY_WRANDDPF_DISTANCE_LENGTH 4
155
156#define POLICY_TYPE_OFFSET PARAMETER_VALUE_OFFSET
157#define POLICY_VALUE_OFFSET (POLICY_TYPE_OFFSET + POLICY_TYPE_LENGTH)
158#define POLICY_WEIGHT_OFFSET POLICY_VALUE_OFFSET
159#define POLICY_PRIORITY_OFFSET POLICY_VALUE_OFFSET
160#define POLICY_LOAD_OFFSET POLICY_VALUE_OFFSET
161#define POLICY_DEGRADATION_OFFSET (POLICY_LOAD_OFFSET + POLICY_LOAD_LENGTH)
162
163#define POLICY_LUDPF_LOADDPF_OFFSET (POLICY_LOAD_OFFSET + POLICY_LOAD_LENGTH)
164#define POLICY_LUDPF_DISTANCE_OFFSET (POLICY_LUDPF_LOADDPF_OFFSET + POLICY_LUDPF_LOADDPF_LENGTH)
165#define POLICY_WRANDDPF_WEIGHTDPF_OFFSET (POLICY_WEIGHT_OFFSET + POLICY_WEIGHT_LENGTH)
166#define POLICY_WRANDDPF_DISTANCE_OFFSET (POLICY_WRANDDPF_WEIGHTDPF_OFFSET + POLICY_WRANDDPF_WEIGHTDPF_LENGTH)
167
168
169#define POOL_HANDLE_OFFSET PARAMETER_VALUE_OFFSET
170
171
172#define PE_PE_IDENTIFIER_LENGTH 4
173#define HOME_ENRP_INDENTIFIER_LENGTH 4
174#define REGISTRATION_LIFE_LENGTH 4
175
176#define PE_PE_IDENTIFIER_OFFSET PARAMETER_VALUE_OFFSET
177#define HOME_ENRP_INDENTIFIER_OFFSET (PE_PE_IDENTIFIER_OFFSET + PE_PE_IDENTIFIER_LENGTH)
178#define REGISTRATION_LIFE_OFFSET (HOME_ENRP_INDENTIFIER_OFFSET + HOME_ENRP_INDENTIFIER_LENGTH)
179#define USER_TRANSPORT_PARAMETER_OFFSET (REGISTRATION_LIFE_OFFSET + REGISTRATION_LIFE_LENGTH)
180
181
182#define SERVER_ID_LENGTH 4
183#define SERVER_ID_OFFSET PARAMETER_VALUE_OFFSET
184#define SERVER_TRANSPORT_OFFSET (SERVER_ID_OFFSET + SERVER_ID_LENGTH)
185
186
187#define PE_IDENTIFIER_LENGTH 4
188#define PE_IDENTIFIER_OFFSET PARAMETER_VALUE_OFFSET
189
190
191#define ERROR_CAUSES_OFFSET PARAMETER_VALUE_OFFSET
192
193
194#define COOKIE_OFFSET PARAMETER_VALUE_OFFSET
195
196
197#define PE_CHECKSUM_LENGTH 2
198
199#define PE_CHECKSUM_OFFSET PARAMETER_VALUE_OFFSET
200
201
202#define HROPT_ITEMS_LENGTH 4
203#define HROPT_ITEMS_OFFSET PARAMETER_VALUE_OFFSET
204
205
206#define MESSAGE_TYPE_LENGTH 1
207#define MESSAGE_FLAGS_LENGTH 1
208#define MESSAGE_LENGTH_LENGTH 2
209#define MESSAGE_HEADER_LENGTH (MESSAGE_TYPE_LENGTH + MESSAGE_FLAGS_LENGTH + MESSAGE_LENGTH_LENGTH)
210
211#define MESSAGE_TYPE_OFFSET 0
212#define MESSAGE_FLAGS_OFFSET (MESSAGE_TYPE_OFFSET + MESSAGE_TYPE_LENGTH)
213#define MESSAGE_LENGTH_OFFSET (MESSAGE_FLAGS_OFFSET + MESSAGE_FLAGS_LENGTH)
214#define MESSAGE_VALUE_OFFSET (MESSAGE_LENGTH_OFFSET + MESSAGE_LENGTH_LENGTH)
215
216
217#endif /* __PACKET_ASAP_ENRP_COMMON_H__ */
Definition value_string.h:25