### Bug Summary

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

### Annotated Source Code

Press '?' to see keyboard shortcuts

Show analyzer invocation
clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name ftypes.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -fno-delete-null-pointer-checks -mframe-pointer=all -relaxed-aliasing -fmath-errno -ffp-contract=on -fno-rounding-math -ffloat16-excess-precision=fast -fbfloat16-excess-precision=fast -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/builds/wireshark/wireshark/build -fcoverage-compilation-dir=/builds/wireshark/wireshark/build -resource-dir /usr/lib/llvm-22/lib/clang/22 -isystem /usr/include/glib-2.0 -isystem /usr/lib/x86_64-linux-gnu/glib-2.0/include -D CARES_NO_DEPRECATED -D G_DISABLE_DEPRECATED -D G_DISABLE_SINGLE_INCLUDES -D WS_BUILD_DLL -D WS_DEBUG -D WS_DEBUG_UTF_8 -I /builds/wireshark/wireshark/build -I /builds/wireshark/wireshark -I /builds/wireshark/wireshark/include -I /builds/wireshark/wireshark/build/epan/ftypes -I /builds/wireshark/wireshark/epan/ftypes -I /builds/wireshark/wireshark/epan -D _GLIBCXX_ASSERTIONS -internal-isystem /usr/lib/llvm-22/lib/clang/22/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/16/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fmacro-prefix-map=/builds/wireshark/wireshark/= -fmacro-prefix-map=/builds/wireshark/wireshark/build/= -fmacro-prefix-map=../= -Wno-format-nonliteral -std=gnu17 -ferror-limit 19 -fvisibility=hidden -fwrapv -fwrapv-pointer -fstrict-flex-arrays=3 -stack-protector 2 -fstack-clash-protection -fcf-protection=full -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fexceptions -fcolor-diagnostics -analyzer-output=html -faddrsig -fdwarf2-cfi-asm -o /builds/wireshark/wireshark/sbout/2026-06-07-100346-3530-1 -x c /builds/wireshark/wireshark/epan/ftypes/ftypes.c

Keyboard shortcuts:

- Use 'j/k' keys for keyboard navigation
- Use 'Shift+S' to show/hide relevant lines
- Use '?' to toggle this window

Close
Show only relevant lines Show control flow arrows

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