uint16_t flags;
uint16_t op_msk;
const char *s;
- int (*print) (netdissect_options *ndo, register const u_char * pptr, register u_int len,
+ int (*print) (netdissect_options *ndo, const u_char * pptr, u_int len,
uint16_t op_msk, int indent);
};
*/
struct forcesh {
nd_uint8_t fm_vrsvd; /* version and reserved */
-#define ForCES_V(forcesh) ((forcesh)->fm_vrsvd >> 4)
+#define ForCES_V(forcesh) (EXTRACT_U_1((forcesh)->fm_vrsvd) >> 4)
nd_uint8_t fm_tom; /* type of message */
nd_uint16_t fm_len; /* total length * 4 bytes */
-#define ForCES_BLN(forcesh) ((uint32_t)(EXTRACT_BE_U_2(&(forcesh)->fm_len) << 2))
+#define ForCES_BLN(forcesh) ((uint32_t)(EXTRACT_BE_U_2((forcesh)->fm_len) << 2))
nd_uint32_t fm_sid; /* Source ID */
-#define ForCES_SID(forcesh) EXTRACT_BE_U_4(&(forcesh)->fm_sid)
+#define ForCES_SID(forcesh) EXTRACT_BE_U_4((forcesh)->fm_sid)
nd_uint32_t fm_did; /* Destination ID */
-#define ForCES_DID(forcesh) EXTRACT_BE_U_4(&(forcesh)->fm_did)
+#define ForCES_DID(forcesh) EXTRACT_BE_U_4((forcesh)->fm_did)
nd_uint8_t fm_cor[8]; /* correlator */
nd_uint32_t fm_flags; /* flags */
-#define ForCES_ACK(forcesh) ((EXTRACT_BE_U_4(&(forcesh)->fm_flags)&0xC0000000) >> 30)
-#define ForCES_PRI(forcesh) ((EXTRACT_BE_U_4(&(forcesh)->fm_flags)&0x38000000) >> 27)
-#define ForCES_RS1(forcesh) ((EXTRACT_BE_U_4(&(forcesh)->fm_flags)&0x07000000) >> 24)
-#define ForCES_EM(forcesh) ((EXTRACT_BE_U_4(&(forcesh)->fm_flags)&0x00C00000) >> 22)
-#define ForCES_AT(forcesh) ((EXTRACT_BE_U_4(&(forcesh)->fm_flags)&0x00200000) >> 21)
-#define ForCES_TP(forcesh) ((EXTRACT_BE_U_4(&(forcesh)->fm_flags)&0x00180000) >> 19)
-#define ForCES_RS2(forcesh) ((EXTRACT_BE_U_4(&(forcesh)->fm_flags)&0x0007FFFF) >> 0)
+#define ForCES_ACK(forcesh) ((EXTRACT_BE_U_4((forcesh)->fm_flags)&0xC0000000) >> 30)
+#define ForCES_PRI(forcesh) ((EXTRACT_BE_U_4((forcesh)->fm_flags)&0x38000000) >> 27)
+#define ForCES_RS1(forcesh) ((EXTRACT_BE_U_4((forcesh)->fm_flags)&0x07000000) >> 24)
+#define ForCES_EM(forcesh) ((EXTRACT_BE_U_4((forcesh)->fm_flags)&0x00C00000) >> 22)
+#define ForCES_AT(forcesh) ((EXTRACT_BE_U_4((forcesh)->fm_flags)&0x00200000) >> 21)
+#define ForCES_TP(forcesh) ((EXTRACT_BE_U_4((forcesh)->fm_flags)&0x00180000) >> 19)
+#define ForCES_RS2(forcesh) ((EXTRACT_BE_U_4((forcesh)->fm_flags)&0x0007FFFF) >> 0)
};
#define ForCES_HLN_VALID(fhl,tlen) ((tlen) >= ForCES_HDRL && \
uint16_t flags;
uint16_t op_msk;
const char *s;
- int (*print) (netdissect_options *ndo, register const u_char * pptr, register u_int len,
+ int (*print) (netdissect_options *ndo, const u_char * pptr, u_int len,
uint16_t op_msk, int indent);
};
-static int genoptlv_print(netdissect_options *, register const u_char * pptr, register u_int len,
+static int genoptlv_print(netdissect_options *, const u_char * pptr, u_int len,
uint16_t op_msk, int indent);
-static int recpdoptlv_print(netdissect_options *, register const u_char * pptr, register u_int len,
+static int recpdoptlv_print(netdissect_options *, const u_char * pptr, u_int len,
uint16_t op_msk, int indent);
-static int invoptlv_print(netdissect_options *, register const u_char * pptr, register u_int len,
+static int invoptlv_print(netdissect_options *, const u_char * pptr, u_int len,
uint16_t op_msk, int indent);
#define OP_MIN_SIZ 8
return 0;
}
-static int lfbselect_print(netdissect_options *, register const u_char * pptr, register u_int len,
+static int lfbselect_print(netdissect_options *, const u_char * pptr, u_int len,
uint16_t op_msk, int indent);
-static int redirect_print(netdissect_options *, register const u_char * pptr, register u_int len,
+static int redirect_print(netdissect_options *, const u_char * pptr, u_int len,
uint16_t op_msk, int indent);
-static int asrtlv_print(netdissect_options *, register const u_char * pptr, register u_int len,
+static int asrtlv_print(netdissect_options *, const u_char * pptr, u_int len,
uint16_t op_msk, int indent);
-static int asttlv_print(netdissect_options *, register const u_char * pptr, register u_int len,
+static int asttlv_print(netdissect_options *, const u_char * pptr, u_int len,
uint16_t op_msk, int indent);
struct forces_lfbsh {
uint16_t flags;
uint16_t op_msk;
const char *s;
- int (*print) (netdissect_options *, register const u_char * pptr, register u_int len,
+ int (*print) (netdissect_options *, const u_char * pptr, u_int len,
uint16_t op_msk, int indent);
};
nd_uint16_t resv2;
};
-static int prestlv_print(netdissect_options *, register const u_char * pptr, register u_int len,
+static int prestlv_print(netdissect_options *, const u_char * pptr, u_int len,
uint16_t op_msk, int indent);
-static int pkeyitlv_print(netdissect_options *, register const u_char * pptr, register u_int len,
+static int pkeyitlv_print(netdissect_options *, const u_char * pptr, u_int len,
uint16_t op_msk, int indent);
-static int fdatatlv_print(netdissect_options *, register const u_char * pptr, register u_int len,
+static int fdatatlv_print(netdissect_options *, const u_char * pptr, u_int len,
uint16_t op_msk, int indent);
-static int sdatatlv_print(netdissect_options *, register const u_char * pptr, register u_int len,
+static int sdatatlv_print(netdissect_options *, const u_char * pptr, u_int len,
uint16_t op_msk, int indent);
static const struct pdata_ops ForCES_pdata[PD_MAX_IND + 1] = {
static int
prestlv_print(netdissect_options *ndo,
- register const u_char * pptr, register u_int len,
+ const u_char * pptr, u_int len,
uint16_t op_msk _U_, int indent)
{
const struct forces_tlv *tlv = (const struct forces_tlv *)pptr;
- register const u_char *tdp = (const u_char *) TLV_DATA(tlv);
+ const u_char *tdp = (const u_char *) TLV_DATA(tlv);
const struct res_val *r = (const struct res_val *)tdp;
u_int dlen;
+ uint8_t result;
/*
* pdatacnt_print() has ensured that len (the TLV length)
}
ND_TCHECK(*r);
- if (r->result >= 0x18 && r->result <= 0xFE) {
- ND_PRINT((ndo, "illegal reserved result code: 0x%x!\n", r->result));
+ result = EXTRACT_U_1(r->result);
+ if (result >= 0x18 && result <= 0xFE) {
+ ND_PRINT((ndo, "illegal reserved result code: 0x%x!\n", result));
return -1;
}
if (ndo->ndo_vflag >= 3) {
char *ib = indent_pr(indent, 0);
ND_PRINT((ndo, "%s Result: %s (code 0x%x)\n", ib,
- tok2str(ForCES_errs, NULL, r->result), r->result));
+ tok2str(ForCES_errs, NULL, result), result));
}
return 0;
static int
fdatatlv_print(netdissect_options *ndo,
- register const u_char * pptr, register u_int len,
+ const u_char * pptr, u_int len,
uint16_t op_msk _U_, int indent)
{
const struct forces_tlv *tlv = (const struct forces_tlv *)pptr;
u_int rlen;
- register const u_char *tdp = (const u_char *) TLV_DATA(tlv);
+ const u_char *tdp = (const u_char *) TLV_DATA(tlv);
uint16_t type;
/*
static int
sdatailv_print(netdissect_options *ndo,
- register const u_char * pptr, register u_int len,
+ const u_char * pptr, u_int len,
uint16_t op_msk _U_, int indent)
{
u_int rlen;
ND_PRINT((ndo, "Jamal - outstanding length <%d>\n", rlen));
#endif
char *ib = indent_pr(indent, 1);
- register const u_char *tdp = (const u_char *) ILV_DATA(ilv);
+ const u_char *tdp = (const u_char *) ILV_DATA(ilv);
ND_TCHECK(*ilv);
invilv = ilv_valid(ilv, rlen);
if (invilv) {
static int
sdatatlv_print(netdissect_options *ndo,
- register const u_char * pptr, register u_int len,
+ const u_char * pptr, u_int len,
uint16_t op_msk, int indent)
{
const struct forces_tlv *tlv = (const struct forces_tlv *)pptr;
u_int rlen;
- register const u_char *tdp = (const u_char *) TLV_DATA(tlv);
+ const u_char *tdp = (const u_char *) TLV_DATA(tlv);
uint16_t type;
/*
static int
pkeyitlv_print(netdissect_options *ndo,
- register const u_char * pptr, register u_int len,
+ const u_char * pptr, u_int len,
uint16_t op_msk, int indent)
{
const struct forces_tlv *tlv = (const struct forces_tlv *)pptr;
- register const u_char *tdp = (const u_char *) TLV_DATA(tlv);
- register const u_char *dp = tdp + 4;
+ const u_char *tdp = (const u_char *) TLV_DATA(tlv);
+ const u_char *dp = tdp + 4;
const struct forces_tlv *kdtlv = (const struct forces_tlv *)dp;
uint32_t id;
char *ib = indent_pr(indent, 0);
uint16_t type, tll;
u_int invtlv;
- ND_TCHECK(*tdp);
+ ND_TCHECK_1(tdp);
id = EXTRACT_BE_U_4(tdp);
ND_PRINT((ndo, "%sKeyinfo: Key 0x%x\n", ib, id));
ND_TCHECK(*kdtlv);
static int
pdatacnt_print(netdissect_options *ndo,
- register const u_char * pptr, register u_int len,
+ const u_char * pptr, u_int len,
uint16_t IDcnt, uint16_t op_msk, int indent)
{
u_int i;
ND_PRINT((ndo, "%sTABLE APPEND\n", ib));
}
for (i = 0; i < IDcnt; i++) {
- ND_TCHECK2(*pptr, 4);
+ ND_TCHECK_4(pptr);
if (len < 4)
goto trunc;
id = EXTRACT_BE_U_4(pptr);
static int
pdata_print(netdissect_options *ndo,
- register const u_char * pptr, register u_int len,
+ const u_char * pptr, u_int len,
uint16_t op_msk, int indent)
{
const struct pathdata_h *pdh = (const struct pathdata_h *)pptr;
static int
genoptlv_print(netdissect_options *ndo,
- register const u_char * pptr, register u_int len,
+ const u_char * pptr, u_int len,
uint16_t op_msk, int indent)
{
const struct forces_tlv *pdtlv = (const struct forces_tlv *)pptr;
* length is large enough but not too large (it doesn't
* go past the end of the containing TLV).
*/
- register const u_char *dp = (const u_char *) TLV_DATA(pdtlv);
+ const u_char *dp = (const u_char *) TLV_DATA(pdtlv);
if (!ttlv_valid(type)) {
ND_PRINT((ndo, "%s TLV type 0x%x len %d\n",
tok2str(ForCES_TLV_err, NULL, invtlv), type,
static int
recpdoptlv_print(netdissect_options *ndo,
- register const u_char * pptr, register u_int len,
+ const u_char * pptr, u_int len,
uint16_t op_msk, int indent)
{
const struct forces_tlv *pdtlv = (const struct forces_tlv *)pptr;
int tll;
u_int invtlv;
uint16_t type;
- register const u_char *dp;
+ const u_char *dp;
char *ib;
while (len != 0) {
static int
invoptlv_print(netdissect_options *ndo,
- register const u_char * pptr, register u_int len,
+ const u_char * pptr, u_int len,
uint16_t op_msk _U_, int indent)
{
char *ib = indent_pr(indent, 1);
const struct forces_tlv *otlv, uint16_t op_msk _U_, int indent)
{
int rc = 0;
- register const u_char *dp = (const u_char *) TLV_DATA(otlv);
+ const u_char *dp = (const u_char *) TLV_DATA(otlv);
uint16_t type;
int tll;
char *ib = indent_pr(indent, 0);
#define ASTMCD 255
static int
asttlv_print(netdissect_options *ndo,
- register const u_char * pptr, register u_int len,
+ const u_char * pptr, u_int len,
uint16_t op_msk _U_, int indent)
{
uint32_t rescode;
ND_PRINT((ndo, "illegal ASTresult-TLV: %d bytes!\n", dlen));
return -1;
}
- ND_TCHECK2(*pptr, 4);
+ ND_TCHECK_4(pptr);
rescode = EXTRACT_BE_U_4(pptr);
if (rescode > ASTMCD) {
ND_PRINT((ndo, "illegal ASTresult result code: %d!\n", rescode));
#define ASRMCD 3
static int
asrtlv_print(netdissect_options *ndo,
- register const u_char * pptr, register u_int len,
+ const u_char * pptr, u_int len,
uint16_t op_msk _U_, int indent)
{
uint32_t rescode;
ND_PRINT((ndo, "illegal ASRresult-TLV: %d bytes!\n", dlen));
return -1;
}
- ND_TCHECK2(*pptr, 4);
+ ND_TCHECK_4(pptr);
rescode = EXTRACT_BE_U_4(pptr);
if (rescode > ASRMCD) {
*/
static int
gentltlv_print(netdissect_options *ndo,
- register const u_char * pptr _U_, register u_int len,
+ const u_char * pptr _U_, u_int len,
uint16_t op_msk _U_, int indent _U_)
{
u_int dlen = len - TLV_HDRL;
static int
print_metailv(netdissect_options *ndo,
- register const u_char * pptr, uint16_t op_msk _U_, int indent)
+ const u_char * pptr, uint16_t op_msk _U_, int indent)
{
u_int rlen;
char *ib = indent_pr(indent, 0);
static int
print_metatlv(netdissect_options *ndo,
- register const u_char * pptr, register u_int len,
+ const u_char * pptr, u_int len,
uint16_t op_msk _U_, int indent)
{
u_int dlen;
static int
print_reddata(netdissect_options *ndo,
- register const u_char * pptr, register u_int len,
+ const u_char * pptr, u_int len,
uint16_t op_msk _U_, int indent)
{
u_int dlen;
static int
redirect_print(netdissect_options *ndo,
- register const u_char * pptr, register u_int len,
+ const u_char * pptr, u_int len,
uint16_t op_msk _U_, int indent)
{
const struct forces_tlv *tlv = (const struct forces_tlv *)pptr;
static int
lfbselect_print(netdissect_options *ndo,
- register const u_char * pptr, register u_int len,
+ const u_char * pptr, u_int len,
uint16_t op_msk, int indent)
{
const struct forces_lfbsh *lfbs;
static int
forces_type_print(netdissect_options *ndo,
- register const u_char * pptr, const struct forcesh *fhdr _U_,
- register u_int mlen, const struct tom_h *tops)
+ const u_char * pptr, const struct forcesh *fhdr _U_,
+ u_int mlen, const struct tom_h *tops)
{
const struct forces_tlv *tltlv;
u_int rlen;
void
forces_print(netdissect_options *ndo,
- register const u_char * pptr, register u_int len)
+ const u_char * pptr, u_int len)
{
const struct forcesh *fhdr;
u_int mlen;
uint32_t flg_raw;
+ uint8_t tom;
const struct tom_h *tops;
int rc = 0;
fhdr = (const struct forcesh *)pptr;
ND_TCHECK(*fhdr);
- if (!tom_valid(fhdr->fm_tom)) {
- ND_PRINT((ndo, "Invalid ForCES message type %d\n", fhdr->fm_tom));
+ tom = EXTRACT_U_1(fhdr->fm_tom);
+ if (!tom_valid(tom)) {
+ ND_PRINT((ndo, "Invalid ForCES message type %d\n", tom));
goto error;
}
mlen = ForCES_BLN(fhdr);
- tops = get_forces_tom(fhdr->fm_tom);
+ tops = get_forces_tom(tom);
if (tops->v == TOM_RSVD) {
- ND_PRINT((ndo, "\n\tUnknown ForCES message type=0x%x", fhdr->fm_tom));
+ ND_PRINT((ndo, "\n\tUnknown ForCES message type=0x%x", tom));
goto error;
}
goto error;
}
- ND_TCHECK2(*(pptr + 20), 4);
+ ND_TCHECK_4(pptr + 20);
flg_raw = EXTRACT_BE_U_4(pptr + 20);
if (ndo->ndo_vflag >= 1) {
ND_PRINT((ndo, "\n\tForCES Version %d len %uB flags 0x%08x ",