ICMP4

Overview

Copyright (C) 2004-2022 OKTET Labs Ltd. More…

// global functions

te_errno tapi_icmp4_add_csap_layer(asn_value** csap_spec);
te_errno tapi_icmp4_add_pdu(asn_value** tmpl_or_ptrn, asn_value** pdu, te_bool is_pattern, int type, int code);
te_errno tapi_ipproto_ip4_icmp_ip4_eth_csap_create(const char* ta_name, int sid, const char* eth_dev, unsigned int receive_mode, const uint8_t* eth_src, const uint8_t* eth_dst, in_addr_t src_addr, in_addr_t dst_addr, in_addr_t msg_src_addr, in_addr_t msg_dst_addr, int msg_src_port, int msg_dst_port, int ip_proto, csap_handle_t* ip_proto_csap);
te_errno tapi_tcp_ip4_icmp_ip4_eth_csap_create(const char* ta_name, int sid, const char* eth_dev, unsigned int receive_mode, const uint8_t* eth_src, const uint8_t* eth_dst, in_addr_t src_addr, in_addr_t dst_addr, in_addr_t msg_src_addr, in_addr_t msg_dst_addr, int msg_src_port, int msg_dst_port, csap_handle_t* tcp_csap);
te_errno tapi_udp_ip4_icmp_ip4_eth_csap_create(const char* ta_name, int sid, const char* eth_dev, unsigned int receive_mode, const uint8_t* eth_src, const uint8_t* eth_dst, in_addr_t src_addr, in_addr_t dst_addr, in_addr_t msg_src_addr, in_addr_t msg_dst_addr, int msg_src_port, int msg_dst_port, csap_handle_t* udp_csap);
te_errno tapi_icmp_ip4_eth_csap_create(const char* ta_name, int sid, const char* eth_dev, unsigned int receive_mode, const uint8_t* eth_src, const uint8_t* eth_dst, in_addr_t src_addr, in_addr_t dst_addr, csap_handle_t* icmp_csap);
te_errno tapi_icmp_ip4_csap_create(const char* ta_name, int sid, const char* ifname, in_addr_t src_addr, in_addr_t dst_addr, csap_handle_t* icmp_csap);

Detailed Documentation

Copyright (C) 2004-2022 OKTET Labs Ltd. All rights reserved.

Global Functions

te_errno tapi_icmp4_add_csap_layer(asn_value** csap_spec)

Add ICMPv4 layer in CSAP specification.

Parameters:

csap_spec

Location of CSAP specification pointer.

Status

code.

te_errno tapi_icmp4_add_pdu(asn_value** tmpl_or_ptrn, asn_value** pdu, te_bool is_pattern, int type, int code)

Add ICMPv4 PDU as the last PDU to the last unit of the traffic template or pattern.

Parameters:

tmpl_or_ptrn

Location of ASN.1 value with traffic template or pattern

pdu

Location for ASN.1 value pointer with added PDU

is_pattern

Is the first argument template or pattern

type

Type of ICMP message or negative to keep unspecified.

code

ICMP message code or negative to keep unspecified.

Returns:

Status code.

te_errno tapi_ipproto_ip4_icmp_ip4_eth_csap_create(const char* ta_name, int sid, const char* eth_dev, unsigned int receive_mode, const uint8_t* eth_src, const uint8_t* eth_dst, in_addr_t src_addr, in_addr_t dst_addr, in_addr_t msg_src_addr, in_addr_t msg_dst_addr, int msg_src_port, int msg_dst_port, int ip_proto, csap_handle_t* ip_proto_csap)

Create ‘{udp,tcp}.ip4.icmp.ip4.eth’ CSAP on the specified Agent

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 tad_common.h. Use TAD_ETH_RECV_DEF by default.

src_mac

Local MAC address (or NULL)

dst_mac

Remote MAC address (or NULL)

src_addr

Local IP address in network byte order (or NULL)

dst_addr

Remote IP address in network byte order (or NULL)

msg_src_addr

Source IPv4 Address of ICMP Error message

