*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <netdissect-stdinc.h>
+#include "netdissect-stdinc.h"
#include "netdissect.h"
#include "addrtoname.h"
uint8_t type, flags;
uint32_t opcode;
+ ndo->ndo_protocol = "rx";
if (!ND_TTEST_LEN(bp, sizeof(struct rx_header))) {
ND_PRINT(" [|rx] (%u)", length);
return;
rx_cache_next = 0;
rxent->callnum = EXTRACT_BE_U_4(rxh->callNumber);
- UNALIGNED_MEMCPY(&rxent->client, &ip->ip_src, sizeof(uint32_t));
- UNALIGNED_MEMCPY(&rxent->server, &ip->ip_dst, sizeof(uint32_t));
+ UNALIGNED_MEMCPY(&rxent->client, ip->ip_src, sizeof(uint32_t));
+ UNALIGNED_MEMCPY(&rxent->server, ip->ip_dst, sizeof(uint32_t));
rxent->dport = dport;
rxent->serviceId = EXTRACT_BE_U_4(rxh->serviceId);
rxent->opcode = EXTRACT_BE_U_4(bp + sizeof(struct rx_header));
uint32_t clip;
uint32_t sip;
- UNALIGNED_MEMCPY(&clip, &ip->ip_dst, sizeof(uint32_t));
- UNALIGNED_MEMCPY(&sip, &ip->ip_src, sizeof(uint32_t));
+ UNALIGNED_MEMCPY(&clip, ip->ip_dst, sizeof(uint32_t));
+ UNALIGNED_MEMCPY(&sip, ip->ip_src, sizeof(uint32_t));
/* Start the search where we last left off */
}
/*
- * These extrememly grody macros handle the printing of various AFS stuff.
+ * These extremely grody macros handle the printing of various AFS stuff.
*/
#define FIDOUT() { uint32_t n1, n2, n3; \
goto trunc; \
bp += sizeof(uint32_t); \
ND_PRINT(" \""); \
- if (fn_printn(ndo, bp, _i, ndo->ndo_snapend)) \
+ if (nd_printn(ndo, bp, _i, ndo->ndo_snapend)) \
goto trunc; \
ND_PRINT("\""); \
bp += ((_i + sizeof(uint32_t) - 1) / sizeof(uint32_t)) * sizeof(uint32_t); \
} \
s[(MAX)] = '\0'; \
ND_PRINT(" \""); \
- fn_print(ndo, s, NULL); \
+ fn_print_str(ndo, s); \
ND_PRINT("\""); \
}
}
if (j == 0)
ND_PRINT(" <none!>");
+ break;
}
case 65537: /* Fetch data 64 */
FIDOUT();
char fmt[1024];
if ((user = (char *)malloc(maxsize)) == NULL)
- return;
+ (*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC, "acl_print: malloc");
if (sscanf((char *) s, "%d %d\n%n", &pos, &neg, &n) != 2)
goto finish;
acl & PRSFS_ADMINISTER ? "a" : "");
for (i = 0; i < pos; i++) {
- snprintf(fmt, sizeof(fmt), "%%%ds %%d\n%%n", maxsize - 1);
+ nd_snprintf(fmt, sizeof(fmt), "%%%ds %%d\n%%n", maxsize - 1);
if (sscanf((char *) s, fmt, user, &acl, &n) != 2)
goto finish;
s += n;
ND_PRINT(" +{");
- fn_print(ndo, (u_char *)user, NULL);
+ fn_print_str(ndo, (u_char *)user);
ND_PRINT(" ");
ACLOUT(acl);
ND_PRINT("}");
}
for (i = 0; i < neg; i++) {
- snprintf(fmt, sizeof(fmt), "%%%ds %%d\n%%n", maxsize - 1);
+ nd_snprintf(fmt, sizeof(fmt), "%%%ds %%d\n%%n", maxsize - 1);
if (sscanf((char *) s, fmt, user, &acl, &n) != 2)
goto finish;
s += n;
ND_PRINT(" -{");
- fn_print(ndo, (u_char *)user, NULL);
+ fn_print_str(ndo, (u_char *)user);
ND_PRINT(" ");
ACLOUT(acl);
ND_PRINT("}");
bp += sizeof(uint32_t);
tok2str(cb_types, "type %u", t);
}
+ break;
}
case 214: {
ND_PRINT(" afsuuid");
INTOUT();
ND_PRINT(" nextindex");
INTOUT();
+ ND_FALL_THROUGH;
case 503: /* Get entry by id */
case 504: /* Get entry by name */
{ uint32_t nservers, j;
ND_TCHECK_4(bp);
if (i < nservers)
ND_PRINT(" %s",
- intoa(((const struct in_addr *) bp)->s_addr));
- bp += sizeof(uint32_t);
+ intoa(EXTRACT_IPV4_TO_NETWORK_ORDER(bp)));
+ bp += sizeof(nd_ipv4);
}
ND_PRINT(" partitions");
for (i = 0; i < 8; i++) {
INTOUT();
ND_PRINT(" nextindex");
INTOUT();
+ ND_FALL_THROUGH;
case 518: /* Get entry by ID N */
case 519: /* Get entry by name N */
{ uint32_t nservers, j;
ND_TCHECK_4(bp);
if (i < nservers)
ND_PRINT(" %s",
- intoa(((const struct in_addr *) bp)->s_addr));
- bp += sizeof(uint32_t);
+ intoa(EXTRACT_IPV4_TO_NETWORK_ORDER(bp)));
+ bp += sizeof(nd_ipv4);
}
ND_PRINT(" partitions");
for (i = 0; i < 13; i++) {
*/
if (ndo->ndo_vflag > 2)
- ND_PRINT(" bufspace %u maxskew %d",
+ ND_PRINT(" bufspace %u maxskew %u",
EXTRACT_BE_U_2(rxa->bufferSpace),
EXTRACT_BE_U_2(rxa->maxSkew));
* the range (such as an nacked packet in
* the middle of some acked packets),
* then print the current packet number
- * seperated from the last number by
+ * separated from the last number by
* a comma.
*/
* we hit a nack ... in _this_ case we
* want to print out the range of packets
* that were acked, so we need to print
- * the _previous_ packet number seperated
+ * the _previous_ packet number separated
* from the first by a dash (-). Since we
* already printed the first packet above,
* just print the final packet. Don't