For signed exponential Golomb, fix a typo when testing if
value was even or odd that resulted in a no-op. This was
mapping all overflows to G_MININT32 instead of half of them
to G_MAXINT32.
Use tvb_new_octet_aligned when adding addresses (strings or bytes)
that are not byte aligned. That is not only clearer code, but also
prevents attempting to add unvalidated strings.
Since we're aligning the fields properly, get rid of the extra
fields for the MSB of the first field and LSB of the last field.
Fix#18664
RFC 3261 does not put a limit on the maximum size of Call-ID.
(Some implementations do, such as at 256 bytes.) Truncating
it can produce invalid UTF-8 if there's also errors that
turn into UTF-8 replacement characteres.
A reduced size is still used for the hash table lookup.
Add an expert info warning if Call-ID is missing, as it's
a mandatory field.
Fix#18620.
Instead of using tvb_get_bits and proto_tree_add_uint,
use a bitmask in the field info and proto_tree_add_item.
This means that when epan/print.c writes PDML or JSON,
the value written is the correctly masked value (PDML also
includes the unmasked value.)
When proto_tree_add_uint is used, the value written to
PDML and JSON is the original value from the packet buffer,
not properly shifted.
Using a bitmask in the field definition allows us to use
proto_tree_add_item, which means that when print.c writes
PDML and JSON, the value written is the correctly masked
value (PDML also includes the unmasked value.)
When functions like proto_tree_add_uint are used instead,
the value written to PDML and JSON is the original value
from the packet buffer, not properly shifted.
Instead of using tvb_get_bits32 and proto_tree_add_uint,
use a bitmask in the field info and proto_tree_add_item.
This means that when epan/print.c writes PDML or JSON,
the value written is the correctly masked value (PDML also
includes the unmasked value.)
When proto_tree_add_uint is used, the value written to
PDML and JSON is the original value from the packet buffer,
not properly shifted.
It's possible, in the case of errors, for the result of
g_uri_unescape_string not to be valid UTF-8, either if originally
some other encoding was percent-encoded, or if there were errors.
Check for it.
Fix#18658.
Rename flex macros using parenthesis (mostly a style issue):
DIAG_OFF_FLEX -> DIAG_OFF_FLEX()
DIAG_ON_FLEX -> DIAG_ON_FLEX()
Use the same kind of construct with lemon generated code using
DIAG_OFF_LEMON() and DIAG_ON_LEMON(). Use %include and %code
directives to enforce the desired order with generated code
in the middle in between pragmas.
Fix a clang-specific pragma to use DIAG_OFF_CLANG().
DIAG_OFF(unreachable-code) -> DIAG_OFF_CLANG(unreachable-code).
Apparently GCC is ignoring the -Wunreachable flag, that's why
it did not trigger an unknown pragma warning. From [1}:
The -Wunreachable-code has been removed, because it was unstable: it
relied on the optimizer, and so different versions of gcc would warn
about different code. The compiler still accepts and ignores the
command line option so that existing Makefiles are not broken. In some
future release the option will be removed entirely. - Ian
[1] https://gcc.gnu.org/legacy-ml/gcc-help/2011-05/msg00360.html
Add strings with proto_tree_add_item or tvb_get_string_enc;
avoid using tvb_get_raw_bytes_as_string.
Use UTF-8 as the encoding to future-proof, according to
Locomation.
Use tvb_find_line_end() to split the lines, which does almost
all the needed logic and simplifies the code.
Fix#18632
maxseqtobeacked needs to be increased when it's lower than
nextseq, not the other way around, otherwise we can get repeated
extra TCP ACKed unseen segment messages.
Since sequence analysis is always on the absolute sequence
numbers, not relative, it needs to use LT_SEQ to handle wraparound.
Fix#18558. Fix#18633.
It's possible to have multiplexed PPP MP that occurs in several
layers in the same frame, so we need to check that we're in the
right packet and also the right layer. process_reassembled_data
does that, so check to see if it returned a tvb instead of
just checking the frame number. Prevents some DISSECTOR BUG errors
when the buffer isn't actually available.
This change adds a small dissector for the NVMe-MI protocol, typically
for tunelling Administration commands over an MCTP (over I2C) channel.
We just decode the request and response headers, and leave the payload
as raw data.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
This change adds a very basic dissector for the MCTP control protocol -
just the header fields, leaving the raw payload data.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
This change adds a protocol dissector for the Management Component
Transport Protocol (MCTP). This is a failry simple datagram-based
protocol for messaging between components within a single platform,
typically over I2C, serial or PCIe.
This dissector just implements the header fields, and sequence-number
based message reassembly. Inner protocols will be added as follow-up
changes.
Linux has support for AF_MCTP data, so decode from the MCTP SLL ltype.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>