IPv6

Overview

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

// typedefs

typedef struct tapi_ip6_packet_t tapi_ip6_packet_t;

typedef void (*ip6_callback)(
    const tapi_ip6_packet_t *pkt,
    void *userdata
    );

// structs

struct tapi_ip6_packet_t;

// global functions

tapi_tad_trrecv_cb_data* tapi_ip6_eth_trrecv_cb_data(ip6_callback callback, void* user_data);
te_errno tapi_ip6_add_csap_layer(asn_value** csap_spec, const uint8_t* local_addr, const uint8_t* remote_addr, int next_header);
te_errno tapi_ip6_eth_csap_create(const char* ta_name, int sid, const char* eth_dev, unsigned int receive_mode, const uint8_t* loc_mac_addr, const uint8_t* rem_mac_addr, const uint8_t* loc_ip6_addr, const uint8_t* rem_ip6_addr, int next_header, csap_handle_t* ip6_csap);
te_errno tapi_ip6_add_pdu(asn_value** tmpl_or_ptrn, asn_value** pdu, te_bool is_pattern, const uint8_t* src_addr, const uint8_t* dst_addr, int next_header, int hop_limit);
te_errno tapi_ip6_get_payload_len(asn_value* pdu, size_t* len);
te_errno tapi_ip6_pdu_tmpl_fragments(asn_value** tmpl, asn_value** pdu, tapi_ip_frag_spec* fragments, unsigned int num_frags);

Detailed Documentation

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

Global Functions

te_errno tapi_ip6_add_csap_layer(asn_value** csap_spec, const uint8_t* local_addr, const uint8_t* remote_addr, int next_header)

Add IPv6 layer in CSAP specification.

Parameters:

csap_spec

Location of CSAP specification pointer.

local_addr

Default local IPv6 address

remote_addr

Default remote IPv6 address

next_header

Protocol or negative to keep unspecified.

Status

code.

te_errno tapi_ip6_eth_csap_create(const char* ta_name, int sid, const char* eth_dev, unsigned int receive_mode, const uint8_t* loc_mac_addr, const uint8_t* rem_mac_addr, const uint8_t* loc_ip6_addr, const uint8_t* rem_ip6_addr, int next_header, csap_handle_t* ip6_csap)

Create ‘ip6.eth’ CSAP

Parameters:

ta_name

Test Agent name

sid

RCF SID

eth_dev

Name of Ethernet interface

receive_mode

Receive mode for Ethernet Layer on the Interface

loc_mac_addr

Local MAC address (or NULL)

rem_mac_addr

Remote MAC address (or NULL)

loc_ip6_addr

Local IPv6 address

rem_ip6_addr

Remote IPv6 address

next_header

Protocol over IPv6 or negative number

ip6_csap

Location for the IPv6 CSAP handle (OUT)

Returns:

Status code.

te_errno tapi_ip6_add_pdu(asn_value** tmpl_or_ptrn, asn_value** pdu, te_bool is_pattern, const uint8_t* src_addr, const uint8_t* dst_addr, int next_header, int hop_limit)

Add IPv6 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

src_addr

Source IPv6 address

dst_addr

Destination IPv6 address

next_header

Protocol or negative to keep unspecified.

hop_limit

Time-to-live or negative to keep unspecified.

Returns:

Status code.

te_errno tapi_ip6_get_payload_len(asn_value* pdu, size_t* len)

Compute IPv6 packet payload length from IP header length fields.

Parameters:

pdu

IPv6 PDU.

len

Where to save computed length.

Returns:

Status code.

te_errno tapi_ip6_pdu_tmpl_fragments(asn_value** tmpl, asn_value** pdu, tapi_ip_frag_spec* fragments, unsigned int num_frags)

Add fragments specification to IPv6 PDU.

Parameters:

tmpl

NULL or location of ASN.1 value with traffic template where IPv6 PDU should be added

pdu

If tmpl is NULL, this parameter must point to IPv6 PDU where to add fragments specification; on return, if this parameter is not NULL, pointer to IPv6 PDU will be saved in it

fragments

Array with IP fragments specifications

num_frags

Number of IP fragments

Returns:

Status code.