File: | builds/wireshark/wireshark/epan/ftypes/ftypes.c |
Warning: | line 154, column 14 Value stored to 's' during its initialization is never read |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | /* |
2 | * Wireshark - Network traffic analyzer |
3 | * By Gerald Combs <[email protected]> |
4 | * Copyright 2001 Gerald Combs |
5 | * |
6 | * SPDX-License-Identifier: GPL-2.0-or-later |
7 | */ |
8 | |
9 | #include "config.h" |
10 | |
11 | #include "ftypes-int.h" |
12 | |
13 | #include <wsutil/ws_assert.h> |
14 | |
15 | /* Keep track of ftype_t's via their ftenum number */ |
16 | const ftype_t* type_list[FT_ENUM_SIZE + 1]; |
17 | |
18 | /* Initialize the ftype module. */ |
19 | void |
20 | ftypes_initialize(void) |
21 | { |
22 | ftype_register_bytes(); |
23 | ftype_register_double(); |
24 | ftype_register_ieee_11073_float(); |
25 | ftype_register_integers(); |
26 | ftype_register_ipv4(); |
27 | ftype_register_ipv6(); |
28 | ftype_register_guid(); |
29 | ftype_register_none(); |
30 | ftype_register_string(); |
31 | ftype_register_time(); |
32 | ftype_register_tvbuff(); |
33 | } |
34 | |
35 | void |
36 | ftypes_register_pseudofields(void) |
37 | { |
38 | static int proto_ftypes; |
39 | |
40 | proto_ftypes = proto_register_protocol( |
41 | "Wireshark Field/Fundamental Types", |
42 | "Wireshark FTypes", |
43 | "_ws.ftypes"); |
44 | |
45 | ftype_register_pseudofields_bytes(proto_ftypes); |
46 | ftype_register_pseudofields_double(proto_ftypes); |
47 | ftype_register_pseudofields_ieee_11073_float(proto_ftypes); |
48 | ftype_register_pseudofields_integer(proto_ftypes); |
49 | ftype_register_pseudofields_ipv4(proto_ftypes); |
50 | ftype_register_pseudofields_ipv6(proto_ftypes); |
51 | ftype_register_pseudofields_guid(proto_ftypes); |
52 | ftype_register_pseudofields_none(proto_ftypes); |
53 | ftype_register_pseudofields_string(proto_ftypes); |
54 | ftype_register_pseudofields_time(proto_ftypes); |
55 | ftype_register_pseudofields_tvbuff(proto_ftypes); |
56 | |
57 | proto_set_cant_toggle(proto_ftypes); |
58 | } |
59 | |
60 | /* Each ftype_t is registered via this function */ |
61 | void |
62 | ftype_register(enum ftenum ftype, const ftype_t *ft) |
63 | { |
64 | /* Check input */ |
65 | ws_assert(ftype < FT_NUM_TYPES)do { if ((1) && !(ftype < FT_NUM_TYPES)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 65, __func__, "assertion failed: %s" , "ftype < FT_NUM_TYPES"); } while (0); |
66 | ws_assert(ftype == ft->ftype)do { if ((1) && !(ftype == ft->ftype)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 66, __func__, "assertion failed: %s" , "ftype == ft->ftype"); } while (0); |
67 | |
68 | /* Don't re-register. */ |
69 | ws_assert(type_list[ftype] == NULL)do { if ((1) && !(type_list[ftype] == ((void*)0))) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 69, __func__, "assertion failed: %s" , "type_list[ftype] == ((void*)0)"); } while (0); |
70 | |
71 | type_list[ftype] = ft; |
72 | } |
73 | |
74 | |
75 | /* from README.dissector: |
76 | Note that the formats used must all belong to the same list as defined below: |
77 | - FT_INT8, FT_INT16, FT_INT24 and FT_INT32 |
78 | - FT_UINT8, FT_UINT16, FT_UINT24, FT_UINT32, FT_IPXNET and FT_FRAMENUM |
79 | - FT_UINT64 and FT_EUI64 |
80 | - FT_STRING, FT_STRINGZ and FT_UINT_STRING |
81 | - FT_FLOAT and FT_DOUBLE |
82 | - FT_BYTES, FT_UINT_BYTES, FT_AX25, FT_ETHER, FT_VINES, FT_OID and FT_REL_OID |
83 | - FT_ABSOLUTE_TIME and FT_RELATIVE_TIME |
84 | */ |
85 | static enum ftenum |
86 | same_ftype(const enum ftenum ftype) |
87 | { |
88 | switch (ftype) { |
89 | case FT_INT8: |
90 | case FT_INT16: |
91 | case FT_INT24: |
92 | case FT_INT32: |
93 | return FT_INT32; |
94 | |
95 | case FT_UINT8: |
96 | case FT_UINT16: |
97 | case FT_UINT24: |
98 | case FT_UINT32: |
99 | return FT_UINT32; |
100 | |
101 | case FT_INT40: |
102 | case FT_INT48: |
103 | case FT_INT56: |
104 | case FT_INT64: |
105 | return FT_INT64; |
106 | |
107 | case FT_UINT40: |
108 | case FT_UINT48: |
109 | case FT_UINT56: |
110 | case FT_UINT64: |
111 | return FT_UINT64; |
112 | |
113 | case FT_STRING: |
114 | case FT_STRINGZ: |
115 | case FT_UINT_STRING: |
116 | return FT_STRING; |
117 | |
118 | case FT_FLOAT: |
119 | case FT_DOUBLE: |
120 | return FT_DOUBLE; |
121 | |
122 | case FT_BYTES: |
123 | case FT_UINT_BYTES: |
124 | return FT_BYTES; |
125 | |
126 | case FT_OID: |
127 | case FT_REL_OID: |
128 | return FT_OID; |
129 | |
130 | /* XXX: the following are unique for now */ |
131 | case FT_IPv4: |
132 | case FT_IPv6: |
133 | |
134 | /* everything else is unique */ |
135 | default: |
136 | return ftype; |
137 | } |
138 | } |
139 | |
140 | /* given two types, are they similar - for example can two |
141 | * duplicate fields be registered of these two types. */ |
142 | bool_Bool |
143 | ftype_similar_types(const enum ftenum ftype_a, const enum ftenum ftype_b) |
144 | { |
145 | return (same_ftype(ftype_a) == same_ftype(ftype_b)); |
146 | } |
147 | |
148 | /* Returns a string representing the name of the type. Useful |
149 | * for glossary production. */ |
150 | const char* |
151 | ftype_name(enum ftenum ftype) |
152 | { |
153 | const ftype_t *ft; |
154 | const char *s = "(null)"; |
Value stored to 's' during its initialization is never read | |
155 | |
156 | FTYPE_LOOKUP(ftype, ft)do { if ((1) && !(ftype < FT_NUM_TYPES)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 156, __func__, "assertion failed: %s" , "ftype < FT_NUM_TYPES"); } while (0); ft = type_list[ftype ];; |
157 | switch (ft->ftype) { |
158 | case FT_NONE: s = "FT_NONE"; break; |
159 | case FT_PROTOCOL: s = "FT_PROTOCOL"; break; |
160 | case FT_BOOLEAN: s = "FT_BOOLEAN"; break; |
161 | case FT_CHAR: s = "FT_CHAR"; break; |
162 | case FT_UINT8: s = "FT_UINT8"; break; |
163 | case FT_UINT16: s = "FT_UINT16"; break; |
164 | case FT_UINT24: s = "FT_UINT24"; break; |
165 | case FT_UINT32: s = "FT_UINT32"; break; |
166 | case FT_UINT40: s = "FT_UINT40"; break; |
167 | case FT_UINT48: s = "FT_UINT48"; break; |
168 | case FT_UINT56: s = "FT_UINT56"; break; |
169 | case FT_UINT64: s = "FT_UINT64"; break; |
170 | case FT_INT8: s = "FT_INT8"; break; |
171 | case FT_INT16: s = "FT_INT16"; break; |
172 | case FT_INT24: s = "FT_INT24"; break; |
173 | case FT_INT32: s = "FT_INT32"; break; |
174 | case FT_INT40: s = "FT_INT40"; break; |
175 | case FT_INT48: s = "FT_INT48"; break; |
176 | case FT_INT56: s = "FT_INT56"; break; |
177 | case FT_INT64: s = "FT_INT64"; break; |
178 | case FT_IEEE_11073_SFLOAT: s = "FT_IEEE_11073_SFLOAT"; break; |
179 | case FT_IEEE_11073_FLOAT: s = "FT_IEEE_11073_FLOAT"; break; |
180 | case FT_FLOAT: s = "FT_FLOAT"; break; |
181 | case FT_DOUBLE: s = "FT_DOUBLE"; break; |
182 | case FT_ABSOLUTE_TIME: s = "FT_ABSOLUTE_TIME"; break; |
183 | case FT_RELATIVE_TIME: s = "FT_RELATIVE_TIME"; break; |
184 | case FT_STRING: s = "FT_STRING"; break; |
185 | case FT_STRINGZ: s = "FT_STRINGZ"; break; |
186 | case FT_UINT_STRING: s = "FT_UINT_STRING"; break; |
187 | case FT_ETHER: s = "FT_ETHER"; break; |
188 | case FT_BYTES: s = "FT_BYTES"; break; |
189 | case FT_UINT_BYTES: s = "FT_UINT_BYTES"; break; |
190 | case FT_IPv4: s = "FT_IPv4"; break; |
191 | case FT_IPv6: s = "FT_IPv6"; break; |
192 | case FT_IPXNET: s = "FT_IPXNET"; break; |
193 | case FT_FRAMENUM: s = "FT_FRAMENUM"; break; |
194 | case FT_GUID: s = "FT_GUID"; break; |
195 | case FT_OID: s = "FT_OID"; break; |
196 | case FT_EUI64: s = "FT_EUI64"; break; |
197 | case FT_AX25: s = "FT_AX25"; break; |
198 | case FT_VINES: s = "FT_VINES"; break; |
199 | case FT_REL_OID: s = "FT_REL_OID"; break; |
200 | case FT_SYSTEM_ID: s = "FT_SYSTEM_ID"; break; |
201 | case FT_STRINGZPAD: s = "FT_STRINGZPAD"; break; |
202 | case FT_FCWWN: s = "FT_FCWWN"; break; |
203 | case FT_STRINGZTRUNC: s = "FT_STRINGZTRUNC"; break; |
204 | case FT_NUM_TYPES: s = "FT_NUM_TYPES"; break; |
205 | case FT_SCALAR: s = "FT_SCALAR"; break; |
206 | } |
207 | return s; |
208 | } |
209 | |
210 | const char* |
211 | ftype_pretty_name(enum ftenum ftype) |
212 | { |
213 | const ftype_t *ft; |
214 | const char *s = "(null)"; |
215 | |
216 | FTYPE_LOOKUP(ftype, ft)do { if ((1) && !(ftype < FT_NUM_TYPES)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 216, __func__, "assertion failed: %s" , "ftype < FT_NUM_TYPES"); } while (0); ft = type_list[ftype ];; |
217 | switch (ft->ftype) { |
218 | case FT_NONE: s = "Label"; break; |
219 | case FT_PROTOCOL: s = "Protocol"; break; |
220 | case FT_BOOLEAN: s = "Boolean"; break; |
221 | case FT_CHAR: s = "Character (8 bits)"; break; |
222 | case FT_UINT8: s = "Unsigned integer (8 bits)"; break; |
223 | case FT_UINT16: s = "Unsigned integer (16 bits)"; break; |
224 | case FT_UINT24: s = "Unsigned integer (24 bits)"; break; |
225 | case FT_UINT32: s = "Unsigned integer (32 bits)"; break; |
226 | case FT_UINT40: s = "Unsigned integer (40 bits)"; break; |
227 | case FT_UINT48: s = "Unsigned integer (48 bits)"; break; |
228 | case FT_UINT56: s = "Unsigned integer (56 bits)"; break; |
229 | case FT_UINT64: s = "Unsigned integer (64 bits)"; break; |
230 | case FT_INT8: s = "Signed integer (8 bits)"; break; |
231 | case FT_INT16: s = "Signed integer (16 bits)"; break; |
232 | case FT_INT24: s = "Signed integer (24 bits)"; break; |
233 | case FT_INT32: s = "Signed integer (32 bits)"; break; |
234 | case FT_INT40: s = "Signed integer (40 bits)"; break; |
235 | case FT_INT48: s = "Signed integer (48 bits)"; break; |
236 | case FT_INT56: s = "Signed integer (56 bits)"; break; |
237 | case FT_INT64: s = "Signed integer (64 bits)"; break; |
238 | case FT_IEEE_11073_SFLOAT: s = "IEEE-11073 floating point (16-bit)"; break; |
239 | case FT_IEEE_11073_FLOAT: s = "IEEE-11073 Floating point (32-bit)"; break; |
240 | case FT_FLOAT: s = "Floating point (single-precision)"; break; |
241 | case FT_DOUBLE: s = "Floating point (double-precision)"; break; |
242 | case FT_ABSOLUTE_TIME: s = "Date and time"; break; |
243 | case FT_RELATIVE_TIME: s = "Time offset"; break; |
244 | case FT_STRING: s = "Character string"; break; |
245 | case FT_STRINGZ: s = "Character string"; break; |
246 | case FT_UINT_STRING: s = "Character string"; break; |
247 | case FT_ETHER: s = "Ethernet or other MAC address"; break; |
248 | case FT_BYTES: s = "Byte sequence"; break; |
249 | case FT_UINT_BYTES: s = "Byte sequence"; break; |
250 | case FT_IPv4: s = "IPv4 address"; break; |
251 | case FT_IPv6: s = "IPv6 address"; break; |
252 | case FT_IPXNET: s = "IPX network number"; break; |
253 | case FT_FRAMENUM: s = "Frame number"; break; |
254 | case FT_GUID: s = "Globally Unique Identifier"; break; |
255 | case FT_OID: s = "ASN.1 object identifier"; break; |
256 | case FT_EUI64: s = "EUI64 address"; break; |
257 | case FT_AX25: s = "AX.25 address"; break; |
258 | case FT_VINES: s = "VINES address"; break; |
259 | case FT_REL_OID: s = "ASN.1 relative object identifier"; break; |
260 | case FT_SYSTEM_ID: s = "OSI System-ID"; break; |
261 | case FT_STRINGZPAD: s = "Character string"; break; |
262 | case FT_FCWWN: s = "Fibre Channel WWN"; break; |
263 | case FT_STRINGZTRUNC: s = "Character string"; break; |
264 | case FT_NUM_TYPES: s = "(num types)"; break; |
265 | case FT_SCALAR: s = "Scalar"; break; |
266 | } |
267 | return s; |
268 | } |
269 | |
270 | int |
271 | ftype_wire_size(enum ftenum ftype) |
272 | { |
273 | const ftype_t *ft; |
274 | |
275 | FTYPE_LOOKUP(ftype, ft)do { if ((1) && !(ftype < FT_NUM_TYPES)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 275, __func__, "assertion failed: %s" , "ftype < FT_NUM_TYPES"); } while (0); ft = type_list[ftype ];; |
276 | return ft->wire_size; |
277 | } |
278 | |
279 | bool_Bool |
280 | ftype_can_length(enum ftenum ftype) |
281 | { |
282 | const ftype_t *ft; |
283 | |
284 | FTYPE_LOOKUP(ftype, ft)do { if ((1) && !(ftype < FT_NUM_TYPES)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 284, __func__, "assertion failed: %s" , "ftype < FT_NUM_TYPES"); } while (0); ft = type_list[ftype ];; |
285 | return ft->len ? true1 : false0; |
286 | } |
287 | |
288 | bool_Bool |
289 | ftype_can_slice(enum ftenum ftype) |
290 | { |
291 | const ftype_t *ft; |
292 | |
293 | FTYPE_LOOKUP(ftype, ft)do { if ((1) && !(ftype < FT_NUM_TYPES)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 293, __func__, "assertion failed: %s" , "ftype < FT_NUM_TYPES"); } while (0); ft = type_list[ftype ];; |
294 | return ft->slice ? true1 : false0; |
295 | } |
296 | |
297 | bool_Bool |
298 | ftype_can_eq(enum ftenum ftype) |
299 | { |
300 | const ftype_t *ft; |
301 | |
302 | FTYPE_LOOKUP(ftype, ft)do { if ((1) && !(ftype < FT_NUM_TYPES)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 302, __func__, "assertion failed: %s" , "ftype < FT_NUM_TYPES"); } while (0); ft = type_list[ftype ];; |
303 | return ft->compare != NULL((void*)0); |
304 | } |
305 | |
306 | bool_Bool |
307 | ftype_can_cmp(enum ftenum ftype) |
308 | { |
309 | const ftype_t *ft; |
310 | |
311 | FTYPE_LOOKUP(ftype, ft)do { if ((1) && !(ftype < FT_NUM_TYPES)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 311, __func__, "assertion failed: %s" , "ftype < FT_NUM_TYPES"); } while (0); ft = type_list[ftype ];; |
312 | return ft->compare != NULL((void*)0); |
313 | } |
314 | |
315 | bool_Bool |
316 | ftype_can_bitwise_and(enum ftenum ftype) |
317 | { |
318 | const ftype_t *ft; |
319 | |
320 | FTYPE_LOOKUP(ftype, ft)do { if ((1) && !(ftype < FT_NUM_TYPES)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 320, __func__, "assertion failed: %s" , "ftype < FT_NUM_TYPES"); } while (0); ft = type_list[ftype ];; |
321 | return ft->bitwise_and ? true1 : false0; |
322 | } |
323 | |
324 | bool_Bool |
325 | ftype_can_unary_minus(enum ftenum ftype) |
326 | { |
327 | const ftype_t *ft; |
328 | |
329 | FTYPE_LOOKUP(ftype, ft)do { if ((1) && !(ftype < FT_NUM_TYPES)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 329, __func__, "assertion failed: %s" , "ftype < FT_NUM_TYPES"); } while (0); ft = type_list[ftype ];; |
330 | return ft->unary_minus != NULL((void*)0); |
331 | } |
332 | |
333 | bool_Bool |
334 | ftype_can_add(enum ftenum ftype) |
335 | { |
336 | const ftype_t *ft; |
337 | |
338 | FTYPE_LOOKUP(ftype, ft)do { if ((1) && !(ftype < FT_NUM_TYPES)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 338, __func__, "assertion failed: %s" , "ftype < FT_NUM_TYPES"); } while (0); ft = type_list[ftype ];; |
339 | return ft->add != NULL((void*)0); |
340 | } |
341 | |
342 | bool_Bool |
343 | ftype_can_subtract(enum ftenum ftype) |
344 | { |
345 | const ftype_t *ft; |
346 | |
347 | FTYPE_LOOKUP(ftype, ft)do { if ((1) && !(ftype < FT_NUM_TYPES)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 347, __func__, "assertion failed: %s" , "ftype < FT_NUM_TYPES"); } while (0); ft = type_list[ftype ];; |
348 | return ft->subtract != NULL((void*)0); |
349 | } |
350 | |
351 | bool_Bool |
352 | ftype_can_multiply(enum ftenum ftype) |
353 | { |
354 | const ftype_t *ft; |
355 | |
356 | FTYPE_LOOKUP(ftype, ft)do { if ((1) && !(ftype < FT_NUM_TYPES)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 356, __func__, "assertion failed: %s" , "ftype < FT_NUM_TYPES"); } while (0); ft = type_list[ftype ];; |
357 | return ft->multiply != NULL((void*)0); |
358 | } |
359 | |
360 | bool_Bool |
361 | ftype_can_divide(enum ftenum ftype) |
362 | { |
363 | const ftype_t *ft; |
364 | |
365 | FTYPE_LOOKUP(ftype, ft)do { if ((1) && !(ftype < FT_NUM_TYPES)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 365, __func__, "assertion failed: %s" , "ftype < FT_NUM_TYPES"); } while (0); ft = type_list[ftype ];; |
366 | return ft->divide != NULL((void*)0); |
367 | } |
368 | |
369 | bool_Bool |
370 | ftype_can_modulo(enum ftenum ftype) |
371 | { |
372 | const ftype_t *ft; |
373 | |
374 | FTYPE_LOOKUP(ftype, ft)do { if ((1) && !(ftype < FT_NUM_TYPES)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 374, __func__, "assertion failed: %s" , "ftype < FT_NUM_TYPES"); } while (0); ft = type_list[ftype ];; |
375 | return ft->modulo != NULL((void*)0); |
376 | } |
377 | |
378 | bool_Bool |
379 | ftype_can_contains(enum ftenum ftype) |
380 | { |
381 | const ftype_t *ft; |
382 | |
383 | FTYPE_LOOKUP(ftype, ft)do { if ((1) && !(ftype < FT_NUM_TYPES)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 383, __func__, "assertion failed: %s" , "ftype < FT_NUM_TYPES"); } while (0); ft = type_list[ftype ];; |
384 | return ft->contains ? true1 : false0; |
385 | } |
386 | |
387 | bool_Bool |
388 | ftype_can_matches(enum ftenum ftype) |
389 | { |
390 | const ftype_t *ft; |
391 | |
392 | FTYPE_LOOKUP(ftype, ft)do { if ((1) && !(ftype < FT_NUM_TYPES)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 392, __func__, "assertion failed: %s" , "ftype < FT_NUM_TYPES"); } while (0); ft = type_list[ftype ];; |
393 | return ft->matches ? true1 : false0; |
394 | } |
395 | |
396 | bool_Bool |
397 | ftype_can_is_zero(enum ftenum ftype) |
398 | { |
399 | const ftype_t *ft; |
400 | |
401 | FTYPE_LOOKUP(ftype, ft)do { if ((1) && !(ftype < FT_NUM_TYPES)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 401, __func__, "assertion failed: %s" , "ftype < FT_NUM_TYPES"); } while (0); ft = type_list[ftype ];; |
402 | return ft->is_zero ? true1 : false0; |
403 | } |
404 | |
405 | bool_Bool |
406 | ftype_can_is_negative(enum ftenum ftype) |
407 | { |
408 | const ftype_t *ft; |
409 | |
410 | FTYPE_LOOKUP(ftype, ft)do { if ((1) && !(ftype < FT_NUM_TYPES)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 410, __func__, "assertion failed: %s" , "ftype < FT_NUM_TYPES"); } while (0); ft = type_list[ftype ];; |
411 | return ft->is_negative ? true1 : false0; |
412 | } |
413 | |
414 | bool_Bool |
415 | ftype_can_val_to_sinteger(enum ftenum ftype) |
416 | { |
417 | const ftype_t *ft; |
418 | |
419 | FTYPE_LOOKUP(ftype, ft)do { if ((1) && !(ftype < FT_NUM_TYPES)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 419, __func__, "assertion failed: %s" , "ftype < FT_NUM_TYPES"); } while (0); ft = type_list[ftype ];; |
420 | /* We first convert to 64 bit and then check for overflow. */ |
421 | return ft->val_to_sinteger64 ? true1 : false0; |
422 | } |
423 | |
424 | bool_Bool |
425 | ftype_can_val_to_uinteger(enum ftenum ftype) |
426 | { |
427 | const ftype_t *ft; |
428 | |
429 | FTYPE_LOOKUP(ftype, ft)do { if ((1) && !(ftype < FT_NUM_TYPES)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 429, __func__, "assertion failed: %s" , "ftype < FT_NUM_TYPES"); } while (0); ft = type_list[ftype ];; |
430 | /* We first convert to 64 bit and then check for overflow. */ |
431 | return ft->val_to_uinteger64 ? true1 : false0; |
432 | } |
433 | |
434 | bool_Bool |
435 | ftype_can_val_to_sinteger64(enum ftenum ftype) |
436 | { |
437 | const ftype_t *ft; |
438 | |
439 | FTYPE_LOOKUP(ftype, ft)do { if ((1) && !(ftype < FT_NUM_TYPES)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 439, __func__, "assertion failed: %s" , "ftype < FT_NUM_TYPES"); } while (0); ft = type_list[ftype ];; |
440 | return ft->val_to_sinteger64 ? true1 : false0; |
441 | } |
442 | |
443 | bool_Bool |
444 | ftype_can_val_to_uinteger64(enum ftenum ftype) |
445 | { |
446 | const ftype_t *ft; |
447 | |
448 | FTYPE_LOOKUP(ftype, ft)do { if ((1) && !(ftype < FT_NUM_TYPES)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 448, __func__, "assertion failed: %s" , "ftype < FT_NUM_TYPES"); } while (0); ft = type_list[ftype ];; |
449 | return ft->val_to_uinteger64 ? true1 : false0; |
450 | } |
451 | |
452 | /* ---------------------------------------------------------- */ |
453 | |
454 | /* Allocate and initialize an fvalue_t, given an ftype */ |
455 | fvalue_t* |
456 | fvalue_new(ftenum_t ftype) |
457 | { |
458 | fvalue_t *fv; |
459 | const ftype_t *ft; |
460 | FvalueNewFunc new_value; |
461 | |
462 | fv = g_slice_new(fvalue_t)((fvalue_t*) g_slice_alloc (sizeof (fvalue_t))); |
463 | |
464 | FTYPE_LOOKUP(ftype, ft)do { if ((1) && !(ftype < FT_NUM_TYPES)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 464, __func__, "assertion failed: %s" , "ftype < FT_NUM_TYPES"); } while (0); ft = type_list[ftype ];; |
465 | fv->ftype = ft; |
466 | |
467 | new_value = ft->new_value; |
468 | if (new_value) { |
469 | new_value(fv); |
470 | } |
471 | |
472 | return fv; |
473 | } |
474 | |
475 | fvalue_t* |
476 | fvalue_dup(const fvalue_t *fv_orig) |
477 | { |
478 | fvalue_t *fv_new; |
479 | FvalueCopyFunc copy_value; |
480 | |
481 | fv_new = g_slice_new(fvalue_t)((fvalue_t*) g_slice_alloc (sizeof (fvalue_t))); |
482 | fv_new->ftype = fv_orig->ftype; |
483 | copy_value = fv_new->ftype->copy_value; |
484 | if (copy_value != NULL((void*)0)) { |
485 | /* deep copy */ |
486 | copy_value(fv_new, fv_orig); |
487 | } |
488 | else { |
489 | /* shallow copy */ |
490 | memcpy(&fv_new->value, &fv_orig->value, sizeof(fv_orig->value)); |
491 | } |
492 | |
493 | return fv_new; |
494 | } |
495 | |
496 | void |
497 | fvalue_init(fvalue_t *fv, ftenum_t ftype) |
498 | { |
499 | const ftype_t *ft; |
500 | FvalueNewFunc new_value; |
501 | |
502 | FTYPE_LOOKUP(ftype, ft)do { if ((1) && !(ftype < FT_NUM_TYPES)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 502, __func__, "assertion failed: %s" , "ftype < FT_NUM_TYPES"); } while (0); ft = type_list[ftype ];; |
503 | fv->ftype = ft; |
504 | |
505 | new_value = ft->new_value; |
506 | if (new_value) { |
507 | new_value(fv); |
508 | } |
509 | } |
510 | |
511 | void |
512 | fvalue_cleanup(fvalue_t *fv) |
513 | { |
514 | if (!fv->ftype->free_value) |
515 | return; |
516 | fv->ftype->free_value(fv); |
517 | } |
518 | |
519 | void |
520 | fvalue_free(fvalue_t *fv) |
521 | { |
522 | fvalue_cleanup(fv); |
523 | g_slice_free(fvalue_t, fv)do { if (1) g_slice_free1 (sizeof (fvalue_t), (fv)); else (void ) ((fvalue_t*) 0 == (fv)); } while (0); |
524 | } |
525 | |
526 | fvalue_t* |
527 | fvalue_from_literal(ftenum_t ftype, const char *s, bool_Bool allow_partial_value, char **err_msg) |
528 | { |
529 | fvalue_t *fv; |
530 | bool_Bool ok = false0; |
531 | |
532 | fv = fvalue_new(ftype); |
533 | if (fv->ftype->val_from_literal) { |
534 | ok = fv->ftype->val_from_literal(fv, s, allow_partial_value, err_msg); |
535 | } |
536 | if (ok) { |
537 | /* Success */ |
538 | if (err_msg != NULL((void*)0)) |
539 | *err_msg = NULL((void*)0); |
540 | return fv; |
541 | } |
542 | else { |
543 | if (err_msg != NULL((void*)0) && *err_msg == NULL((void*)0)) { |
544 | *err_msg = ws_strdup_printf("\"%s\" cannot be converted to %s.",wmem_strdup_printf(((void*)0), "\"%s\" cannot be converted to %s." , s, ftype_pretty_name(ftype)) |
545 | s, ftype_pretty_name(ftype))wmem_strdup_printf(((void*)0), "\"%s\" cannot be converted to %s." , s, ftype_pretty_name(ftype)); |
546 | } |
547 | } |
548 | fvalue_free(fv); |
549 | return NULL((void*)0); |
550 | } |
551 | |
552 | fvalue_t* |
553 | fvalue_from_string(ftenum_t ftype, const char *str, size_t len, char **err_msg) |
554 | { |
555 | fvalue_t *fv; |
556 | |
557 | fv = fvalue_new(ftype); |
558 | if (fv->ftype->val_from_string && fv->ftype->val_from_string(fv, str, len, err_msg)) { |
559 | /* Success */ |
560 | if (err_msg != NULL((void*)0)) |
561 | *err_msg = NULL((void*)0); |
562 | return fv; |
563 | } |
564 | else { |
565 | if (err_msg != NULL((void*)0) && *err_msg == NULL((void*)0)) { |
566 | *err_msg = ws_strdup_printf("%s cannot be converted from a string (\"%s\").",wmem_strdup_printf(((void*)0), "%s cannot be converted from a string (\"%s\")." , ftype_pretty_name(ftype), str) |
567 | ftype_pretty_name(ftype), str)wmem_strdup_printf(((void*)0), "%s cannot be converted from a string (\"%s\")." , ftype_pretty_name(ftype), str); |
568 | } |
569 | } |
570 | fvalue_free(fv); |
571 | return NULL((void*)0); |
572 | } |
573 | |
574 | fvalue_t* |
575 | fvalue_from_charconst(ftenum_t ftype, unsigned long num, char **err_msg) |
576 | { |
577 | fvalue_t *fv; |
578 | |
579 | fv = fvalue_new(ftype); |
580 | if (fv->ftype->val_from_charconst && fv->ftype->val_from_charconst(fv, num, err_msg)) { |
581 | /* Success */ |
582 | if (err_msg != NULL((void*)0)) |
583 | *err_msg = NULL((void*)0); |
584 | return fv; |
585 | } |
586 | else { |
587 | if (err_msg != NULL((void*)0) && *err_msg == NULL((void*)0)) { |
588 | if (num <= 0x7f && g_ascii_isprint(num)((g_ascii_table[(guchar) (num)] & G_ASCII_PRINT) != 0)) { |
589 | *err_msg = ws_strdup_printf("Character constant '%c' (0x%lx) cannot be converted to %s.",wmem_strdup_printf(((void*)0), "Character constant '%c' (0x%lx) cannot be converted to %s." , (int)num, num, ftype_pretty_name(ftype)) |
590 | (int)num, num, ftype_pretty_name(ftype))wmem_strdup_printf(((void*)0), "Character constant '%c' (0x%lx) cannot be converted to %s." , (int)num, num, ftype_pretty_name(ftype)); |
591 | } |
592 | else { |
593 | *err_msg = ws_strdup_printf("Character constant 0x%lx cannot be converted to %s.",wmem_strdup_printf(((void*)0), "Character constant 0x%lx cannot be converted to %s." , num, ftype_pretty_name(ftype)) |
594 | num, ftype_pretty_name(ftype))wmem_strdup_printf(((void*)0), "Character constant 0x%lx cannot be converted to %s." , num, ftype_pretty_name(ftype)); |
595 | } |
596 | } |
597 | } |
598 | fvalue_free(fv); |
599 | return NULL((void*)0); |
600 | } |
601 | |
602 | fvalue_t* |
603 | fvalue_from_sinteger64(ftenum_t ftype, const char *s, int64_t num, char **err_msg) |
604 | { |
605 | fvalue_t *fv; |
606 | |
607 | fv = fvalue_new(ftype); |
608 | if (fv->ftype->val_from_sinteger64 && fv->ftype->val_from_sinteger64(fv, s, num, err_msg)) { |
609 | /* Success */ |
610 | if (err_msg != NULL((void*)0)) |
611 | *err_msg = NULL((void*)0); |
612 | return fv; |
613 | } |
614 | else { |
615 | if (err_msg != NULL((void*)0) && *err_msg == NULL((void*)0)) { |
616 | *err_msg = ws_strdup_printf("Integer %"PRId64" cannot be converted to %s.",wmem_strdup_printf(((void*)0), "Integer %""l" "d"" cannot be converted to %s." , num, ftype_pretty_name(ftype)) |
617 | num, ftype_pretty_name(ftype))wmem_strdup_printf(((void*)0), "Integer %""l" "d"" cannot be converted to %s." , num, ftype_pretty_name(ftype)); |
618 | } |
619 | } |
620 | fvalue_free(fv); |
621 | return NULL((void*)0); |
622 | } |
623 | |
624 | fvalue_t* |
625 | fvalue_from_uinteger64(ftenum_t ftype, const char *s, uint64_t num, char **err_msg) |
626 | { |
627 | fvalue_t *fv; |
628 | |
629 | fv = fvalue_new(ftype); |
630 | if (fv->ftype->val_from_uinteger64 && fv->ftype->val_from_uinteger64(fv, s, num, err_msg)) { |
631 | /* Success */ |
632 | if (err_msg != NULL((void*)0)) |
633 | *err_msg = NULL((void*)0); |
634 | return fv; |
635 | } |
636 | else { |
637 | if (err_msg != NULL((void*)0) && *err_msg == NULL((void*)0)) { |
638 | *err_msg = ws_strdup_printf("Unsigned integer 0x%"PRIu64" cannot be converted to %s.",wmem_strdup_printf(((void*)0), "Unsigned integer 0x%""l" "u"" cannot be converted to %s." , num, ftype_pretty_name(ftype)) |
639 | num, ftype_pretty_name(ftype))wmem_strdup_printf(((void*)0), "Unsigned integer 0x%""l" "u"" cannot be converted to %s." , num, ftype_pretty_name(ftype)); |
640 | } |
641 | } |
642 | fvalue_free(fv); |
643 | return NULL((void*)0); |
644 | } |
645 | |
646 | fvalue_t* |
647 | fvalue_from_floating(ftenum_t ftype, const char *s, double num, char **err_msg) |
648 | { |
649 | fvalue_t *fv; |
650 | |
651 | fv = fvalue_new(ftype); |
652 | if (fv->ftype->val_from_double && fv->ftype->val_from_double(fv, s, num, err_msg)) { |
653 | /* Success */ |
654 | if (err_msg != NULL((void*)0)) |
655 | *err_msg = NULL((void*)0); |
656 | return fv; |
657 | } |
658 | else { |
659 | if (err_msg != NULL((void*)0) && *err_msg == NULL((void*)0)) { |
660 | *err_msg = ws_strdup_printf("Double %g cannot be converted to %s.",wmem_strdup_printf(((void*)0), "Double %g cannot be converted to %s." , num, ftype_pretty_name(ftype)) |
661 | num, ftype_pretty_name(ftype))wmem_strdup_printf(((void*)0), "Double %g cannot be converted to %s." , num, ftype_pretty_name(ftype)); |
662 | } |
663 | } |
664 | fvalue_free(fv); |
665 | return NULL((void*)0); |
666 | } |
667 | |
668 | ftenum_t |
669 | fvalue_type_ftenum(const fvalue_t *fv) |
670 | { |
671 | return fv->ftype->ftype; |
672 | } |
673 | |
674 | const char* |
675 | fvalue_type_name(const fvalue_t *fv) |
676 | { |
677 | return ftype_name(fv->ftype->ftype); |
678 | } |
679 | |
680 | |
681 | size_t |
682 | fvalue_length2(fvalue_t *fv) |
683 | { |
684 | if (!fv->ftype->len) { |
685 | ws_critical("fv->ftype->len is NULL")do { if (1) { ws_log_full("", LOG_LEVEL_CRITICAL, "epan/ftypes/ftypes.c" , 685, __func__, "fv->ftype->len is NULL"); } } while ( 0); |
686 | return 0; |
687 | } |
688 | return fv->ftype->len(fv); |
689 | } |
690 | |
691 | char * |
692 | fvalue_to_string_repr(wmem_allocator_t *scope, const fvalue_t *fv, ftrepr_t rtype, int field_display) |
693 | { |
694 | if (fv->ftype->val_to_string_repr == NULL((void*)0)) { |
695 | /* no value-to-string-representation function, so the value cannot be represented */ |
696 | return NULL((void*)0); |
697 | } |
698 | |
699 | return fv->ftype->val_to_string_repr(scope, fv, rtype, field_display); |
700 | } |
701 | |
702 | enum ft_result |
703 | fvalue_to_uinteger(const fvalue_t *fv, uint32_t *repr) |
704 | { |
705 | uint64_t val; |
706 | enum ft_result res = fv->ftype->val_to_uinteger64(fv, &val); |
707 | if (res != FT_OK) |
708 | return res; |
709 | if (val > UINT32_MAX(4294967295U)) |
710 | return FT_OVERFLOW; |
711 | |
712 | *repr = (uint32_t)val; |
713 | return FT_OK; |
714 | } |
715 | |
716 | enum ft_result |
717 | fvalue_to_sinteger(const fvalue_t *fv, int32_t *repr) |
718 | { |
719 | int64_t val; |
720 | enum ft_result res = fv->ftype->val_to_sinteger64(fv, &val); |
721 | if (res != FT_OK) |
722 | return res; |
723 | if (val > INT32_MAX(2147483647)) |
724 | return FT_OVERFLOW; |
725 | |
726 | *repr = (int32_t)val; |
727 | return FT_OK; |
728 | } |
729 | |
730 | enum ft_result |
731 | fvalue_to_uinteger64(const fvalue_t *fv, uint64_t *repr) |
732 | { |
733 | ws_assert(fv->ftype->val_to_uinteger64)do { if ((1) && !(fv->ftype->val_to_uinteger64) ) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 733, __func__, "assertion failed: %s", "fv->ftype->val_to_uinteger64" ); } while (0); |
734 | return fv->ftype->val_to_uinteger64(fv, repr); |
735 | } |
736 | |
737 | enum ft_result |
738 | fvalue_to_sinteger64(const fvalue_t *fv, int64_t *repr) |
739 | { |
740 | ws_assert(fv->ftype->val_to_sinteger64)do { if ((1) && !(fv->ftype->val_to_sinteger64) ) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 740, __func__, "assertion failed: %s", "fv->ftype->val_to_sinteger64" ); } while (0); |
741 | return fv->ftype->val_to_sinteger64(fv, repr); |
742 | } |
743 | |
744 | enum ft_result |
745 | fvalue_to_double(const fvalue_t *fv, double *repr) |
746 | { |
747 | ws_assert(fv->ftype->val_to_double)do { if ((1) && !(fv->ftype->val_to_double)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 747, __func__, "assertion failed: %s" , "fv->ftype->val_to_double"); } while (0); |
748 | return fv->ftype->val_to_double(fv, repr); |
749 | } |
750 | |
751 | typedef struct { |
752 | fvalue_t *fv; |
753 | void *ptr; |
754 | bool_Bool slice_failure; |
755 | } slice_data_t; |
756 | |
757 | static bool_Bool |
758 | compute_drnode(size_t field_length, drange_node *drnode, size_t *offset_ptr, size_t *length_ptr) |
759 | { |
760 | ssize_t start_offset; |
761 | ssize_t length = 0; |
762 | ssize_t end_offset = 0; |
763 | drange_node_end_t ending; |
764 | |
765 | start_offset = drange_node_get_start_offset(drnode); |
766 | ending = drange_node_get_ending(drnode); |
767 | |
768 | /* Check for negative start */ |
769 | if (start_offset < 0) { |
770 | start_offset = field_length + start_offset; |
771 | if (start_offset < 0) { |
772 | return false0; |
773 | } |
774 | } |
775 | |
776 | /* Check the end type and set the length */ |
777 | |
778 | if (ending == DRANGE_NODE_END_T_TO_THE_END) { |
779 | length = field_length - start_offset; |
780 | if (length <= 0) { |
781 | return false0; |
782 | } |
783 | } |
784 | else if (ending == DRANGE_NODE_END_T_LENGTH) { |
785 | length = drange_node_get_length(drnode); |
786 | if (start_offset + length > (int) field_length) { |
787 | return false0; |
788 | } |
789 | } |
790 | else if (ending == DRANGE_NODE_END_T_OFFSET) { |
791 | end_offset = drange_node_get_end_offset(drnode); |
792 | if (end_offset < 0) { |
793 | end_offset = field_length + end_offset; |
794 | if (end_offset < start_offset) { |
795 | return false0; |
796 | } |
797 | } else if (end_offset >= (int) field_length) { |
798 | return false0; |
799 | } |
800 | length = end_offset - start_offset + 1; |
801 | } |
802 | else { |
803 | ws_assert_not_reached()ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 803, __func__, "assertion \"not reached\" failed"); |
804 | } |
805 | |
806 | *offset_ptr = start_offset; |
807 | *length_ptr = length; |
808 | return true1; |
809 | } |
810 | |
811 | static void |
812 | slice_func(void * data, void * user_data) |
813 | { |
814 | drange_node *drnode = (drange_node *)data; |
815 | slice_data_t *slice_data = (slice_data_t *)user_data; |
816 | size_t start_offset; |
817 | size_t length = 0; |
818 | fvalue_t *fv; |
819 | |
820 | if (slice_data->slice_failure) { |
821 | return; |
822 | } |
823 | |
824 | fv = slice_data->fv; |
825 | if (!compute_drnode((unsigned)fvalue_length2(fv), drnode, &start_offset, &length)) { |
826 | slice_data->slice_failure = true1; |
827 | return; |
828 | } |
829 | |
830 | ws_assert(length > 0)do { if ((1) && !(length > 0)) ws_log_fatal_full("" , LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 830, __func__, "assertion failed: %s" , "length > 0"); } while (0); |
831 | fv->ftype->slice(fv, slice_data->ptr, (unsigned)start_offset, (unsigned)length); |
832 | } |
833 | |
834 | static fvalue_t * |
835 | slice_string(fvalue_t *fv, drange_t *d_range) |
836 | { |
837 | slice_data_t slice_data; |
838 | fvalue_t *new_fv; |
839 | |
840 | slice_data.fv = fv; |
841 | slice_data.ptr = wmem_strbuf_create(NULL)wmem_strbuf_new(((void*)0), ""); |
842 | slice_data.slice_failure = false0; |
843 | |
844 | /* XXX - We could make some optimizations here based on |
845 | * drange_has_total_length() and |
846 | * drange_get_max_offset(). |
847 | */ |
848 | |
849 | drange_foreach_drange_node(d_range, slice_func, &slice_data); |
850 | |
851 | new_fv = fvalue_new(FT_STRING); |
852 | fvalue_set_strbuf(new_fv, slice_data.ptr); |
853 | return new_fv; |
854 | } |
855 | |
856 | static fvalue_t * |
857 | slice_bytes(fvalue_t *fv, drange_t *d_range) |
858 | { |
859 | slice_data_t slice_data; |
860 | fvalue_t *new_fv; |
861 | |
862 | slice_data.fv = fv; |
863 | slice_data.ptr = g_byte_array_new(); |
864 | slice_data.slice_failure = false0; |
865 | |
866 | /* XXX - We could make some optimizations here based on |
867 | * drange_has_total_length() and |
868 | * drange_get_max_offset(). |
869 | */ |
870 | |
871 | drange_foreach_drange_node(d_range, slice_func, &slice_data); |
872 | |
873 | new_fv = fvalue_new(FT_BYTES); |
874 | fvalue_set_byte_array(new_fv, slice_data.ptr); |
875 | return new_fv; |
876 | } |
877 | |
878 | /* Returns a new slice fvalue_t* if possible, otherwise NULL */ |
879 | fvalue_t* |
880 | fvalue_slice(fvalue_t *fv, drange_t *d_range) |
881 | { |
882 | if (FT_IS_STRING(fvalue_type_ftenum(fv))((fvalue_type_ftenum(fv)) == FT_STRING || (fvalue_type_ftenum (fv)) == FT_STRINGZ || (fvalue_type_ftenum(fv)) == FT_STRINGZPAD || (fvalue_type_ftenum(fv)) == FT_STRINGZTRUNC || (fvalue_type_ftenum (fv)) == FT_UINT_STRING || (fvalue_type_ftenum(fv)) == FT_AX25 )) { |
883 | return slice_string(fv, d_range); |
884 | } |
885 | return slice_bytes(fv, d_range); |
886 | } |
887 | |
888 | void |
889 | fvalue_set_bytes(fvalue_t *fv, GBytes *value) |
890 | { |
891 | ws_assert(fv->ftype->ftype == FT_BYTES ||do { if ((1) && !(fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype-> ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv ->ftype->ftype == FT_SYSTEM_ID || fv->ftype->ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv-> ftype->ftype == FT_FCWWN)) ws_log_fatal_full("", LOG_LEVEL_ERROR , "epan/ftypes/ftypes.c", 898, __func__, "assertion failed: %s" , "fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype->ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv->ftype->ftype == FT_FCWWN" ); } while (0) |
892 | fv->ftype->ftype == FT_UINT_BYTES ||do { if ((1) && !(fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype-> ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv ->ftype->ftype == FT_SYSTEM_ID || fv->ftype->ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv-> ftype->ftype == FT_FCWWN)) ws_log_fatal_full("", LOG_LEVEL_ERROR , "epan/ftypes/ftypes.c", 898, __func__, "assertion failed: %s" , "fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype->ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv->ftype->ftype == FT_FCWWN" ); } while (0) |
893 | fv->ftype->ftype == FT_OID ||do { if ((1) && !(fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype-> ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv ->ftype->ftype == FT_SYSTEM_ID || fv->ftype->ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv-> ftype->ftype == FT_FCWWN)) ws_log_fatal_full("", LOG_LEVEL_ERROR , "epan/ftypes/ftypes.c", 898, __func__, "assertion failed: %s" , "fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype->ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv->ftype->ftype == FT_FCWWN" ); } while (0) |
894 | fv->ftype->ftype == FT_REL_OID ||do { if ((1) && !(fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype-> ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv ->ftype->ftype == FT_SYSTEM_ID || fv->ftype->ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv-> ftype->ftype == FT_FCWWN)) ws_log_fatal_full("", LOG_LEVEL_ERROR , "epan/ftypes/ftypes.c", 898, __func__, "assertion failed: %s" , "fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype->ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv->ftype->ftype == FT_FCWWN" ); } while (0) |
895 | fv->ftype->ftype == FT_SYSTEM_ID ||do { if ((1) && !(fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype-> ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv ->ftype->ftype == FT_SYSTEM_ID || fv->ftype->ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv-> ftype->ftype == FT_FCWWN)) ws_log_fatal_full("", LOG_LEVEL_ERROR , "epan/ftypes/ftypes.c", 898, __func__, "assertion failed: %s" , "fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype->ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv->ftype->ftype == FT_FCWWN" ); } while (0) |
896 | fv->ftype->ftype == FT_VINES ||do { if ((1) && !(fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype-> ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv ->ftype->ftype == FT_SYSTEM_ID || fv->ftype->ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv-> ftype->ftype == FT_FCWWN)) ws_log_fatal_full("", LOG_LEVEL_ERROR , "epan/ftypes/ftypes.c", 898, __func__, "assertion failed: %s" , "fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype->ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv->ftype->ftype == FT_FCWWN" ); } while (0) |
897 | fv->ftype->ftype == FT_ETHER ||do { if ((1) && !(fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype-> ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv ->ftype->ftype == FT_SYSTEM_ID || fv->ftype->ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv-> ftype->ftype == FT_FCWWN)) ws_log_fatal_full("", LOG_LEVEL_ERROR , "epan/ftypes/ftypes.c", 898, __func__, "assertion failed: %s" , "fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype->ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv->ftype->ftype == FT_FCWWN" ); } while (0) |
898 | fv->ftype->ftype == FT_FCWWN)do { if ((1) && !(fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype-> ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv ->ftype->ftype == FT_SYSTEM_ID || fv->ftype->ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv-> ftype->ftype == FT_FCWWN)) ws_log_fatal_full("", LOG_LEVEL_ERROR , "epan/ftypes/ftypes.c", 898, __func__, "assertion failed: %s" , "fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype->ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv->ftype->ftype == FT_FCWWN" ); } while (0); |
899 | ws_assert(fv->ftype->set_value.set_value_bytes)do { if ((1) && !(fv->ftype->set_value.set_value_bytes )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 899, __func__, "assertion failed: %s", "fv->ftype->set_value.set_value_bytes" ); } while (0); |
900 | fv->ftype->set_value.set_value_bytes(fv, value); |
901 | } |
902 | |
903 | void |
904 | fvalue_set_byte_array(fvalue_t *fv, GByteArray *value) |
905 | { |
906 | GBytes *bytes = g_byte_array_free_to_bytes(value); |
907 | fvalue_set_bytes(fv, bytes); |
908 | g_bytes_unref(bytes); |
909 | } |
910 | |
911 | void |
912 | fvalue_set_bytes_data(fvalue_t *fv, const void *data, size_t size) |
913 | { |
914 | GBytes *bytes = g_bytes_new(data, size); |
915 | fvalue_set_bytes(fv, bytes); |
916 | g_bytes_unref(bytes); |
917 | } |
918 | |
919 | void |
920 | fvalue_set_fcwwn(fvalue_t *fv, const uint8_t *value) |
921 | { |
922 | GBytes *bytes = g_bytes_new(value, FT_FCWWN_LEN8); |
923 | fvalue_set_bytes(fv, bytes); |
924 | g_bytes_unref(bytes); |
925 | } |
926 | |
927 | void |
928 | fvalue_set_ax25(fvalue_t *fv, const uint8_t *value) |
929 | { |
930 | wmem_strbuf_t *buf = wmem_strbuf_new(NULL((void*)0), NULL((void*)0)); |
931 | for (size_t i = 0; i < FT_AX25_ADDR_LEN7 - 1; i++) { |
932 | if (value[i] != 0x40) { |
933 | /* ignore space-padding */ |
934 | wmem_strbuf_append_c(buf, value[i] >> 1); |
935 | } |
936 | } |
937 | /* Ignore C-bit and reserved bits, and end of address bits. */ |
938 | uint8_t ssid = (value[FT_AX25_ADDR_LEN7 - 1] >> 1) & 0x0f; |
939 | if (ssid != 0) { |
940 | wmem_strbuf_append_printf(buf, "-%u", ssid); |
941 | } |
942 | fvalue_set_strbuf(fv, buf); |
943 | } |
944 | |
945 | void |
946 | fvalue_set_vines(fvalue_t *fv, const uint8_t *value) |
947 | { |
948 | GBytes *bytes = g_bytes_new(value, FT_VINES_ADDR_LEN6); |
949 | fvalue_set_bytes(fv, bytes); |
950 | g_bytes_unref(bytes); |
951 | } |
952 | |
953 | void |
954 | fvalue_set_ether(fvalue_t *fv, const uint8_t *value) |
955 | { |
956 | GBytes *bytes = g_bytes_new(value, FT_ETHER_LEN6); |
957 | fvalue_set_bytes(fv, bytes); |
958 | g_bytes_unref(bytes); |
959 | } |
960 | |
961 | void |
962 | fvalue_set_guid(fvalue_t *fv, const e_guid_t *value) |
963 | { |
964 | ws_assert(fv->ftype->ftype == FT_GUID)do { if ((1) && !(fv->ftype->ftype == FT_GUID)) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 964, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_GUID" ); } while (0); |
965 | ws_assert(fv->ftype->set_value.set_value_guid)do { if ((1) && !(fv->ftype->set_value.set_value_guid )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 965, __func__, "assertion failed: %s", "fv->ftype->set_value.set_value_guid" ); } while (0); |
966 | fv->ftype->set_value.set_value_guid(fv, value); |
967 | } |
968 | |
969 | void |
970 | fvalue_set_time(fvalue_t *fv, const nstime_t *value) |
971 | { |
972 | ws_assert(FT_IS_TIME(fv->ftype->ftype))do { if ((1) && !(((fv->ftype->ftype) == FT_ABSOLUTE_TIME || (fv->ftype->ftype) == FT_RELATIVE_TIME))) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 972, __func__, "assertion failed: %s" , "((fv->ftype->ftype) == FT_ABSOLUTE_TIME || (fv->ftype->ftype) == FT_RELATIVE_TIME)" ); } while (0); |
973 | ws_assert(fv->ftype->set_value.set_value_time)do { if ((1) && !(fv->ftype->set_value.set_value_time )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 973, __func__, "assertion failed: %s", "fv->ftype->set_value.set_value_time" ); } while (0); |
974 | fv->ftype->set_value.set_value_time(fv, value); |
975 | } |
976 | |
977 | void |
978 | fvalue_set_string(fvalue_t *fv, const char *value) |
979 | { |
980 | wmem_strbuf_t *buf = wmem_strbuf_new(NULL((void*)0), value); |
981 | fvalue_set_strbuf(fv, buf); |
982 | } |
983 | |
984 | void |
985 | fvalue_set_strbuf(fvalue_t *fv, wmem_strbuf_t *value) |
986 | { |
987 | if (value->allocator != NULL((void*)0)) { |
988 | /* XXX Can this condition be relaxed? */ |
989 | ws_critical("Fvalue strbuf allocator must be NULL")do { if (1) { ws_log_full("", LOG_LEVEL_CRITICAL, "epan/ftypes/ftypes.c" , 989, __func__, "Fvalue strbuf allocator must be NULL"); } } while (0); |
990 | } |
991 | ws_assert(FT_IS_STRING(fv->ftype->ftype))do { if ((1) && !(((fv->ftype->ftype) == FT_STRING || (fv->ftype->ftype) == FT_STRINGZ || (fv->ftype-> ftype) == FT_STRINGZPAD || (fv->ftype->ftype) == FT_STRINGZTRUNC || (fv->ftype->ftype) == FT_UINT_STRING || (fv->ftype ->ftype) == FT_AX25))) ws_log_fatal_full("", LOG_LEVEL_ERROR , "epan/ftypes/ftypes.c", 991, __func__, "assertion failed: %s" , "((fv->ftype->ftype) == FT_STRING || (fv->ftype->ftype) == FT_STRINGZ || (fv->ftype->ftype) == FT_STRINGZPAD || (fv->ftype->ftype) == FT_STRINGZTRUNC || (fv->ftype->ftype) == FT_UINT_STRING || (fv->ftype->ftype) == FT_AX25)" ); } while (0); |
992 | ws_assert(fv->ftype->set_value.set_value_strbuf)do { if ((1) && !(fv->ftype->set_value.set_value_strbuf )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 992, __func__, "assertion failed: %s", "fv->ftype->set_value.set_value_strbuf" ); } while (0); |
993 | fv->ftype->set_value.set_value_strbuf(fv, value); |
994 | } |
995 | |
996 | void |
997 | fvalue_set_protocol(fvalue_t *fv, tvbuff_t *value, const char *name, int length) |
998 | { |
999 | ws_assert(fv->ftype->ftype == FT_PROTOCOL)do { if ((1) && !(fv->ftype->ftype == FT_PROTOCOL )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 999, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_PROTOCOL" ); } while (0); |
1000 | ws_assert(fv->ftype->set_value.set_value_protocol)do { if ((1) && !(fv->ftype->set_value.set_value_protocol )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1000, __func__, "assertion failed: %s", "fv->ftype->set_value.set_value_protocol" ); } while (0); |
1001 | fv->ftype->set_value.set_value_protocol(fv, value, name, length); |
1002 | } |
1003 | |
1004 | void |
1005 | fvalue_set_protocol_length(fvalue_t *fv, int length) |
1006 | { |
1007 | ws_assert(fv->ftype->ftype == FT_PROTOCOL)do { if ((1) && !(fv->ftype->ftype == FT_PROTOCOL )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1007, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_PROTOCOL" ); } while (0); |
1008 | protocol_value_t *proto = &fv->value.protocol; |
1009 | proto->length = length; |
1010 | } |
1011 | |
1012 | void |
1013 | fvalue_set_uinteger(fvalue_t *fv, uint32_t value) |
1014 | { |
1015 | ws_assert(fv->ftype->ftype == FT_IEEE_11073_SFLOAT ||do { if ((1) && !(fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype ->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv-> ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1023, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv->ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM" ); } while (0) |
1016 | fv->ftype->ftype == FT_IEEE_11073_FLOAT ||do { if ((1) && !(fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype ->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv-> ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1023, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv->ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM" ); } while (0) |
1017 | fv->ftype->ftype == FT_CHAR ||do { if ((1) && !(fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype ->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv-> ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1023, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv->ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM" ); } while (0) |
1018 | fv->ftype->ftype == FT_UINT8 ||do { if ((1) && !(fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype ->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv-> ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1023, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv->ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM" ); } while (0) |
1019 | fv->ftype->ftype == FT_UINT16 ||do { if ((1) && !(fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype ->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv-> ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1023, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv->ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM" ); } while (0) |
1020 | fv->ftype->ftype == FT_UINT24 ||do { if ((1) && !(fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype ->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv-> ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1023, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv->ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM" ); } while (0) |
1021 | fv->ftype->ftype == FT_UINT32 ||do { if ((1) && !(fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype ->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv-> ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1023, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv->ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM" ); } while (0) |
1022 | fv->ftype->ftype == FT_IPXNET ||do { if ((1) && !(fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype ->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv-> ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1023, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv->ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM" ); } while (0) |
1023 | fv->ftype->ftype == FT_FRAMENUM)do { if ((1) && !(fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype ->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv-> ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1023, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv->ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM" ); } while (0); |
1024 | ws_assert(fv->ftype->set_value.set_value_uinteger)do { if ((1) && !(fv->ftype->set_value.set_value_uinteger )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1024, __func__, "assertion failed: %s", "fv->ftype->set_value.set_value_uinteger" ); } while (0); |
1025 | fv->ftype->set_value.set_value_uinteger(fv, value); |
1026 | } |
1027 | |
1028 | void |
1029 | fvalue_set_sinteger(fvalue_t *fv, int32_t value) |
1030 | { |
1031 | ws_assert(fv->ftype->ftype == FT_INT8 ||do { if ((1) && !(fv->ftype->ftype == FT_INT8 || fv->ftype->ftype == FT_INT16 || fv->ftype->ftype == FT_INT24 || fv->ftype->ftype == FT_INT32)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1034, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_INT8 || fv->ftype->ftype == FT_INT16 || fv->ftype->ftype == FT_INT24 || fv->ftype->ftype == FT_INT32" ); } while (0) |
1032 | fv->ftype->ftype == FT_INT16 ||do { if ((1) && !(fv->ftype->ftype == FT_INT8 || fv->ftype->ftype == FT_INT16 || fv->ftype->ftype == FT_INT24 || fv->ftype->ftype == FT_INT32)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1034, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_INT8 || fv->ftype->ftype == FT_INT16 || fv->ftype->ftype == FT_INT24 || fv->ftype->ftype == FT_INT32" ); } while (0) |
1033 | fv->ftype->ftype == FT_INT24 ||do { if ((1) && !(fv->ftype->ftype == FT_INT8 || fv->ftype->ftype == FT_INT16 || fv->ftype->ftype == FT_INT24 || fv->ftype->ftype == FT_INT32)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1034, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_INT8 || fv->ftype->ftype == FT_INT16 || fv->ftype->ftype == FT_INT24 || fv->ftype->ftype == FT_INT32" ); } while (0) |
1034 | fv->ftype->ftype == FT_INT32)do { if ((1) && !(fv->ftype->ftype == FT_INT8 || fv->ftype->ftype == FT_INT16 || fv->ftype->ftype == FT_INT24 || fv->ftype->ftype == FT_INT32)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1034, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_INT8 || fv->ftype->ftype == FT_INT16 || fv->ftype->ftype == FT_INT24 || fv->ftype->ftype == FT_INT32" ); } while (0); |
1035 | ws_assert(fv->ftype->set_value.set_value_sinteger)do { if ((1) && !(fv->ftype->set_value.set_value_sinteger )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1035, __func__, "assertion failed: %s", "fv->ftype->set_value.set_value_sinteger" ); } while (0); |
1036 | fv->ftype->set_value.set_value_sinteger(fv, value); |
1037 | } |
1038 | |
1039 | void |
1040 | fvalue_set_uinteger64(fvalue_t *fv, uint64_t value) |
1041 | { |
1042 | ws_assert(fv->ftype->ftype == FT_UINT40 ||do { if ((1) && !(fv->ftype->ftype == FT_UINT40 || fv->ftype->ftype == FT_UINT48 || fv->ftype->ftype == FT_UINT56 || fv->ftype->ftype == FT_UINT64 || fv-> ftype->ftype == FT_BOOLEAN || fv->ftype->ftype == FT_EUI64 )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1047, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_UINT40 || fv->ftype->ftype == FT_UINT48 || fv->ftype->ftype == FT_UINT56 || fv->ftype->ftype == FT_UINT64 || fv->ftype->ftype == FT_BOOLEAN || fv->ftype->ftype == FT_EUI64" ); } while (0) |
1043 | fv->ftype->ftype == FT_UINT48 ||do { if ((1) && !(fv->ftype->ftype == FT_UINT40 || fv->ftype->ftype == FT_UINT48 || fv->ftype->ftype == FT_UINT56 || fv->ftype->ftype == FT_UINT64 || fv-> ftype->ftype == FT_BOOLEAN || fv->ftype->ftype == FT_EUI64 )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1047, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_UINT40 || fv->ftype->ftype == FT_UINT48 || fv->ftype->ftype == FT_UINT56 || fv->ftype->ftype == FT_UINT64 || fv->ftype->ftype == FT_BOOLEAN || fv->ftype->ftype == FT_EUI64" ); } while (0) |
1044 | fv->ftype->ftype == FT_UINT56 ||do { if ((1) && !(fv->ftype->ftype == FT_UINT40 || fv->ftype->ftype == FT_UINT48 || fv->ftype->ftype == FT_UINT56 || fv->ftype->ftype == FT_UINT64 || fv-> ftype->ftype == FT_BOOLEAN || fv->ftype->ftype == FT_EUI64 )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1047, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_UINT40 || fv->ftype->ftype == FT_UINT48 || fv->ftype->ftype == FT_UINT56 || fv->ftype->ftype == FT_UINT64 || fv->ftype->ftype == FT_BOOLEAN || fv->ftype->ftype == FT_EUI64" ); } while (0) |
1045 | fv->ftype->ftype == FT_UINT64 ||do { if ((1) && !(fv->ftype->ftype == FT_UINT40 || fv->ftype->ftype == FT_UINT48 || fv->ftype->ftype == FT_UINT56 || fv->ftype->ftype == FT_UINT64 || fv-> ftype->ftype == FT_BOOLEAN || fv->ftype->ftype == FT_EUI64 )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1047, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_UINT40 || fv->ftype->ftype == FT_UINT48 || fv->ftype->ftype == FT_UINT56 || fv->ftype->ftype == FT_UINT64 || fv->ftype->ftype == FT_BOOLEAN || fv->ftype->ftype == FT_EUI64" ); } while (0) |
1046 | fv->ftype->ftype == FT_BOOLEAN ||do { if ((1) && !(fv->ftype->ftype == FT_UINT40 || fv->ftype->ftype == FT_UINT48 || fv->ftype->ftype == FT_UINT56 || fv->ftype->ftype == FT_UINT64 || fv-> ftype->ftype == FT_BOOLEAN || fv->ftype->ftype == FT_EUI64 )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1047, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_UINT40 || fv->ftype->ftype == FT_UINT48 || fv->ftype->ftype == FT_UINT56 || fv->ftype->ftype == FT_UINT64 || fv->ftype->ftype == FT_BOOLEAN || fv->ftype->ftype == FT_EUI64" ); } while (0) |
1047 | fv->ftype->ftype == FT_EUI64)do { if ((1) && !(fv->ftype->ftype == FT_UINT40 || fv->ftype->ftype == FT_UINT48 || fv->ftype->ftype == FT_UINT56 || fv->ftype->ftype == FT_UINT64 || fv-> ftype->ftype == FT_BOOLEAN || fv->ftype->ftype == FT_EUI64 )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1047, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_UINT40 || fv->ftype->ftype == FT_UINT48 || fv->ftype->ftype == FT_UINT56 || fv->ftype->ftype == FT_UINT64 || fv->ftype->ftype == FT_BOOLEAN || fv->ftype->ftype == FT_EUI64" ); } while (0); |
1048 | ws_assert(fv->ftype->set_value.set_value_uinteger64)do { if ((1) && !(fv->ftype->set_value.set_value_uinteger64 )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1048, __func__, "assertion failed: %s", "fv->ftype->set_value.set_value_uinteger64" ); } while (0); |
1049 | fv->ftype->set_value.set_value_uinteger64(fv, value); |
1050 | } |
1051 | |
1052 | void |
1053 | fvalue_set_sinteger64(fvalue_t *fv, int64_t value) |
1054 | { |
1055 | ws_assert(fv->ftype->ftype == FT_INT40 ||do { if ((1) && !(fv->ftype->ftype == FT_INT40 || fv->ftype->ftype == FT_INT48 || fv->ftype->ftype == FT_INT56 || fv->ftype->ftype == FT_INT64)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1058, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_INT40 || fv->ftype->ftype == FT_INT48 || fv->ftype->ftype == FT_INT56 || fv->ftype->ftype == FT_INT64" ); } while (0) |
1056 | fv->ftype->ftype == FT_INT48 ||do { if ((1) && !(fv->ftype->ftype == FT_INT40 || fv->ftype->ftype == FT_INT48 || fv->ftype->ftype == FT_INT56 || fv->ftype->ftype == FT_INT64)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1058, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_INT40 || fv->ftype->ftype == FT_INT48 || fv->ftype->ftype == FT_INT56 || fv->ftype->ftype == FT_INT64" ); } while (0) |
1057 | fv->ftype->ftype == FT_INT56 ||do { if ((1) && !(fv->ftype->ftype == FT_INT40 || fv->ftype->ftype == FT_INT48 || fv->ftype->ftype == FT_INT56 || fv->ftype->ftype == FT_INT64)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1058, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_INT40 || fv->ftype->ftype == FT_INT48 || fv->ftype->ftype == FT_INT56 || fv->ftype->ftype == FT_INT64" ); } while (0) |
1058 | fv->ftype->ftype == FT_INT64)do { if ((1) && !(fv->ftype->ftype == FT_INT40 || fv->ftype->ftype == FT_INT48 || fv->ftype->ftype == FT_INT56 || fv->ftype->ftype == FT_INT64)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1058, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_INT40 || fv->ftype->ftype == FT_INT48 || fv->ftype->ftype == FT_INT56 || fv->ftype->ftype == FT_INT64" ); } while (0); |
1059 | ws_assert(fv->ftype->set_value.set_value_sinteger64)do { if ((1) && !(fv->ftype->set_value.set_value_sinteger64 )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1059, __func__, "assertion failed: %s", "fv->ftype->set_value.set_value_sinteger64" ); } while (0); |
1060 | fv->ftype->set_value.set_value_sinteger64(fv, value); |
1061 | } |
1062 | |
1063 | void |
1064 | fvalue_set_floating(fvalue_t *fv, double value) |
1065 | { |
1066 | ws_assert(fv->ftype->ftype == FT_FLOAT ||do { if ((1) && !(fv->ftype->ftype == FT_FLOAT || fv->ftype->ftype == FT_DOUBLE)) ws_log_fatal_full("", LOG_LEVEL_ERROR , "epan/ftypes/ftypes.c", 1067, __func__, "assertion failed: %s" , "fv->ftype->ftype == FT_FLOAT || fv->ftype->ftype == FT_DOUBLE" ); } while (0) |
1067 | fv->ftype->ftype == FT_DOUBLE)do { if ((1) && !(fv->ftype->ftype == FT_FLOAT || fv->ftype->ftype == FT_DOUBLE)) ws_log_fatal_full("", LOG_LEVEL_ERROR , "epan/ftypes/ftypes.c", 1067, __func__, "assertion failed: %s" , "fv->ftype->ftype == FT_FLOAT || fv->ftype->ftype == FT_DOUBLE" ); } while (0); |
1068 | ws_assert(fv->ftype->set_value.set_value_floating)do { if ((1) && !(fv->ftype->set_value.set_value_floating )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1068, __func__, "assertion failed: %s", "fv->ftype->set_value.set_value_floating" ); } while (0); |
1069 | fv->ftype->set_value.set_value_floating(fv, value); |
1070 | } |
1071 | |
1072 | void |
1073 | fvalue_set_ipv4(fvalue_t *fv, const ipv4_addr_and_mask *value) |
1074 | { |
1075 | ws_assert(fv->ftype->ftype == FT_IPv4)do { if ((1) && !(fv->ftype->ftype == FT_IPv4)) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1075, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_IPv4" ); } while (0); |
1076 | ws_assert(fv->ftype->set_value.set_value_ipv4)do { if ((1) && !(fv->ftype->set_value.set_value_ipv4 )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1076, __func__, "assertion failed: %s", "fv->ftype->set_value.set_value_ipv4" ); } while (0); |
1077 | fv->ftype->set_value.set_value_ipv4(fv, value); |
1078 | } |
1079 | |
1080 | void |
1081 | fvalue_set_ipv6(fvalue_t *fv, const ipv6_addr_and_prefix *value) |
1082 | { |
1083 | ws_assert(fv->ftype->ftype == FT_IPv6)do { if ((1) && !(fv->ftype->ftype == FT_IPv6)) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1083, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_IPv6" ); } while (0); |
1084 | ws_assert(fv->ftype->set_value.set_value_ipv6)do { if ((1) && !(fv->ftype->set_value.set_value_ipv6 )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1084, __func__, "assertion failed: %s", "fv->ftype->set_value.set_value_ipv6" ); } while (0); |
1085 | fv->ftype->set_value.set_value_ipv6(fv, value); |
1086 | } |
1087 | |
1088 | GBytes * |
1089 | fvalue_get_bytes(fvalue_t *fv) |
1090 | { |
1091 | ws_assert(fv->ftype->ftype == FT_BYTES ||do { if ((1) && !(fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype-> ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv ->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype-> ftype == FT_FCWWN || fv->ftype->ftype == FT_IPv6)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1099, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype->ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype->ftype == FT_FCWWN || fv->ftype->ftype == FT_IPv6" ); } while (0) |
1092 | fv->ftype->ftype == FT_UINT_BYTES ||do { if ((1) && !(fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype-> ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv ->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype-> ftype == FT_FCWWN || fv->ftype->ftype == FT_IPv6)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1099, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype->ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype->ftype == FT_FCWWN || fv->ftype->ftype == FT_IPv6" ); } while (0) |
1093 | fv->ftype->ftype == FT_VINES ||do { if ((1) && !(fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype-> ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv ->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype-> ftype == FT_FCWWN || fv->ftype->ftype == FT_IPv6)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1099, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype->ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype->ftype == FT_FCWWN || fv->ftype->ftype == FT_IPv6" ); } while (0) |
1094 | fv->ftype->ftype == FT_ETHER ||do { if ((1) && !(fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype-> ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv ->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype-> ftype == FT_FCWWN || fv->ftype->ftype == FT_IPv6)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1099, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype->ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype->ftype == FT_FCWWN || fv->ftype->ftype == FT_IPv6" ); } while (0) |
1095 | fv->ftype->ftype == FT_OID ||do { if ((1) && !(fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype-> ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv ->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype-> ftype == FT_FCWWN || fv->ftype->ftype == FT_IPv6)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1099, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype->ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype->ftype == FT_FCWWN || fv->ftype->ftype == FT_IPv6" ); } while (0) |
1096 | fv->ftype->ftype == FT_REL_OID ||do { if ((1) && !(fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype-> ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv ->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype-> ftype == FT_FCWWN || fv->ftype->ftype == FT_IPv6)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1099, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype->ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype->ftype == FT_FCWWN || fv->ftype->ftype == FT_IPv6" ); } while (0) |
1097 | fv->ftype->ftype == FT_SYSTEM_ID ||do { if ((1) && !(fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype-> ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv ->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype-> ftype == FT_FCWWN || fv->ftype->ftype == FT_IPv6)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1099, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype->ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype->ftype == FT_FCWWN || fv->ftype->ftype == FT_IPv6" ); } while (0) |
1098 | fv->ftype->ftype == FT_FCWWN ||do { if ((1) && !(fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype-> ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv ->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype-> ftype == FT_FCWWN || fv->ftype->ftype == FT_IPv6)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1099, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype->ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype->ftype == FT_FCWWN || fv->ftype->ftype == FT_IPv6" ); } while (0) |
1099 | fv->ftype->ftype == FT_IPv6)do { if ((1) && !(fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype-> ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv ->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype-> ftype == FT_FCWWN || fv->ftype->ftype == FT_IPv6)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1099, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_BYTES || fv->ftype->ftype == FT_UINT_BYTES || fv->ftype->ftype == FT_VINES || fv->ftype->ftype == FT_ETHER || fv->ftype->ftype == FT_OID || fv->ftype->ftype == FT_REL_OID || fv->ftype->ftype == FT_SYSTEM_ID || fv->ftype->ftype == FT_FCWWN || fv->ftype->ftype == FT_IPv6" ); } while (0); |
1100 | ws_assert(fv->ftype->get_value.get_value_bytes)do { if ((1) && !(fv->ftype->get_value.get_value_bytes )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1100, __func__, "assertion failed: %s", "fv->ftype->get_value.get_value_bytes" ); } while (0); |
1101 | return fv->ftype->get_value.get_value_bytes(fv); |
1102 | } |
1103 | |
1104 | size_t |
1105 | fvalue_get_bytes_size(fvalue_t *fv) |
1106 | { |
1107 | GBytes *bytes = fvalue_get_bytes(fv); |
1108 | size_t size = g_bytes_get_size(bytes); |
1109 | g_bytes_unref(bytes); |
1110 | return size; |
1111 | } |
1112 | |
1113 | const void * |
1114 | fvalue_get_bytes_data(fvalue_t *fv) |
1115 | { |
1116 | GBytes *bytes = fvalue_get_bytes(fv); |
1117 | const void *data = g_bytes_get_data(bytes, NULL((void*)0)); |
1118 | g_bytes_unref(bytes); |
1119 | return data; |
1120 | } |
1121 | |
1122 | const e_guid_t * |
1123 | fvalue_get_guid(fvalue_t *fv) |
1124 | { |
1125 | ws_assert(fv->ftype->ftype == FT_GUID)do { if ((1) && !(fv->ftype->ftype == FT_GUID)) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1125, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_GUID" ); } while (0); |
1126 | ws_assert(fv->ftype->get_value.get_value_guid)do { if ((1) && !(fv->ftype->get_value.get_value_guid )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1126, __func__, "assertion failed: %s", "fv->ftype->get_value.get_value_guid" ); } while (0); |
1127 | return fv->ftype->get_value.get_value_guid(fv); |
1128 | } |
1129 | |
1130 | const nstime_t * |
1131 | fvalue_get_time(fvalue_t *fv) |
1132 | { |
1133 | ws_assert(FT_IS_TIME(fv->ftype->ftype))do { if ((1) && !(((fv->ftype->ftype) == FT_ABSOLUTE_TIME || (fv->ftype->ftype) == FT_RELATIVE_TIME))) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1133, __func__, "assertion failed: %s", "((fv->ftype->ftype) == FT_ABSOLUTE_TIME || (fv->ftype->ftype) == FT_RELATIVE_TIME)" ); } while (0); |
1134 | ws_assert(fv->ftype->get_value.get_value_time)do { if ((1) && !(fv->ftype->get_value.get_value_time )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1134, __func__, "assertion failed: %s", "fv->ftype->get_value.get_value_time" ); } while (0); |
1135 | return fv->ftype->get_value.get_value_time(fv); |
1136 | } |
1137 | |
1138 | const char * |
1139 | fvalue_get_string(fvalue_t *fv) |
1140 | { |
1141 | return wmem_strbuf_get_str(fvalue_get_strbuf(fv)); |
1142 | } |
1143 | |
1144 | const wmem_strbuf_t * |
1145 | fvalue_get_strbuf(fvalue_t *fv) |
1146 | { |
1147 | ws_assert(FT_IS_STRING(fv->ftype->ftype))do { if ((1) && !(((fv->ftype->ftype) == FT_STRING || (fv->ftype->ftype) == FT_STRINGZ || (fv->ftype-> ftype) == FT_STRINGZPAD || (fv->ftype->ftype) == FT_STRINGZTRUNC || (fv->ftype->ftype) == FT_UINT_STRING || (fv->ftype ->ftype) == FT_AX25))) ws_log_fatal_full("", LOG_LEVEL_ERROR , "epan/ftypes/ftypes.c", 1147, __func__, "assertion failed: %s" , "((fv->ftype->ftype) == FT_STRING || (fv->ftype->ftype) == FT_STRINGZ || (fv->ftype->ftype) == FT_STRINGZPAD || (fv->ftype->ftype) == FT_STRINGZTRUNC || (fv->ftype->ftype) == FT_UINT_STRING || (fv->ftype->ftype) == FT_AX25)" ); } while (0); |
1148 | ws_assert(fv->ftype->get_value.get_value_strbuf)do { if ((1) && !(fv->ftype->get_value.get_value_strbuf )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1148, __func__, "assertion failed: %s", "fv->ftype->get_value.get_value_strbuf" ); } while (0); |
1149 | return fv->ftype->get_value.get_value_strbuf(fv); |
1150 | } |
1151 | |
1152 | tvbuff_t * |
1153 | fvalue_get_protocol(fvalue_t *fv) |
1154 | { |
1155 | ws_assert(fv->ftype->ftype == FT_PROTOCOL)do { if ((1) && !(fv->ftype->ftype == FT_PROTOCOL )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1155, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_PROTOCOL" ); } while (0); |
1156 | ws_assert(fv->ftype->get_value.get_value_protocol)do { if ((1) && !(fv->ftype->get_value.get_value_protocol )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1156, __func__, "assertion failed: %s", "fv->ftype->get_value.get_value_protocol" ); } while (0); |
1157 | return fv->ftype->get_value.get_value_protocol(fv); |
1158 | } |
1159 | |
1160 | uint32_t |
1161 | fvalue_get_uinteger(fvalue_t *fv) |
1162 | { |
1163 | ws_assert(fv->ftype->ftype == FT_IEEE_11073_SFLOAT ||do { if ((1) && !(fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype ->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv-> ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1171, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv->ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM" ); } while (0) |
1164 | fv->ftype->ftype == FT_IEEE_11073_FLOAT ||do { if ((1) && !(fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype ->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv-> ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1171, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv->ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM" ); } while (0) |
1165 | fv->ftype->ftype == FT_CHAR ||do { if ((1) && !(fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype ->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv-> ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1171, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv->ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM" ); } while (0) |
1166 | fv->ftype->ftype == FT_UINT8 ||do { if ((1) && !(fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype ->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv-> ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1171, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv->ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM" ); } while (0) |
1167 | fv->ftype->ftype == FT_UINT16 ||do { if ((1) && !(fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype ->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv-> ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1171, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv->ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM" ); } while (0) |
1168 | fv->ftype->ftype == FT_UINT24 ||do { if ((1) && !(fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype ->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv-> ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1171, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv->ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM" ); } while (0) |
1169 | fv->ftype->ftype == FT_UINT32 ||do { if ((1) && !(fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype ->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv-> ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1171, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv->ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM" ); } while (0) |
1170 | fv->ftype->ftype == FT_IPXNET ||do { if ((1) && !(fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype ->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv-> ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1171, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv->ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM" ); } while (0) |
1171 | fv->ftype->ftype == FT_FRAMENUM)do { if ((1) && !(fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype ->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv-> ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1171, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_IEEE_11073_SFLOAT || fv->ftype->ftype == FT_IEEE_11073_FLOAT || fv->ftype->ftype == FT_CHAR || fv->ftype->ftype == FT_UINT8 || fv->ftype->ftype == FT_UINT16 || fv->ftype->ftype == FT_UINT24 || fv->ftype->ftype == FT_UINT32 || fv->ftype->ftype == FT_IPXNET || fv->ftype->ftype == FT_FRAMENUM" ); } while (0); |
1172 | ws_assert(fv->ftype->get_value.get_value_uinteger)do { if ((1) && !(fv->ftype->get_value.get_value_uinteger )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1172, __func__, "assertion failed: %s", "fv->ftype->get_value.get_value_uinteger" ); } while (0); |
1173 | return fv->ftype->get_value.get_value_uinteger(fv); |
1174 | } |
1175 | |
1176 | int32_t |
1177 | fvalue_get_sinteger(fvalue_t *fv) |
1178 | { |
1179 | ws_assert(fv->ftype->ftype == FT_INT8 ||do { if ((1) && !(fv->ftype->ftype == FT_INT8 || fv->ftype->ftype == FT_INT16 || fv->ftype->ftype == FT_INT24 || fv->ftype->ftype == FT_INT32)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1182, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_INT8 || fv->ftype->ftype == FT_INT16 || fv->ftype->ftype == FT_INT24 || fv->ftype->ftype == FT_INT32" ); } while (0) |
1180 | fv->ftype->ftype == FT_INT16 ||do { if ((1) && !(fv->ftype->ftype == FT_INT8 || fv->ftype->ftype == FT_INT16 || fv->ftype->ftype == FT_INT24 || fv->ftype->ftype == FT_INT32)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1182, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_INT8 || fv->ftype->ftype == FT_INT16 || fv->ftype->ftype == FT_INT24 || fv->ftype->ftype == FT_INT32" ); } while (0) |
1181 | fv->ftype->ftype == FT_INT24 ||do { if ((1) && !(fv->ftype->ftype == FT_INT8 || fv->ftype->ftype == FT_INT16 || fv->ftype->ftype == FT_INT24 || fv->ftype->ftype == FT_INT32)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1182, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_INT8 || fv->ftype->ftype == FT_INT16 || fv->ftype->ftype == FT_INT24 || fv->ftype->ftype == FT_INT32" ); } while (0) |
1182 | fv->ftype->ftype == FT_INT32)do { if ((1) && !(fv->ftype->ftype == FT_INT8 || fv->ftype->ftype == FT_INT16 || fv->ftype->ftype == FT_INT24 || fv->ftype->ftype == FT_INT32)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1182, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_INT8 || fv->ftype->ftype == FT_INT16 || fv->ftype->ftype == FT_INT24 || fv->ftype->ftype == FT_INT32" ); } while (0); |
1183 | ws_assert(fv->ftype->get_value.get_value_sinteger)do { if ((1) && !(fv->ftype->get_value.get_value_sinteger )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1183, __func__, "assertion failed: %s", "fv->ftype->get_value.get_value_sinteger" ); } while (0); |
1184 | return fv->ftype->get_value.get_value_sinteger(fv); |
1185 | } |
1186 | |
1187 | uint64_t |
1188 | fvalue_get_uinteger64(fvalue_t *fv) |
1189 | { |
1190 | ws_assert(fv->ftype->ftype == FT_UINT40 ||do { if ((1) && !(fv->ftype->ftype == FT_UINT40 || fv->ftype->ftype == FT_UINT48 || fv->ftype->ftype == FT_UINT56 || fv->ftype->ftype == FT_UINT64 || fv-> ftype->ftype == FT_BOOLEAN || fv->ftype->ftype == FT_EUI64 )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1195, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_UINT40 || fv->ftype->ftype == FT_UINT48 || fv->ftype->ftype == FT_UINT56 || fv->ftype->ftype == FT_UINT64 || fv->ftype->ftype == FT_BOOLEAN || fv->ftype->ftype == FT_EUI64" ); } while (0) |
1191 | fv->ftype->ftype == FT_UINT48 ||do { if ((1) && !(fv->ftype->ftype == FT_UINT40 || fv->ftype->ftype == FT_UINT48 || fv->ftype->ftype == FT_UINT56 || fv->ftype->ftype == FT_UINT64 || fv-> ftype->ftype == FT_BOOLEAN || fv->ftype->ftype == FT_EUI64 )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1195, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_UINT40 || fv->ftype->ftype == FT_UINT48 || fv->ftype->ftype == FT_UINT56 || fv->ftype->ftype == FT_UINT64 || fv->ftype->ftype == FT_BOOLEAN || fv->ftype->ftype == FT_EUI64" ); } while (0) |
1192 | fv->ftype->ftype == FT_UINT56 ||do { if ((1) && !(fv->ftype->ftype == FT_UINT40 || fv->ftype->ftype == FT_UINT48 || fv->ftype->ftype == FT_UINT56 || fv->ftype->ftype == FT_UINT64 || fv-> ftype->ftype == FT_BOOLEAN || fv->ftype->ftype == FT_EUI64 )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1195, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_UINT40 || fv->ftype->ftype == FT_UINT48 || fv->ftype->ftype == FT_UINT56 || fv->ftype->ftype == FT_UINT64 || fv->ftype->ftype == FT_BOOLEAN || fv->ftype->ftype == FT_EUI64" ); } while (0) |
1193 | fv->ftype->ftype == FT_UINT64 ||do { if ((1) && !(fv->ftype->ftype == FT_UINT40 || fv->ftype->ftype == FT_UINT48 || fv->ftype->ftype == FT_UINT56 || fv->ftype->ftype == FT_UINT64 || fv-> ftype->ftype == FT_BOOLEAN || fv->ftype->ftype == FT_EUI64 )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1195, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_UINT40 || fv->ftype->ftype == FT_UINT48 || fv->ftype->ftype == FT_UINT56 || fv->ftype->ftype == FT_UINT64 || fv->ftype->ftype == FT_BOOLEAN || fv->ftype->ftype == FT_EUI64" ); } while (0) |
1194 | fv->ftype->ftype == FT_BOOLEAN ||do { if ((1) && !(fv->ftype->ftype == FT_UINT40 || fv->ftype->ftype == FT_UINT48 || fv->ftype->ftype == FT_UINT56 || fv->ftype->ftype == FT_UINT64 || fv-> ftype->ftype == FT_BOOLEAN || fv->ftype->ftype == FT_EUI64 )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1195, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_UINT40 || fv->ftype->ftype == FT_UINT48 || fv->ftype->ftype == FT_UINT56 || fv->ftype->ftype == FT_UINT64 || fv->ftype->ftype == FT_BOOLEAN || fv->ftype->ftype == FT_EUI64" ); } while (0) |
1195 | fv->ftype->ftype == FT_EUI64)do { if ((1) && !(fv->ftype->ftype == FT_UINT40 || fv->ftype->ftype == FT_UINT48 || fv->ftype->ftype == FT_UINT56 || fv->ftype->ftype == FT_UINT64 || fv-> ftype->ftype == FT_BOOLEAN || fv->ftype->ftype == FT_EUI64 )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1195, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_UINT40 || fv->ftype->ftype == FT_UINT48 || fv->ftype->ftype == FT_UINT56 || fv->ftype->ftype == FT_UINT64 || fv->ftype->ftype == FT_BOOLEAN || fv->ftype->ftype == FT_EUI64" ); } while (0); |
1196 | ws_assert(fv->ftype->get_value.get_value_uinteger64)do { if ((1) && !(fv->ftype->get_value.get_value_uinteger64 )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1196, __func__, "assertion failed: %s", "fv->ftype->get_value.get_value_uinteger64" ); } while (0); |
1197 | return fv->ftype->get_value.get_value_uinteger64(fv); |
1198 | } |
1199 | |
1200 | int64_t |
1201 | fvalue_get_sinteger64(fvalue_t *fv) |
1202 | { |
1203 | ws_assert(fv->ftype->ftype == FT_INT40 ||do { if ((1) && !(fv->ftype->ftype == FT_INT40 || fv->ftype->ftype == FT_INT48 || fv->ftype->ftype == FT_INT56 || fv->ftype->ftype == FT_INT64)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1206, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_INT40 || fv->ftype->ftype == FT_INT48 || fv->ftype->ftype == FT_INT56 || fv->ftype->ftype == FT_INT64" ); } while (0) |
1204 | fv->ftype->ftype == FT_INT48 ||do { if ((1) && !(fv->ftype->ftype == FT_INT40 || fv->ftype->ftype == FT_INT48 || fv->ftype->ftype == FT_INT56 || fv->ftype->ftype == FT_INT64)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1206, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_INT40 || fv->ftype->ftype == FT_INT48 || fv->ftype->ftype == FT_INT56 || fv->ftype->ftype == FT_INT64" ); } while (0) |
1205 | fv->ftype->ftype == FT_INT56 ||do { if ((1) && !(fv->ftype->ftype == FT_INT40 || fv->ftype->ftype == FT_INT48 || fv->ftype->ftype == FT_INT56 || fv->ftype->ftype == FT_INT64)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1206, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_INT40 || fv->ftype->ftype == FT_INT48 || fv->ftype->ftype == FT_INT56 || fv->ftype->ftype == FT_INT64" ); } while (0) |
1206 | fv->ftype->ftype == FT_INT64)do { if ((1) && !(fv->ftype->ftype == FT_INT40 || fv->ftype->ftype == FT_INT48 || fv->ftype->ftype == FT_INT56 || fv->ftype->ftype == FT_INT64)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1206, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_INT40 || fv->ftype->ftype == FT_INT48 || fv->ftype->ftype == FT_INT56 || fv->ftype->ftype == FT_INT64" ); } while (0); |
1207 | ws_assert(fv->ftype->get_value.get_value_sinteger64)do { if ((1) && !(fv->ftype->get_value.get_value_sinteger64 )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1207, __func__, "assertion failed: %s", "fv->ftype->get_value.get_value_sinteger64" ); } while (0); |
1208 | return fv->ftype->get_value.get_value_sinteger64(fv); |
1209 | } |
1210 | |
1211 | double |
1212 | fvalue_get_floating(fvalue_t *fv) |
1213 | { |
1214 | ws_assert(fv->ftype->ftype == FT_FLOAT ||do { if ((1) && !(fv->ftype->ftype == FT_FLOAT || fv->ftype->ftype == FT_DOUBLE)) ws_log_fatal_full("", LOG_LEVEL_ERROR , "epan/ftypes/ftypes.c", 1215, __func__, "assertion failed: %s" , "fv->ftype->ftype == FT_FLOAT || fv->ftype->ftype == FT_DOUBLE" ); } while (0) |
1215 | fv->ftype->ftype == FT_DOUBLE)do { if ((1) && !(fv->ftype->ftype == FT_FLOAT || fv->ftype->ftype == FT_DOUBLE)) ws_log_fatal_full("", LOG_LEVEL_ERROR , "epan/ftypes/ftypes.c", 1215, __func__, "assertion failed: %s" , "fv->ftype->ftype == FT_FLOAT || fv->ftype->ftype == FT_DOUBLE" ); } while (0); |
1216 | ws_assert(fv->ftype->get_value.get_value_floating)do { if ((1) && !(fv->ftype->get_value.get_value_floating )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1216, __func__, "assertion failed: %s", "fv->ftype->get_value.get_value_floating" ); } while (0); |
1217 | return fv->ftype->get_value.get_value_floating(fv); |
1218 | } |
1219 | |
1220 | const ipv4_addr_and_mask * |
1221 | fvalue_get_ipv4(fvalue_t *fv) |
1222 | { |
1223 | ws_assert(fv->ftype->ftype == FT_IPv4)do { if ((1) && !(fv->ftype->ftype == FT_IPv4)) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1223, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_IPv4" ); } while (0); |
1224 | ws_assert(fv->ftype->get_value.get_value_ipv4)do { if ((1) && !(fv->ftype->get_value.get_value_ipv4 )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1224, __func__, "assertion failed: %s", "fv->ftype->get_value.get_value_ipv4" ); } while (0); |
1225 | return fv->ftype->get_value.get_value_ipv4(fv); |
1226 | } |
1227 | |
1228 | const ipv6_addr_and_prefix * |
1229 | fvalue_get_ipv6(fvalue_t *fv) |
1230 | { |
1231 | ws_assert(fv->ftype->ftype == FT_IPv6)do { if ((1) && !(fv->ftype->ftype == FT_IPv6)) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1231, __func__, "assertion failed: %s", "fv->ftype->ftype == FT_IPv6" ); } while (0); |
1232 | ws_assert(fv->ftype->get_value.get_value_ipv6)do { if ((1) && !(fv->ftype->get_value.get_value_ipv6 )) ws_log_fatal_full("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c" , 1232, __func__, "assertion failed: %s", "fv->ftype->get_value.get_value_ipv6" ); } while (0); |
1233 | return fv->ftype->get_value.get_value_ipv6(fv); |
1234 | } |
1235 | |
1236 | ft_bool_t |
1237 | fvalue_eq(const fvalue_t *a, const fvalue_t *b) |
1238 | { |
1239 | int cmp; |
1240 | enum ft_result res; |
1241 | |
1242 | ws_assert(a->ftype->compare)do { if ((1) && !(a->ftype->compare)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1242, __func__, "assertion failed: %s", "a->ftype->compare"); } while ( 0); |
1243 | res = a->ftype->compare(a, b, &cmp); |
1244 | if (res != FT_OK) |
1245 | return -res; |
1246 | return cmp == 0 ? FT_TRUE1 : FT_FALSE0; |
1247 | } |
1248 | |
1249 | ft_bool_t |
1250 | fvalue_ne(const fvalue_t *a, const fvalue_t *b) |
1251 | { |
1252 | int cmp; |
1253 | enum ft_result res; |
1254 | |
1255 | ws_assert(a->ftype->compare)do { if ((1) && !(a->ftype->compare)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1255, __func__, "assertion failed: %s", "a->ftype->compare"); } while ( 0); |
1256 | res = a->ftype->compare(a, b, &cmp); |
1257 | if (res != FT_OK) |
1258 | return -res; |
1259 | return cmp != 0 ? FT_TRUE1 : FT_FALSE0; |
1260 | } |
1261 | |
1262 | ft_bool_t |
1263 | fvalue_gt(const fvalue_t *a, const fvalue_t *b) |
1264 | { |
1265 | int cmp; |
1266 | enum ft_result res; |
1267 | |
1268 | ws_assert(a->ftype->compare)do { if ((1) && !(a->ftype->compare)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1268, __func__, "assertion failed: %s", "a->ftype->compare"); } while ( 0); |
1269 | res = a->ftype->compare(a, b, &cmp); |
1270 | if (res != FT_OK) |
1271 | return -res; |
1272 | return cmp > 0 ? FT_TRUE1 : FT_FALSE0; |
1273 | } |
1274 | |
1275 | ft_bool_t |
1276 | fvalue_ge(const fvalue_t *a, const fvalue_t *b) |
1277 | { |
1278 | int cmp; |
1279 | enum ft_result res; |
1280 | |
1281 | ws_assert(a->ftype->compare)do { if ((1) && !(a->ftype->compare)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1281, __func__, "assertion failed: %s", "a->ftype->compare"); } while ( 0); |
1282 | res = a->ftype->compare(a, b, &cmp); |
1283 | if (res != FT_OK) |
1284 | return -res; |
1285 | return cmp >= 0 ? FT_TRUE1 : FT_FALSE0; |
1286 | } |
1287 | |
1288 | ft_bool_t |
1289 | fvalue_lt(const fvalue_t *a, const fvalue_t *b) |
1290 | { |
1291 | int cmp; |
1292 | enum ft_result res; |
1293 | |
1294 | ws_assert(a->ftype->compare)do { if ((1) && !(a->ftype->compare)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1294, __func__, "assertion failed: %s", "a->ftype->compare"); } while ( 0); |
1295 | res = a->ftype->compare(a, b, &cmp); |
1296 | if (res != FT_OK) |
1297 | return -res; |
1298 | return cmp < 0 ? FT_TRUE1 : FT_FALSE0; |
1299 | } |
1300 | |
1301 | ft_bool_t |
1302 | fvalue_le(const fvalue_t *a, const fvalue_t *b) |
1303 | { |
1304 | int cmp; |
1305 | enum ft_result res; |
1306 | |
1307 | ws_assert(a->ftype->compare)do { if ((1) && !(a->ftype->compare)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1307, __func__, "assertion failed: %s", "a->ftype->compare"); } while ( 0); |
1308 | res = a->ftype->compare(a, b, &cmp); |
1309 | if (res != FT_OK) |
1310 | return -res; |
1311 | return cmp <= 0 ? FT_TRUE1 : FT_FALSE0; |
1312 | } |
1313 | |
1314 | ft_bool_t |
1315 | fvalue_contains(const fvalue_t *a, const fvalue_t *b) |
1316 | { |
1317 | bool_Bool yes; |
1318 | enum ft_result res; |
1319 | |
1320 | ws_assert(a->ftype->contains)do { if ((1) && !(a->ftype->contains)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1320, __func__, "assertion failed: %s", "a->ftype->contains"); } while (0); |
1321 | res = a->ftype->contains(a, b, &yes); |
1322 | if (res != FT_OK) |
1323 | return -res; |
1324 | return yes ? FT_TRUE1 : FT_FALSE0; |
1325 | } |
1326 | |
1327 | ft_bool_t |
1328 | fvalue_matches(const fvalue_t *a, const ws_regex_t *re) |
1329 | { |
1330 | bool_Bool yes; |
1331 | enum ft_result res; |
1332 | |
1333 | ws_assert(a->ftype->matches)do { if ((1) && !(a->ftype->matches)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1333, __func__, "assertion failed: %s", "a->ftype->matches"); } while ( 0); |
1334 | res = a->ftype->matches(a, re, &yes); |
1335 | if (res != FT_OK) |
1336 | return -res; |
1337 | return yes ? FT_TRUE1 : FT_FALSE0; |
1338 | } |
1339 | |
1340 | bool_Bool |
1341 | fvalue_is_zero(const fvalue_t *a) |
1342 | { |
1343 | return a->ftype->is_zero(a); |
1344 | } |
1345 | |
1346 | bool_Bool |
1347 | fvalue_is_negative(const fvalue_t *a) |
1348 | { |
1349 | return a->ftype->is_negative(a); |
1350 | } |
1351 | |
1352 | static fvalue_t * |
1353 | _fvalue_binop(FvalueBinaryOp op, const fvalue_t *a, const fvalue_t *b, char **err_msg) |
1354 | { |
1355 | fvalue_t *result; |
1356 | |
1357 | result = fvalue_new(a->ftype->ftype); |
1358 | if (op(result, a, b, err_msg) != FT_OK) { |
1359 | fvalue_free(result); |
1360 | return NULL((void*)0); |
1361 | } |
1362 | return result; |
1363 | } |
1364 | |
1365 | fvalue_t * |
1366 | fvalue_bitwise_and(const fvalue_t *a, const fvalue_t *b, char **err_msg) |
1367 | { |
1368 | /* XXX - check compatibility of a and b */ |
1369 | ws_assert(a->ftype->bitwise_and)do { if ((1) && !(a->ftype->bitwise_and)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1369, __func__, "assertion failed: %s", "a->ftype->bitwise_and"); } while (0); |
1370 | return _fvalue_binop(a->ftype->bitwise_and, a, b, err_msg); |
1371 | } |
1372 | |
1373 | fvalue_t * |
1374 | fvalue_add(const fvalue_t *a, const fvalue_t *b, char **err_msg) |
1375 | { |
1376 | /* XXX - check compatibility of a and b */ |
1377 | ws_assert(a->ftype->add)do { if ((1) && !(a->ftype->add)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1377, __func__, "assertion failed: %s", "a->ftype->add"); } while (0); |
1378 | return _fvalue_binop(a->ftype->add, a, b, err_msg); |
1379 | } |
1380 | |
1381 | fvalue_t * |
1382 | fvalue_subtract(const fvalue_t *a, const fvalue_t *b, char **err_msg) |
1383 | { |
1384 | /* XXX - check compatibility of a and b */ |
1385 | ws_assert(a->ftype->subtract)do { if ((1) && !(a->ftype->subtract)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1385, __func__, "assertion failed: %s", "a->ftype->subtract"); } while (0); |
1386 | return _fvalue_binop(a->ftype->subtract, a, b, err_msg); |
1387 | } |
1388 | |
1389 | fvalue_t * |
1390 | fvalue_multiply(const fvalue_t *a, const fvalue_t *b, char **err_msg) |
1391 | { |
1392 | /* XXX - check compatibility of a and b */ |
1393 | ws_assert(a->ftype->multiply)do { if ((1) && !(a->ftype->multiply)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1393, __func__, "assertion failed: %s", "a->ftype->multiply"); } while (0); |
1394 | return _fvalue_binop(a->ftype->multiply, a, b, err_msg); |
1395 | } |
1396 | |
1397 | fvalue_t * |
1398 | fvalue_divide(const fvalue_t *a, const fvalue_t *b, char **err_msg) |
1399 | { |
1400 | /* XXX - check compatibility of a and b */ |
1401 | ws_assert(a->ftype->divide)do { if ((1) && !(a->ftype->divide)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1401, __func__, "assertion failed: %s", "a->ftype->divide"); } while ( 0); |
1402 | return _fvalue_binop(a->ftype->divide, a, b, err_msg); |
1403 | } |
1404 | |
1405 | fvalue_t * |
1406 | fvalue_modulo(const fvalue_t *a, const fvalue_t *b, char **err_msg) |
1407 | { |
1408 | /* XXX - check compatibility of a and b */ |
1409 | ws_assert(a->ftype->modulo)do { if ((1) && !(a->ftype->modulo)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1409, __func__, "assertion failed: %s", "a->ftype->modulo"); } while ( 0); |
1410 | return _fvalue_binop(a->ftype->modulo, a, b, err_msg); |
1411 | } |
1412 | |
1413 | fvalue_t* |
1414 | fvalue_unary_minus(const fvalue_t *fv, char **err_msg) |
1415 | { |
1416 | fvalue_t *result; |
1417 | |
1418 | ws_assert(fv->ftype->unary_minus)do { if ((1) && !(fv->ftype->unary_minus)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1418, __func__, "assertion failed: %s", "fv->ftype->unary_minus"); } while (0); |
1419 | |
1420 | result = fvalue_new(fv->ftype->ftype); |
1421 | if (fv->ftype->unary_minus(result, fv, err_msg) != FT_OK) { |
1422 | fvalue_free(result); |
1423 | return NULL((void*)0); |
1424 | } |
1425 | return result; |
1426 | } |
1427 | |
1428 | unsigned |
1429 | fvalue_hash(const fvalue_t *fv) |
1430 | { |
1431 | ws_assert(fv->ftype->hash)do { if ((1) && !(fv->ftype->hash)) ws_log_fatal_full ("", LOG_LEVEL_ERROR, "epan/ftypes/ftypes.c", 1431, __func__, "assertion failed: %s", "fv->ftype->hash"); } while (0 ); |
1432 | return fv->ftype->hash(fv); |
1433 | } |
1434 | |
1435 | bool_Bool |
1436 | fvalue_equal(const fvalue_t *a, const fvalue_t *b) |
1437 | { |
1438 | return fvalue_eq(a, b) == FT_TRUE1; |
1439 | } |
1440 | |
1441 | /* |
1442 | * Editor modelines - https://www.wireshark.org/tools/modelines.html |
1443 | * |
1444 | * Local variables: |
1445 | * c-basic-offset: 8 |
1446 | * tab-width: 8 |
1447 | * indent-tabs-mode: t |
1448 | * End: |
1449 | * |
1450 | * vi: set shiftwidth=8 tabstop=8 noexpandtab: |
1451 | * :indentSize=8:tabSize=8:noTabs=false: |
1452 | */ |