void
rx_print(netdissect_options *ndo,
- register const u_char *bp, u_int length, u_int sport, u_int dport,
+ const u_char *bp, u_int length, u_int sport, u_int dport,
const u_char *bp2)
{
- register const struct rx_header *rxh;
+ const struct rx_header *rxh;
uint32_t i;
uint8_t type, flags;
uint32_t opcode;
- if (!ND_TTEST2(*bp, sizeof (struct rx_header))) {
+ if (!ND_TTEST_LEN(bp, sizeof(struct rx_header))) {
ND_PRINT((ndo, " [|rx] (%u)", length));
return;
}
*/
#define FIDOUT() { uint32_t n1, n2, n3; \
- ND_TCHECK2(bp[0], sizeof(uint32_t) * 3); \
+ ND_TCHECK_LEN(bp, sizeof(uint32_t) * 3); \
n1 = EXTRACT_BE_U_4(bp); \
bp += sizeof(uint32_t); \
n2 = EXTRACT_BE_U_4(bp); \
}
#define STROUT(MAX) { uint32_t _i; \
- ND_TCHECK2(bp[0], sizeof(uint32_t)); \
+ ND_TCHECK_LEN(bp, sizeof(uint32_t)); \
_i = EXTRACT_BE_U_4(bp); \
if (_i > (MAX)) \
goto trunc; \
}
#define UINT64OUT() { uint64_t _i; \
- ND_TCHECK2(bp[0], sizeof(uint64_t)); \
+ ND_TCHECK_LEN(bp, sizeof(uint64_t)); \
_i = EXTRACT_BE_U_8(bp); \
bp += sizeof(uint64_t); \
ND_PRINT((ndo, " %" PRIu64, _i)); \
}
#define STOREATTROUT() { uint32_t mask, _i; \
- ND_TCHECK2(bp[0], (sizeof(uint32_t)*6)); \
+ ND_TCHECK_LEN(bp, (sizeof(uint32_t) * 6)); \
mask = EXTRACT_BE_U_4(bp); bp += sizeof(uint32_t); \
if (mask) ND_PRINT((ndo, " StoreStatus")); \
if (mask & 1) { ND_PRINT((ndo, " date")); DATEOUT(); } \
}
#define UBIK_VERSIONOUT() {uint32_t epoch; uint32_t counter; \
- ND_TCHECK2(bp[0], sizeof(uint32_t) * 2); \
+ ND_TCHECK_LEN(bp, sizeof(uint32_t) * 2); \
epoch = EXTRACT_BE_U_4(bp); \
bp += sizeof(uint32_t); \
counter = EXTRACT_BE_U_4(bp); \
}
#define AFSUUIDOUT() {uint32_t temp; int _i; \
- ND_TCHECK2(bp[0], 11*sizeof(uint32_t)); \
+ ND_TCHECK_LEN(bp, 11 * sizeof(uint32_t)); \
temp = EXTRACT_BE_U_4(bp); \
bp += sizeof(uint32_t); \
ND_PRINT((ndo, " %08x", temp)); \
uint32_t k; \
if ((MAX) + 1 > sizeof(s)) \
goto trunc; \
- ND_TCHECK2(bp[0], (MAX) * sizeof(uint32_t)); \
+ ND_TCHECK_LEN(bp, (MAX) * sizeof(uint32_t)); \
sp = s; \
for (k = 0; k < (MAX); k++) { \
*sp++ = (u_char) EXTRACT_BE_U_4(bp); \
}
#define DESTSERVEROUT() { uint32_t n1, n2, n3; \
- ND_TCHECK2(bp[0], sizeof(uint32_t) * 3); \
+ ND_TCHECK_LEN(bp, sizeof(uint32_t) * 3); \
n1 = EXTRACT_BE_U_4(bp); \
bp += sizeof(uint32_t); \
n2 = EXTRACT_BE_U_4(bp); \
static void
fs_print(netdissect_options *ndo,
- register const u_char *bp, u_int length)
+ const u_char *bp, u_int length)
{
uint32_t fs_op;
uint32_t i;
ND_TCHECK_4(bp);
i = EXTRACT_BE_U_4(bp);
bp += sizeof(uint32_t);
- ND_TCHECK2(bp[0], i);
+ ND_TCHECK_LEN(bp, i);
i = min(AFSOPAQUEMAX, i);
strncpy(a, (const char *) bp, i);
a[i] = '\0';
static void
fs_reply_print(netdissect_options *ndo,
- register const u_char *bp, u_int length, uint32_t opcode)
+ const u_char *bp, u_int length, uint32_t opcode)
{
uint32_t i;
const struct rx_header *rxh;
ND_TCHECK_4(bp);
i = EXTRACT_BE_U_4(bp);
bp += sizeof(uint32_t);
- ND_TCHECK2(bp[0], i);
+ ND_TCHECK_LEN(bp, i);
i = min(AFSOPAQUEMAX, i);
strncpy(a, (const char *) bp, i);
a[i] = '\0';
static void
cb_print(netdissect_options *ndo,
- register const u_char *bp, u_int length)
+ const u_char *bp, u_int length)
{
uint32_t cb_op;
uint32_t i;
static void
cb_reply_print(netdissect_options *ndo,
- register const u_char *bp, u_int length, uint32_t opcode)
+ const u_char *bp, u_int length, uint32_t opcode)
{
const struct rx_header *rxh;
uint8_t type;
static void
prot_print(netdissect_options *ndo,
- register const u_char *bp, u_int length)
+ const u_char *bp, u_int length)
{
uint32_t i;
uint32_t pt_op;
static void
prot_reply_print(netdissect_options *ndo,
- register const u_char *bp, u_int length, uint32_t opcode)
+ const u_char *bp, u_int length, uint32_t opcode)
{
const struct rx_header *rxh;
uint8_t type;
static void
vldb_print(netdissect_options *ndo,
- register const u_char *bp, u_int length)
+ const u_char *bp, u_int length)
{
uint32_t vldb_op;
uint32_t i;
static void
vldb_reply_print(netdissect_options *ndo,
- register const u_char *bp, u_int length, uint32_t opcode)
+ const u_char *bp, u_int length, uint32_t opcode)
{
const struct rx_header *rxh;
uint8_t type;
ND_PRINT((ndo, " %u", j));
bp += sizeof(uint32_t);
}
- ND_TCHECK2(bp[0], 8 * sizeof(uint32_t));
+ ND_TCHECK_LEN(bp, 8 * sizeof(uint32_t));
bp += 8 * sizeof(uint32_t);
ND_PRINT((ndo, " rwvol"));
UINTOUT();
ND_PRINT((ndo, " %u", j));
bp += sizeof(uint32_t);
}
- ND_TCHECK2(bp[0], 13 * sizeof(uint32_t));
+ ND_TCHECK_LEN(bp, 13 * sizeof(uint32_t));
bp += 13 * sizeof(uint32_t);
ND_PRINT((ndo, " rwvol"));
UINTOUT();
ND_PRINT((ndo, " afsuuid"));
AFSUUIDOUT();
} else {
- ND_TCHECK2(bp[0], 44);
+ ND_TCHECK_LEN(bp, 44);
bp += 44;
}
}
- ND_TCHECK2(bp[0], 4 * 13);
+ ND_TCHECK_LEN(bp, 4 * 13);
bp += 4 * 13;
ND_PRINT((ndo, " partitions"));
for (i = 0; i < 13; i++) {
ND_PRINT((ndo, " %u", j));
bp += sizeof(uint32_t);
}
- ND_TCHECK2(bp[0], 13 * sizeof(uint32_t));
+ ND_TCHECK_LEN(bp, 13 * sizeof(uint32_t));
bp += 13 * sizeof(uint32_t);
ND_PRINT((ndo, " rwvol"));
UINTOUT();
static void
kauth_print(netdissect_options *ndo,
- register const u_char *bp, u_int length)
+ const u_char *bp, u_int length)
{
uint32_t kauth_op;
ND_TCHECK_4(bp);
i = EXTRACT_BE_U_4(bp);
bp += sizeof(uint32_t);
- ND_TCHECK2(bp[0], i);
+ ND_TCHECK_LEN(bp, i);
bp += i;
ND_PRINT((ndo, " principal"));
STROUT(KANAMEMAX);
static void
kauth_reply_print(netdissect_options *ndo,
- register const u_char *bp, u_int length, uint32_t opcode)
+ const u_char *bp, u_int length, uint32_t opcode)
{
const struct rx_header *rxh;
uint8_t type;
static void
vol_print(netdissect_options *ndo,
- register const u_char *bp, u_int length)
+ const u_char *bp, u_int length)
{
uint32_t vol_op;
static void
vol_reply_print(netdissect_options *ndo,
- register const u_char *bp, u_int length, uint32_t opcode)
+ const u_char *bp, u_int length, uint32_t opcode)
{
const struct rx_header *rxh;
uint8_t type;
static void
bos_print(netdissect_options *ndo,
- register const u_char *bp, u_int length)
+ const u_char *bp, u_int length)
{
uint32_t bos_op;
static void
bos_reply_print(netdissect_options *ndo,
- register const u_char *bp, u_int length, uint32_t opcode)
+ const u_char *bp, u_int length, uint32_t opcode)
{
const struct rx_header *rxh;
uint8_t type;
static void
ubik_print(netdissect_options *ndo,
- register const u_char *bp)
+ const u_char *bp)
{
uint32_t ubik_op;
uint32_t temp;
static void
ubik_reply_print(netdissect_options *ndo,
- register const u_char *bp, u_int length, uint32_t opcode)
+ const u_char *bp, u_int length, uint32_t opcode)
{
const struct rx_header *rxh;
uint8_t type;
static void
rx_ack_print(netdissect_options *ndo,
- register const u_char *bp, u_int length)
+ const u_char *bp, u_int length)
{
const struct rx_ackPacket *rxa;
uint8_t nAcks;
bp += sizeof(struct rx_header);
- ND_TCHECK2(bp[0], sizeof(struct rx_ackPacket));
+ ND_TCHECK_LEN(bp, sizeof(struct rx_ackPacket));
rxa = (const struct rx_ackPacket *) bp;
bp += sizeof(struct rx_ackPacket);
nAcks = EXTRACT_U_1(rxa->nAcks);
if (nAcks != 0) {
- ND_TCHECK2(bp[0], nAcks);
+ ND_TCHECK_LEN(bp, nAcks);
/*
* Sigh, this is gross, but it seems to work to collapse