/* \summary: Common Address Redundancy Protocol (CARP) printer */
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
-#include <netdissect-stdinc.h>
+#include "netdissect-stdinc.h"
#include "netdissect.h" /* for checksum structure and functions */
#include "extract.h"
void
-carp_print(netdissect_options *ndo, const u_char *bp, u_int len, int ttl)
+carp_print(netdissect_options *ndo, const u_char *bp, u_int len, u_int ttl)
{
- int version, type;
+ u_int version, type;
const char *type_s;
+ ndo->ndo_protocol = "carp";
ND_TCHECK_1(bp);
version = (EXTRACT_U_1(bp) & 0xf0) >> 4;
type = EXTRACT_U_1(bp) & 0x0f;
type_s = "advertise";
else
type_s = "unknown";
- ND_PRINT("CARPv%d-%s %d: ", version, type_s, len);
+ ND_PRINT("CARPv%u-%s %u: ", version, type_s, len);
if (ttl != 255)
- ND_PRINT("[ttl=%d!] ", ttl);
+ ND_PRINT("[ttl=%u!] ", ttl);
if (version != 2 || type != 1)
return;
ND_TCHECK_1(bp + 2);
ND_TCHECK_1(bp + 5);
- ND_PRINT("vhid=%d advbase=%d advskew=%d authlen=%d ",
+ ND_PRINT("vhid=%u advbase=%u advskew=%u authlen=%u ",
EXTRACT_U_1(bp + 1), EXTRACT_U_1(bp + 5), EXTRACT_U_1(bp + 2), EXTRACT_U_1(bp + 3));
if (ndo->ndo_vflag) {
struct cksum_vec vec[1];
return;
trunc:
- ND_PRINT("[|carp]");
+ nd_print_trunc(ndo);
}