- const u_char *rrcp;
- u_int8_t rrcp_proto;
- u_int8_t rrcp_opcode;
- register const struct ether_header *ep;
- char proto_str[16];
- char opcode_str[32];
-
- ep = (const struct ether_header *)cp;
- rrcp = cp + ETHER_HDRLEN;
-
- ND_TCHECK(*(rrcp + RRCP_PROTO_OFFSET));
- rrcp_proto = *(rrcp + RRCP_PROTO_OFFSET);
- ND_TCHECK(*(rrcp + RRCP_OPCODE_ISREPLY_OFFSET));
- rrcp_opcode = (*(rrcp + RRCP_OPCODE_ISREPLY_OFFSET)) & RRCP_OPCODE_MASK;
- ND_PRINT((ndo, "%s > %s, %s %s",
- etheraddr_string(ESRC(ep)),
- etheraddr_string(EDST(ep)),
- tok2strbuf(proto_values,"RRCP-0x%02d",rrcp_proto,proto_str,sizeof(proto_str)),
- ((*(rrcp + RRCP_OPCODE_ISREPLY_OFFSET)) & RRCP_ISREPLY) ? "reply" : "query"));
+ uint8_t rrcp_proto;
+ uint8_t rrcp_opcode;
+
+ ND_TCHECK_1(cp + RRCP_PROTO_OFFSET);
+ rrcp_proto = EXTRACT_U_1(cp + RRCP_PROTO_OFFSET);
+ ND_TCHECK_1(cp + RRCP_OPCODE_ISREPLY_OFFSET);
+ rrcp_opcode = EXTRACT_U_1((cp + RRCP_OPCODE_ISREPLY_OFFSET)) & RRCP_OPCODE_MASK;
+ if (src != NULL && dst != NULL) {
+ ND_PRINT((ndo, "%s > %s, ",
+ (src->addr_string)(ndo, src->addr),
+ (dst->addr_string)(ndo, dst->addr)));
+ }
+ ND_PRINT((ndo, "%s %s",
+ tok2str(proto_values,"RRCP-0x%02x",rrcp_proto),
+ ((EXTRACT_U_1(cp + RRCP_OPCODE_ISREPLY_OFFSET)) & RRCP_ISREPLY) ? "reply" : "query"));