aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-bpv6.c
AgeCommit message (Collapse)AuthorFilesLines
2023-11-20Remove init of proto variablesStig Bjørlykke1-158/+158
Remove init of proto, header field, expert info and subtree variables. This will reduces the binary size by approximate 1266320 bytes due to using .bss to zero-initialize the fields. The conversion is done using the tools/convert-proto-init.py script.
2023-02-25Change some `wmem_packet_scope()` to `pinfo->pool`David Perry1-3/+3
As requested [here][1] by @eapache, help with removing calls to `wmem_packet_scope()` in favour of references to `pinfo->pool`. * Plugins chosen semi-randomly. * When a calling function already has a `pinfo` argument, use that. * Remove `_U_` from its signature if it was there. * If a function seems narrowly focused on getting and (possibly) returning memory, change the function signature to take a `wmem_allocator_t *`. * If it seems more focused on packet-based operations, pass in a `packet_info *` instead and use `pinfo->pool` within. * If there are several functions defined with the same call signature, add `pinfo _U_` to the argument list of similar functions in order to maintain clarity/symmetry. [1]: https://www.wireshark.org/lists/wireshark-dev/202107/msg00052.html
2022-12-13bpv6: Fix possible infinite loopJohn Thacker1-2/+2
display_extension_block is supposed to return the current offset, not the number of bytes remaining. The number of bytes remaining can be less than the current offset and cause an infinite loop. In the case of an error, set lastheader and return the current offset in order to break out of the main processing loop. Fix #18711.
2022-12-01bpv6: Prevent infinite loopsJohn Thacker1-4/+8
display_extension_block is supposed to return the current offset, not the number of bytes remaining, which can be less than the current offset and cause an infinite loop. In the case of errors, set lastheader and return the current offset to break out of loops.
2022-10-19epan: centralize SDNV processing along other similar varint typesBrian Sipos1-220/+23
This avoids having general-purpose decoding happening in non-DLL-exported functions defined in a dissector for #18478, and removes unused functions and avoids duplicate decoding. This also removes unnecessary early exit conditions for #18145. Unit test cases for varint decoding are added to verify this.
2022-07-15Fix -Wmissing-prototypes found by ClangAlexis La Goutte1-0/+3
ftype-double.c:89:1: warning: no previous prototype for function 'val_unary_minus' ftype-double.c:96:1: warning: no previous prototype for function 'val_add' ftype-double.c:103:1: warning: no previous prototype for function 'val_subtract' ftype-double.c:110:1: warning: no previous prototype for function 'val_multiply' ftype-double.c:117:1: warning: no previous prototype for function 'val_divide' ftype-integer.c:670:1: warning: no previous prototype for function 'uint_bitwise_and' ftype-integer.c:677:1: warning: no previous prototype for function 'uint_is_zero' ftype-integer.c:683:1: warning: no previous prototype for function 'uint_is_negative' ftype-integer.c:689:1: warning: no previous prototype for function 'uint_unary_minus' ftype-integer.c:704:1: warning: no previous prototype for function 'uint64_bitwise_and' ftype-integer.c:711:1: warning: no previous prototype for function 'uint64_is_zero' ftype-integer.c:717:1: warning: no previous prototype for function 'uint64_is_negative' ftype-integer.c:723:1: warning: no previous prototype for function 'uint64_unary_minus' ftype-integer.c:738:1: warning: no previous prototype for function 'sint_bitwise_and' ftype-integer.c:745:1: warning: no previous prototype for function 'sint_is_zero' ftype-integer.c:751:1: warning: no previous prototype for function 'sint_is_negative' ftype-integer.c:757:1: warning: no previous prototype for function 'sint_unary_minus ftype-integer.c:764:1: warning: no previous prototype for function 'sint64_bitwise_and' ftype-integer.c:771:1: warning: no previous prototype for function 'sint64_is_zero' ftype-integer.c:777:1: warning: no previous prototype for function 'sint64_is_negative' ftype-integer.c:783:1: warning: no previous prototype for function 'sint64_unary_minus' packet-bpv6.c:2182:1: warning: no previous prototype for function 'proto_register_bpv6' packet-bpv6.c:2766:1: warning: no previous prototype for function 'proto_reg_handoff_bpv6' packet-bpv7.c:1978:6: warning: no previous prototype for function 'proto_register_bpv7' packet-bpv7.c:2037:6: warning: no previous prototype for function 'proto_reg_handoff_bpv7' packet-realtek.c:349:1: warning: no previous prototype for function 'proto_register_realtek' packet-realtek.c:436:1: warning: no previous prototype for function 'proto_reg_handoff_realtek' packet-tcpcl.c:2147:1: warning: no previous prototype for function 'proto_register_tcpclv3' packet-tcpcl.c:2211:1: warning: no previous prototype for function 'proto_reg_handoff_tcpclv3'
2022-02-15Tools: Fix fix-encoding-args.pl ASCII string validationJoão Valverde1-9/+9
Do not require a useless ENC_NA parameter for string encodings. FT_STRING and FT_STRINGZ types don't have any ndianness. Follow-up to 6ec429622c9258eefd388caf21ce92ab5b9f54b4.
2022-02-08BP: Make sure our offset advances.Gerald Combs1-11/+36
Fixes #17933.
2021-12-05Dissectors should not include stdio.h, unless neededJaap Keuter1-1/+0
2021-10-12BP: Fix crashes on invalid fuzzed inputsBrian Sipos1-0/+2
2021-10-10BPv7: Add Bundle Protocol version 7 and BPSec dissectors from dtn-wiresharkBrian Sipos1-0/+2758