olsr_print_lq_neighbor4(netdissect_options *ndo,
const u_char *msg_data, u_int hello_len)
{
olsr_print_lq_neighbor4(netdissect_options *ndo,
const u_char *msg_data, u_int hello_len)
{
while (hello_len >= sizeof(struct olsr_lq_neighbor4)) {
lq_neighbor = (struct olsr_lq_neighbor4 *)msg_data;
while (hello_len >= sizeof(struct olsr_lq_neighbor4)) {
lq_neighbor = (struct olsr_lq_neighbor4 *)msg_data;
ND_PRINT((ndo, "\n\t neighbor %s, link-quality %.2lf%%"
", neighbor-link-quality %.2lf%%",
ND_PRINT((ndo, "\n\t neighbor %s, link-quality %.2lf%%"
", neighbor-link-quality %.2lf%%",
((double)lq_neighbor->link_quality/2.55),
((double)lq_neighbor->neighbor_link_quality/2.55)));
msg_data += sizeof(struct olsr_lq_neighbor4);
hello_len -= sizeof(struct olsr_lq_neighbor4);
}
((double)lq_neighbor->link_quality/2.55),
((double)lq_neighbor->neighbor_link_quality/2.55)));
msg_data += sizeof(struct olsr_lq_neighbor4);
hello_len -= sizeof(struct olsr_lq_neighbor4);
}
olsr_print_lq_neighbor6(netdissect_options *ndo,
const u_char *msg_data, u_int hello_len)
{
olsr_print_lq_neighbor6(netdissect_options *ndo,
const u_char *msg_data, u_int hello_len)
{
while (hello_len >= sizeof(struct olsr_lq_neighbor6)) {
lq_neighbor = (struct olsr_lq_neighbor6 *)msg_data;
while (hello_len >= sizeof(struct olsr_lq_neighbor6)) {
lq_neighbor = (struct olsr_lq_neighbor6 *)msg_data;
ND_PRINT((ndo, "\n\t neighbor %s, link-quality %.2lf%%"
", neighbor-link-quality %.2lf%%",
ND_PRINT((ndo, "\n\t neighbor %s, link-quality %.2lf%%"
", neighbor-link-quality %.2lf%%",
((double)lq_neighbor->link_quality/2.55),
((double)lq_neighbor->neighbor_link_quality/2.55)));
msg_data += sizeof(struct olsr_lq_neighbor6);
hello_len -= sizeof(struct olsr_lq_neighbor6);
}
((double)lq_neighbor->link_quality/2.55),
((double)lq_neighbor->neighbor_link_quality/2.55)));
msg_data += sizeof(struct olsr_lq_neighbor6);
hello_len -= sizeof(struct olsr_lq_neighbor6);
}
olsr_print_neighbor(netdissect_options *ndo,
const u_char *msg_data, u_int hello_len)
{
olsr_print_neighbor(netdissect_options *ndo,
const u_char *msg_data, u_int hello_len)
{
- ND_PRINT((ndo, "%s%s", ipaddr_string(msg_data),
+ ND_PRINT((ndo, "%s%s", ipaddr_string(ndo, msg_data),
neighbor % 4 == 0 ? "\n\t\t" : " "));
msg_data += sizeof(struct in_addr);
hello_len -= sizeof(struct in_addr);
}
neighbor % 4 == 0 ? "\n\t\t" : " "));
msg_data += sizeof(struct in_addr);
hello_len -= sizeof(struct in_addr);
}
} ptr;
u_int msg_type, msg_len, msg_tlen, hello_len;
} ptr;
u_int msg_type, msg_len, msg_tlen, hello_len;
ptr.common = (struct olsr_common *)tptr;
length = min(length, EXTRACT_16BITS(ptr.common->packet_len));
ptr.common = (struct olsr_common *)tptr;
length = min(length, EXTRACT_16BITS(ptr.common->packet_len));
ND_PRINT((ndo, "\n\t%s Message (%#04x), originator %s, ttl %u, hop %u"
"\n\t vtime %.3lfs, msg-seq 0x%04x, length %u%s",
tok2str(olsr_msg_values, "Unknown", msg_type),
ND_PRINT((ndo, "\n\t%s Message (%#04x), originator %s, ttl %u, hop %u"
"\n\t vtime %.3lfs, msg-seq 0x%04x, length %u%s",
tok2str(olsr_msg_values, "Unknown", msg_type),
- msg_type, ip6addr_string(msgptr.v6->originator),
+ msg_type, ip6addr_string(ndo, msgptr.v6->originator),
msgptr.v6->ttl,
msgptr.v6->hopcount,
ME_TO_DOUBLE(msgptr.v6->vtime),
EXTRACT_16BITS(msgptr.v6->msg_seq),
msg_len, (msg_len_valid == 0) ? " (invalid)" : ""));
msgptr.v6->ttl,
msgptr.v6->hopcount,
ME_TO_DOUBLE(msgptr.v6->vtime),
EXTRACT_16BITS(msgptr.v6->msg_seq),
msg_len, (msg_len_valid == 0) ? " (invalid)" : ""));
ND_PRINT((ndo, "\n\t%s Message (%#04x), originator %s, ttl %u, hop %u"
"\n\t vtime %.3lfs, msg-seq 0x%04x, length %u%s",
tok2str(olsr_msg_values, "Unknown", msg_type),
ND_PRINT((ndo, "\n\t%s Message (%#04x), originator %s, ttl %u, hop %u"
"\n\t vtime %.3lfs, msg-seq 0x%04x, length %u%s",
tok2str(olsr_msg_values, "Unknown", msg_type),
- msg_type, ipaddr_string(msgptr.v4->originator),
+ msg_type, ipaddr_string(ndo, msgptr.v4->originator),
msgptr.v4->ttl,
msgptr.v4->hopcount,
ME_TO_DOUBLE(msgptr.v4->vtime),
EXTRACT_16BITS(msgptr.v4->msg_seq),
msg_len, (msg_len_valid == 0) ? " (invalid)" : ""));
msgptr.v4->ttl,
msgptr.v4->hopcount,
ME_TO_DOUBLE(msgptr.v4->vtime),
EXTRACT_16BITS(msgptr.v4->msg_seq),
msg_len, (msg_len_valid == 0) ? " (invalid)" : ""));
ptr.hello = (struct olsr_hello *)msg_data;
ND_PRINT((ndo, "\n\t hello-time %.3lfs, MPR willingness %u",
ptr.hello = (struct olsr_hello *)msg_data;
ND_PRINT((ndo, "\n\t hello-time %.3lfs, MPR willingness %u",
ptr.tc = (struct olsr_tc *)msg_data;
ND_PRINT((ndo, "\n\t advertised neighbor seq 0x%04x",
ptr.tc = (struct olsr_tc *)msg_data;
ND_PRINT((ndo, "\n\t advertised neighbor seq 0x%04x",
- is_ipv6 ? ip6addr_string(msg_data) :
- ipaddr_string(msg_data)));
+ is_ipv6 ? ip6addr_string(ndo, msg_data) :
+ ipaddr_string(ndo, msg_data)));
hna6 = (struct olsr_hna6 *)msg_data;
ND_PRINT((ndo, "\n\t #%i: %s/%u",
hna6 = (struct olsr_hna6 *)msg_data;
ND_PRINT((ndo, "\n\t #%i: %s/%u",
ptr.hna = (struct olsr_hna4 *)msg_data;
/* print 4 prefixes per line */
ND_PRINT((ndo, "%s%s/%u",
col == 0 ? "\n\t " : ", ",
ptr.hna = (struct olsr_hna4 *)msg_data;
/* print 4 prefixes per line */
ND_PRINT((ndo, "%s%s/%u",
col == 0 ? "\n\t " : ", ",
ND_PRINT((ndo, "\n\t Version %u, Entries %u%s",
EXTRACT_16BITS(msg_data),
ND_PRINT((ndo, "\n\t Version %u, Entries %u%s",
EXTRACT_16BITS(msg_data),
#if INET6
if (is_ipv6)
ND_PRINT((ndo, ", address %s, name \"",
#if INET6
if (is_ipv6)
ND_PRINT((ndo, ", address %s, name \"",
else
#endif
ND_PRINT((ndo, ", address %s, name \"",
else
#endif
ND_PRINT((ndo, ", address %s, name \"",
- ipaddr_string(msg_data)));
- fn_printn(msg_data + addr_size, name_entry_len, NULL);
+ ipaddr_string(ndo, msg_data)));
+ fn_printn(ndo, msg_data + addr_size, name_entry_len, NULL);