* IS-IS: ISO 10589
*/
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "netdissect-stdinc.h"
{ ESIS_OPTION_SECURITY, "Security" },
{ ESIS_OPTION_ES_CONF_TIME, "ES Configuration Time" },
{ ESIS_OPTION_PRIORITY, "Priority" },
- { ESIS_OPTION_ADDRESS_MASK, "Addressk Mask" },
+ { ESIS_OPTION_ADDRESS_MASK, "Address Mask" },
{ ESIS_OPTION_SNPA_MASK, "SNPA Mask" },
{ 0, NULL }
};
#define ISIS_PTP_ADJ_INIT 1
#define ISIS_PTP_ADJ_DOWN 2
-static const struct tok isis_ptp_adjancey_values[] = {
+static const struct tok isis_ptp_adjacency_values[] = {
{ ISIS_PTP_ADJ_UP, "Up" },
{ ISIS_PTP_ADJ_INIT, "Initializing" },
{ ISIS_PTP_ADJ_DOWN, "Down" },
default:
/* dump the PDU specific data */
- if (length > ND_BYTES_BETWEEN(pptr, optr)) {
+ if (length > ND_BYTES_BETWEEN(optr, pptr)) {
ND_PRINT("\n\t undecoded non-header data, length %u", length-li);
- print_unknown_data(ndo, pptr, "\n\t ", length - ND_BYTES_BETWEEN(pptr, optr));
+ print_unknown_data(ndo, pptr, "\n\t ",
+ length - ND_BYTES_BETWEEN(optr, pptr));
}
}
ND_TCHECK_SIZE(mcid);
ND_PRINT("ID: %u, Name: ", GET_U_1(mcid->format_id));
- if (nd_printzp(ndo, mcid->name, 32, ndo->ndo_snapend))
- goto trunc;
+ nd_printjnp(ndo, mcid->name, sizeof(mcid->name));
ND_PRINT("\n\t Lvl: %u", GET_BE_U_2(mcid->revision_lvl));
const struct isis_subtlv_spb_mcid *subtlv_spb_mcid;
int i;
- while (len > 2)
- {
+ while (len > 2) {
stlv_type = GET_U_1(tptr);
stlv_len = GET_U_1(tptr + 1);
/* Make sure the entire subTLV is in the captured data */
ND_TCHECK_LEN(tptr, stlv_len);
- switch (stlv_type)
- {
+ switch (stlv_type) {
case ISIS_SUBTLV_SPB_MCID:
{
if (stlv_len < ISIS_SUBTLV_SPB_MCID_MIN_LEN)
ND_PRINT("\n\t Digest: ");
- for(i=1;i<=8; i++)
- {
+ for(i=1;i<=8; i++) {
ND_PRINT("%08x ", GET_BE_U_4(tptr));
if (i%4 == 0 && i != 8)
ND_PRINT("\n\t ");
case ISIS_SUBTLV_SPB_BVID:
{
- while (stlv_len != 0)
- {
+ while (stlv_len != 0) {
if (stlv_len < 4)
goto subtlv_too_short;
ND_PRINT("\n\t ECT: %08x",
{
u_int stlv_type, stlv_len, treecount;
- while (len > 2)
- {
+ while (len > 2) {
stlv_type = GET_U_1(tptr);
stlv_len = GET_U_1(tptr + 1);
tptr += 2;
/* Make sure the entire subTLV is in the captured data */
ND_TCHECK_LEN(tptr, stlv_len);
- switch (stlv_type)
- {
+ switch (stlv_type) {
case ISIS_SUBTLV_SPB_INSTANCE:
if (stlv_len < ISIS_SUBTLV_SPB_INSTANCE_MIN_LEN)
goto subtlv_too_short;
len -= ISIS_SUBTLV_SPB_INSTANCE_MIN_LEN;
stlv_len -= ISIS_SUBTLV_SPB_INSTANCE_MIN_LEN;
- while (treecount)
- {
+ while (treecount) {
if (stlv_len < ISIS_SUBTLV_SPB_INSTANCE_VLAN_TUPLE_LEN)
goto trunc;
byte_length = (bit_length + 7) / 8; /* prefix has variable length encoding */
- ND_TCHECK_LEN(tptr, byte_length);
memset(prefix, 0, sizeof(prefix)); /* clear the copy buffer */
- memcpy(prefix,tptr,byte_length); /* copy as much as is stored in the TLV */
+ GET_CPY_BYTES(prefix,tptr,byte_length); /* copy as much as is stored in the TLV */
tptr+=byte_length;
processed+=byte_length;
}
}
return (processed);
-trunc:
- return 0;
}
static void
switch (auth_type) {
case ISIS_SUBTLV_AUTH_SIMPLE:
- if (nd_printzp(ndo, tptr, tlen, ndo->ndo_snapend))
- goto trunc;
+ nd_printjnp(ndo, tptr, tlen);
break;
case ISIS_SUBTLV_AUTH_MD5:
for(i=0;i<tlen;i++) {
tlv_ptp_adj = (const struct isis_tlv_ptp_adj *)tptr;
if(tlen>=1) {
ND_PRINT("\n\t Adjacency State: %s (%u)",
- tok2str(isis_ptp_adjancey_values, "unknown", GET_U_1(tptr)),
+ tok2str(isis_ptp_adjacency_values, "unknown", GET_U_1(tptr)),
GET_U_1(tptr));
tlen--;
}
case ISIS_TLV_HOSTNAME:
ND_PRINT("\n\t Hostname: ");
- if (nd_printzp(ndo, tptr, tlen, ndo->ndo_snapend))
- goto trunc;
+ nd_printjnp(ndo, tptr, tlen);
break;
case ISIS_TLV_SHARED_RISK_GROUP: