summaryrefslogtreecommitdiff
path: root/print-atalk.c
Commit message (Collapse)AuthorAgeFilesLines
* Update the ND_LCHECK*() macros to ND_ICHECK*() macrosFrancois-Xavier Le Bail2021-12-291-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | ICHECK like Invalid-Check. Reminder: If the checked expression is true an error message is printed and a 'goto invalid' is executed. This change adds the parameter 'operator'. Before this change, '<' comparison was hard coded. We can do now: ND_ICHECK_U(length, <, HEADER_LEN); ND_ICHECK_U(length, ==, 24); ND_ICHECK_U(length, !=, 8); ND_ICHECK_ZU(length, <, sizeof(struct my_struct)); ND_ICHECKMSG_U("message length", msg_tlen, <, 4); ... (Any comparison operator) Remark: The change of names from ND_LCHECK*() to ND_ICHECK*() is because something else than a length(L) can be checked. Moreover: Place the 'message' parameter at the beginning of ND_ICHECKMSG_U() and ND_ICHECKMSG_ZU() paramaters lists.
* Try the new ND_LCHECK*() macros. [skip ci]Denis Ovsienko2021-01-171-29/+8
|
* AppleTalk: Modernize packet parsing style.Denis Ovsienko2021-01-131-105/+66
| | | | | | | Enable ND_LONGJMP_FROM_TCHECK. Report invalid packets as invalid. Remove all improvised snapshot end guards as they were redundant. In print_cstring() have nd_printjn() guard the snapshot end. Use tok2str() in nbp_print(). Update two tests.
* AppleTalk: Declutter appletalk.h.Denis Ovsienko2021-01-131-6/+71
| | | | | Lose unused definitions and structures. Move most other contents into print-atalk.c and rearrange for clarity. Lose a dead #ifdef block.
* Use nd_mac_addr where it belongs. [skip ci]Denis Ovsienko2020-10-171-2/+2
|
* Use __func__ from C99 in error messages. [skip ci]Denis Ovsienko2020-10-081-3/+3
| | | | | This automatically fixes a few error messages that would tell an incorrect function name.
* Spell most remaining MAC_ADDR_LEN instances. [skip ci]Denis Ovsienko2020-10-041-3/+3
|
* AppleTalk: Update the link-layer dissector to a void functionFrancois-Xavier Le Bail2020-08-061-4/+5
| | | | | Moreover: Remove trailing "_if" from the protocol name.
* More bounds checking when fetching addresses and converting to strings.Guy Harris2020-01-191-1/+1
| | | | | | | | | | | | | | Replace more calls to ipaddr_string()/ip6addr_string() with calls to GET_IPADDR_STRING()/GET_IP6ADDR_STRING() macros performing bounds checking. Add similar bounds-checking inline functions and macros to wrap linkaddr_string(), etheraddr_string(), and isonsap_string() and convert calls to them to use the macros as well. Shuffle the inline functions in addrtoname.h around a bit, so that the inline functions, external declarations, and macros are all in the same order.
* Remove more old-compiler compensation.Guy Harris2019-08-081-4/+4
| | | | | | | | | | | | We require an environment with a C99-compatible snprintf(), so we don't need to work around older implementations. Make the configuration process fail if we don't have snprintf() and vsnprintf(). We require at least VS 2015, so we don't have to check for _MSC_VER >= 1400. Make the build fail if we don't have at least VS 2015. We apparently do, however, have to use __inline, as the VS 2015 documentation doesn't meaning plain old "inline". Update a comment.
* Use the new GET_ macros instead of the EXTRACT_ onesFrancois-Xavier Le Bail2019-03-261-52/+62
| | | | | | | The exceptions are currently: Some EXTRACT_ in print-juniper.c, not used on packet buffer pointer. An EXTRACT_BE_U_3 in addrtoname.c, not always used on packet buffer pointer.
* That wasn't correct.Guy Harris2018-09-161-8/+7
|
* Clean up the name resolution a bit.Guy Harris2018-09-151-33/+52
| | | | | If we're not doing name-to-address resolution, don't bother with the address-to-name table.
* Add more nd_print_trunc() callsFrancois-Xavier Le Bail2018-06-061-2/+2
| | | | Update the output of some tests accordingly.
* Pointers to packet bytes should be u_char *, not char *.Guy Harris2018-05-191-5/+5
|
* Print truncations with nd_print_trunc() instead of tstr[] stringsFrancois-Xavier Le Bail2018-05-041-7/+6
| | | | | | | | Remove the tstr[] strings. Update the output of some tests accordingly. Moreover: Add or update some ndo_protocol fields.
* Add the ndo_protocol field in the netdissect_options structureFrancois-Xavier Le Bail2018-03-161-0/+4
| | | | | Update this field in printer entry functions. It will be used for some printings.
* AppleTalk: Filter out non-printable charactersFrancois-Xavier Le Bail2018-02-281-1/+1
| | | | Use fn_print_char().
* Add a status exit code to the function ndo_error()Francois-Xavier Le Bail2018-02-251-5/+6
| | | | | | | The status are defined in an enum in status-exit-codes.h. Moreover: Use ndo_error() instead of ndo_warning() for malloc() errors in print-esp.c.
* Add nd_{v}snprintf() routines/wrappers.Guy Harris2018-01-291-4/+4
| | | | | | | | Some versions of the MSVC runtime library have a non-C99-compliant vsnprintf(), which we want to avoid. On Windows, use snprintf() and vsnprintf() for VS 2015 and later, where they both exist in C99-compliant forms, and wrap _{v}snprintf_s() otherwise (they're guaranteed to do the null termination that we want).
* Always include <config.h> rather than "config.h".Guy Harris2018-01-211-1/+1
| | | | | | | | This can prevent bizarre failures if, for example, you've done a configuration in the top-level source directory, leaving behind one config.h file, and then do an out-of-tree build in another directory, with different configuration options. This way, we always pick up the same config.h, in the build directory.
* Use quoted include netdissect-stdinc.h instead of angle-bracketed oneFrancois-Xavier Le Bail2018-01-211-1/+1
|
* Clean up signed vs. unsigned.Guy Harris2018-01-111-24/+24
|
* Update ND_PRINT() as a variadic macroFrancois-Xavier Le Bail2018-01-071-83/+83
|
* Use ND_TTEST_SIZE()/ND_TCHECK_SIZE() macros (1/n)Francois-Xavier Le Bail2018-01-031-1/+1
|
* Use nd_ types in AppleTalk structures, and add EXTRACT_ calls.Guy Harris2017-12-141-65/+72
|
* Remove all storage class specifier 'register'Francois-Xavier Le Bail2017-12-131-27/+27
| | | | | | Let the compiler do the optimizations (or not) based on build options. Avoid 'value has been optimized out' messages in gdb using '-O0'.
* Replace ND_TTEST2()/ND_TCHECK2() macros by macros using pointers (1/n)Francois-Xavier Le Bail2017-12-111-4/+4
| | | | | ND_TTEST2(var, l) -> ND_TTEST_LEN(p, l) ND_TCHECK2(var, l) -> ND_TCHECK_LEN(p, l)
* Use EXTRACT_U_1().Guy Harris2017-11-231-3/+6
|
* Rename EXTRACT_ macrosFrancois-Xavier Le Bail2017-11-221-18/+18
| | | | | | | | | | | | | | | | Now all the macros have a name meaning a count in bytes. With _S_: signed, _U_: unsigned e.g.: EXTRACT_BE_32BITS -> EXTRACT_BE_U_4 EXTRACT_LE_32BITS -> EXTRACT_LE_U_4 ... EXTRACT_BE_INT32 -> EXTRACT_BE_S_4 and have: EXTRACT_8BITS -> EXTRACT_U_1 EXTRACT_INT8 -> EXTRACT_S_1
* Rename EXTRACT_nBITS() macros to EXTRACT_BE_nBITS()Francois-Xavier Le Bail2017-11-181-19/+19
| | | | | It indicates clearly that these macros are used to extract big-endian integral values.
* AppleTalk: Address a few cppcheck style notices.Denis Ovsienko2017-09-061-5/+2
| | | | | | | | | [print-atalk.c:283]: (style) The scope of the variable 'c' can be reduced. [print-atalk.c:380]: (style) The scope of the variable 'c' can be reduced. [print-atalk.c:360]: (style) Variable 'c' is assigned a value that is never used.
* Fix a trailing tabFrancois-Xavier Le Bail2017-01-181-1/+1
|
* CVE-2016-7973/Add bounds and length checks.Guy Harris2017-01-181-0/+9
| | | | Fixes heap overflows found with American Fuzzy Lop by Hanno Böck.
* Pass the actual frame length to llap_print().Guy Harris2017-01-181-1/+1
| | | | | That way, it can properly do the check against that length; it also does bounds checks, so it'll catch running past the snapshot length.
* Check against the packet length first.Guy Harris2017-01-181-16/+16
| | | | | That way, if the packet is inherently too short, rather than just having been cut short by the snapshot length, we'll report that properly.
* CVE-2016-7973/Add some bounds checks.Guy Harris2017-01-181-1/+24
| | | | Fixes a heap overflow found with American Fuzzy Lop by Hanno Böck.
* Add a summary comment in all other printersFrancois-Xavier Le Bail2016-08-151-2/+0
| | | | | | | Moreover: Remove some redundant comments Update some summary comments Update the specification URL for ATA over Ethernet (AoE) protocol
* Move the printer summaries from INSTALL.txt to each printerFrancois-Xavier Le Bail2016-08-141-0/+2
| | | | | | | | with the tag '\summary:' for greping. Remark: Currently some printers have no summary line. Moreover: Summarize all printers with a single line in INSTALL.txt
* Rename 'tcpdump-stdinc.h' to 'netdissect-stdinc.h'Francois-Xavier Le Bail2015-09-101-1/+1
| | | | Get the full log via: git log --follow netdissect-stdinc.h
* Remove obsolete commentsFrancois-Xavier Le Bail2015-09-071-1/+1
|
* Printers must include 'netdissect.h', not 'interface.h'Francois-Xavier Le Bail2015-09-051-1/+1
|
* Functions in libnetdissect must use ndo_error() functionFrancois-Xavier Le Bail2015-09-051-3/+3
|
* Printers must use ndo_error() function (via ndo->ndo_error)Francois-Xavier Le Bail2015-09-051-3/+5
|
* Add checks for strdup() failure.Bill Parker2015-07-131-0/+6
|
* Fix a bunch of de-constifications.Guy Harris2015-04-261-1/+1
|
* dismiss NETDISSECT_REWORKED macroDenis Ovsienko2015-03-221-1/+0
| | | | | | | The purpose of this macro was to enable the file-by-file switch to NDO, after which only tcpdump.c had a use of it and the definitions guarded by it. Update tcpdump.c not to require them any more and dismiss the unused definitions.
* More fixes for uint8_t being shorter than u_int8_t.Guy Harris2014-04-231-5/+5
| | | | Fix a typo while we're at it.
* u_intN_t is dead, long live uintN_t.Guy Harris2014-04-231-8/+8
| | | | | | | | | And, as we require at least autoconf 2.61, and as autoconf 2.61 and later have AC_TYPE_UINTn_T and AC_TYPE_INTn_T macros, we use them to define the uintN_t and intN_t macros if the system doesn't define them for us. This lets us get rid of bitypes.h as well.
* Netdissectify the to-name resolution routines.Guy Harris2014-04-041-1/+1
| | | | | | | | Have them take a netdissect_options * argument, and get the "no name resolution" flag from it. Move the declaration of dnaddr_string to addrtoname.h, along with the other XXX-to-string routines.