Bug Summary

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