cur.len = 0;
cur.base = -1;
for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) {
cur.len = 0;
cur.base = -1;
for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) {
if (cur.base == -1)
cur.base = i, cur.len = 1;
else cur.len++;
}
if (cur.base == -1)
cur.base = i, cur.len = 1;
else cur.len++;
}
- else if (cur.base != -1)
- {
+ else if (cur.base != -1) {
if (best.base == -1 || cur.len > best.len)
best = cur;
cur.base = -1;
if (best.base == -1 || cur.len > best.len)
best = cur;
cur.base = -1;
for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) {
/* Are we inside the best run of 0x00's?
*/
for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) {
/* Are we inside the best run of 0x00's?
*/
- if (best.base != -1 && i >= best.base && i < (best.base + best.len))
- {
+ if (best.base != -1 && i >= best.base && i < (best.base + best.len)) {
if (i == best.base)
APPEND_CHAR(':');
continue;
if (i == best.base)
APPEND_CHAR(':');
continue;
if (i == 6 && best.base == 0 &&
(best.len == 6 || (best.len == 5 && words[5] == 0xffff)))
{
if (i == 6 && best.base == 0 &&
(best.len == 6 || (best.len == 5 && words[5] == 0xffff)))
{
- if (!addrtostr(srcaddr+12, dp, space_left))
- {
+ if (!addrtostr(srcaddr+12, dp, space_left)) {
errno = ENOSPC;
return (NULL);
}
errno = ENOSPC;
return (NULL);
}
snprintfed = snprintf (dp, space_left, "%x", words[i]);
if (snprintfed < 0)
return (NULL);
snprintfed = snprintf (dp, space_left, "%x", words[i]);
if (snprintfed < 0)
return (NULL);
- if ((size_t) snprintfed >= space_left)
- {
+ if ((size_t) snprintfed >= space_left) {
errno = ENOSPC;
return (NULL);
}
errno = ENOSPC;
return (NULL);
}
- if (ndo->ndo_vflag < 1)
- {
+ if (ndo->ndo_vflag < 1) {
ND_PRINT("BFDv0, Control, Flags: [%s], length: %u",
bittok2str(bfd_v0_flag_values, "none", flags),
len);
ND_PRINT("BFDv0, Control, Flags: [%s], length: %u",
bittok2str(bfd_v0_flag_values, "none", flags),
len);
- if (ndo->ndo_vflag < 1)
- {
+ if (ndo->ndo_vflag < 1) {
ND_PRINT("BFDv1, %s, State %s, Flags: [%s], length: %u",
tok2str(bfd_port_values, "unknown (%u)", port),
tok2str(bfd_v1_state_values, "unknown (%u)", (flags & 0xc0) >> 6),
ND_PRINT("BFDv1, %s, State %s, Flags: [%s], length: %u",
tok2str(bfd_port_values, "unknown (%u)", port),
tok2str(bfd_v1_state_values, "unknown (%u)", (flags & 0xc0) >> 6),
} msgptr;
int msg_len_valid = 0;
} msgptr;
int msg_len_valid = 0;
ND_TCHECK_LEN(tptr, sizeof(struct olsr_msg6));
msgptr.v6 = (const struct olsr_msg6 *) tptr;
msg_type = GET_U_1(msgptr.v6->msg_type);
ND_TCHECK_LEN(tptr, sizeof(struct olsr_msg6));
msgptr.v6 = (const struct olsr_msg6 *) tptr;
msg_type = GET_U_1(msgptr.v6->msg_type);
int i = 0;
ND_PRINT("\n\t Advertised networks (total %u)",
int i = 0;
ND_PRINT("\n\t Advertised networks (total %u)",
case TUNNEL_ASSIGN_ID:
case TUNNEL_CLIENT_AUTH:
case TUNNEL_SERVER_AUTH:
case TUNNEL_ASSIGN_ID:
case TUNNEL_CLIENT_AUTH:
case TUNNEL_SERVER_AUTH:
- if (GET_U_1(data) <= 0x1F)
- {
+ if (GET_U_1(data) <= 0x1F) {
if (length < 1)
goto trunc;
if (GET_U_1(data))
if (length < 1)
goto trunc;
if (GET_U_1(data))
vendor_type = GET_U_1(data);
vendor_length = GET_U_1(data + 1);
vendor_type = GET_U_1(data);
vendor_length = GET_U_1(data + 1);
- if (vendor_length < 2)
- {
+ if (vendor_length < 2) {
ND_PRINT("\n\t Vendor Attribute: %u, Length: %u (bogus, must be >= 2)",
vendor_type,
vendor_length);
return;
}
ND_PRINT("\n\t Vendor Attribute: %u, Length: %u (bogus, must be >= 2)",
vendor_type,
vendor_length);
return;
}
- if (vendor_length > length)
- {
+ if (vendor_length > length) {
ND_PRINT("\n\t Vendor Attribute: %u, Length: %u (bogus, goes past end of vendor-specific attribute)",
vendor_type,
vendor_length);
ND_PRINT("\n\t Vendor Attribute: %u, Length: %u (bogus, goes past end of vendor-specific attribute)",
vendor_type,
vendor_length);
ND_PRINT("ERROR: length %u != 4", length);
return;
}
/* This attribute has standard values */
ND_PRINT("ERROR: length %u != 4", length);
return;
}
/* This attribute has standard values */
- if (attr_type[attr_code].siz_subtypes)
- {
+ if (attr_type[attr_code].siz_subtypes) {
static const char **table;
uint32_t data_value;
table = attr_type[attr_code].subtypes;
static const char **table;
uint32_t data_value;
table = attr_type[attr_code].subtypes;
- if ( (attr_code == TUNNEL_TYPE) || (attr_code == TUNNEL_MEDIUM) )
- {
+ if ( (attr_code == TUNNEL_TYPE) || (attr_code == TUNNEL_MEDIUM) ) {
if (!GET_U_1(data))
ND_PRINT("Tag[Unused] ");
else
if (!GET_U_1(data))
ND_PRINT("Tag[Unused] ");
else
print_attr_address(netdissect_options *ndo,
const u_char *data, u_int length, u_short attr_code)
{
print_attr_address(netdissect_options *ndo,
const u_char *data, u_int length, u_short attr_code)
{
ND_PRINT("ERROR: length %u != 4", length);
return;
}
ND_PRINT("ERROR: length %u != 4", length);
return;
}
print_attr_address6(netdissect_options *ndo,
const u_char *data, u_int length, u_short attr_code _U_)
{
print_attr_address6(netdissect_options *ndo,
const u_char *data, u_int length, u_short attr_code _U_)
{
ND_PRINT("ERROR: length %u != 16", length);
return;
}
ND_PRINT("ERROR: length %u != 16", length);
return;
}
- if (length < 2 || length > 18)
- {
+ if (length < 2 || length > 18) {
ND_PRINT("ERROR: length %u not in range (2..18)", length);
return;
}
ND_TCHECK_LEN(data, length);
ND_PRINT("ERROR: length %u not in range (2..18)", length);
return;
}
ND_TCHECK_LEN(data, length);
- if (GET_U_1(data + 1) > 128)
- {
+ if (GET_U_1(data + 1) > 128) {
ND_PRINT("ERROR: netmask %u not in range (0..128)", GET_U_1(data + 1));
return;
}
ND_PRINT("ERROR: netmask %u not in range (0..128)", GET_U_1(data + 1));
return;
}
print_attr_mip6_home_link_prefix(netdissect_options *ndo,
const u_char *data, u_int length, u_short attr_code _U_)
{
print_attr_mip6_home_link_prefix(netdissect_options *ndo,
const u_char *data, u_int length, u_short attr_code _U_)
{
ND_PRINT("ERROR: length %u != 17", length);
return;
}
ND_TCHECK_LEN(data, length);
ND_PRINT("ERROR: length %u != 17", length);
return;
}
ND_TCHECK_LEN(data, length);
- if (GET_U_1(data) > 128)
- {
+ if (GET_U_1(data) > 128) {
ND_PRINT("ERROR: netmask %u not in range (0..128)", GET_U_1(data));
return;
}
ND_PRINT("ERROR: netmask %u not in range (0..128)", GET_U_1(data));
return;
}
u_int namespace_value;
ND_TCHECK_LEN(data, length);
u_int namespace_value;
ND_TCHECK_LEN(data, length);
ND_PRINT("ERROR: length %u < 2", length);
return;
}
ND_PRINT("ERROR: length %u < 2", length);
return;
}
uint8_t code, entity;
ND_TCHECK_LEN(data, length);
uint8_t code, entity;
ND_TCHECK_LEN(data, length);
ND_PRINT("ERROR: length %u < 21", length);
return;
}
ND_PRINT("ERROR: length %u < 21", length);
return;
}
uint16_t index;
ND_TCHECK_LEN(data, length);
uint16_t index;
ND_TCHECK_LEN(data, length);
ND_PRINT("ERROR: length %u < 3", length);
return;
}
ND_PRINT("ERROR: length %u < 3", length);
return;
}
uint16_t flags;
ND_TCHECK_LEN(data, length);
uint16_t flags;
ND_TCHECK_LEN(data, length);
ND_PRINT("ERROR: length %u < 10", length);
return;
}
ND_PRINT("ERROR: length %u < 10", length);
return;
}
time_t attr_time;
char string[26];
time_t attr_time;
char string[26];
ND_PRINT("ERROR: length %u != 4", length);
return;
}
ND_PRINT("ERROR: length %u != 4", length);
return;
}
uint64_t data_value, i;
const char *sep = "";
uint64_t data_value, i;
const char *sep = "";
ND_PRINT("ERROR: length %u != 8", length);
return;
}
ND_PRINT("ERROR: length %u != 8", length);
return;
}
switch(attr_code)
{
case ARAP_PASS:
switch(attr_code)
{
case ARAP_PASS:
ND_PRINT("ERROR: length %u != 16", length);
return;
}
ND_PRINT("ERROR: length %u != 16", length);
return;
}
break;
case ARAP_FEATURES:
break;
case ARAP_FEATURES:
ND_PRINT("ERROR: length %u != 14", length);
return;
}
ND_PRINT("ERROR: length %u != 14", length);
return;
}
break;
case ARAP_CHALLENGE_RESP:
break;
case ARAP_CHALLENGE_RESP:
ND_PRINT("ERROR: length %u != 8", length);
return;
}
ND_PRINT("ERROR: length %u != 8", length);
return;
}
ND_PRINT("Error: length %u != 4", length);
return;
}
ND_PRINT("Error: length %u != 4", length);
return;
}
ND_PRINT(" (bogus, must be >= 2)");
return;
}
ND_PRINT(" (bogus, must be >= 2)");
return;
}
ND_PRINT(" (bogus, goes past end of packet)");
return;
}
ND_PRINT(", Value: ");
ND_PRINT(" (bogus, goes past end of packet)");
return;
}
ND_PRINT(", Value: ");
- if (type < TAM_SIZE(attr_type))
- {
- if (len > 2)
- {
+ if (type < TAM_SIZE(attr_type)) {
+ if (len > 2) {
if ( attr_type[type].print_func )
(*attr_type[type].print_func)(
ndo, ((const u_char *)(rad_attr+1)),
if ( attr_type[type].print_func )
(*attr_type[type].print_func)(
ndo, ((const u_char *)(rad_attr+1)),
rad = (const struct radius_hdr *)dat;
len = GET_BE_U_2(rad->len);
rad = (const struct radius_hdr *)dat;
len = GET_BE_U_2(rad->len);
- if (len < MIN_RADIUS_LEN)
- {
+ if (len < MIN_RADIUS_LEN) {
nd_print_trunc(ndo);
return;
}
nd_print_trunc(ndo);
return;
}
}
stp_print_mstp_bpdu(ndo, stp_bpdu, length);
}
stp_print_mstp_bpdu(ndo, stp_bpdu, length);
- if (protocol_version == STP_PROTO_SPB)
- {
+ if (protocol_version == STP_PROTO_SPB) {
/* Validate v4 length */
spb_len = GET_BE_U_2(p + MST_BPDU_VER3_LEN_OFFSET + mstp_len);
spb_len += 2;
/* Validate v4 length */
spb_len = GET_BE_U_2(p + MST_BPDU_VER3_LEN_OFFSET + mstp_len);
spb_len += 2;
facility = (pri & SYSLOG_FACILITY_MASK) >> 3;
severity = pri & SYSLOG_SEVERITY_MASK;
facility = (pri & SYSLOG_FACILITY_MASK) >> 3;
severity = pri & SYSLOG_SEVERITY_MASK;
- if (ndo->ndo_vflag < 1 )
- {
+ if (ndo->ndo_vflag < 1 ) {
ND_PRINT("SYSLOG %s.%s, length: %u",
tok2str(syslog_facility_values, "unknown (%u)", facility),
tok2str(syslog_severity_values, "unknown (%u)", severity),
ND_PRINT("SYSLOG %s.%s, length: %u",
tok2str(syslog_facility_values, "unknown (%u)", facility),
tok2str(syslog_severity_values, "unknown (%u)", severity),