- if (family == 0xFFFF) {
- if (EXTRACT_16BITS(&ni->rip_tag) == 2) {
- memcpy(buf, &ni->rip_dest, sizeof(buf));
- buf[sizeof(buf)-1] = '\0';
- for (p = buf; *p; p++) {
- if (!isprint(*p))
- break;
- }
- if (!*p) {
- printf(" [password %s]", buf);
- } else {
- printf(" [password: ");
- rip_printblk((u_char *)&ni->rip_dest,
- (u_char *)&ni->rip_metric +
- sizeof(ni->rip_metric));
- printf("]");
- }
+ if (family == 0xFFFF) { /* variable-sized authentication structures */
+ uint16_t auth_type = EXTRACT_16BITS(&ni->rip_tag);
+ if (auth_type == 2) {
+ register const u_char *p = (const u_char *)&ni->rip_dest;
+ u_int i = 0;
+ ND_PRINT((ndo, "\n\t Simple Text Authentication data: "));
+ for (; i < RIP_AUTHLEN; p++, i++)
+ ND_PRINT((ndo, "%c", ND_ISPRINT(*p) ? *p : '.'));
+ } else if (auth_type == 3) {
+ ND_PRINT((ndo, "\n\t Auth header:"));
+ ND_PRINT((ndo, " Packet Len %u,", EXTRACT_16BITS((const uint8_t *)ni + 4)));
+ ND_PRINT((ndo, " Key-ID %u,", *((const uint8_t *)ni + 6)));
+ ND_PRINT((ndo, " Auth Data Len %u,", *((const uint8_t *)ni + 7)));
+ ND_PRINT((ndo, " SeqNo %u,", EXTRACT_32BITS(&ni->rip_dest_mask)));
+ ND_PRINT((ndo, " MBZ %u,", EXTRACT_32BITS(&ni->rip_router)));
+ ND_PRINT((ndo, " MBZ %u", EXTRACT_32BITS(&ni->rip_metric)));
+ } else if (auth_type == 1) {
+ ND_PRINT((ndo, "\n\t Auth trailer:"));
+ print_unknown_data(ndo, (const uint8_t *)&ni->rip_dest, "\n\t ", remaining);
+ return remaining; /* AT spans till the packet end */