char *str, size_t size, u_int asnum)
{
if (!ndo->ndo_bflag || asnum <= 0xFFFF) {
- nd_snprintf(str, size, "%u", asnum);
+ snprintf(str, size, "%u", asnum);
} else {
- nd_snprintf(str, size, "%u.%u", asnum >> 16, asnum & 0xFFFF);
+ snprintf(str, size, "%u.%u", asnum >> 16, asnum & 0xFFFF);
}
return str;
}
if (plen % 8) {
((u_char *)&addr)[plenbytes - 1] &= ((0xff00 >> (plen % 8)) & 0xff);
}
- nd_snprintf(buf, buflen, "%s/%u", ipaddr_string(ndo, (const u_char *)&addr), plen);
+ snprintf(buf, buflen, "%s/%u", ipaddr_string(ndo, (const u_char *)&addr), plen);
return 1 + plenbytes;
trunc:
((u_char *)&addr)[plenbytes - 1] &= ((0xff00 >> (plen % 8)) & 0xff);
}
/* the label may get offsetted by 4 bits so lets shift it right */
- nd_snprintf(buf, buflen, "%s/%u, label:%u %s",
+ snprintf(buf, buflen, "%s/%u, label:%u %s",
ipaddr_string(ndo, (const u_char *)&addr),
plen,
GET_BE_U_3(pptr + 1)>>4,
switch(addr_length) {
case (sizeof(nd_ipv4) << 3): /* 32 */
ND_TCHECK_LEN(pptr, sizeof(nd_ipv4));
- nd_snprintf(pos, sizeof(addr), "%s", ipaddr_string(ndo, pptr));
+ snprintf(pos, sizeof(addr), "%s", ipaddr_string(ndo, pptr));
break;
case (sizeof(nd_ipv6) << 3): /* 128 */
ND_TCHECK_LEN(pptr, sizeof(nd_ipv6));
- nd_snprintf(pos, sizeof(addr), "%s", ip6addr_string(ndo, pptr));
+ snprintf(pos, sizeof(addr), "%s", ip6addr_string(ndo, pptr));
break;
default:
- nd_snprintf(pos, sizeof(addr), "bogus address length %u", addr_length);
+ snprintf(pos, sizeof(addr), "bogus address length %u", addr_length);
break;
}
pos += strlen(pos);
total_length += (addr_length >> 3) + 1;
offset = (u_int)strlen(buf);
if (addr_length) {
- nd_snprintf(buf + offset, buflen - offset, ", Source %s",
+ snprintf(buf + offset, buflen - offset, ", Source %s",
bgp_vpn_ip_print(ndo, pptr, addr_length));
pptr += (addr_length >> 3);
}
total_length += (addr_length >> 3) + 1;
offset = (u_int)strlen(buf);
if (addr_length) {
- nd_snprintf(buf + offset, buflen - offset, ", Group %s",
+ snprintf(buf + offset, buflen - offset, ", Group %s",
bgp_vpn_ip_print(ndo, pptr, addr_length));
pptr += (addr_length >> 3);
}
case 0:
/* 2-byte-AS:number fmt */
- nd_snprintf(pos, sizeof(rd) - (pos - rd), "%u:%u (= %u.%u.%u.%u)",
+ snprintf(pos, sizeof(rd) - (pos - rd), "%u:%u (= %u.%u.%u.%u)",
GET_BE_U_2(pptr + 2),
GET_BE_U_4(pptr + 4),
GET_U_1(pptr + 4), GET_U_1(pptr + 5),
case 1:
/* IP-address:AS fmt */
- nd_snprintf(pos, sizeof(rd) - (pos - rd), "%u.%u.%u.%u:%u",
+ snprintf(pos, sizeof(rd) - (pos - rd), "%u.%u.%u.%u:%u",
GET_U_1(pptr + 2), GET_U_1(pptr + 3),
GET_U_1(pptr + 4), GET_U_1(pptr + 5),
GET_BE_U_2(pptr + 6));
case 2:
/* 4-byte-AS:number fmt */
- nd_snprintf(pos, sizeof(rd) - (pos - rd), "%s:%u (%u.%u.%u.%u:%u)",
+ snprintf(pos, sizeof(rd) - (pos - rd), "%s:%u (%u.%u.%u.%u:%u)",
as_printf(ndo, astostr, sizeof(astostr), GET_BE_U_4(pptr + 2)),
GET_BE_U_2(pptr + 6), GET_U_1(pptr + 2),
GET_U_1(pptr + 3), GET_U_1(pptr + 4),
GET_U_1(pptr + 5), GET_BE_U_2(pptr + 6));
break;
default:
- nd_snprintf(pos, sizeof(rd) - (pos - rd), "unknown RD format");
+ snprintf(pos, sizeof(rd) - (pos - rd), "unknown RD format");
break;
}
pos += strlen(pos);
((0xff00 >> (plen % 8)) & 0xff);
}
/* the label may get offsetted by 4 bits so lets shift it right */
- nd_snprintf(buf, buflen, "RD: %s, %s/%u, label:%u %s",
+ snprintf(buf, buflen, "RD: %s, %s/%u, label:%u %s",
bgp_vpn_rd_print(ndo, pptr+4),
ipaddr_string(ndo, (const u_char *)&addr),
plen,
/* MDT Group Address */
ND_TCHECK_LEN(pptr, sizeof(nd_ipv4));
- nd_snprintf(buf, buflen, "RD: %s, VPN IP Address: %s, MC Group Address: %s",
+ snprintf(buf, buflen, "RD: %s, VPN IP Address: %s, MC Group Address: %s",
bgp_vpn_rd_print(ndo, rd), ipaddr_string(ndo, vpn_ip), ipaddr_string(ndo, pptr));
return MDT_VPN_NLRI_LEN + 1;
route_length = GET_U_1(pptr);
pptr++;
- nd_snprintf(buf, buflen, "Route-Type: %s (%u), length: %u",
+ snprintf(buf, buflen, "Route-Type: %s (%u), length: %u",
tok2str(bgp_multicast_vpn_route_type_values,
"Unknown", route_type),
route_type, route_length);
case BGP_MULTICAST_VPN_ROUTE_TYPE_INTRA_AS_I_PMSI:
ND_TCHECK_LEN(pptr, BGP_VPN_RD_LEN);
offset = (u_int)strlen(buf);
- nd_snprintf(buf + offset, buflen - offset, ", RD: %s, Originator %s",
+ snprintf(buf + offset, buflen - offset, ", RD: %s, Originator %s",
bgp_vpn_rd_print(ndo, pptr),
bgp_vpn_ip_print(ndo, pptr + BGP_VPN_RD_LEN,
(route_length - BGP_VPN_RD_LEN) << 3));
case BGP_MULTICAST_VPN_ROUTE_TYPE_INTER_AS_I_PMSI:
ND_TCHECK_LEN(pptr, BGP_VPN_RD_LEN + 4);
offset = (u_int)strlen(buf);
- nd_snprintf(buf + offset, buflen - offset, ", RD: %s, Source-AS %s",
+ snprintf(buf + offset, buflen - offset, ", RD: %s, Source-AS %s",
bgp_vpn_rd_print(ndo, pptr),
as_printf(ndo, astostr, sizeof(astostr),
GET_BE_U_4(pptr + BGP_VPN_RD_LEN)));
case BGP_MULTICAST_VPN_ROUTE_TYPE_S_PMSI:
ND_TCHECK_LEN(pptr, BGP_VPN_RD_LEN);
offset = (u_int)strlen(buf);
- nd_snprintf(buf + offset, buflen - offset, ", RD: %s",
+ snprintf(buf + offset, buflen - offset, ", RD: %s",
bgp_vpn_rd_print(ndo, pptr));
pptr += BGP_VPN_RD_LEN;
ND_TCHECK_LEN(pptr, addr_length);
offset = (u_int)strlen(buf);
- nd_snprintf(buf + offset, buflen - offset, ", Originator %s",
+ snprintf(buf + offset, buflen - offset, ", Originator %s",
bgp_vpn_ip_print(ndo, pptr, addr_length << 3));
break;
case BGP_MULTICAST_VPN_ROUTE_TYPE_SOURCE_ACTIVE:
ND_TCHECK_LEN(pptr, BGP_VPN_RD_LEN);
offset = (u_int)strlen(buf);
- nd_snprintf(buf + offset, buflen - offset, ", RD: %s",
+ snprintf(buf + offset, buflen - offset, ", RD: %s",
bgp_vpn_rd_print(ndo, pptr));
pptr += BGP_VPN_RD_LEN;
case BGP_MULTICAST_VPN_ROUTE_TYPE_SOURCE_TREE_JOIN:
ND_TCHECK_LEN(pptr, BGP_VPN_RD_LEN + 4);
offset = (u_int)strlen(buf);
- nd_snprintf(buf + offset, buflen - offset, ", RD: %s, Source-AS %s",
+ snprintf(buf + offset, buflen - offset, ", RD: %s, Source-AS %s",
bgp_vpn_rd_print(ndo, pptr),
as_printf(ndo, astostr, sizeof(astostr),
GET_BE_U_4(pptr + BGP_VPN_RD_LEN)));
/* assume AD-only with RD, BGPNH */
ND_TCHECK_LEN(pptr, 12);
buf[0] = '\0';
- stringlen = nd_snprintf(buf, buflen, "RD: %s, BGPNH: %s",
+ stringlen = snprintf(buf, buflen, "RD: %s, BGPNH: %s",
bgp_vpn_rd_print(ndo, pptr),
ipaddr_string(ndo, pptr+8));
UPDATE_BUF_BUFLEN(buf, buflen, stringlen);
ND_TCHECK_LEN(pptr, 15);
buf[0] = '\0';
- stringlen = nd_snprintf(buf, buflen, "RD: %s, CE-ID: %u, Label-Block Offset: %u, Label Base %u",
+ stringlen = snprintf(buf, buflen, "RD: %s, CE-ID: %u, Label-Block Offset: %u, Label Base %u",
bgp_vpn_rd_print(ndo, pptr),
GET_BE_U_2(pptr + 8),
GET_BE_U_2(pptr + 10),
while (tlen != 0) {
if (tlen < 3) {
if (buflen != 0) {
- stringlen=nd_snprintf(buf,buflen, "\n\t\tran past the end");
+ stringlen=snprintf(buf,buflen, "\n\t\tran past the end");
UPDATE_BUF_BUFLEN(buf, buflen, stringlen);
}
return plen + 2;
switch(tlv_type) {
case 1:
if (buflen != 0) {
- stringlen=nd_snprintf(buf,buflen, "\n\t\tcircuit status vector (%u) length: %u: 0x",
+ stringlen=snprintf(buf,buflen, "\n\t\tcircuit status vector (%u) length: %u: 0x",
tlv_type,
tlv_len);
UPDATE_BUF_BUFLEN(buf, buflen, stringlen);
while (ttlv_len != 0) {
if (tlen < 1) {
if (buflen != 0) {
- stringlen=nd_snprintf(buf,buflen, " (ran past the end)");
+ stringlen=snprintf(buf,buflen, " (ran past the end)");
UPDATE_BUF_BUFLEN(buf, buflen, stringlen);
}
return plen + 2;
}
ND_TCHECK_1(pptr);
if (buflen != 0) {
- stringlen=nd_snprintf(buf,buflen, "%02x",
+ stringlen=snprintf(buf,buflen, "%02x",
GET_U_1(pptr));
pptr++;
UPDATE_BUF_BUFLEN(buf, buflen, stringlen);
break;
default:
if (buflen != 0) {
- stringlen=nd_snprintf(buf,buflen, "\n\t\tunknown TLV #%u, length: %u",
+ stringlen=snprintf(buf,buflen, "\n\t\tunknown TLV #%u, length: %u",
tlv_type,
tlv_len);
UPDATE_BUF_BUFLEN(buf, buflen, stringlen);
}
if (tlen < ttlv_len) {
if (buflen != 0) {
- stringlen=nd_snprintf(buf,buflen, " (ran past the end)");
+ stringlen=snprintf(buf,buflen, " (ran past the end)");
UPDATE_BUF_BUFLEN(buf, buflen, stringlen);
}
return plen + 2;
addr[plenbytes - 1] &=
((0xff00 >> (plen % 8)) & 0xff);
}
- nd_snprintf(buf, buflen, "%s/%u", ip6addr_string(ndo, (const u_char *)&addr), plen);
+ snprintf(buf, buflen, "%s/%u", ip6addr_string(ndo, (const u_char *)&addr), plen);
return 1 + plenbytes;
trunc:
((0xff00 >> (plen % 8)) & 0xff);
}
/* the label may get offsetted by 4 bits so lets shift it right */
- nd_snprintf(buf, buflen, "%s/%u, label:%u %s",
+ snprintf(buf, buflen, "%s/%u, label:%u %s",
ip6addr_string(ndo, (const u_char *)&addr),
plen,
GET_BE_U_3(pptr + 1)>>4,
((0xff00 >> (plen % 8)) & 0xff);
}
/* the label may get offsetted by 4 bits so lets shift it right */
- nd_snprintf(buf, buflen, "RD: %s, %s/%u, label:%u %s",
+ snprintf(buf, buflen, "RD: %s, %s/%u, label:%u %s",
bgp_vpn_rd_print(ndo, pptr+4),
ip6addr_string(ndo, (const u_char *)&addr),
plen,
addr[(plen + 7) / 8 - 1] &=
((0xff00 >> (plen % 8)) & 0xff);
}
- nd_snprintf(buf, buflen, "%s/%u",
+ snprintf(buf, buflen, "%s/%u",
isonsap_string(ndo, addr,(plen + 7) / 8),
plen);
addr[(plen + 7) / 8 - 1] &= ((0xff00 >> (plen % 8)) & 0xff);
}
/* the label may get offsetted by 4 bits so lets shift it right */
- nd_snprintf(buf, buflen, "RD: %s, %s/%u, label:%u %s",
+ snprintf(buf, buflen, "RD: %s, %s/%u, label:%u %s",
bgp_vpn_rd_print(ndo, pptr+4),
isonsap_string(ndo, addr,(plen + 7) / 8),
plen,