- printf("keepalive: mineseen=0x%08x yourseen=0x%08x ",
- (u_int32_t)ntohl(slarp->un.keep.myseq),
- (u_int32_t)ntohl(slarp->un.keep.yourseq));
- printf("reliability=0x%04x t1=%d.%d",
- ntohs(slarp->un.keep.rel), ntohs(slarp->un.keep.t1),
- ntohs(slarp->un.keep.t2));
+ ND_PRINT((ndo, "keepalive: mineseen=0x%08x, yourseen=0x%08x, reliability=0x%04x",
+ EXTRACT_32BITS(&slarp->un.keep.myseq),
+ EXTRACT_32BITS(&slarp->un.keep.yourseq),
+ EXTRACT_16BITS(&slarp->un.keep.rel)));
+
+ if (length >= SLARP_MAX_LEN) { /* uptime-stamp is optional */
+ cp += SLARP_MIN_LEN;
+ ND_TCHECK2(*cp, 4);
+ sec = EXTRACT_32BITS(cp) / 1000;
+ min = sec / 60; sec -= min * 60;
+ hrs = min / 60; min -= hrs * 60;
+ days = hrs / 24; hrs -= days * 24;
+ ND_PRINT((ndo, ", link uptime=%ud%uh%um%us",days,hrs,min,sec));
+ }