sl_if_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, const u_char *p)
{
- register u_int caplen = h->caplen;
- register u_int length = h->len;
- register const struct ip *ip;
+ u_int caplen = h->caplen;
+ u_int length = h->len;
+ const struct ip *ip;
if (caplen < SLIP_HDRLEN || length < SLIP_HDRLEN) {
ND_PRINT((ndo, "%s", tstr));
sl_bsdos_if_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, const u_char *p)
{
- register u_int caplen = h->caplen;
- register u_int length = h->len;
- register const struct ip *ip;
+ u_int caplen = h->caplen;
+ u_int length = h->len;
+ const struct ip *ip;
if (caplen < SLIP_HDRLEN) {
ND_PRINT((ndo, "%s", tstr));
static void
sliplink_print(netdissect_options *ndo,
- register const u_char *p, register const struct ip *ip,
- register u_int length)
+ const u_char *p, const struct ip *ip,
+ u_int length)
{
int dir;
u_int hlen;
- dir = p[SLX_DIR];
+ dir = EXTRACT_U_1(p + SLX_DIR);
switch (dir) {
case SLIPDIR_IN:
}
if (ndo->ndo_nflag) {
/* XXX just dump the header */
- register int i;
+ int i;
for (i = SLX_CHDR; i < SLX_CHDR + CHDR_LEN - 1; ++i)
- ND_PRINT((ndo, "%02x.", p[i]));
- ND_PRINT((ndo, "%02x: ", p[SLX_CHDR + CHDR_LEN - 1]));
+ ND_PRINT((ndo, "%02x.", EXTRACT_U_1(p + i)));
+ ND_PRINT((ndo, "%02x: ", EXTRACT_U_1(p + SLX_CHDR + CHDR_LEN - 1)));
return;
}
- switch (p[SLX_CHDR] & 0xf0) {
+ switch (EXTRACT_U_1(p + SLX_CHDR) & 0xf0) {
case TYPE_IP:
ND_PRINT((ndo, "ip %d: ", length + SLIP_HDRLEN));
* Get it from the link layer since sl_uncompress_tcp()
* has restored the IP header copy to IPPROTO_TCP.
*/
- lastconn = ((const struct ip *)&p[SLX_CHDR])->ip_p;
+ lastconn = EXTRACT_U_1(((const struct ip *)(p + SLX_CHDR))->ip_p);
ND_PRINT((ndo, "utcp %d: ", lastconn));
if (dir == -1) {
/* Direction is bogus, don't use it */
/* Direction is bogus, don't use it */
return;
}
- if (p[SLX_CHDR] & TYPE_COMPRESSED_TCP) {
- compressed_sl_print(ndo, &p[SLX_CHDR], ip,
- length, dir);
+ if (EXTRACT_U_1(p + SLX_CHDR) & TYPE_COMPRESSED_TCP) {
+ compressed_sl_print(ndo, p + SLX_CHDR, ip,
+ length, dir);
ND_PRINT((ndo, ": "));
} else
- ND_PRINT((ndo, "slip-%d!: ", p[SLX_CHDR]));
+ ND_PRINT((ndo, "slip-%d!: ", EXTRACT_U_1(p + SLX_CHDR)));
}
}
static const u_char *
print_sl_change(netdissect_options *ndo,
- const char *str, register const u_char *cp)
+ const char *str, const u_char *cp)
{
- register u_int i;
+ u_int i;
- if ((i = *cp++) == 0) {
+ if ((i = EXTRACT_U_1(cp)) == 0) {
+ cp++;
i = EXTRACT_BE_U_2(cp);
cp += 2;
}
static const u_char *
print_sl_winchange(netdissect_options *ndo,
- register const u_char *cp)
+ const u_char *cp)
{
- register short i;
+ short i;
- if ((i = *cp++) == 0) {
+ if ((i = EXTRACT_U_1(cp)) == 0) {
+ cp++;
i = EXTRACT_BE_U_2(cp);
cp += 2;
}
const u_char *chdr, const struct ip *ip,
u_int length, int dir)
{
- register const u_char *cp = chdr;
- register u_int flags, hlen;
+ const u_char *cp = chdr;
+ u_int flags, hlen;
flags = EXTRACT_U_1(cp);
cp++;