Bug Summary

File:builds/wireshark/wireshark/epan/ftypes/ftypes.c
Warning:line 171, column 14
Value stored to 's' during its initialization is never read

Annotated Source Code

Press '?' to see keyboard shortcuts

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