#include "netdissect-stdinc.h"
+#define ND_LONGJMP_FROM_TCHECK
#include "netdissect.h"
#include "extract.h"
#include "addrtoname.h"
* Fail if we don't have enough data for the Hilscher pseudo-header.
*/
ndo->ndo_protocol = "netanalyzer";
- if (h->caplen < 4) {
- ndo->ndo_ll_hdr_len += h->caplen;
- nd_print_trunc(ndo);
- return;
- }
+ ND_TCHECK_LEN(p, 4);
/* Skip the pseudo-header. */
ndo->ndo_ll_hdr_len += 4;
* preamble, and SOF.
*/
ndo->ndo_protocol = "netanalyzer_transparent";
- if (h->caplen < 12) {
- ndo->ndo_ll_hdr_len += h->caplen;
- nd_print_trunc(ndo);
- return;
- }
+ ND_TCHECK_LEN(p, 12);
/* Skip the pseudo-header, preamble, and SOF. */
ndo->ndo_ll_hdr_len += 12;
nd_print_trunc(ndo);
return (1);
}
+ /* At least one byte is required */
+ /* FIXME: Reference for this byte? */
+ ND_TCHECK_LEN(p, 1);
isoclns_print(ndo, p + 1, length - 1);
return(1);