if ((i % 3) != 0) lprintf(T_IPHDR, "\n"); break;
lprintf(T_ADDR, "%-20s%-3u", ipaddmask, get32(data + 16));  if ((++i % 3) == 0) lprintf(T_IPHDR, "\n");  length -= RIP_ENTRY; data += RIP_ENTRY; }  if ((i % 3) != 0) lprintf(T_IPHDR, "\n"); break;
void rip_dump(unsigned char *data, int length){	int i;	int cmd;	int version;	int domain;	char ipaddmask[25];    	lprintf(T_PROTOCOL, "RIP: ");	cmd     = data[0];	version = data[1];	domain  = get16(data + 2);	length -= RIP_HEADER;	data   += RIP_HEADER;	switch (cmd)	{		case RIPCMD_REQUEST:			lprintf(T_IPHDR, "REQUEST");			break;		case RIPCMD_RESPONSE:			lprintf(T_IPHDR, "RESPONSE");			break;		default:			lprintf(T_IPHDR, " cmd %u", cmd);			break;	}  	switch (version)	{		case RIP_VERSION_98:	/* IPGATE **/			lprintf(T_IPHDR, " vers %u entries %u\n", version, length / RIP98_ENTRY);        			i = 0;			while (length >= RIP98_ENTRY)			{				sprintf(ipaddmask, "%u.%u.%u.%u/%-2u", data[0], data[1], data[2], data[3], data[4]);				lprintf(T_ADDR, "%-16s %-3u ", ipaddmask, data[5]);				if ((++i % 3) == 0) lprintf(T_IPHDR, "\n");				length -= RIP98_ENTRY;				data   += RIP98_ENTRY;			}			if ((i % 3) != 0) lprintf(T_IPHDR, "\n");			break;		default:			lprintf(T_IPHDR, " vers %u entries %u domain %u:\n", version, length / RIP_ENTRY, domain);			i = 0;			while (length >= RIP_ENTRY)			{				if (get16(data + 0) != RIP_AF_INET)				{					/* Skip non-IP addresses */					length -= RIP_ENTRY;					data   += RIP_ENTRY;					continue;				}				if (version >= RIP_VERSION_2)				{					sprintf(ipaddmask, "%u.%u.%u.%u/%-4d", data[4], data[5], data[6], data[7],						mask2width(get32(data + 8)));				}				else				{					sprintf(ipaddmask, "%u.%u.%u.%u/??", data[4], data[5], data[6], data[7]);				}				lprintf(T_ADDR, "%-20s%-3u", ipaddmask, get32(data + 16));				if ((++i % 3) == 0) lprintf(T_IPHDR, "\n");				length -= RIP_ENTRY;				data   += RIP_ENTRY;			}			if ((i % 3) != 0) lprintf(T_IPHDR, "\n");			break;	}}