STP

Overview

Declarations of API for Spanning tree Protocol. More…

// typedefs

typedef void (*tapi_stp_bpdu_callback)(
    const ndn_stp_bpdu_t *bpdu,
    const struct timeval *time_stamp,
    void *userdata
    );

// global functions

int tapi_stp_plain_csap_create(const char* ta_name, int sid, const char* ifname, const uint8_t* own_mac_addr, const uint8_t* peer_mac_addr, csap_handle_t* stp_csap);
int tapi_stp_bpdu_send(const char* ta_name, int sid, csap_handle_t stp_csap, const asn_value* templ);

Detailed Documentation

Declarations of API for Spanning tree Protocol.

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

Typedefs

typedef void (*tapi_stp_bpdu_callback)(
    const ndn_stp_bpdu_t *bpdu,
    const struct timeval *time_stamp,
    void *userdata
    )

Callback function for the tapi_eth_recv_start() routine, it is called for each packet received for csap.

Parameters:

header

Structure with Ethernet header of the frame.

payload

Payload of the frame.

plen

Length of the frame payload.

userdata

Pointer to user data, provided by the caller of tapi_eth_recv_start.

Global Functions

int tapi_stp_plain_csap_create(const char* ta_name, int sid, const char* ifname, const uint8_t* own_mac_addr, const uint8_t* peer_mac_addr, csap_handle_t* stp_csap)

Creates STP CSAP that can be used for sending/receiving Configuration and Notification BPDUs specified in Media Access Control (MAC) Bridges ANSI/IEEE Std. 802.1D, 1998 Edition section 9

If “own_mac_addr” parameter is not NULL, then “peer_mac_addr” has to be NULL, and vice versa - If “peer_mac_addr” parameter is not NULL, then “own_mac_addr” has to be NULL. If both “peer_mac_addr” and “own_mac_addr” are NULL, then “own_mac_addr” is assumed to be MAC address of the specified interface on the Agent.

Parameters:

ta_name

Test Agent name where CSAP will be created

sid

RCF session;

ifname

Name of an interface the CSAP is attached to (frames are sent/captured from/on this interface)

own_mac_addr

Default MAC address used on the Agent:

  • source MAC address of outgoing from the CASP frames,

peer_mac_addr

Default peer MAC address:

  • source MAC address of incoming into the CSAP frames

stp_csap

Created STP CSAP (OUT)

Returns:

Status of the operation

int tapi_stp_bpdu_send(const char* ta_name, int sid, csap_handle_t stp_csap, const asn_value* templ)

Sends STP BPDU from the specified CSAP

Parameters:

ta_name

Test Agent name

sid

RCF session identifier

stp_csap

CSAP handle

templ

Traffic template

TE_EINVAL

This code is returned if “peer_mac_addr” value wasn’t specified on creating the CSAP and “dst_mac_addr” parameter is NULL.

0

BPDU is sent

Returns:

Status of the operation