summaryrefslogtreecommitdiff
path: root/print-ipx.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2017-11-22 23:54:09 +0100
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2017-11-22 23:54:09 +0100
commitda20bc56d6100b5275d6f85c4a25bac1dab4e57e (patch)
tree643c746e737c54d5a13d0b0083049d847d2cff24 /print-ipx.c
parent3c8f3e13b03380742c24070f8a7b56fe12c6b8ee (diff)
downloadtcpdump-da20bc56d6100b5275d6f85c4a25bac1dab4e57e.tar.gz
Rename EXTRACT_ macros
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
Diffstat (limited to 'print-ipx.c')
-rw-r--r--print-ipx.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/print-ipx.c b/print-ipx.c
index 9574d477..0c42c54d 100644
--- a/print-ipx.c
+++ b/print-ipx.c
@@ -78,16 +78,16 @@ ipx_print(netdissect_options *ndo, const u_char *p, u_int length)
ND_TCHECK(ipx->srcSkt);
ND_PRINT((ndo, "%s.%04x > ",
- ipxaddr_string(EXTRACT_BE_32BITS(ipx->srcNet), ipx->srcNode),
- EXTRACT_BE_16BITS(&ipx->srcSkt)));
+ ipxaddr_string(EXTRACT_BE_U_4(ipx->srcNet), ipx->srcNode),
+ EXTRACT_BE_U_2(&ipx->srcSkt)));
ND_PRINT((ndo, "%s.%04x: ",
- ipxaddr_string(EXTRACT_BE_32BITS(ipx->dstNet), ipx->dstNode),
- EXTRACT_BE_16BITS(&ipx->dstSkt)));
+ ipxaddr_string(EXTRACT_BE_U_4(ipx->dstNet), ipx->dstNode),
+ EXTRACT_BE_U_2(&ipx->dstSkt)));
/* take length from ipx header */
ND_TCHECK(ipx->length);
- length = EXTRACT_BE_16BITS(&ipx->length);
+ length = EXTRACT_BE_U_2(&ipx->length);
ipx_decode(ndo, ipx, p + ipxSize, length - ipxSize);
return;
@@ -111,7 +111,7 @@ ipx_decode(netdissect_options *ndo, const struct ipxHdr *ipx, const u_char *data
{
register u_short dstSkt;
- dstSkt = EXTRACT_BE_16BITS(&ipx->dstSkt);
+ dstSkt = EXTRACT_BE_U_2(&ipx->dstSkt);
switch (dstSkt) {
case IPX_SKT_NCP:
ND_PRINT((ndo, "ipx-ncp %d", length));
@@ -152,7 +152,7 @@ ipx_sap_print(netdissect_options *ndo, const u_short *ipx, u_int length)
int command, i;
ND_TCHECK(ipx[0]);
- command = EXTRACT_BE_16BITS(ipx);
+ command = EXTRACT_BE_U_2(ipx);
ipx++;
length -= 2;
@@ -165,7 +165,7 @@ ipx_sap_print(netdissect_options *ndo, const u_short *ipx, u_int length)
ND_PRINT((ndo, "ipx-sap-nearest-req"));
ND_TCHECK(ipx[0]);
- ND_PRINT((ndo, " %s", ipxsap_string(ndo, htons(EXTRACT_BE_16BITS(ipx)))));
+ ND_PRINT((ndo, " %s", ipxsap_string(ndo, htons(EXTRACT_BE_U_2(ipx)))));
break;
case 2:
@@ -177,14 +177,14 @@ ipx_sap_print(netdissect_options *ndo, const u_short *ipx, u_int length)
for (i = 0; i < 8 && length > 0; i++) {
ND_TCHECK(ipx[0]);
- ND_PRINT((ndo, " %s '", ipxsap_string(ndo, htons(EXTRACT_BE_16BITS(ipx)))));
+ ND_PRINT((ndo, " %s '", ipxsap_string(ndo, htons(EXTRACT_BE_U_2(ipx)))));
if (fn_printzp(ndo, (const u_char *)&ipx[1], 48, ndo->ndo_snapend)) {
ND_PRINT((ndo, "'"));
goto trunc;
}
ND_TCHECK2(ipx[25], 10);
ND_PRINT((ndo, "' addr %s",
- ipxaddr_string(EXTRACT_BE_32BITS(ipx + 25), (const u_char *)&ipx[27])));
+ ipxaddr_string(EXTRACT_BE_U_4(ipx + 25), (const u_char *)&ipx[27])));
ipx += 32;
length -= 64;
}
@@ -204,7 +204,7 @@ ipx_rip_print(netdissect_options *ndo, const u_short *ipx, u_int length)
int command, i;
ND_TCHECK(ipx[0]);
- command = EXTRACT_BE_16BITS(ipx);
+ command = EXTRACT_BE_U_2(ipx);
ipx++;
length -= 2;
@@ -213,16 +213,16 @@ ipx_rip_print(netdissect_options *ndo, const u_short *ipx, u_int length)
ND_PRINT((ndo, "ipx-rip-req"));
if (length > 0) {
ND_TCHECK(ipx[3]);
- ND_PRINT((ndo, " %08x/%d.%d", EXTRACT_BE_32BITS(ipx),
- EXTRACT_BE_16BITS(ipx + 2), EXTRACT_BE_16BITS(ipx + 3)));
+ ND_PRINT((ndo, " %08x/%d.%d", EXTRACT_BE_U_4(ipx),
+ EXTRACT_BE_U_2(ipx + 2), EXTRACT_BE_U_2(ipx + 3)));
}
break;
case 2:
ND_PRINT((ndo, "ipx-rip-resp"));
for (i = 0; i < 50 && length > 0; i++) {
ND_TCHECK(ipx[3]);
- ND_PRINT((ndo, " %08x/%d.%d", EXTRACT_BE_32BITS(ipx),
- EXTRACT_BE_16BITS(ipx + 2), EXTRACT_BE_16BITS(ipx + 3)));
+ ND_PRINT((ndo, " %08x/%d.%d", EXTRACT_BE_U_4(ipx),
+ EXTRACT_BE_U_2(ipx + 2), EXTRACT_BE_U_2(ipx + 3)));
ipx += 4;
length -= 8;