#include <stdio.h>
#include "netdissect.h"
+#include "extract.h"
static const char tstr[] = " [|telnet]";
/* IAC SB .... IAC SE */
p = sp;
while (length > (u_int)(p + 1 - sp)) {
- if (p[0] == IAC && p[1] == SE)
+ ND_TCHECK_2(p);
+ if (EXTRACT_U_1(p) == IAC && EXTRACT_U_1(p + 1) == SE)
break;
p++;
}
- if (*p != IAC)
+ ND_TCHECK_1(p);
+ if (EXTRACT_U_1(p) != IAC)
goto pktend;
switch (x) {
osp = sp;
- ND_TCHECK(*sp);
- while (length > 0 && *sp == IAC) {
+ ND_TCHECK_1(sp);
+ while (length > 0 && EXTRACT_U_1(sp) == IAC) {
/*
* Parse the Telnet command without printing it,
* to determine its length.
sp += l;
length -= l;
- ND_TCHECK(*sp);
+ ND_TCHECK_1(sp);
}
if (!first) {
if (ndo->ndo_Xflag && 2 < ndo->ndo_vflag)