void
decnet_print(netdissect_options *ndo,
- register const u_char *ap, register u_int length,
- register u_int caplen)
+ const u_char *ap, u_int length,
+ u_int caplen)
{
- register const union routehdr *rhp;
- register int mflags;
+ const union routehdr *rhp;
+ int mflags;
int dst, src, hops;
u_int nsplen, pktlen;
const u_char *nspp;
return;
}
- ND_TCHECK2(*ap, sizeof(short));
+ ND_TCHECK_LEN(ap, sizeof(short));
pktlen = EXTRACT_LE_U_2(ap);
if (pktlen < sizeof(struct shorthdr)) {
ND_PRINT((ndo, "%s", tstr));
}
length = pktlen;
- rhp = (const union routehdr *)&(ap[sizeof(short)]);
+ rhp = (const union routehdr *)(ap + sizeof(short));
ND_TCHECK(rhp->rh_short.sh_flags);
mflags = EXTRACT_U_1(rhp->rh_short.sh_flags);
ND_PRINT((ndo, "%s", tstr));
return;
}
- ND_TCHECK2(ap[sizeof(short)], padlen);
+ ND_TCHECK_LEN(ap + sizeof(short), padlen);
ap += padlen;
length -= padlen;
caplen -= padlen;
- rhp = (const union routehdr *)&(ap[sizeof(short)]);
+ rhp = (const union routehdr *)(ap + sizeof(short));
ND_TCHECK(rhp->rh_short.sh_flags);
mflags = EXTRACT_U_1(rhp->rh_short.sh_flags);
}
src =
EXTRACT_LE_U_2(rhp->rh_long.lg_src.dne_remote.dne_nodeaddr);
hops = EXTRACT_U_1(rhp->rh_long.lg_visits);
- nspp = &(ap[sizeof(short) + sizeof(struct longhdr)]);
+ nspp = ap + sizeof(short) + sizeof(struct longhdr);
nsplen = length - sizeof(struct longhdr);
break;
case RMF_SHORT:
dst = EXTRACT_LE_U_2(rhp->rh_short.sh_dst);
src = EXTRACT_LE_U_2(rhp->rh_short.sh_src);
hops = (EXTRACT_U_1(rhp->rh_short.sh_visits) & VIS_MASK)+1;
- nspp = &(ap[sizeof(short) + sizeof(struct shorthdr)]);
+ nspp = ap + sizeof(short) + sizeof(struct shorthdr);
nsplen = length - sizeof(struct shorthdr);
break;
default:
static int
print_decnet_ctlmsg(netdissect_options *ndo,
- register const union routehdr *rhp, u_int length,
+ const union routehdr *rhp, u_int length,
u_int caplen)
{
/* Our caller has already checked for mflags */
int mflags = EXTRACT_U_1(rhp->rh_short.sh_flags);
- register const union controlmsg *cmp = (const union controlmsg *)rhp;
+ const union controlmsg *cmp = (const union controlmsg *)rhp;
int src, dst, info, blksize, eco, ueco, hello, other, vers;
etheraddr srcea, rtea;
int priority;
/* The last short is a checksum */
while (len > (3 * sizeof(short))) {
- ND_TCHECK2(*rp, 3 * sizeof(short));
+ ND_TCHECK_LEN(rp, 3 * sizeof(short));
count = EXTRACT_LE_U_2(rp);
if (count > 1024)
return (1); /* seems to be bogus from here on */
/* The last short is a checksum */
while (len > (3 * sizeof(short))) {
- ND_TCHECK2(*rp, 3 * sizeof(short));
+ ND_TCHECK_LEN(rp, 3 * sizeof(short));
count = EXTRACT_LE_U_2(rp);
if (count > 1024)
return (1); /* seems to be bogus from here on */
{
const struct seghdr *shp = (const struct seghdr *)nspp;
const struct lsmsg *lsmp =
- (const struct lsmsg *)&(nspp[sizeof(struct seghdr)]);
+ (const struct lsmsg *)(nspp + sizeof(struct seghdr));
int ack;
int lsflags, fcval;
static void
print_reason(netdissect_options *ndo,
- register int reason)
+ int reason)
{
ND_PRINT((ndo, "%s ", tok2str(reason2str, "reason-%d", reason)));
}