Bug Summary

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