*
* Reference documentation:
- * http://www.cisco.com/univercd/cc/td/doc/product/lan/trsrb/frames.htm
+ * https://web.archive.org/web/20000914194913/http://www.cisco.com/univercd/cc/td/doc/product/lan/trsrb/frames.pdf
*/
/* \summary: Cisco Discovery Protocol (CDP) printer */
cdp_print(netdissect_options *ndo,
const u_char *pptr, u_int length, u_int caplen)
{
- u_int type, len, i, j;
+ u_int type, len, i;
const u_char *tptr;
ndo->ndo_protocol = "cdp";
case 0x05: /* Version */
ND_PRINT("\n\t ");
for (i=0;i<len;i++) {
- j = GET_U_1(tptr + i);
- if (j == '\n') /* lets rework the version string to
+ u_char c;
+
+ c = GET_U_1(tptr + i);
+ if (c == '\n') /* lets rework the version string to
get a nice indentation */
ND_PRINT("\n\t ");
else
- fn_print_char(ndo, j);
+ fn_print_char(ndo, c);
}
break;
case 0x06: /* Platform */
ND_PRINT("%s", GET_U_1(tptr) ? "full": "half");
break;
- /* http://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cata/186/2_12_m/english/release/notes/186rn21m.html
+ /* https://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cata/186/2_12_m/english/release/notes/186rn21m.html
* plus more details from other sources
*
* There are apparently versions of the request with both
*/
p += 3;
- ND_TCHECK_4(p);
if (p + 4 > endp)
goto trunc;
- ND_PRINT("IPv4 (%u) %s", num, ipaddr_string(ndo, p));
+ ND_PRINT("IPv4 (%u) %s", num, GET_IPADDR_STRING(p));
p += 4;
}
else if (pt == PT_IEEE_802_2 && pl == 8 &&
if (p + al > endp)
goto trunc;
- ND_PRINT("IPv6 (%u) %s", num, ip6addr_string(ndo, p));
+ ND_PRINT("IPv6 (%u) %s", num, GET_IP6ADDR_STRING(p));
p += al;
}
else {