msg_dst_addr

Destination IPv4 Address of ICMP Error message

msg_src_port

Source UDP port in network byte order or -1

msg_dst_port

Destination UDP port in network byte order or -1

ip_proto

IPPROTO_UDP or IPPROTO_TCP

ip_proto_csap

Location for the CSAP handle (OUT)

Returns:

Statuc code

te_errno tapi_tcp_ip4_icmp_ip4_eth_csap_create(const char* ta_name, int sid, const char* eth_dev, unsigned int receive_mode, const uint8_t* eth_src, const uint8_t* eth_dst, in_addr_t src_addr, in_addr_t dst_addr, in_addr_t msg_src_addr, in_addr_t msg_dst_addr, int msg_src_port, int msg_dst_port, csap_handle_t* tcp_csap)

Create ‘tcp.ip4.icmp.ip4.eth’ CSAP on the specified Agent

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 tad_common.h. Use TAD_ETH_RECV_DEF by default.

src_mac

Local MAC address (or NULL)

dst_mac

Remote MAC address (or NULL)

src_addr

Local IP address in network byte order (or NULL)

dst_addr

Remote IP address in network byte order (or NULL)

msg_src_addr

Source IPv4 Address of ICMP Error message

msg_dst_addr

Destination IPv4 Address of ICMP Error message

msg_src_port

Source UDP port in network byte order or -1

msg_dst_port

Destination UDP port in network byte order or -1

tcp_csap

Location for the CSAP handle (OUT)

Returns:

Zero on success or error code

te_errno tapi_udp_ip4_icmp_ip4_eth_csap_create(const char* ta_name, int sid, const char* eth_dev, unsigned int receive_mode, const uint8_t* eth_src, const uint8_t* eth_dst, in_addr_t src_addr, in_addr_t dst_addr, in_addr_t msg_src_addr, in_addr_t msg_dst_addr, int msg_src_port, int msg_dst_port, csap_handle_t* udp_csap)

Create ‘udp.ip4.icmp.ip4.eth’ CSAP on the specified Agent

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 tad_common.h. Use TAD_ETH_RECV_DEF by default.

src_mac

Local MAC address (or NULL)

dst_mac

Remote MAC address (or NULL)

src_addr

Local IP address in network byte order (or NULL)

dst_addr

Remote IP address in network byte order (or NULL)

msg_src_addr

Source IPv4 Address of ICMP Error message

msg_dst_addr

Destination IPv4 Address of ICMP Error message

msg_src_port

Source UDP port in network byte order or -1

msg_dst_port

Destination UDP port in network byte order or -1

udp_csap

Location for the CSAP handle (OUT)

Returns:

Zero on success or error code

te_errno tapi_icmp_ip4_eth_csap_create(const char* ta_name, int sid, const char* eth_dev, unsigned int receive_mode, const uint8_t* eth_src, const uint8_t* eth_dst, in_addr_t src_addr, in_addr_t dst_addr, csap_handle_t* icmp_csap)

Create ‘icmp.ip4.eth’ CSAP on the specified Agent

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 tad_common.h. Use TAD_ETH_RECV_DEF by default.

eth_src

Local MAC address (or NULL)

eth_dst

Remote MAC address (or NULL)

src_addr

Local IP address in network byte order (or NULL)

dst_addr

Remote IP address in network byte order (or NULL)

icmp_csap

Location for the CSAP handle (OUT)

Returns:

Zero on success or error code

te_errno tapi_icmp_ip4_csap_create(const char* ta_name, int sid, const char* ifname, in_addr_t src_addr, in_addr_t dst_addr, csap_handle_t* icmp_csap)

Create ‘icmp.ip4’ CSAP on the specified Agent

Parameters:

ta_name

Test Agent name

sid

RCF SID

ifname

Name of interface

src_addr

Local IP address in network byte order (or NULL)

dst_addr

Remote IP address in network byte order (or NULL)

icmp_csap

Location for the CSAP handle (OUT)

Returns:

Zero on success or error code