*/
struct lspping_common_header {
- u_int8_t version[2];
- u_int8_t reserved[2];
- u_int8_t msg_type;
- u_int8_t reply_mode;
- u_int8_t return_code;
- u_int8_t return_subcode;
- u_int8_t sender_handle[4];
- u_int8_t seq_number[4];
- u_int8_t ts_sent_sec[4];
- u_int8_t ts_sent_usec[4];
- u_int8_t ts_rcvd_sec[4];
- u_int8_t ts_rcvd_usec[4];
+ uint8_t version[2];
+ uint8_t reserved[2];
+ uint8_t msg_type;
+ uint8_t reply_mode;
+ uint8_t return_code;
+ uint8_t return_subcode;
+ uint8_t sender_handle[4];
+ uint8_t seq_number[4];
+ uint8_t ts_sent_sec[4];
+ uint8_t ts_sent_usec[4];
+ uint8_t ts_rcvd_sec[4];
+ uint8_t ts_rcvd_usec[4];
};
#define LSPPING_VERSION 1
*/
struct lspping_tlv_header {
- u_int8_t type[2];
- u_int8_t length[2];
+ uint8_t type[2];
+ uint8_t length[2];
};
#define LSPPING_TLV_TARGET_FEC_STACK 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
struct lspping_tlv_targetfec_subtlv_ldp_ipv4_t {
- u_int8_t prefix [4];
- u_int8_t prefix_len;
+ uint8_t prefix [4];
+ uint8_t prefix_len;
};
/*
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
struct lspping_tlv_targetfec_subtlv_ldp_ipv6_t {
- u_int8_t prefix [16];
- u_int8_t prefix_len;
+ uint8_t prefix [16];
+ uint8_t prefix_len;
};
/*
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
struct lspping_tlv_targetfec_subtlv_bgp_ipv4_t {
- u_int8_t sender_id [4];
- u_int8_t prefix [4];
- u_int8_t prefix_len;
+ uint8_t sender_id [4];
+ uint8_t prefix [4];
+ uint8_t prefix_len;
};
/*
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
struct lspping_tlv_targetfec_subtlv_bgp_ipv6_t {
- u_int8_t sender_id [16];
- u_int8_t prefix [16];
- u_int8_t prefix_len;
+ uint8_t sender_id [16];
+ uint8_t prefix [16];
+ uint8_t prefix_len;
};
/*
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
struct lspping_tlv_targetfec_subtlv_rsvp_ipv4_t {
- u_int8_t tunnel_endpoint [4];
- u_int8_t res[2];
- u_int8_t tunnel_id[2];
- u_int8_t extended_tunnel_id[4];
- u_int8_t tunnel_sender [4];
- u_int8_t res2[2];
- u_int8_t lsp_id [2];
+ uint8_t tunnel_endpoint [4];
+ uint8_t res[2];
+ uint8_t tunnel_id[2];
+ uint8_t extended_tunnel_id[4];
+ uint8_t tunnel_sender [4];
+ uint8_t res2[2];
+ uint8_t lsp_id [2];
};
/*
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
struct lspping_tlv_targetfec_subtlv_rsvp_ipv6_t {
- u_int8_t tunnel_endpoint [16];
- u_int8_t res[2];
- u_int8_t tunnel_id[2];
- u_int8_t extended_tunnel_id[16];
- u_int8_t tunnel_sender [16];
- u_int8_t res2[2];
- u_int8_t lsp_id [2];
+ uint8_t tunnel_endpoint [16];
+ uint8_t res[2];
+ uint8_t tunnel_id[2];
+ uint8_t extended_tunnel_id[16];
+ uint8_t tunnel_sender [16];
+ uint8_t res2[2];
+ uint8_t lsp_id [2];
};
/*
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
struct lspping_tlv_targetfec_subtlv_l3vpn_ipv4_t {
- u_int8_t rd [8];
- u_int8_t prefix [4];
- u_int8_t prefix_len;
+ uint8_t rd [8];
+ uint8_t prefix [4];
+ uint8_t prefix_len;
};
/*
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
struct lspping_tlv_targetfec_subtlv_l3vpn_ipv6_t {
- u_int8_t rd [8];
- u_int8_t prefix [16];
- u_int8_t prefix_len;
+ uint8_t rd [8];
+ uint8_t prefix [16];
+ uint8_t prefix_len;
};
/*
* 0 1 2 3
*/
struct lspping_tlv_targetfec_subtlv_l2vpn_endpt_t {
- u_int8_t rd [8];
- u_int8_t sender_ce_id [2];
- u_int8_t receiver_ce_id [2];
- u_int8_t encapsulation[2];
+ uint8_t rd [8];
+ uint8_t sender_ce_id [2];
+ uint8_t receiver_ce_id [2];
+ uint8_t encapsulation[2];
};
/*
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
struct lspping_tlv_targetfec_subtlv_l2vpn_vcid_old_t {
- u_int8_t remote_pe_address [4];
- u_int8_t vc_id [4];
- u_int8_t encapsulation[2];
+ uint8_t remote_pe_address [4];
+ uint8_t vc_id [4];
+ uint8_t encapsulation[2];
};
/*
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
struct lspping_tlv_targetfec_subtlv_l2vpn_vcid_t {
- u_int8_t sender_pe_address [4];
- u_int8_t remote_pe_address [4];
- u_int8_t vc_id [4];
- u_int8_t encapsulation[2];
+ uint8_t sender_pe_address [4];
+ uint8_t remote_pe_address [4];
+ uint8_t vc_id [4];
+ uint8_t encapsulation[2];
};
/*
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
struct lspping_tlv_downstream_map_ipv4_t {
- u_int8_t mtu [2];
- u_int8_t address_type;
- u_int8_t res;
- u_int8_t downstream_ip[4];
- u_int8_t downstream_interface[4];
+ uint8_t mtu [2];
+ uint8_t address_type;
+ uint8_t res;
+ uint8_t downstream_ip[4];
+ uint8_t downstream_interface[4];
};
struct lspping_tlv_downstream_map_ipv6_t {
- u_int8_t mtu [2];
- u_int8_t address_type;
- u_int8_t res;
- u_int8_t downstream_ip[16];
- u_int8_t downstream_interface[16];
+ uint8_t mtu [2];
+ uint8_t address_type;
+ uint8_t res;
+ uint8_t downstream_ip[16];
+ uint8_t downstream_interface[16];
};
struct lspping_tlv_downstream_map_info_t {
- u_int8_t hash_key_type;
- u_int8_t depth_limit;
- u_int8_t multipath_length [2];
+ uint8_t hash_key_type;
+ uint8_t depth_limit;
+ uint8_t multipath_length [2];
};
#define LSPPING_AFI_IPV4 1
timestamp.tv_sec=EXTRACT_32BITS(lspping_com_header->ts_sent_sec);
timestamp.tv_usec=EXTRACT_32BITS(lspping_com_header->ts_sent_usec);
ND_PRINT((ndo, "\n\t Sender Timestamp: "));
- ts_print(×tamp);
+ ts_print(ndo, ×tamp);
timestamp.tv_sec=EXTRACT_32BITS(lspping_com_header->ts_rcvd_sec);
timestamp.tv_usec=EXTRACT_32BITS(lspping_com_header->ts_rcvd_usec);
ND_PRINT((ndo, "Receiver Timestamp: "));
if ((timestamp.tv_sec != 0) && (timestamp.tv_usec != 0))
- ts_print(×tamp);
+ ts_print(ndo, ×tamp);
else
ND_PRINT((ndo, "no timestamp"));
while(tlen>(int)sizeof(struct lspping_tlv_header)) {
/* did we capture enough for fully decoding the tlv header ? */
- if (!ND_TTEST2(*tptr, sizeof(struct lspping_tlv_header)))
- goto trunc;
+ ND_TCHECK2(*tptr, sizeof(struct lspping_tlv_header));
lspping_tlv_header = (const struct lspping_tlv_header *)tptr;
lspping_tlv_type=EXTRACT_16BITS(lspping_tlv_header->type);
tlv_tlen=lspping_tlv_len; /* header not included -> no adjustment */
/* did we capture enough for fully decoding the tlv ? */
- if (!ND_TTEST2(*tptr, lspping_tlv_len))
- goto trunc;
+ ND_TCHECK2(*tptr, lspping_tlv_len);
tlv_hexdump=FALSE;
switch(lspping_tlv_type) {
while(tlv_tlen>(int)sizeof(struct lspping_tlv_header)) {
/* did we capture enough for fully decoding the subtlv header ? */
- if (!ND_TTEST2(*tptr, sizeof(struct lspping_tlv_header)))
- goto trunc;
+ ND_TCHECK2(*tptr, sizeof(struct lspping_tlv_header));
subtlv_hexdump=FALSE;
lspping_subtlv_header = (const struct lspping_tlv_header *)tlv_tptr;
subtlv_ptr.lspping_tlv_targetfec_subtlv_ldp_ipv4 = \
(const struct lspping_tlv_targetfec_subtlv_ldp_ipv4_t *)subtlv_tptr;
ND_PRINT((ndo, "\n\t %s/%u",
- ipaddr_string(subtlv_ptr.lspping_tlv_targetfec_subtlv_ldp_ipv4->prefix),
+ ipaddr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_ldp_ipv4->prefix),
subtlv_ptr.lspping_tlv_targetfec_subtlv_ldp_ipv4->prefix_len));
break;
subtlv_ptr.lspping_tlv_targetfec_subtlv_ldp_ipv6 = \
(const struct lspping_tlv_targetfec_subtlv_ldp_ipv6_t *)subtlv_tptr;
ND_PRINT((ndo, "\n\t %s/%u",
- ip6addr_string(subtlv_ptr.lspping_tlv_targetfec_subtlv_ldp_ipv6->prefix),
+ ip6addr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_ldp_ipv6->prefix),
subtlv_ptr.lspping_tlv_targetfec_subtlv_ldp_ipv6->prefix_len));
break;
#endif
subtlv_ptr.lspping_tlv_targetfec_subtlv_bgp_ipv4 = \
(const struct lspping_tlv_targetfec_subtlv_bgp_ipv4_t *)subtlv_tptr;
ND_PRINT((ndo, "\n\t %s/%u, sender-id %s",
- ipaddr_string(subtlv_ptr.lspping_tlv_targetfec_subtlv_bgp_ipv4->prefix),
+ ipaddr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_bgp_ipv4->prefix),
subtlv_ptr.lspping_tlv_targetfec_subtlv_bgp_ipv4->prefix_len,
- ipaddr_string(subtlv_ptr.lspping_tlv_targetfec_subtlv_bgp_ipv4->sender_id)));
+ ipaddr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_bgp_ipv4->sender_id)));
break;
#ifdef INET6
subtlv_ptr.lspping_tlv_targetfec_subtlv_bgp_ipv6 = \
(const struct lspping_tlv_targetfec_subtlv_bgp_ipv6_t *)subtlv_tptr;
ND_PRINT((ndo, "\n\t %s/%u, sender-id %s",
- ip6addr_string(subtlv_ptr.lspping_tlv_targetfec_subtlv_bgp_ipv6->prefix),
+ ip6addr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_bgp_ipv6->prefix),
subtlv_ptr.lspping_tlv_targetfec_subtlv_bgp_ipv6->prefix_len,
- ip6addr_string(subtlv_ptr.lspping_tlv_targetfec_subtlv_bgp_ipv6->sender_id)));
+ ip6addr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_bgp_ipv6->sender_id)));
break;
#endif
(const struct lspping_tlv_targetfec_subtlv_rsvp_ipv4_t *)subtlv_tptr;
ND_PRINT((ndo, "\n\t tunnel end-point %s, tunnel sender %s, lsp-id 0x%04x" \
"\n\t tunnel-id 0x%04x, extended tunnel-id %s",
- ipaddr_string(subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv4->tunnel_endpoint),
- ipaddr_string(subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv4->tunnel_sender),
+ ipaddr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv4->tunnel_endpoint),
+ ipaddr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv4->tunnel_sender),
EXTRACT_16BITS(subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv4->lsp_id),
EXTRACT_16BITS(subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv4->tunnel_id),
- ipaddr_string(subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv4->extended_tunnel_id)));
+ ipaddr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv4->extended_tunnel_id)));
break;
#ifdef INET6
(const struct lspping_tlv_targetfec_subtlv_rsvp_ipv6_t *)subtlv_tptr;
ND_PRINT((ndo, "\n\t tunnel end-point %s, tunnel sender %s, lsp-id 0x%04x" \
"\n\t tunnel-id 0x%04x, extended tunnel-id %s",
- ip6addr_string(subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv6->tunnel_endpoint),
- ip6addr_string(subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv6->tunnel_sender),
+ ip6addr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv6->tunnel_endpoint),
+ ip6addr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv6->tunnel_sender),
EXTRACT_16BITS(subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv6->lsp_id),
EXTRACT_16BITS(subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv6->tunnel_id),
- ip6addr_string(subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv6->extended_tunnel_id)));
+ ip6addr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv6->extended_tunnel_id)));
break;
#endif
(const struct lspping_tlv_targetfec_subtlv_l3vpn_ipv4_t *)subtlv_tptr;
ND_PRINT((ndo, "\n\t RD: %s, %s/%u",
bgp_vpn_rd_print(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_l3vpn_ipv4->rd),
- ipaddr_string(subtlv_ptr.lspping_tlv_targetfec_subtlv_l3vpn_ipv4->prefix),
+ ipaddr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_l3vpn_ipv4->prefix),
subtlv_ptr.lspping_tlv_targetfec_subtlv_l3vpn_ipv4->prefix_len));
break;
(const struct lspping_tlv_targetfec_subtlv_l3vpn_ipv6_t *)subtlv_tptr;
ND_PRINT((ndo, "\n\t RD: %s, %s/%u",
bgp_vpn_rd_print(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_l3vpn_ipv6->rd),
- ip6addr_string(subtlv_ptr.lspping_tlv_targetfec_subtlv_l3vpn_ipv6->prefix),
+ ip6addr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_l3vpn_ipv6->prefix),
subtlv_ptr.lspping_tlv_targetfec_subtlv_l3vpn_ipv6->prefix_len));
break;
#endif
(const struct lspping_tlv_targetfec_subtlv_l2vpn_vcid_old_t *)subtlv_tptr;
ND_PRINT((ndo, "\n\t Remote PE: %s" \
"\n\t VC-ID: 0x%08x, Encapsulation Type: %s (%u)",
- ipaddr_string(subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_vcid_old->remote_pe_address),
+ ipaddr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_vcid_old->remote_pe_address),
EXTRACT_32BITS(subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_vcid_old->vc_id),
tok2str(l2vpn_encaps_values,
"unknown",
(const struct lspping_tlv_targetfec_subtlv_l2vpn_vcid_t *)subtlv_tptr;
ND_PRINT((ndo, "\n\t Sender PE: %s, Remote PE: %s" \
"\n\t VC-ID: 0x%08x, Encapsulation Type: %s (%u)",
- ipaddr_string(subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_vcid->sender_pe_address),
- ipaddr_string(subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_vcid->remote_pe_address),
+ ipaddr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_vcid->sender_pe_address),
+ ipaddr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_vcid->remote_pe_address),
EXTRACT_32BITS(subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_vcid->vc_id),
tok2str(l2vpn_encaps_values,
"unknown",
case LSPPING_TLV_DOWNSTREAM_MAPPING:
/* that strange thing with the downstream map TLV is that until now
- * we do not know if its IPv4 or IPv6 , after we found the adress-type
+ * we do not know if its IPv4 or IPv6 , after we found the address-type
* lets recast the tlv_tptr and move on */
tlv_ptr.lspping_tlv_downstream_map_ipv4= \
case LSPPING_AFI_IPV4:
ND_PRINT((ndo, "\n\t Downstream IP: %s" \
"\n\t Downstream Interface IP: %s",
- ipaddr_string(tlv_ptr.lspping_tlv_downstream_map_ipv4->downstream_ip),
- ipaddr_string(tlv_ptr.lspping_tlv_downstream_map_ipv4->downstream_interface)));
+ ipaddr_string(ndo, tlv_ptr.lspping_tlv_downstream_map_ipv4->downstream_ip),
+ ipaddr_string(ndo, tlv_ptr.lspping_tlv_downstream_map_ipv4->downstream_interface)));
tlv_tptr+=sizeof(struct lspping_tlv_downstream_map_ipv4_t);
tlv_tlen-=sizeof(struct lspping_tlv_downstream_map_ipv4_t);
break;
case LSPPING_AFI_IPV6:
ND_PRINT((ndo, "\n\t Downstream IP: %s" \
"\n\t Downstream Interface IP: %s",
- ip6addr_string(tlv_ptr.lspping_tlv_downstream_map_ipv6->downstream_ip),
- ip6addr_string(tlv_ptr.lspping_tlv_downstream_map_ipv6->downstream_interface)));
+ ip6addr_string(ndo, tlv_ptr.lspping_tlv_downstream_map_ipv6->downstream_ip),
+ ip6addr_string(ndo, tlv_ptr.lspping_tlv_downstream_map_ipv6->downstream_interface)));
tlv_tptr+=sizeof(struct lspping_tlv_downstream_map_ipv6_t);
tlv_tlen-=sizeof(struct lspping_tlv_downstream_map_ipv6_t);
break;
case LSPPING_AFI_UNMB:
ND_PRINT((ndo, "\n\t Downstream IP: %s" \
"\n\t Downstream Interface Index: 0x%08x",
- ipaddr_string(tlv_ptr.lspping_tlv_downstream_map_ipv4->downstream_ip),
+ ipaddr_string(ndo, tlv_ptr.lspping_tlv_downstream_map_ipv4->downstream_ip),
EXTRACT_32BITS(tlv_ptr.lspping_tlv_downstream_map_ipv4->downstream_interface)));
tlv_tptr+=sizeof(struct lspping_tlv_downstream_map_ipv4_t);
tlv_tlen-=sizeof(struct lspping_tlv_downstream_map_ipv4_t);
case LSPPING_TLV_BFD_DISCRIMINATOR:
tptr += sizeof(struct lspping_tlv_header);
- if (!ND_TTEST2(*tptr, LSPPING_TLV_BFD_DISCRIMINATOR_LEN))
- goto trunc;
+ ND_TCHECK2(*tptr, LSPPING_TLV_BFD_DISCRIMINATOR_LEN);
ND_PRINT((ndo, "\n\t BFD Discriminator 0x%08x", EXTRACT_32BITS(tptr)));
break;
case LSPPING_TLV_VENDOR_ENTERPRISE:
{
- u_int32_t vendor_id;
+ uint32_t vendor_id;
- if (!ND_TTEST2(*tptr, LSPPING_TLV_VENDOR_ENTERPRISE_LEN))
- goto trunc;
+ ND_TCHECK2(*tptr, LSPPING_TLV_VENDOR_ENTERPRISE_LEN);
vendor_id = EXTRACT_32BITS(tlv_tptr);
ND_PRINT((ndo, "\n\t Vendor: %s (0x%04x)",
tok2str(smi_values, "Unknown", vendor_id),