ICMP
Overview
Copyright (C) 2019-2022 OKTET Labs Ltd. More…
// global functions te_errno tapi_udp_ip_icmp_ip_eth_csap_create(const char* ta_name, int sid, const char* eth_dev, unsigned int receive_mode, const uint8_t* loc_eth, const uint8_t* rem_eth, const struct sockaddr* loc_saddr, const struct sockaddr* rem_saddr, const struct sockaddr* msg_loc_saddr, const struct sockaddr* msg_rem_saddr, int af, csap_handle_t* udp_csap); te_errno tapi_tcp_ip_icmp_ip_eth_csap_create(const char* ta_name, int sid, const char* eth_dev, unsigned int receive_mode, const uint8_t* loc_eth, const uint8_t* rem_eth, const struct sockaddr* loc_saddr, const struct sockaddr* rem_saddr, const struct sockaddr* msg_loc_saddr, const struct sockaddr* msg_rem_saddr, int af, csap_handle_t* tcp_csap); te_errno tapi_icmp_tmpl_encap_ext(const asn_value* tmpl, const void* src_eth, const void* dst_eth, const struct sockaddr* src_addr, const struct sockaddr* dst_addr, int ttl_hoplimit, int ip4_tos, int af, uint8_t icmp_type, uint8_t icmp_code, icmp6_msg_body* msg_body, asn_value** icmp_tmpl); static te_errno tapi_icmp_tmpl_encap(const asn_value* tmpl, const void* src_eth, const void* dst_eth, const struct sockaddr* src_addr, const struct sockaddr* dst_addr, int af, uint8_t icmp_type, uint8_t icmp_code, asn_value** icmp_tmpl);
Detailed Documentation
Copyright (C) 2019-2022 OKTET Labs Ltd. All rights reserved.
Global Functions
te_errno tapi_udp_ip_icmp_ip_eth_csap_create(const char* ta_name, int sid, const char* eth_dev, unsigned int receive_mode, const uint8_t* loc_eth, const uint8_t* rem_eth, const struct sockaddr* loc_saddr, const struct sockaddr* rem_saddr, const struct sockaddr* msg_loc_saddr, const struct sockaddr* msg_rem_saddr, int af, csap_handle_t* udp_csap)
Create ‘udp.ip.icmp.ip.eth’ CSAP on the specified Agent, IPv4 or IPv6 version depends on the af.
Parameters:
ta_name |
Test Agent name |
sid |
RCF SID |
eth_dev |
Name of Ethernet interface |
receive_mode |
Bitmask with receive mode, see ‘enum tad_eth_recv_mode’ in |
loc_eth |
Local MAC address (or NULL) |
rem_eth |
Remote MAC address (or NULL) |
loc_saddr |
Local IP address (or NULL) |
rem_saddr |
Remote IP address (or NULL) |
msg_loc_saddr |
Local IP address/port of ICMP Error message (or NULL) |
msg_rem_saddr |
Remote IP address/port of ICMP Error message (or NULL) |
af |
Address family |
udp_csap |
Location for the CSAP handle (OUT) |
Returns:
Status code
te_errno tapi_tcp_ip_icmp_ip_eth_csap_create(const char* ta_name, int sid, const char* eth_dev, unsigned int receive_mode, const uint8_t* loc_eth, const uint8_t* rem_eth, const struct sockaddr* loc_saddr, const struct sockaddr* rem_saddr, const struct sockaddr* msg_loc_saddr, const struct sockaddr* msg_rem_saddr, int af, csap_handle_t* tcp_csap)
Create ‘tcp.ip.icmp.ip.eth’ CSAP on the specified Agent, IPv4 or IPv6 version depends on the af.
Parameters:
ta_name |
Test Agent name |
sid |
RCF SID |
eth_dev |
Name of Ethernet interface |
receive_mode |
Bitmask with receive mode, see ‘enum tad_eth_recv_mode’ in |
loc_eth |
Local MAC address (or NULL) |
rem_eth |
Remote MAC address (or NULL) |
loc_saddr |
Local IP address (or NULL) |
rem_saddr |
Remote IP address (or NULL) |
msg_loc_saddr |
Local IP address/port of ICMP Error message (or NULL) |
msg_rem_saddr |
Remote IP address/port of ICMP Error message (or NULL) |
af |
Address family |
tcp_csap |
Location for the CSAP handle (OUT) |
Returns:
Status code
te_errno tapi_icmp_tmpl_encap_ext(const asn_value* tmpl, const void* src_eth, const void* dst_eth, const struct sockaddr* src_addr, const struct sockaddr* dst_addr, int ttl_hoplimit, int ip4_tos, int af, uint8_t icmp_type, uint8_t icmp_code, icmp6_msg_body* msg_body, asn_value** icmp_tmpl)
Encapsulate packet template in ICMP header.
Parameters:
tmpl |
Packet template to encapsulate. |
src_eth |
Source MAC address for ETH header. |
dst_eth |
Destination address for ETH header. |
src_addr |
Source IP address for IP header. |
dst_addr |
Destination IP address for IP header. |
ttl_hoplimit |
TTL or Hop Limit for IP header. |
ip4_tos |
TOS field for IP header. For IPv4 only. (may be |
af |
Address family. |
icmp_type |
ICMP type. |
icmp_code |
ICMP code. |
msg_body |
ICMP message body. For IPv6 only. (may be |
icmp_tmpl |
Resulting packet template. |
Returns:
Status code
static te_errno tapi_icmp_tmpl_encap(const asn_value* tmpl, const void* src_eth, const void* dst_eth, const struct sockaddr* src_addr, const struct sockaddr* dst_addr, int af, uint8_t icmp_type, uint8_t icmp_code, asn_value** icmp_tmpl)
Wrapper for tapi_icmp_tmpl_encap_ext with default options.
Parameters:
tmpl |
Packet template to encapsulate. |
src_eth |
Source MAC address for ETH header. |
dst_eth |
Destination address for ETH header. |
src_addr |
Source IP address for IP header. |
dst_addr |
Destination IP address for IP header. |
af |
Address family. |
icmp_type |
ICMP type. |
icmp_code |
ICMP code. |
icmp_tmpl |
Resulting packet template. |
Returns:
Status code