# ADLINK PacketManager API Programming Guide

Manual Revision: 1.1

Revision Date: August 15, 2017

Part Number: 50-1G043-1010

# Preface

Copyright 2016, 2017 ADLINK Technology, Inc.

This document contains proprietary information protected by copyright. All rights are reserved. No part of this manual may be reproduced by any mechanical, electronic, or other means in any form without prior written permission of the manufacturer.

# Disclaimer

The information in this document is subject to change without prior notice in order to improve reliability, design, and function and does not represent a commitment on the part of the manufacturer. In no event will the manufacturer be liable for direct, indirect, special, incidental, or consequential damages arising out of the use or inability to use the product or documentation, even if advised of the possibility of such damages.

# Environmental Responsibility

ADLINK is committed to fulfill its social responsibility to global environmental preservation through compliance with the European Union's Restriction of Hazardous Substances (RoHS) directive and Waste Electrical and Electronic Equipment (WEEE) directive. Environmental protection is a top priority for ADLINK. We have enforced measures to ensure that our products, manufacturing processes, components, and raw materials have as little impact on the environment as possible. When products are at their end of life, our customers are encouraged to dispose of them in accordance with the product disposal and/or recovery programs prescribed by their nation or company.

# Trademarks

Product names mentioned herein are used for identification purposes only and may be trademarks and/or registered trademarks of their respective companies.

Revision History

<table><tr><td>Rev</td><td>Date</td><td>Description</td></tr><tr><td>1.00</td><td>22/03/2016</td><td>Initial release</td></tr><tr><td>1.1</td><td>15/08/2017</td><td>Separate the API sections for switch and processor blades respectively. Add VRRP configuration note. Update for MXN-3610/MXN-4100. Add LBG and CMM configuration note. Remove API for processor blades.</td></tr></table>

# Table of Contents

# Preface.

# 1 Introduction...... . 5

1.1 Architecture Overview .. 5
1.2 Deliverables.. 6

# 2 Application API ..

2.1 Base . 7

2.1.1 Macro Definitions.. 7
2.1.2 Data Structure . . 8
2.1.3 Enum Type . . 8
2.1.4 Functions. . 11

2.2 Static Routing (IPv4) . . 15

2.2.1 Macro Definitions.. . 15
2.2.2 Enum Type . . 16
2.2.3 Data Structure . 16
2.2.4 Functions. 17

2.3 Static Routing (IPv6) . . 20

2.3.1 Macro Definitions.. .. 20
2.3.2 Enum Type . . 21
2.3.3 Data Structure . .. 21
2.3.4 Functions. . 22

2.4 Port .. . 25

2.4.1 Macro Definitions.. . 25
2.4.2 Enum Type . . 26
2.4.3 Data Structure . . 29
2.4.4 Function.. . 34

2.5 VLAN .. . 38

2.5.1 Macro Definitions.. . 38
2.5.2 Enum Type . . 38
2.5.3 Data Structure . . 39
2.5.4 Functions.. .. 40

2.6 Trunk .. . 44

2.6.1 Macro Definitions.. . 44
2.6.2 Enum Type . . 45
2.6.3 Data Structure . . 48
2.6.4 Functions. . 51

2.7 LBG . . 64

2.7.1 Macro Definitions.. . 64
2.7.2 EnumType .. . 66

2.7.3 Data Structure . . 66
2.7.4 Functions.. . 66

2.8 Layer-2 . . 70

2.8.1 Macro Definitions.. ... 70
2.8.2 Enum Type .. ... 70
2.8.3 Data Structure . .. 70
2.8.4 Functions.. . 71

2.9 Access Control List.. . 74

2.9.1 Macro Definitions.. . 74
2.9.2 Enum Type .. . 74
2.9.3 Data Structure . . 77
2.9.4 Functions. . 79

2.10 Spanning Tree Protocol.. . 82

2.10.1 Macro Definitions... . 82
2.10.2 Enum Type .. . 82
2.10.3 Data Structure .. .. 83
2.10.4 Functions.. . 89

2.11 Rapid Spanning Tree Protocol .. . 96

2.11.1 Macro Definitions.... .. 96
2.11.2 Enum Type .... . 96
2.11.3 Data Structure . . 99
2.11.4 Functions.. . 109

2.12 LLDP . . 116

2.12.1 Macro Definitions... . 116
2.12.2 Enum Type .... . 117
2.12.3 Data Structure . . 118
2.12.4 Functions.. . 122

2.13 VRRP . . 127

2.13.1 Macro Definitions... . 127
2.13.2 EnumType .... . 127
2.13.3 Data Structure ... . 128
2.13.4 Functions.. . 129

2.14 CMM. . 132

2.14.1 Macro Definitions... . 132
2.14.2 EnumType ..... . 132
2.14.3 Data Structure .. . 132
2.14.4 Functions... . 136

Getting Service........ ..... 141

# 1 Introduction

This guide describes how use the ADLINK PacketManager Software application program interface (API).

# 1.1 Architecture Overview

All the APIs listed in this document are programmed using the hardware architecture, shown in Figure 1. In this figure, the client is running on a standalone server. However, it also can run on the Local Management Processor (LMP) on the blade.

![Based on the provided image, here is the description of the flowchart:\n\n**Labeled Blocks:**\n*   **Left Side:** A computer tower icon labeled **'Controller'** at the bottom. Above the icon, the text reads **'PacketManager API Library runs on client'**.\n*   **Center:** A cloud icon labeled **'Ethernet'** inside the cloud shape.\n*   **Right Side:** A server rack icon labeled **'Blade Server'** at the bottom. Above the icon, the text reads **'PacketManager Core Service runs on blade server'**.\n\n**Connections:**\n*   **Controller to Ethernet:** Bidirectional blue arrows connect the 'Controller' block to the 'Ethernet' cloud.\n*   **Blade Server to Ethernet:** Bidirectional blue arrows connect the 'Blade Server' block to the 'Ethernet' cloud.](.packetmanager-manual-en-20170818-v1/ecf6fa4fca66394f7ab6acffe9ad2657e9b5158ac7b9470b9facb467cb60d2e2.jpg)

Figure 1 Hardware Architecture for PacketManager API Programming

ADLINK PacketManager Software implements the network connections between server and client so that customers do not have to worry about the connections between them. Client API libraries, header files and relevant documentation are provided for easy programming.

PacketManager is designed to support different hardware architectures, including Broadcom and Intel® Red Rock Canyon switches. PacketManager provides application APIs to handle operations for protocol stack, ports and other modules. Some APIs are dedicated for specific switch boards and others are general purpose.

# 1.2 Deliverables

The ADLINK PacketManager API Library includes the following software components:

Include: Header files of the ADLINK PackageManager API library

Lib: Static library including the API functions listed in this document

Bin: Binary files for controlling the system

Example: Application demo to show usage of the APIs provided

ReadMe: Release notes for different library revisions

# 2 Application API

# 2.1 Base

This section describes the macro, enum, struct and functions for fundamentals. They are defined in the header file “adlink\_api\_base.h” or “adlink\_base.h”. Users do not need to worry about where they are defined. Just include the header file “adlink\_api\_base.h”.

# 2.1.1 Macro Definitions

# MAC\_SIZE

MAC address size

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# PROTOCOL\_UDP

UDP protocol id.

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# PROTOCOL\_TCP

TCP protocol id

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# PROTOCOL\_ICMP

ICMP protocol id

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# ADLINK\_EVENT\_SWITCH\_DOWN

Switch blade down event (RPC lost).

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# 2.1.2 Data Structure

adlink\_ether\_address\_t
```c
typedef struct adlink_ether_address_s
{
    uint8_t addr_bytes[ETHER_ADDR_LENGTH]; /**&lt; Address bytes in transmission order */
} __attribute__ ((____packed____)) adlink_ether_address_t;
```

Define the Ethernet address format.

Supported On
```txt
aTCA-3710 aTCA-N700 aTCA-3430 MXN-3610/MXN-4100 cPCI-6S10 MXN-0410
```

# 2.1.3 Enum Type

status\_t
```python
typedef enum
{
    ADLINK_E_None = 0,
    ADLINK_E_INTERNAL = -1,
    ADLINK_E_MALLOC = -2,
    ADLINK_E_PARA = -3,
    ADLINK_E_TABLE_EMPTY = -4,
    ADLINK_E_TABLE_FULL = -5,
    ADLINK_E_NOT_FOUND = -6,
    ADLINK_E_FIND = ADLINK_E_NOT_FOUND,
    ADLINK_E_EXIST = -7,
    ADLINK_E_TIMEOUT = -8,
    ADLINK_E_BUSY = -9,
    ADLINK_E_FAIL = -10,
    ADLINK_E_DISABLED = -11,
    ADLINK_E_BADID = -12,
    ADLINK_E_RESOURCE = -13,
    ADLINK_E_CONFIG = -14,
    ADLINK_E_UNAVAIL = -15,
    ADLINK_E_INIT = -16,
    ADLINK_E_SOCKET = -17,
    ADLINK_E_RING = -18,
    ADLINK_E_IPC = -19,
    ADLINK_E_RPC = -20,
    ADLINK_E_FILE = -21,
```

```c
ADLINK_E_RANGE = -22,
ADLINK_E_NO_LOCK = -23,
ADLINK_E_AUTH = -24,
ADLINK_E_NOMSG = -25,
ADLINK_E_OVERFLOW = -26,
ADLINK_E_NOT_SUPPORT = -27,
ADLINK_E_BAD_MSG = -28,
ADLINK_E_FUNC_NOT_IMPLEMENT = -29,
ADLINK_E_NOENT = -30,
ADLINK_E_NOSPC = -31,
ADLINK_E_NO_TAILQ = -32,
ADLINK_E_OPEN = -33,
ADLINK_E_ROUTE = -34,
ADLINK_E_PTHREAD = -35,
ADLINK_E_PORT_EXIST = -36,
ADLINK_E_PORT_FIND = -37,
ADLINK_E_OTHER = -127,
ADLINK_E_SERVER_BASE = -128,
} status_t;
```

Supported On

&lt;table&gt;<tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

This enum describes the return codes of the APIs. They are defined in “adlink\_api\_base.h”. Table 1 shows the meaning of each error code.

<table><tr><td>Return Code</td><td>Description</td></tr><tr><td>ADLINK_E_None</td><td>The routine completed successfully</td></tr><tr><td>ADLINK_E_INTERNAL</td><td>Some internal operations failed in an unexpected way. This usually indicates that an access to some hardware resource failed</td></tr><tr><td>ADLINK_E_MALLOC</td><td>Dynamically allocated memory was not available to complete the operation</td></tr><tr><td>ADLINK_E_PARA</td><td>A parameter to a ADLINK API routines was invalid</td></tr><tr><td>ADLINK_E_TABLE_EMPTY</td><td>The routine expected a table not to be empty</td></tr><tr><td>ADLINK_E_TABLE_FULL</td><td>The routine could not add an entry to the table</td></tr><tr><td>ADLINK_E_NOT_FOUNDADLINK_E_FIND</td><td>The specific entry in a table could not be found</td></tr><tr><td>ADLINK_E_EXIST</td><td>The specific entry was already in a table</td></tr><tr><td>ADLINK_E_TIMEOUT</td><td>The routine started an operation that did not complete</td></tr><tr><td>ADLINK_E_BUSY</td><td>The routine tried to start an operation, but a previous operation was still running</td></tr><tr><td>ADLINK_E_FAIL</td><td>The routine attempted an operation that could not be</td></tr></table>

<table><tr><td>Return Code</td><td>Description</td></tr><tr><td></td><td>completed. This may be caused by a hardware failure or a configuration failure</td></tr><tr><td>ADLINK_E_DISABLED</td><td>The routine could not complete because a required feature was temporarily disabled</td></tr><tr><td>ADLINK_E_BADID</td><td>An identifier was not valid</td></tr><tr><td>ADLINK_E_RESOURCE</td><td>The routine needed more resources</td></tr><tr><td>ADLINK_E_CONFIG</td><td>Invalid configuration</td></tr><tr><td>ADLINK_E_UNAVAIL</td><td>Feature unavailable</td></tr><tr><td>ADLINK_E_INIT</td><td>Feature not initialized</td></tr><tr><td>ADLINK_E_SOCKET</td><td>Socket error</td></tr><tr><td>ADLINK_E_RING</td><td>RING error</td></tr><tr><td>ADLINK_E_IPC</td><td>IPC error</td></tr><tr><td>ADLINK_E_RPC</td><td>RPC error</td></tr><tr><td>ADLINK_E_FILE</td><td>File operate error</td></tr><tr><td>ADLINK_E_RANGE</td><td>Result too large or too small</td></tr><tr><td>ADLINK_E_NO_LOCK</td><td>No locks available</td></tr><tr><td>ADLINK_E_AUTH</td><td>Authentication error</td></tr><tr><td>ADLINK_E_NOMSG</td><td>No message of desired type</td></tr><tr><td>ADLINK_E_OVERFLOW</td><td>Value too large to be stored in data type</td></tr><tr><td>ADLINK_E_NOT_SUPPORTED</td><td>Not supported</td></tr><tr><td>ADLINK_E_BAD_MSG</td><td>Bad or Corrupt message</td></tr><tr><td>ADLINK_E_FUNC_NOT_IMPLEMENTMENT</td><td>Function not implemented</td></tr><tr><td>ADLINK_E_NOENT</td><td>No such file or such directory</td></tr><tr><td>ADLINK_E_NOSPC</td><td>No space left on device</td></tr><tr><td>ADLINK_E_NO_TAILQ</td><td>Uninitialized TAIL Queue</td></tr><tr><td>ADLINK_E_OPEN</td><td>Open/fopen operation failed</td></tr><tr><td>ADLINK_E_ROUTE</td><td>Route error</td></tr><tr><td>ADLINK_E_PTHREAD</td><td>Pthread error</td></tr><tr><td>ADLINK_E_PORT_EXIST</td><td>Port already exist</td></tr><tr><td>ADLINK_E_PORT_FIND</td><td>Port not find</td></tr><tr><td>ADLINK_E_OTHER</td><td>Error except above</td></tr><tr><td>ADLINK_E_SERVER_BASE</td><td>For a meaningful error code form server, we return it with this value added. So, if the returned code is less than this value, we can subtract this value and get the real return value from server. This is useful for debugging.</td></tr></table>

Table 1. Return Code Description

# 2.1.4 Functions

# adlink\_switch\_chip\_init ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

CLIENT\* adlink\_switch\_chip\_init(char\* server\_ip)

# Description

This function is used to init the switch chip. It will return an RPC handle.

# Parameters

server\_ip [IN] IP address of the server

# Return

CLIENT\* the RPC client pointer, which will be used in all RPC api call.

# adlink\_switch\_chip\_close ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_switch\_chip\_close(CLIENT\* clnt)；

# Description

This function is used to close the switch chip. It will close the RPC handle.

# Parameters

clnt [IN] RPC client that the init function returned.

# Return

status\_t.

# adlink\_config\_write ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_config\_write(CLIENT\* clnt)

# Description

This function is used to write the current configuration into file. After the function is called successfully, the configuration will still be in effect after the system reboots.

# Parameters

clnt [IN] RPC client that the init function returned.

Return

status\_t

# adlink\_config\_restore ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_config\_restore (CLIENT\* clnt)

# Description

This function is used to clear the configuration file. After the function is called successfully, the configuration will be cleared. This function doesn’t change the current configuration of the system.

# Parameters

clnt [IN] RPC client that the init function returned.

Return

status\_t

# adlink\_switch\_status\_notify\_register ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_switch\_status\_notify\_register(CLIENT\* clnt,switch\_status\_callback\_fun func);

# Description

This function is used to regist a callback function. When the RPC connect with the blade is lost.

The callback function will be called automaticly.

# Parameters

clnt [IN] RPC client that the init function returned.

Func [IN] Call back function.

# Return

status\_t

# adlink\_get\_board\_type

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

char\* adlink\_get\_board\_type(void)

# Description

This function is used to get the board type

# Parameters

None.

# Return

Board type string.

# adlink\_fabric\_unit\_id\_get ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

int adlink\_fabric\_unit\_id\_get(CLIENT\* clnt)

# Description

This function is used to get the fabric unit id.

# Parameters

clnt [IN] RPC client that the init function returned.

# Return

Int Fabric unit id.

# adlink\_base\_unit\_id\_get ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

int adlink\_base\_unit\_id\_get(CLIENT\* clnt)

# Description

This function is used to Base unit id.

# Parameters

clnt [IN] RPC client that the init function returned.

# Return

Int Fabric unit id.

# 2.2 Static Routing (IPv4)

This section describes the macro, enum, struct and functions for routing. They are defined in the header file “adlink\_api\_route.h”.

# 2.2.1 Macro Definitions

# MAX\_REPEAT\_ROUTE\_NUM

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

This macro is defined the max num of the route entris with the same destination address.

# MAX\_METRIC\_NUM

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

This macro is defined for the max metric.

# TAPNAMSIZ

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

This macro is defined for the max length of the tap device name.

# ADLINK\_ROUTE\_ENTRY\_STATUS\_KERNEL

# ADLINK\_ROUTE\_ENTRY\_STATUS\_CHIP

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

This macro is defined for route entries status.kernel mean that the entry is working in linux kermel. Chip mean that the entry is working in the switch chip T-cam.

# MAX\_ROUTE\_ENTRY\_ONE\_TIME\_GET

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

This macro is used for getting route entries from the server. Due to packet size limitations allowed in the network (MTU), it isn't possible to get all the entries at once. This macro defines the maximum number of entries retrievable at one time.

# 2.2.2 Enum Type

# adlink\_route\_type\_t

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

```c
typedef enum adlink_route_type
{
    ADLINK_ROUTE_TYPE_UNKNOWN = 0,
    ADLINK_ROUTE_TYPE_STATIC = 1,
    ADLINK_ROUTE_TYPE_DIRECT,
    ADLINK_ROUTE_TYPE_PROTOCOL,
}adlink_route_type_t;
```

Route type description.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>ADLINK_ROUTE_TYPE_UNKNOWN</td><td>Unknown route entry type</td></tr><tr><td>ADLINK_ROUTE_TYPE_STATIC</td><td>Static route entry type</td></tr><tr><td>ADLINK_ROUTE_TYPE_DIRECT</td><td>Direct route entry type</td></tr><tr><td>ADLINK_ROUTE_TYPE_PROTOCOL</td><td>Route entry generated by protocols like RIP,OPSF and so on</td></tr></table>

# 2.2.3 Data Structure

# adlink\_route\_info\_t

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

typedef struct adlink\_route\_info

```txt
{ int unit;
    UINT32 ip_addr;
    UINT32 ip_mask;
    UINT32 gateway_ip;
    UINT16 metric;
    UINT16 type;
```

char if\_name[TAPNAMSIZ];

}adlink\_route\_info\_t;

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>ip_addr</td><td>IP address</td></tr><tr><td>ip_mask</td><td>IP address net mask</td></tr><tr><td>Gateway_ip</td><td>Next hop IP address</td></tr><tr><td>metric</td><td>metric</td></tr><tr><td>type</td><td>adlink_route_type_t</td></tr><tr><td>If_name</td><td>Dev name</td></tr></table>

# 2.2.4 Functions

# adlink\_route\_add ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_route\_add(CLIENT\* clnt, int unit,UINT32 ip\_addr,UINT32 ip\_mask,UINT32 gateway\_ip,UINT16 metric);

# Description

This function is used to add a rule entry.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>uinit</td><td>[IN] Fabric or Base Uinit.</td></tr><tr><td>ip_addr</td><td>[IN] ip address.</td></tr><tr><td>ip_mask</td><td>[IN] ip address mask</td></tr><tr><td>gateway_ip</td><td>[IN] gateway ip</td></tr><tr><td>metric</td><td>[IN] route metric</td></tr></table>

# Return

status\_t

# adlink\_route\_delete ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_route\_delete(CLIENT\* clnt, int unit,UINT32 ip\_addr,UINT32 ip\_mask,UINT32

gateway\_ip,UINT16 metric);

# Description

This function is used to delete a route entry.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>uinit</td><td>[IN] Fabric or Base Uinit.</td></tr><tr><td>ip_addr</td><td>[IN] ip address.</td></tr><tr><td>ip_mask</td><td>[IN] ip address mask.</td></tr><tr><td>gateway_ip</td><td>[IN] gateway ip</td></tr><tr><td>metric</td><td>[IN] route metric</td></tr></table>

# Return

status\_t.

# adlink\_route\_table\_clear ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_route\_table\_clear(CLIENT\* clnt,int unit);

# Description

This function is used to clear all routing table entries that have been added by users.

# Parameters

clnt [IN] RPC client that the init function returned.

uinit [IN] Fabric or Base Uinit.

# Return

status\_t.

# adlink\_route\_table\_dump ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_route\_table\_dump (CLIENT\* clnt,int unit,adlink\_route\_info\_t\* last\_route,int \*count,adlink\_route\_info\_t\*route\_info);

# Description

This function is used to get all route entry info that has been added.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>uinit</td><td>[IN] Fabric or Base Uinit.</td></tr><tr><td>ip_last /mask_last</td><td>[IN] These two parameters pass the last route entry that was retrieved.The function call will start retrieving route entry info after these values. Set both of these parameters to 0 the first time this function is called.</td></tr><tr><td>Count</td><td>[OUT] This parameter passes the number of route entry values retrieved.If &quot;Count&quot; is less than MAX_ROUTE_ENTRY_ONE_TIME_GET, then all the route entries have been retrieved. Otherwise, we need to call this function again to continue retrieving route entry info.</td></tr><tr><td>route_info</td><td>[OUT] This parameter is the pointer for saving the route entry info. It must have enough space to save as many asMAX_ROUTE_ENTRY_ONE_TIME_GET route entries.</td></tr></table>

# Return

status\_t.

# 2.3 Static Routing (IPv6)

This section describes the macro, enum, struct and functions for routing. They are defined in the header file “adlink\_api\_route.h”.

# 2.3.1 Macro Definitions

# MAX\_REPEAT\_ROUTE\_NUM

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

This macro is defined the max num of the route entris with the same destination address.

# MAX\_METRIC\_NUM

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

This macro is defined for the max metric.

# TAPNAMSIZ

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

This macro is defined for the max length of the tap device name.

# MAX\_ROUTE\_ENTRY\_ONE\_TIME\_GET

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

This macro is used for getting route entries from the server. Due to packet size limitations allowed in the network (MTU), it isn't possible to get all the entries at once. This macro defines the maximum number of entries retrievable at one time.

# 2.3.2 Enum Type

# adlink\_route\_type\_t

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

```c
typedef enum adlink_route_type
{
    ADLINK_ROUTE_TYPE_UNKNOWN = 0,
    ADLINK_ROUTE_TYPE_STATIC = 1,
    ADLINK_ROUTE_TYPE_DIRECT,
    ADLINK_ROUTE_TYPE_PROTOCOL,
}adlink_route_type_t;
```

Route type description.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>ADLINK_ROUTE_TYPE_UNKNOWN</td><td>Unknow route entry type</td></tr><tr><td>ADLINK_ROUTE_TYPE_STATIC</td><td>Static route entry type</td></tr><tr><td>ADLINK_ROUTE_TYPE_DIRECT</td><td>Direct route entry type</td></tr><tr><td>ADLINK_ROUTE_TYPE_PROTOCOL</td><td>Route entry generated by protocols like RIP,OPSF and so on</td></tr></table>

# 2.3.3 Data Structure

# adlink\_route6\_info\_t

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

```c
typedef struct adlink_route6_info
{
    int unit;
    struct in6_addr ip6;
    UINT32 mask_len;
    struct in6_addr gateway_ip6;
    UINT16 metric;
    UINT16 type;
    char if_name[TAPNAMSIZ];
}adlink_route6_info_t;
```

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>Ip6</td><td>IPv6 address</td></tr><tr><td>mask_len</td><td>IPv6 mask leng</td></tr><tr><td>gateway_ip6</td><td>Next hop IPv6 address</td></tr><tr><td>metric</td><td>Metric</td></tr><tr><td>type</td><td>adlink_route_type_t</td></tr><tr><td>if_name</td><td>Dev name</td></tr></table>

# 2.3.4 Functions

# adlink\_route6\_add ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_route6\_add(CLIENT\* clnt,int unit,struct in6\_addr \*ip6,UINT32 mask\_len,struct in6\_addr \*gateway\_ip6,UINT16 metric);;

# Description

This function is used to add a IPv6 rule entry.

# Parameters

clnt [IN] RPC client that the init function returned.

uinit [IN] Fabric or Base Uinit.

Ip6\_addr [IN] ipv6 address.

Mask\_len [IN] mask length.

gateway\_ip6 [IN] gateway ipv6 address.

metric [IN] route metric.

Return

status\_t

# adlink\_route6\_delete ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_route6\_delete(CLIENT\* clnt,int unit,struct in6\_addr \*ip6,UINT32

mask\_len,struct in6\_addr \*gateway\_ip6,UINT16 metric);

# Description

This function is used to delete a route entry.

# Parameters

clnt [IN] RPC client that the init function returned.

uinit [IN] Fabric or Base Uinit.

Ip6\_addr [IN] ipv6 address.

Mask\_len [IN] mask length.

gateway\_ip6 [IN] gateway ipv6 address.

metric [IN] route metric.

# Return

status\_t.

# adlink\_route6\_table\_clear ()

# Supported on

aTCA-3710 aTCA-N700 aTCA-3430 MXN-3610/MXN-4100 cPCI-6S10 MXN-0410

# Prototype

status\_t adlink\_route6\_table\_clear(CLIENT\* clnt,int unit);

# Description

This function is used to clear all routing table entries that have been added by users.

# Parameters

clnt [IN] RPC client that the init function returned.

uinit [IN] Fabric or Base Uinit.

# Return

status\_t.

# adlink\_route\_table\_dump ()

# Supported on

aTCA-3710 aTCA-N700 aTCA-3430 MXN-3610/MXN-4100 cPCI-6S10 MXN-0410

# Prototype

status\_t adlink\_route6\_table\_dump(CLIENT\* clnt,int unit,adlink\_route6\_info\_t\* last\_route6,int \*count,adlink\_route6\_info\_t\*route6\_info);

# Description

This function is used to get all route entry info that has been added.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>uinit</td><td>[IN] Fabric or Base Uinit.</td></tr><tr><td>last_route6</td><td>[IN] These parameter pass the last route entry that was retrieved. The function call will start retrieving route entry info after these values. Set all of these parameters to 0 the first time this function is called.</td></tr><tr><td>Count</td><td>[OUT] This parameter passes the number of route entry values retrieved. If &quot;Count&quot; is less than MAX_ROUTE_ENTRY_ONE_TIME_GET, then all the route entries have been retrieved. Otherwise, we need to call this function again to continue retrieving route entry info.</td></tr><tr><td>Route6_info</td><td>[OUT] This parameter is the pointer for saving the route entry info. It must have enough space to save as many as MAX_ROUTE_ENTRY_ONE_TIME_GET route entries.</td></tr></table>

# Return

status\_t.

# 2.4 Port

This section describes the macro, enum, struct and functions for port. They are defined in the header file “adlink\_api\_port.h”.

# 2.4.1 Macro Definitions

# MAX\_PORT\_BCM\_NAME\_SIZE

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

This macro is defined the max length of port name string.

# MAX\_PORT\_NUN

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

This macro is defined the max num of the ports of the blade.

# TAPNAMSIZ

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

This macro is defined the max length of tap dev name.

# ADLINK\_PORT\_LOOPBACK\_OFF

# ADLINK\_PORT\_LOOPBACK\_TX2RX

# ADLINK\_PORT\_LOOPBACK\_RX2TX

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

This macro is defined the loopback mode of port.

# 2.4.2 Enum Type

port\_speed\_t
```c
typedef enum port_speed_e
{
    PORT_SPEED_10M = 10,
    PORT_SPEED_100M = 100,
    PORT_SPEED_1G = 1000,
    PORT_SPEED_10G = 10000,
    PORT_SPEED_40G = 40000,
} port_speed_t;
```

Supported On
```txt
aTCA-3710 aTCA-N700 aTCA-3430 MXN-3610/MXN-4100 cPCI-6S10 MXN-0410
```

Define the codes of port speed mode.

port\_attribute\_t
```txt
typedef enum port_attribute_e
{
    PORT_ATTR_MASK_NONE = 0,
    PORT_ATTR_MASK_STATUS = (1U &lt;&lt; 0),
    PORT_ATTR_MASK_AUTONEG = (1U &lt;&lt; 1),
    PORT_ATTR_MASK_SPEED = (1U &lt;&lt; 2),
    PORT_ATTR_MASK_PVID = (1U &lt;&lt; 3),
    PORT_ATTR_MASK_COS = (1U &lt;&lt; 4),
    PORT_ATTR_MASK_MTU = (1U &lt;&lt; 5),
    PORT_ATTR_MASK_QINQ = (1U &lt;&lt; 6),
    PORT_ATTR_MASK_MAC_LEARN = (1U &lt;&lt; 7),
    PORT_ATTR_MASK_VLAN_FILTER = (1U &lt;&lt; 8),
    PORT_ATTR_MASK_RATE_BCAST = (1U &lt;&lt; 9),
    PORT_ATTR_MASK_RATE_MCAST = (1U &lt;&lt; 10),
    PORT_ATTR_MASK_RATE_DLF = (1U &lt;&lt; 11),
    PORT_ATTR_MASK_TX_PAUSE = (1U &lt;&lt; 12),
    PORT_ATTR_MASK_RX_PAUSE = (1U &lt;&lt; 13),
    PORT_ATTR_MASK_LOOPBACK = (1u &lt;&lt; 14),
}port_attribute_t;
```

Supported On
```txt
aTCA-3710 aTCA-N700 aTCA-3430 MXN-3610/MXN-4100 cPCI-6S10 MXN-0410
```

Define the opcodes of port attributes.

# port\_duplex\_t

```c
typedef enum port_duplex_e
{
    PORT_DUPLEX_HALF = 0,
    PORT_DUPLEX_FULL = 1,
} port_duplex_t;
```

Supported On

&lt;table&gt;<tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

Define the codes of port duplex. This attribute can be read only.

# port\_mirror\_mode\_t

```txt
typedef enum port_mirror_mode_e
{
    PORT_MIRROR_INGRESS = (1U &lt;&lt; 0),
    PORT_MIRROR_EGRESS = (1U &lt;&lt; 1),
} port_mirror_mode_t;
```

Supported On

&lt;table&gt;<tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

Define the codes of port mirror mode.

# qinq\_mode\_t

```c
typedef enum port_qinq_mode_e
{
    PORT_QINQ_MODE_NONE = 0,
    PORT_QINQ_MODE_INTERNAL = 1,
    PORT_QINQ_MODE_EXTERNAL = 2,
} qinq_mode_t;
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

Define the codes of port qiniq mode.

# port\_link\_status\_t

```txt
typedef enum port_link_status_e
{ /*Heritage*/
```

```txt
PORT_LINK_STATUS_DOWN = 0,
PORT_LINK_STATUS_UP = 1,
PORT_LINK_STATUS_FAILED = 2,
PORT_LINK_STATUS_REMOTE_FAULT = 3,
PORT_LINK_STATUS_LOCAL_FAULT = 4,
} port_link_status_t;
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

Define the codes of port physical link status.

port\_stp\_state\_t
```c
typedef enum port_stp_state_e { /*Heritage */
    PORT_STP_DISABLE = 0, /* Disabled. */
    PORT_STP_BLOCK = 1, /* BPDUs/no learns. */
    PORT_STP_LISTEN = 2, /* BPDUs/no learns. */
    PORT_STP_LEARN = 3, /* BPDUs/learns. */
    PORT_STP_FORWARD = 4, /* Normal operation. */
    PORT_STP_COUNT = 5
} port_stp_state_t;
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

Define the codes of port status for Spanning Tree Protocol.

port\_vlan\_filter\_mode\_mask\_t
```c
typedef enum port_vlan_filter_mode_mask_e { /*Heritage*/
    PORT_VLAN_FILTER_INGRESS = 0x00000001,
    PORT_VLAN_FILTER_EGRESS = 0x00000002,
} port_vlan_filter_mode_mask_t;
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

Define the codes of VLAN filter mode in port attribute.

port\_rate\_limit\_mask\_t
```python
typedef enum port_rate_limit_mask_e { /*Heritage*/
    PORT_RATE_DLF = 0x01,
    PORT_RATE_MCAST = 0x02,
```

```c
PORT_RATE_BCAST = 0x04,
PORT_RATE_UCAST = 0x08,
} port_rate_limit_mask_t;
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

Define the codes of rate limit type mask in port attribute.

nic\_config\_mask\_t
```c
typedef enum nic_config_mask
{
    NIC_CONFIG_IP_MASK = (1U &lt;&lt; 0), /*Set this bit to flag IP&MASK operation*/
    NIC_CONFIG_HWADDR = (1U &lt;&lt; 1),
    NIC_CONFIG_STATUS = (1U &lt;&lt; 2), /*Set this bit to flag NIC running status operation*/
} nic_config_mask_t;
```

Supported On

&lt;table&gt;<tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

Define the codes of NIC operation.

port\_info\_change\_event\_t
```c
typedef enum port_info_change_event_e
{
    PORT_EVENT_NONE = 0,
    PORT_LINKSTATUS_EVENT = (1U &lt;&lt; 0),
    PORT_SPEED_EVENT = (1U &lt;&lt; 1),
    PORT_MTU_EVENT = (1U &lt;&lt; 2),
} port_info_change_event_t;
```

Supported On

&lt;table&gt;<tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

Define the codes of port status change event.

# 2.4.3 Data Structure

adlink\_port\_info\_t
```txt
typedef struct adlink_port_info_s
{
    char port_name[MAX_PORT_BCM_NAME_SIZE];
```

```c
int port_id;
int enable;
int linkstatus;
int autoneg;
int duplex;
int speed;
int cos;
UINT16 pvid;
adlink_port_vlan_t port_vlan_info;
int stp_state;
int loopback;
int pause_tx;
int pause_rx;
adlink_port_rate_t rate_bcast;
adlink_port_rate_t rate_mcast;
adlink_port_rate_t rate_dlf;
int mtu;
UINT32 fault;    /*link fault reason*/
int qinq;
int vlanfilter;
int mac_learn;
}adlink_port_info_t;
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

Define the entry format of the port attribute table.

# adlink\_port\_status\_set\_cmd\_t

typedef struct adlink\_port\_status\_set\_cmd {

```c
int unit;
UINT64 port_mask;    /*port mask*/
UINT64 action_mask;    /*PORT_ATTR_xxx in port_attribute_t*/
int status;    /*ENABLE/DISABLE*/
int autoneg;    /*ENABLE/DISABLE*/
int duplex;    /*PORT_DUPLEX_xxx in port_duplex_t*/
int speed;    /*PORT_SPEED_xxx in port_speed_t*/
UINT16 pvid;    /*default 802.1Q vid for untagged packets*/
int cos;    /*default 802.1Q cos for untagged packets*/
int qinq;
int mac_learn;
int loopback;
int pause_tx;
```

```txt
int pause_rx;
int mtu;
int vlanfilter;
adlink_port_rate_t rate_bcast;
adlink_port_rate_t rate_mcast;
adlink_port_rate_t rate_dlf;
}adlink_port_status_set_cmd_t;
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

Define the cmd struct of ports attribute setting.

adlink\_port\_status\_get\_cmd\_t
```c
typedef struct adlink_port_status_get_cmd
{
    int unit;
    UINT32 port;
}adlink_port_status_get_cmd_t;
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

Define the entry format of the cmd of port status geting.

adlink\_mirror\_t
```c
typedef struct adlink_mirror_s {
    UINT32 enable;    /*ENABLE/DISABLE. Other items are valid only when 'enable' is true. */
    UINT32 mode;    /*PORT_MIRROR_xxx. Control mirror mode. */
    UINT32 dst_port;    /*port of mirror to. */
}adlink_mirror_t;
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

Define the entry format of the information of port mirror.

adlink\_portstat\_t
```c
typedef struct adlink_portstat_s
{
    UINT64 rx_byte_num;
    UINT64 rx_pkt_num;
```

```c
UINT64 rx_pkt_unicast;
UINT64 rx_pkt_err;
UINT64 rx_pkt_discards;
UINT64 rx_pkt_broadcast;
UINT64 rx_pkt_multicast;
UINT64 rx_pkt_octets64;
UINT64 rx_pkt_octets65to127;
UINT64 rx_pkt_octets128to255;
UINT64 rx_pkt_octets256to511;
UINT64 rx_pkt_octets512to1023;
UINT64 rx_pkt_octets1024to1518;
UINT64 rx_pkt_oversize;
UINT64 rx_pkt_total;

UINT64 tx_byte_num;
UINT64 tx_pkt_num;
UINT64 tx_pkt_unicast;
UINT64 tx_pkt_discards;
UINT64 tx_pkt_broadcast;
UINT64 tx_pkt_multicast;
UINT64 tm_use_last_clr; //us
}adlink_portstat_t;
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

Define the entry format of the port statistic table.

adlink\_set\_port\_status\_cmd\_t
```c
typedef struct adlink_set_port_status_cmd {
    UINT32 port;    /*port ID*/
    UINT32 flag;    /*PORT_ATTR_xxx in port_attribute_t*/
    int status;    /*ENABLE/DISABLE*/
    int autoneg_mode;    /*ENABLE/DISABLE*/
    int duplex_mode;    /*PORT_DUPLEX_xxx in port_duplex_t*/
    int speed_mode;    /*PORT_SPEED_xxx in port_speed_t*/
    int pvid;    /*default 802.1Q vid for untagged packets*/
    int cos;    /*default 802.1Q cos for untagged packets*/
    int mtu;    /*max data transmission unit*/
} adlink_set_port_status_cmd_t;
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

Define the format of parameters used to set port attributes.

adlink\_nic\_config\_set\_cmd\_t
```c
typedef struct adl_nic_config_set_cmd {
    int unit;
    char if_name[TAPNAMSIZ];
    UINT32 config_mask; //nic_config_mask_t
    UINT32 ip;
    UINT32 netmask;
    UINT8 mac[MAC_SIZE];
    UINT8 rsv[2];
    UINT32 status; //0 down, 1 up
}adlink_nic_config_set_cmd_t;
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

Define the format of parameters used to set NIC configuration.

adlink\_nic\_config\_info\_t
```c
typedef struct adlink_nic_config_info
{
    UINT32 ip;
    UINT32 mask;
    UINT8 mac[MAC_SIZE];
    UINT8 rsv[2];
    UINT32 status;
}adlink_nic_config_info_t;
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

Define the format of retrieved NIC info.

adlink\_nic\_config\_get\_cmd\_t
```c
typedef struct adlink_nic_config_get_cmd {
    char if_name[TAPNAMSIZ];
}adlink_nic_config_get_cmd_t;
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

Define the format of the get NIC info command parameter.

# 2.4.4 Function

# adlink\_port\_info\_get

# Prototype

status\_t adlink\_port\_info\_get(CLIENT\* clnt ,uint8\_t port, adlink\_port\_info\_t\* port\_info);

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Description

Gets port info.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>port</td><td>[IN] logic port id;</td></tr><tr><td>port_info</td><td>[OUT] port status info.</td></tr></table>

# Return

status\_t.

# adlink\_port\_statistic\_get

# Prototype

status\_t adlink\_port\_statistic\_get (CLIENT\* clnt, UINT32 port, adlink\_portstat\_t \*stat);

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Description

It’s to get port statistic info.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>port</td><td>[IN] logic port id;</td></tr><tr><td>clear</td><td>[IN] 1:reset port0: not reset port</td></tr><tr><td>port_statistic/stat</td><td>[OUT] port statistic info ;</td></tr></table>

# Return

status\_t.

# adlink\_port\_statistic\_clear

# Prototype

status\_t adlink\_port\_statistic\_clear (CLIENT\* clnt, UINT32 port);

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Description

Clear port statistic info.

# Parameters

clnt [IN] RPC client that the init function returned.

port [IN] logic port id;

# Return

status\_t.

# adlink\_port\_status\_set

# Prototype

status\_t adlink\_port\_status\_set(CLIENT\* clnt,adlink\_port\_status\_set\_cmd\_t\* cmd);

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Description

Set port attributes.

# Parameters

clnt [IN] RPC client that the init function returned.

cmd [IN] port attributes cmd;

# Return

status\_t.

# adlink\_nic\_config\_set ()

# adlink\_nic\_config\_get()

# Prototype

status\_t adlink\_nic\_config\_set(CLIENT\* clnt, adl\_nic\_config\_set\_cmd\_t \*cmd);

status\_t adlink\_nic\_config\_get(CLIENT\* clnt, adl\_nic\_config\_get\_cmd\_t \*cmd, adl\_nic\_config\_info\_t \*info);

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Description

The function ‘get’ is used to get configuration of a NIC, including running status and IP address. The function ‘set’ is used to configure a NIC.

# Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>cmd</td><td>[IN] NIC name and operation code;</td></tr><tr><td>info</td><td>[OUT] NIC information;</td></tr></table>

# Return

status\_t.

# adlink\_port\_mirror\_set ()

# adlink\_port\_mirror\_get()

# Prototype

status\_t adlink\_port\_mirror\_set(CLIENT\* clnt,int unit, UINT32 port, adlink\_mirror\_t \*info); status\_t adlink\_port\_mirror\_get(CLIENT\* clnt, int unit,UINT32 port, adlink\_mirror\_t \*info);

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Description

The function ‘get’ is used to get mirror info of a port. The function ‘set’ is used to set the mirror info of a port.

# Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>Unit</td><td>[IN] Fabric or Base unit.</td></tr><tr><td>info</td><td>[IN/OUT] mirror information;</td></tr></table>

# Return

status\_t.

# adlink\_port\_status\_notify\_register ()

# Prototype

status\_t adlink\_port\_status\_notify\_register(CLIENT\*rpc\_clnt,int unit,

adlink\_port\_status\_change\_callback\_fun func);

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Description

The function is used to regist a call back function for port status. When the port status are changed, the function will be called automatically.

# Parameters

clnt [IN] RPC client that the init function returned.

Unit [IN] Fabric or Base unit.

func [IN] The call back function handle

# Prototype

typedef void (\*adlink\_port\_status\_change\_callback\_fun)(CLIENT\* clnt,int unit, int port, UINT32 event\_mask, adlink\_port\_info\_t \*port\_info);

# Return

status\_t.

# adlink\_port\_id\_get\_by\_name ()

# adlink\_port\_name\_get\_by\_id()

# Prototype

status\_t adlink\_port\_id\_get\_by\_name (CLIENT\* clnt,int unit,char\* bcm\_name,int\* port\_id);

status\_t adlink\_port\_name\_get\_by\_id (CLIENT\* clnt,int unit,int port\_id,char\* bcm\_name);

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Description

The two functions are used for the conversion of bcm name and bcm port id.

# Parameters

clnt [IN] RPC client that the init function returned.

Unit [IN] Fabric or Base unit.

Bcm\_name [IN/OUT] port bcm name, such as xe0;

Port\_id [IN/OUT] port id, such as 1;

# Return

status\_t.

# 2.5 VLAN

This section describes the macro, enum, struct and functions for VLAN. They are defined in the header file “adlink\_api\_vlan.h”.

VLAN management interfaces include the following services:

Add ports to and delete ports from a vlan
Delete all ports of a vlan and destroy the vlan
• Set the egress tagging option(whether frames leave the switch VLAN tagged or untagged)

# 2.5.1 Macro Definitions

# MAX\_VLAN\_MAC\_CNT

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

Maximum entry count of MAC based VLAN.

# MAX\_VLAN\_NAME\_SIZE

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

Each VLAN can associate with a name. This is used to limit the name size.

# 2.5.2 Enum Type

# adlink\_vlan\_tag\_mode\_t

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

typedef enum adlink\_vlan\_tag\_mode\_e{ $\mathsf { V L A N \_ M O D E \_ U N T A G G E D } = 0 ,$ $\mathsf { V L A N \_ M O D E \_ T A G G E D } = 1 ,$ } adlink\_vlan\_tag\_mode\_t;

Egress tagging options.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>VLAN_MODE_UNTAGGED</td><td>Untagged egress tagging mode</td></tr><tr><td>VLAN_MODE_TAGGED</td><td>Tagged egress tagging mode</td></tr></table>

# 2.5.3 Data Structure

# adlink\_vlan\_info\_t

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr><tr><td colspan="6">typedef struct adlink_vlan_info_s {UINT8 enable; /*admin status*/UINT8 rsv1[3]; /*for align purpose*/UINT64 pbmp; /*port bitmap in this vlan*/UINT64 untag_pbmp; /*port bitmap of untagged ports*/char name[MAX_VLAN_NAME_SIZE]; /*vlan name. 31 characters at maximum*/}adlink_vlan_info_t;</td></tr></table>

Definitions of the VLAN table entry format.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>enable</td><td>Admin status. For cPCI-6S10 and MXN-0410, use API adlink_vlan_admin_status_set or VLAN enable command to make the VLAN enable. For other boards, after the VLAN created, it will at enable states automatically.</td></tr><tr><td>rsv1[3]</td><td>Alignment of data, useless.</td></tr><tr><td>pbmp</td><td>port bitmap in this vlan, include tag and untag ports(uint64 type at MXN-3610/MXN-4100)</td></tr><tr><td>untag_pbmp</td><td>port bitmap of untagged ports (uint64 type at MXN-3610/MXN-4100)</td></tr><tr><td>name[MAX_VLAN_NAME_SIZE]</td><td>VLAN name. 31 characters maximum</td></tr></table>

# adlink\_vlan\_mac\_t

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

typedef struct adlink\_vlan\_mac\_s {

UINT8 valid;

UINT8 cos;

UINT8 mac[MAC\_SIZE];

UINT16 vid;

UINT8 rsv[2];

}adlink\_vlan\_mac\_t;

Definitions of the MAC based VLAN table entry format.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>valid</td><td>Vlan in using or not. 0—INVALID 1—VALID</td></tr><tr><td>cos</td><td>Priority value for the packets with the VLAN</td></tr><tr><td>mac[MAC_SIZE]</td><td>MAC address associate with the VLAN</td></tr><tr><td>vid</td><td>VLAN id, 1-4094</td></tr></table>

# 2.5.4 Functions

# adlink\_vlan\_info\_get ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_vlan\_info\_get (CLIENT\* clnt, int unit, int vlan\_id, adlink\_vlan\_info\_t \*info);

# Description

This function is used to get specific VLAN’s information.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned. Not support on cPCI-6S10 and MXN-0410</td></tr><tr><td>unit</td><td>[IN] Fabric or Base chip unit;</td></tr><tr><td>vlan_id</td><td>[IN] The VLAN ID on which to operate;</td></tr><tr><td>info</td><td>[OUT] VLAN information;</td></tr></table>

# Return

status\_t

# adlink\_vlan\_admin\_status\_set ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_vlan\_admin\_status\_set (int unit,int vlan, int status);

# Description

This function is used to switch admin status of a VLAN. If the status is disabled, VLAN can be configured but not used. This function is used to created VLANs, set them to ENABLE.

# Parameters

unit [IN] Fabric or Base chip unit;

vlan\_id [IN] The VLAN ID on which to operate;

status [IN] Admin status. Use ‘ENABLE’ or ‘DISABLE’;

# Return

status\_t

# adlink\_vlan\_destroy ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_vlan\_destroy (CLIENT\* clnt,int unit,int vlan);

# Description

This function is used to destroy an existing VLAN.

# Parameters

clnt [IN] RPC client that the init function returned.

unit [IN] Fabric or Base chip unit;

vlan [IN] The VLAN ID to be destroyed;

# Return

status\_t.

# adlink\_vlan\_member\_add ()

# adlink\_vlan\_member\_del ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_vlan\_member\_add (int unit, int vlan, UINT32 port\_id, UINT32 mode);

status\_t adlink\_vlan\_member\_del (int unit, int vlan, UINT32 port\_id);

# Description

These two functions are used to add port into or remove port from a VLAN.

# Parameters

unit [IN] Fabric or Base chip unit;

vlan [IN] The VLAN ID in which port member is configured.

port \_id [IN] Port ID to be added/removed.

mode [IN] Port is tagged or untagged in the VLAN. Use ‘VLAN\_MODE\_TAGGED’ or ‘VLAN\_MODE\_UNTAGGED’

# Return

status\_t.

adlink\_vlan\_member\_add ()

adlink\_vlan\_member\_del ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_vlan\_member\_add(CLIENT\* clnt,int unit,int vlan, UINT64 port\_mask, UINT32 mode);

status\_t adlink\_vlan\_member\_del(CLIENT\* clnt,int unit,int vlan, UINT64 port\_mask);

# Description

These two functions are used to add ports into or remove ports from a VLAN.

# Parameters

unit [IN] Fabric or Base chip unit;

vlan [IN] The VLAN ID in which port member is configured.

port \_mask [IN] Ports bitmap to be added/removed. Port mask is the same with port bitmap.

mode [IN] Port is tagged or untagged in the VLAN. Use ‘VLAN\_MODE\_TAGGED’ or ‘VLAN\_MODE\_UNTAGGED’

# Return

status\_t.

adlink\_vlan\_port\_pvid\_set ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_vlan\_port\_pvid\_set (int unit, int vlan, UINT32 port);

# Description

This function is used to assign a port’s default VLAN tag for untagged packets.

# Parameters

unit [IN] Fabric or Base chip unit;

vlan [IN] The default VLAN ID of a port;

port [IN] The port ID which will be assigned a default VLAN tag;

# Return

status\_t

adlink\_mac\_based\_vlan\_add ()

adlink\_mac\_based\_vlan\_del ()

adlink\_mac\_based\_vlan\_get ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_mac\_based\_vlan\_add (CLIENT\* clnt, int unit, int vlan, UINT8 \*mac, UINT8 cos); status\_t adlink\_mac\_based\_vlan\_del (CLIENT\* clnt, int unit, UINT8 \*mac);

status\_t adlink\_mac\_based\_vlan\_get (CLIENT\* clnt, int unit, UINT8 \*mac, UINT16 \*vlan, UINT8 \*cos);

# Description

These functions are used to configure MAC base VLAN. MAC address can be associated with a VLAN id.Packet with specific MAC address with be located to a dedicate VLAN.

Parameters

<table><tr><td>CInt</td><td>[IN] RPC client that the init function returned. Not support at cPCI-6S10 and MXN-0410</td></tr><tr><td>unit</td><td>[IN] Fabric or Base chip unit;</td></tr><tr><td>vlan</td><td>[IN] The VLAN ID which will be assigned to a specified MAC address;</td></tr><tr><td>mac</td><td>[IN] A pointer points to specified MAC address;</td></tr><tr><td>cos</td><td>[IN] Default COS value which will be filled in VLAN tag;</td></tr></table>

# Return

status\_t.

# 2.6 Trunk

This section describes the macro, enum, struct and functions for trunk. They are defined in the header file “adlink\_api\_trunk.h”.

# 2.6.1 Macro Definitions

# MIN\_TRUNK\_ID

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Minimun trunk id

# MAX\_TRUNK\_CNT

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Maximum trunk count.

# MAX\_PORT\_NUM\_PER\_TRUNK

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Trunk group index range and member port count limit of a group.

# MAX\_TRUNK\_PORT\_NUM

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Trunk group index range and member port count limit of a group.

# 2.6.2 Enum Type

adlink\_trunk\_balance\_type\_t
prototype
```txt
typedef enum adlink_trunk_balance_type
{
    BALANCE_TYPE_DEFAULT = 0,
    BALANCE_TYPE_SA = 1,
    BALANCE_TYPE_DA = 2,
    BALANCE_TYPE_SA_DA = 3,
    BALANCE_TYPE_SIP = 4,
    BALANCE_TYPE_DIP = 5,
    BALANCE_TYPE_SIP_DIP = 6,
    BALANCE_TYPE_ENHANCED=7
}adlink_trunk_balance_type_t
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Define the codes of trunk port selection criteria. Packets will be dispatched to different ports based on the criteria.

# PACKET\_SELECT\_FIELD\_t

prototype
```sql
typedef enum PACKET_SELECT_FIELD_s
{
SOURCE_MAC,
DESTIONATION_MAC,
ETHER_TYPE,
VLAN_ID,
VLAN_PRIORITY,
SOURCE_IP,
DESTIONATION_IP,
PROTOCOL,
TCP_UDP_SOURCE_PORT,
TCP_UDP_DESTINATION_PORT,
PACKET_SELECT_FIELD_END,
}PACKET_SELECT_FIELD_t;
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Define the packet’s fields which used to do port selection criteria. The default set of the fields is enabled, packets will be dispatched to different ports based on the criteria.

# adlink\_trunk\_enhance\_balance\_type\_t

# Prototype

```c
typedef enum adlink_trunk_enhance_balance_type_e
{
    ENHANCED_BALANCE_TYPE_INVALID = 0,
    ENHANCED_BALANCE_TYPE_4TUPLE = 1,
    ENHANCED_BALANCE_TYPE_5TUPLE = 2,
}adlink_trunk_enhance_balance_type_t
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Define the trunk port selection criteria when balance type is selected as BALANCE\_TYPE\_ENHANCED. 4 Tuple means port is selected Source IP, Source Port, Destination IP, Destination Port. 5 Tuple means port is selected Source IP, Source Port, Destination IP, Destination Port, Protocol Type.

# adlink\_trunk\_l4\_port\_flag\_t

```c
typedef enum adlink_trunk_l4_port_flag
{
    BALANCE_TYPE_L4_PORT_DISABLE = 0,
    BALANCE_TYPE_L4_PORT_ENABLE = 1,
}adlink_trunk_l4_port_flag_t;
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

Define the trunk port selection criteria when balance type is selected as BALANCE\_TYPE\_SIP or BALANCE\_TYPE\_DIP or BALANCE\_TYPE\_SIP\_DIP. L4\_Port\_Disable means port is selected by “Source IP” or “Destination IP” or “Source IP and Destination IP”, L4\_Port\_Enable means port is selected by “Source IP and Source Port” or “Destination IP and Destination Port” or “Source IP, Destination IP, Source Port, Destination Port”.

# adlink\_trunk\_mode\_t

# Prototype

```c
typedef enum adlink_trunk_mode_e
{
    ADLINK_TRUNK_MODE_INVALID = 0,
    ADLINK_TRUNK_MODE_MANUAL = 1,
    ADLINK_TRUNK_MODE_LACP = 2,
}adlink_trunk_mode_t
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Define the work mode of the trunk. The manual trunk is a static one, the member ports of the trunk will not change. The LACP trunk is negotiated by LACP protocol, which ports will forward packets are decided by LACP protocol.

# adlink\_manual\_trunk\_port\_status\_t

# Prototype

```c
typedef enum adlink_manual_trunk_port_status_e
{
    ADLINK_MANUAL_TRUNK_PORT_DOWN = 0,
    ADLINK_MANUAL_TRUNK_PORT_ACTIVE = 1,
}adlink_manual_trunk_port_status_t
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Define the member port status of the manual trunk. Down means the port link state is fault, active means the port link is up.

# adlink\_lacp\_trunk\_port\_status\_t

# Prototype

```txt
typedef enum adlink_lacp_trunk_port_status_e
{
    ADLINK_LACP_TRUNC_PORT_DOWN = 0,
    ADLINK_LACP_TRUNC_PORT_ACTIVE = 1,
    ADLINK_LACP_TRUNC_PORT_STANDBY = 2,
    ADLINK_LACP_TRUNC_PORT_NO_PARTNER = 3,
}adlink_lacp_trunk_port_status_t
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Define the member port status of the LACP trunk. Down means the port link state is fault, active means the port link is up and the port is chosen to forward packets, standby means the port link is up but the port will not forward packets, no partner means the port can’t negotiate successfully with the partner port in the other device.

# 2.6.3 Data Structure

# adlink\_trunk\_manual\_port\_t

# Prototype

```c
struct adlink_trunk_manual_port{
    unsigned int port_no;
    unsigned int port_state;
}
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Define the port member info of manual trunk.

# adlink\_trunk\_manual\_trunk\_t

# Protorype

```c
struct adlink_trunk_manual_trunk{
    int unit;
    int tid;
    unsigned int port_num;
    adlink_trunk_manual_port_t port_info[MAX_TRUNK_PORT_NUM];
}
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

typedef struct adlink\_trunk\_manual\_trunk adlink\_trunk\_manual\_trunk\_t; Define the trunk info of manual trunk.

# adlink\_trunk\_lacp\_port\_t

# Prototype

```txt
struct adlink_trunk_lacp_port{
    unsigned int port_no;
```

```dart
unsigned int port_state;
unsigned int port_priority;
unsigned char lacp_state;
}
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Typedef struct adlink\_trunk\_lacp\_port adlink\_trunk\_lacp\_port\_t;

Define the port member info of lacp trunk.

# adlink\_trunk\_lacp\_trunk\_t

# Prototype

```c
struct adlink_trunk_lacp_trunk{
    int unit;
    int tid;
    unsigned int port_num;
    adlink_trunk_lacp_port_t port_info[MAX_TRUNK_PORT_NUM];
}
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

typedef struct adlink\_trunk\_lacp\_trunk adlink\_trunk\_lacp\_trunk\_t;

Define the trunk info of lacp trunks.

# adlink\_trunk\_port\_info\_t

# Prototype

```c
struct adlink_trunk_port_info{
    unsigned int port_no;
    unsigned int port_status;
    unsigned int port_priority;
    unsigned char lacp_state;
}
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To describe the info of a port to be print out.

adlink\_trunk\_info\_t
Prototype
```c
struct adlink_trunk_lacp_trunk{
    int unit;
    int tid;
    unsigned int port_num;
    adlink_trunk_port_info_t port_info[MAX_PORT_NUM_PER_TRUNK];
}
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

Description
```txt
To store main information of a lacp trunk.
```

```c
adlink_trunk_balance_config_t
typedef struct adlink_trunk_balance_config_s
{
    int unit;
    PACKET_SELECT_FIELD_t packet_select_field;
    BOOL status; //Enable or Disable
}adlink_trunk_balance_config_t;
```

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

Description
```txt
Trunk balance configuration of specific packet field.
```

adlink\_trunk\_balance\_config\_info\_t
```sql
typedef struct adlink_trunk_balance_config_info_s
{
    adlink_trunk_balance_config_t trunk_hash_field_info [PACKET_SELECT_FIELD_END];
}adlink_trunk_balance_config_info_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

Description
```txt
Trunk balance info.
```

# 2.6.4 Functions

# adlink\_trunk\_ manual\_trunk\_add ()

# Prototype

status\_t adlink\_trunk\_manual\_trunk\_add (CLIENT\* clnt,int unit, int trunk\_id)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Add a manual trunk.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN] Specified the switch chip,eg:Fabric/Base.</td></tr><tr><td>trunk_id</td><td>[IN] Specified the target trunk, range &lt;1-8&gt;.</td></tr></table>

# Return

status\_t

# adlink\_trunk\_lacp\_trunk\_add()

# Prototype

status\_t adlink\_trunk\_lacp\_trunk\_add(CLIENT\* clnt,int unit, int Trunk\_id)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Add a lacp trunk.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN] Specified the switch chip,eg:Fabric/Base.</td></tr><tr><td>trunk_id</td><td>[IN] Specified the target trunk ,range &lt;1-8&gt;.</td></tr></table>

# Return

status\_t

# adlink\_trunk\_del()

# Prototype

status\_t adlink\_trunk\_del(CLIENT\* clnt,int unit, int trunk\_id)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

remove a trunk.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN] Specified the switch chip,eg:Fabric/Base.</td></tr><tr><td>trunk_id</td><td>[IN] Specified the target trunk ,range &lt;1-8&gt;.</td></tr></table>

# Return

Status\_t

# adlink\_trunk\_lacp\_priority\_trunk\_add ()

# Prototype

status\_t adlink\_trunk\_lacp\_priority\_trunk\_add(CLIENT\* clnt,int unit, int trunk\_id, UINT32 sys\_priority)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

add a lacp trunk with user-defined priority.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN] Specified the switch chip,eg:Fabric/Base.</td></tr><tr><td>trunk_id</td><td>[IN] Specified the target trunk,range &lt;1-8&gt;.</td></tr><tr><td>sys_priority</td><td>[IN] Specified the lacp trunk system priority value.</td></tr></table>

# Return

status\_t

# adlink\_trunk\_manual\_trunk\_del ()

# Prototype

status\_t adlink\_trunk\_manual\_trunk\_del (CLIENT\* clnt,int unit, int trunk\_id)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Remove a manual trunk.

# Parameters

clnt [IN] RPC client that the init function returned.

unit [IN] Specified the switch chip,eg:Fabric/Base.

trunk\_id [IN] Specified the target trunk,range &lt;1-8&gt;.

# Return

status\_t

# adlink\_trunk\_lacp\_port\_del ()

# Prototype

status\_t adlink\_trunk\_lacp\_trunk\_del (CLIENT\* clnt,int unit, int trunk\_id);

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Remove a lacp trunk.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN] Fabric or Base chip unit.</td></tr><tr><td>trunk_id</td><td>[IN] Trunk group id,range &lt;1-8&gt;.</td></tr><tr><td>sys_priority</td><td>[IN] Priority of the trunk,0~65535,0 is highest.</td></tr></table>

# Return

status\_t

# adlink\_trunk\_manual\_port\_add ()

# Prototype

status\_t adlink\_trunk\_manual\_port\_add (CLIENT\* clnt,int unit, int trunk\_id, UINT64 pbmp)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Prototype

status\_t adlink\_trunk\_manual\_port\_add(CLIENT\* clnt,int unit, int trunk\_id, UINT32 port\_id)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Add a port to a manual trunk.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN] Fabric or Base chip unit.</td></tr><tr><td>trunk_id</td><td>[IN] Trunk group id,range &lt;1-8&gt;.</td></tr><tr><td>pbmp</td><td>[IN] a port bit map,specified the port set.</td></tr><tr><td>port_id</td><td>[IN] Specified a port ID.</td></tr></table>

# Return

status\_t

# adlink\_trunk\_port\_del()

# Prototype

status\_t adlink\_trunk\_port\_del(CLIENT\* clnt,int unit, int trunk\_id, UINT64 pbmp);

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Remove a port from the trunk.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN] Fabric or Base chip unit.</td></tr><tr><td>trunk_id</td><td>[IN] Trunk group id,range &lt;1-8&gt;.</td></tr><tr><td>pbmp</td><td>[IN] a port bit map,specified the port set.</td></tr></table>

# Return

status\_t

# adlink\_trunk\_manual\_port\_del ()

# Prototype

status\_t adlink\_trunk\_manual\_port\_del (CLIENT\* clnt, int unit, int trunk\_id, UINT32 port\_id)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Remove a port from a manual trunk.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN] Fabric or Base chip unit.</td></tr><tr><td>trunk_id</td><td>[IN] Trunk group id,range &lt;1-8&gt;.</td></tr><tr><td>port_id</td><td>[IN] Specified the port ID.</td></tr></table>

# Return

status\_t

# adlink\_trunk\_lacp\_port\_add ()

# Prototype

status\_t adlink\_trunk\_lacp\_port\_add (CLIENT\* clnt, int unit, int trunk\_id, UINT64 pbmp)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Prototype

status\_t adlink\_trunk\_lacp\_port\_add(CLIENT\* clnt,int unit, int trunk\_id, UINT32 port\_id)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Add a port to a lacp trunk.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN] Fabric or Base chip unit.</td></tr><tr><td>trunk_id</td><td>[IN] Trunk group id,range &lt;1-8&gt;.</td></tr><tr><td>pbmp</td><td>[IN] A port bit map,specified the port set.</td></tr><tr><td>port_id</td><td>[IN] Specified the port ID.</td></tr></table>

# Return

status\_t

# adlink\_trunk\_lacp\_priority\_port\_add ()

# Prototype

status\_t adlink\_trunk\_lacp\_priority\_port\_add (CLIENT\* clnt,int unit, int trunk\_id, UINT32 port\_id, UINT32 port\_priority)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Add a port to a lacp trunk with user-defined port priority.

# Parameters

clnt [IN] RPC client that the init function returned.

<table><tr><td>unit</td><td>[IN] Fabric or Base chip unit;</td></tr><tr><td>trunk_id</td><td>[IN] Trunk group id; Start from ‘0’;</td></tr><tr><td>port_id</td><td>[IN] Port Id</td></tr><tr><td>port_priority</td><td>[IN] Priority of the trunk,0~65535,0 is highest</td></tr></table>

# Return

status\_t

# adlink\_trunk\_lacp\_pri\_port\_add ()

# Prototype

status\_t adlink\_trunk\_lacp\_pri\_port\_add (CLIENT\* clnt, int unit, int trunk\_id, UINT64 pbmp, UINT32 pri)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Add ports to a lacp trunk with user-defined port priority.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN] Fabric or Base chip unit.</td></tr><tr><td>trunk_id</td><td>[IN] Trunk group id,range &lt;1-8&gt;.</td></tr><tr><td>pbmp</td><td>[IN] A port bit map,specified the port set.</td></tr><tr><td>pri</td><td>[IN] Specified a lacp port priority.</td></tr></table>

# Return

status\_t

# adlink\_trunk\_all\_trunk\_clear ()

# Prototype

status\_t adlink\_all\_trunk\_clear (CLIENT\* clnt, int unit)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Remove all trunks.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN] Fabric or Base chip unit;</td></tr></table>

# Return

status\_t

# adlink\_trunk\_manual\_trunk\_get ()

# Prototype

status\_t adlink\_trunk\_manual\_trunk\_get(CLIENT\* clnt,int unit, int trunk\_id, adlink\_trunk\_manual\_trunk\_t\* manual\_trunk);

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Get manual trunk information.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN] Fabric or Base chip unit;</td></tr><tr><td>trunk_id</td><td>[IN] Trunk group id,range &lt;1-8&gt;.</td></tr><tr><td>manual_trunk</td><td>[OUT] structure to store manual trunk information.</td></tr></table>

# Return

status\_t

# adlink\_trunk\_lacp\_trunk\_get ()

# Prototype

status\_t adlink\_trunk\_lacp\_trunk\_get(CLIENT\* clnt,int unit, int trunk\_id, adlink\_trunk\_info\_t\* trunk\_info)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# prototype

status\_t adlink\_trunk\_lacp\_trunk\_get(CLIENT\* clnt,int unit, int trunk\_id, adlink\_trunk\_lacp\_trunk\_t\* lacp\_trunk);

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

This function is used to get trunk group information.

# Parameters

clnt [IN] RPC client that the init function returned.

unit [IN] Fabric or Base chip unit;

trunk\_id [IN] Trunk group id,range &lt;1-8&gt;.

lacp\_trunk [OUT] structure to store lacp trunk information.

trunk\_info [OUT] structure to store lacp trunk information.

# Return

status\_t

# adlink\_trunk\_ balance\_type \_set ()

# Prototype

status\_t adlink\_trunk\_balance\_type\_set (CLIENT\* clnt, int unit, int trunk\_id, UINT32

balance\_type)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Set the trunk load balance type.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN] Fabric or Base chip unit.</td></tr><tr><td>trunk_id</td><td>[IN] Trunk group id,range &lt;1-8&gt;.</td></tr><tr><td>balance_type</td><td>[IN] Specified a balance type, see enumerate in adlink_trunk_balance_type_t.</td></tr></table>

# Return

status\_t

# adlink\_trunk\_ balance\_type \_get ()

# Prototype

status\_t adlink\_trunk\_balance\_type\_get(CLIENT\* clnt,int unit, int trunk\_id, UINT32

\*balance\_type)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Get the trunk load balance type.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN] Fabric or Base chip unit;</td></tr></table>

trunk\_id [IN] Trunk group id; Start from ‘1’,invalid in MXN-3610/MXN-4100.

balance\_type [OUT] Specified a balance type,see enumerate in adlink\_trunk\_balance\_type\_t.

# Return

status\_t.

# adlink\_trunk\_enhanced\_balance\_mode\_set ()

# Prototype

status\_t adlink\_trunk\_enhanced\_balance\_mode\_set(CLIENT\* clnt,int unit, UINT32 enhanced\_mode)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

These functions are used to control the enhanced port selection criteria, an ADLINK-defined hash method utilizing "mode7" in the Broadcom SDK (using adlink\_trunk\_balance\_type\_set to set balance type as BALANCE\_TYPE\_ENHANCED). Enhanced port selection criteria can be set to use 4-tuple (SrcIp, DstIp. SrcPort, DstPort) or 5-tuple (SrcIp, DstIp, SrcPort, DstPort, IpProtocol) to generate the hash value. Note that this is a system wide configuration and modification of this mode will affect all trunk groups that are using Enhanced port selection criteria.

# Parameters

clnt [IN] RPC client that the init function returned.

unit [IN] Fabric or Base chip unit.

enhanced\_mode [IN] 4-tuple/5-tuple.

# Return

status\_t

adlink\_trunk\_balance\_config\_set()

status\_t adlink\_trunk\_balance\_config\_set(CLIENT \*clnt,int unit, PACKET\_SELECT\_FIELD\_t packet\_select\_field, BOOL set\_config);

adlink\_trunk\_balance\_config\_get()

status\_t adlink\_trunk\_balance\_config\_get(CLIENT \*clnt,int unit,

adlink\_trunk\_balance\_config\_info\_t \*trunk\_balance\_config\_info);

# adlink\_trunk\_enhanced\_balance\_mode\_get()

# Prototype

status\_t adlink\_trunk\_enhanced\_balance\_mode\_get(CLIENT\* clnt,int unit, UINT32

\*enhanced\_mode)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

These functions are used to control the enhanced port selection criteria, an ADLINK-defined hash method utilizing "mode7" in the Broadcom SDK (using adlink\_trunk\_balance\_type\_set to set balance type as BALANCE\_TYPE\_ENHANCED). Enhanced port selection criteria can be set to use 4-tuple (SrcIp, DstIp. SrcPort, DstPort) or 5-tuple (SrcIp, DstIp, SrcPort, DstPort, IpProtocol) to generate the hash value. Note that this is a system wide configuration and modification of this mode will affect all trunk groups that are using Enhanced port selection criteria.

# Parameters

clnt [IN] RPC client that the init function returned.

unit [IN] Fabric or Base chip unit.

enhanced\_mode [OUT] 4-tuple/5-tuple.

# Return

status\_t.

# adlink\_trunk\_l4\_port\_enable()

# Prototype

status\_t adlink\_trunk\_l4\_port\_enable(CLIENT\* clnt,int unit)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

These functions are used to control the port selection criteria detail, (using adlink\_trunk\_balance\_type\_set to set balance type as BALANCE\_TYPE\_SIP or BALANCE\_TYPE\_DIP or BALANCE\_TYPE\_SIP\_DIP). L4 port disable means port is selected by “Source IP” or “Destination IP” or “Source IP and Destination IP”, L4 port enable means port is selected by “Source IP and Source Port” or “Destination IP and Destination Port” or “Source IP, Destination IP, Source Port, Destination Port”.

# Parameters

clnt [IN] RPC client that the init function returned.

unit [IN] Fabric or Base chip unit;

# Return

status\_t

# adlink\_trunk\_l4\_port\_disable()

# Prototype

status\_t adlink\_trunk\_l4\_port\_disable(CLIENT\* clnt,int unit)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

These functions are used to control the port selection criteria detail, (using adlink\_trunk\_balance\_type\_set to set balance type as BALANCE\_TYPE\_SIP or BALANCE\_TYPE\_DIP or BALANCE\_TYPE\_SIP\_DIP). L4 port disable means port is selected by “Source IP” or “Destination IP” or “Source IP and Destination IP”, L4 port enable means port is selected by “Source IP and Source Port” or “Destination IP and Destination Port” or “Source IP, Destination IP, Source Port, Destination Port”.

# Parameters

clnt [IN] RPC client that the init function returned. unit [IN] Fabric or Base chip unit;

# Return

status\_t

# adlink\_trunk\_l4\_port\_get()

# Prototype

status\_t adlink\_trunk\_l4\_port\_get(CLIENT\* clnt,int unit, UINT32 \*flag)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

These functions are used to control the port selection criteria detail, (using adlink\_trunk\_balance\_type\_set to set balance type as BALANCE\_TYPE\_SIP or BALANCE\_TYPE\_DIP or BALANCE\_TYPE\_SIP\_DIP). L4 port disable means port is selected by “Source IP” or “Destination IP” or “Source IP and Destination IP”, L4 port enable means port is selected by “Source IP and Source Port” or “Destination IP and Destination Port” or “Source IP, Destination IP, Source Port, Destination Port”.

# Parameters

clnt [IN] RPC client that the init function returned. unit [IN] Fabric or Base chip unit. flag [IN|OUT] L4 enbale/disable.

# Return

status\_t

# adlink\_trunk\_mode\_get()

# Prototype

adlink\_trunk\_mode\_t adlink\_trunk\_mode\_get(CLIENT\* clnt,int unit, int trunk\_id);

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Get the trunk mode, manual or lacp.

# Parameters

clnt [IN] RPC client that the init function returned.

unit [IN] Specified the switch chip,eg:Fabric/Base.

trunk\_id [IN] Specified the target trunk .

# Return

adlink\_trunk\_mode\_t

# adlink\_trunk\_balance\_config\_set()

# Prototype

adlink\_trunk\_balance\_config\_set(CLIENT \*clnt,int unit, PACKET\_SELECT\_FIELD\_t packet\_select\_field, BOOL set\_config);

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Set the packet field status which can be used as a hash key for trunk.

# Parameters

clnt [IN] RPC client that the init function returned.

unit [IN] Specified the switch chip,eg:Fabric/Base.

packet\_select\_field [IN] packet field

set\_config [IN] ENABLE/DISABLE

# Return

status\_t

# adlink\_trunk\_balance\_config\_get()

adlink\_trunk\_balance\_config\_get(CLIENT \*clnt,int unit, adlink\_trunk\_balance\_config\_info\_t \*trunk\_balance\_config\_info);

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Get the packet field staus which can be used as a hash key for trunk.

# Return

status\_t

# 2.7 LBG

This section describes the macro, enum, struct and functions for LBG. They are defined in the header file “adlink\_api\_lbg.h”.

# 2.7.1 Macro Definitions

# L34HASH\_SIP

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Indicates hash field “source ip address” to operate on.

# L34HASH\_DIP

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Indicates hash field “destination ip address” to operate on.

# L34HASH\_L4SRC

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Indicates hash field “layer 4 source port” to operate on.

# L34HASH\_L4DST

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Indicates hash field “layer 4 destination port” to operate on.

# LBGACTIVEPORT

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Indicate lbg port set to active mode.

# LBGBACKUPPORT

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Indicate lbg port set to backup mode..

# L34HASH\_PROT

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Indicates hash field “layer 4 protocol type” to operate on.

# L34HASH\_SYM

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Indicates hash field “layer 3, 4 symmetric” to operate on.

# L34HASH\_USETCP

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Indicates hash field “layer 4 protocol is TCP” to operate on.

# L34HASH\_USEUDP

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Indicates hash field “layer 4 protocol is UDP” to operate on.

# 2.7.2 EnumType

None.

# 2.7.3 Data Structure

None.

# 2.7.4 Functions

# adlink\_lbg\_add()

# Prototype

status\_t adlink\_lbg\_add(CLIENT\* clnt, int unit, int lbgIndex, int numberOfBins)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Create a load balance group.

Parameters

<table><tr><td>clnt</td><td>[IN] rpc client handler..</td></tr><tr><td>unit</td><td>[IN] switch chip number.</td></tr><tr><td>lbgIndex</td><td>[IN] LBG to be created.</td></tr><tr><td>numberOfBins</td><td>[IN] amount of hash bins, can be 0-16, 32, 64, 128, 256, 512, 1024, 2048, 4096. If 0, default value 128 will be used.</td></tr></table>

# Return

status\_t

ADLINK\_E\_NONE if successful.

ADLINK\_E\_FAIL if LBG cannot be created.

ADLINK\_E\_CONFIG if LBG cannot be activated.

ADLINK\_E\_MALLOC if memory cannot be allocated.

# adlink\_lbg\_del()

# Prototype

status\_t adlink\_lbg\_del(CLIENT \*clnt, int unit, int lbgIndex)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Delete a load balance group.

# Parameters

clnt [IN] rpc client handler..

unit [IN] switch chip number.

lbgIndex [IN] LBG to be deleted.

# Return

status\_t

ADLINK\_E\_NONE if successful.

ADLINK\_E\_NOT\_FOUND if LBG cannot be found.

ADLINK\_E\_FAIL if LBG cannot be deleted.

# adlink\_lbg\_port\_add()

# Prototype

status\_t adlink\_lbg\_port\_add(CLIENT \*clnt, int unit, int lbgIndex, int logicalPort, int portmode)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Add a logical port to an LBG.

# Parameters

clnt [IN] rpc client handler..

unit [IN] switch chip number.

lbgIndex [IN] target LBG index.

logicalPort [IN] logical port number to add.

Portmode [IN] logical port mode active or backup.

# Return

status\_t

ADLINK\_E\_NONE if successful.

ADLINK\_E\_NOT\_FOUND if LBG cannot be found.

ADLINK\_E\_FAIL if port cannot be added.

# adlink\_lbg\_port\_del()

# Prototype

status\_t adlink\_lbg\_port\_del(CLIENT \*clnt, int unit, int lbgIndex, int logicalPort)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Delete a logical port from an LBG.

# Parameters

clnt [IN] rpc client handler..

unit [IN] switch chip number.

lbgIndex [IN] target LBG index.

logicalPort [IN] logical port number to delete.

# Return

status\_t

ADLINK\_E\_NONE if successful.

ADLINK\_E\_NOT\_FOUND if LBG cannot be found.

ADLINK\_E\_FAIL if port cannot be added.

# adlink\_lbg\_hash34\_set()

# Prototype

status\_t adlink\_lbg\_hash34\_set(CLIENT \*clnt, int unit, int l34HashField, int l34HashFieldVal)

Supported On

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Set L34 hashing properties for all LBGs.

# Parameters

clnt [IN] rpc client handler..

unit [IN] switch chip number.

l34HashField [IN] hash source field, please refer to macros "L34HASH\_\*" in header file "adlink\_api\_lbg.h".

l34HashFieldVal [IN] bool value for l34HashField, 1-on, 0-off.

# Return

status\_t

ADLINK\_E\_NONE if successful.

ADLINK\_E\_INTERNAL if current hash config cannot be obtained.

ADLINK\_E\_FAIL if port cannot be added.

# 2.8 Layer-2

This section describes the macro, enum, struct and functions for Layer-2. They are defined in the header file “adlink\_api\_l2.h”.

# 2.8.1 Macro Definitions

# MAC\_SIZE

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

MAC addresses data size in bytes.

# ADLINK\_L2\_xxx

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

L2 entry flag masks. Flags are special attributes of the MAC entry. For details, please refer to the definitions in “adlink\_api\_l2. h”.

# 2.8.2 Enum Type

None.

# 2.8.3 Data Structure

adlink\_mac\_entry\_t
Prototype
```c
typedef struct adlink_mac_entry_s
{
    UINT32 port;    /*port ID associated with the entry, start from 1*/
    UINT16 vid;    /*vlan id*/
    UINT8 rsv0[2];    /*reserved*/
    UINT32 flag;    /*entry flag, ADLINK_L2_XXX*/
    UINT8 mac[MAC_SIZE];    /*mac address*/
    UINT8 rsv1[2];    /*reserved*/
} adlink_mac_entry_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Define the entry format of the MAC table.

# proxy\_mac\_item\_t

# Prototype

typedef struct proxy\_mac\_item\_s{

```c
UINT32 flag;    /*ADLINK_L2_xxx*/
UINT32 port;    /*port id associated to the mac address*/
UINT16 vid;    /*VLAN id associated to the mac address*/
UINT8 mac[MAC_SIZE];/*mac address*/
}proxy_mac_item_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Define the struct of mac item.

# proxy\_mac\_dump\_t

# Prototype

```c
typedef struct proxy_mac_dump_s{
    UINT8 end;    /*indicate whether retrieve finished*/
    UINT8 cnt;    /*retrieved item number in the list*/
    UINT16 last_index;    /*last item index in mac table*/
    proxy_mac_item_t item[MAX_MAC_LIST_SIZE];    /*retrieved mac items*/
}proxy_mac_dump_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Define the struct for l2 mac table dumping.

# 2.8.4 Functions

# adlink\_mac\_entry\_add ()

# Prototype

status\_t adlink\_mac\_entry\_add (CLIENT\* clnt, adlink\_mac\_entry\_t \*entry);

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

These functions are used to change the MAC address table. Add/delete an item or clear all items.

# Parameters

clnt [IN] RPC client that the init function returned.

entry [IN] Entry that will be added or deleted;

# Return

status\_t.

# adlink\_mac\_entry\_del ()

# Prototype

status\_t adlink\_mac\_entry\_del (CLIENT\* clnt, adlink\_mac\_entry\_t \*entry);

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

These functions are used to change the MAC address table. Add/delete an item or clear all items.

# Parameters

clnt [IN] RPC client that the init function returned.

entry [IN] Entry that will be added or deleted.

# Return

status\_t.

# adlink\_mac\_table\_clear ()

# Prototype

status\_t adlink\_mac\_table\_clear (CLIENT\* clnt);

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

These functions are used to change the MAC address table. Add/delete an item or clear all items.

# Parameters

clnt [IN] RPC client that the init function returned.

entry [IN] Entry that will be added or deleted;

# Return

status\_t.

# adlink\_mac\_table\_dump ()

# Prototype

status\_t adlink\_mac\_table\_dump (CLIENT\* clnt, proxy\_index\_t \*start\_index, proxy\_mac\_dump\_t \*list);

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

This function is used to dump the entire MAC address table.

# Parameters

clnt [IN] RPC client that the init function returned. start\_index [IN] Start index of MAC address table; list [OUT] Retrieved MAC entries;

# Return

status\_t

# adlink\_mac\_filter\_add ()

# adlink\_mac\_filter\_del ()

# Prototype

status\_t adlink\_mac\_filter\_add(CLIENT\* clnt,adlink\_mac\_entry\_t \*entry); status\_t adlink\_mac\_filter\_del(CLIENT\* clnt,adlink\_mac\_entry\_t \*entry);;

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

This function is used to add/delete the filter mac.

# Parameters

clnt [IN] RPC client that the init function returned. entry [IN] mac entry for mac filter;

# Return

status\_t

# 2.9 Access Control List

This section describes the macro, enum, struct and functions for Access Control List (ACL).

They are defined in the header file “adlink\_api\_acl.h”.

# 2.9.1 Macro Definitions

# MAX\_QUALIFIER\_NUM

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

The ACL supports multiple qualifiers in a rule. This macro defines the maximum qualifier number allowed in a rule.

# MAX\_UDF\_DATA\_CNT

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

MAX count of UDF data can be added.

# RULE\_INFO\_ACL\_CONFIG

# RULE\_INFO\_QOS\_CONFIG

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

Define the rule is ACL or QOS. Now only ACL can be used.

# 2.9.2 Enum Type

# adlink\_qualifier\_type\_t

```cpp
typedef enum adlink_qualifier_type
{
    INPORT = 1, //port id,data32, only support one port, it is waste for MXN-3610/MXN-4100.
    INPORTS,//data64, port bits map
    SRCIP, //data32
    DSTIP, //data32
    IPPROTOCOL,//data8
```

```txt
DSCP, //data8
L4SRCPORT, //data16
L4DSTPORT, //data16
SRCMAC, //data48
DSTMAC, //data48
//SRCTRUNK, //data16
ETHERTYPE, //data16
INNERVLAN, //data16
OUTERVLAN, //data16
UDF, //data16,
STAGELOOKUP, //No data, customer can't use
}adlink_qualifier_type_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

<table><tr><td>Qualifier Type</td><td>Description</td></tr><tr><td>INPORT</td><td>Filter for the port ID a packet comes from</td></tr><tr><td>INPORTS</td><td>Filter for the port ID a packet comes from</td></tr><tr><td>SRCIP</td><td>Filter for source IP address of a packet</td></tr><tr><td>DSTIP</td><td>Filter for destination IP address of a packet</td></tr><tr><td>IPPROTOCOL</td><td>Filter for IP protocol (such as 0x06 for TCP) of a packet</td></tr><tr><td>L4SRCPORT</td><td>Filter for L4 source port of a packet</td></tr><tr><td>L4DSTPORT</td><td>Filter for L4 destination port of a packet</td></tr><tr><td>SRCMAC</td><td>Filter for source MAC address of a packet</td></tr><tr><td>DSTMAC</td><td>Filter for destination MAC address of a packet</td></tr><tr><td>SRCTRUNK</td><td>Filter for the trunk ID a packet comes from</td></tr><tr><td>ETHERTYPE</td><td>Filter for Ethernet type (such as 0x0806 for ARP) of a packet</td></tr><tr><td>INNERVLAN</td><td>Filter for the inner VLAN ID of a packet</td></tr><tr><td>OUTERVLAN</td><td>Filter for the outer VLAN ID of a packet</td></tr><tr><td>UDF</td><td>Filter for the user defined field</td></tr><tr><td>STAGELOOKUP</td><td>Internal retention</td></tr></table>

Table 2. Return Code Description

# adlink\_action\_type\_t

```c
typedef enum adlink_action_type
{
    REDIRECTPORT = 1*64+1, //port id,data32
    REDIRECTTRUNK, //trunk id,data16
    DROP, //no param
    OUTERVLANNEW, //vlan id,data16
    REMARK_USR_PRIORITY, //Internal retention
```

```c
MIRROR_INGRESS, //Internal retention
MIRROR_EGRESS, //Internal retention
REMARK_DSCP, //Internal retention
REMARK_TOS, //Internal retention
SET_DISCARD_ABILITY, //Internal retention
ASSIGN_OUTPUT_QUEUE, //Internal retention
} adlink_action_type_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

<table><tr><td>Action Type</td><td>Description</td></tr><tr><td>REDIRECTPORT</td><td>Redirect the packet to a port (cpu0, xe0, xe1, xe2...).</td></tr><tr><td>REDIRECTTRUNK</td><td>Redirect the packet to a trunk</td></tr><tr><td>DROP</td><td>Drop the packet</td></tr></table>

Table 3. Action Type Description

adlink\_udf\_offset\_type\_t
```c
typedef enum adlink_udf_offset_type
{
    UDF_PACKETSTART = 1,
    UDF_OUTERL3HEAD = 2,
    UDF_INNERL3HEAD = 3,
    UDF_OUTERL4HEAD = 4,
    UDF_INNERL4HEAD = 5
}adlink_udf_offset_type_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

<table><tr><td>Offset type</td><td>Description</td></tr><tr><td>UDF_PACKETSTART</td><td>Offset from the packet head.</td></tr><tr><td>UDF_OUTERL3HEAD</td><td>Offset from the packet outer l3 head.</td></tr><tr><td>UDF_INNERL3HEAD</td><td>Offset from the packet inner l3 head</td></tr><tr><td>UDF_OUTERL4HEAD</td><td>Offset from the packet outer l4 head</td></tr><tr><td>UDF_INNERL4HEAD</td><td>Offset from the packet inner l4 head</td></tr></table>

Table 4 Action Type Description

adlink\_priority\_type\_t
```c
typedef enum adlink_priority_type
{
    HIGH_PRIORITY = 0,
    LOW_PRIORITY = 1,
}adlink_priority_type_t;
```

Supported on
```txt
aTCA-3710 aTCA-N700 aTCA-3430 MXN-3610/MXN-4100 cPCI-6S10 MXN-0410
```

# 2.9.3 Data Structure

adlink\_udf\_data\_info\_t
```c
typedef struct adlink_udf_data_info
{
    int index;
    UINT32 offset_base;
    UINT16 offset;
    UINT16 ethtype;
    UINT8 ipproto;
    UINT8 resv;
}adlink_udf_data_info_t;
```

Supported on
```txt
aTCA-3710 aTCA-N700 aTCA-3430 MXN-3610/MXN-4100 cPCI-6S10 MXN-0410
```

Udf data info struct.

adlink\_acl\_data\_t
```c
typedef struct adlink_acl_data
{
    UINT8 data128[16]; //data128 use, such as ipv6 addr
    UINT64 data64; //data64 use, such as imports pbmp
    UINT8 data48[6]; //data48 use, such as mac addr
    UINT32 data32; //data32 use, such as ip addr
    UINT16 data16; //data16 use, such as l4port
    UINT8 data8; //data8 use, such as ip protocol
} adlink_acl_data_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

For different qualifiers and actions, there are different data lengths. For example, an IP address is 32 bits long, a MAC address is 48 bits long, and an L4 port ID is 16 bits long. This data structure was defined in order to accommodate these different situations. Careful attention must be paid to refer to the appropriate member according to the actual situation. The appropriate members for existing qualifiers and actions are listed in the tables above.

# adlink\_acl\_qualifier\_info\_t

```c
typedef struct adlink_acl_qualifier_info
{
    adlink_qualifier_type_t type;
    UINT16 udf_id;//only used for type=UDF
    adlink_acl_data_t data;//use the correct member for different types
    adlink_acl_data_t mask;//use the correct member for different types
} adlink_acl_qualifier_info_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

<table><tr><td>Qualifier Type</td><td>Data</td><td>mask</td></tr><tr><td>INPORT</td><td>data32(port id)</td><td>None</td></tr><tr><td>INPORTS</td><td>Data64(port bit maps,cpu0 is bit 0,xe0 is bit 1,...)</td><td></td></tr><tr><td>SRCIP</td><td>data32</td><td>data32</td></tr><tr><td>DSTIP</td><td>data32</td><td>data32</td></tr><tr><td>IPPROTOCOL</td><td>Data8</td><td>Data8</td></tr><tr><td>L4SRCPORT</td><td>Data16</td><td>Data16</td></tr><tr><td>L4DSTPORT</td><td>Data16</td><td>Data16</td></tr><tr><td>SRCMAC</td><td>Data48</td><td>Data48</td></tr><tr><td>DSTMAC</td><td>Data48</td><td>Data48</td></tr><tr><td>SRCTRUNK</td><td>Data16</td><td>Data16</td></tr><tr><td>ETHERTYPE</td><td>Data16</td><td>Data16</td></tr><tr><td>INNERVLAN</td><td>Data16</td><td>Data16</td></tr><tr><td>OUTERVLAN</td><td>Data16</td><td>Data16</td></tr><tr><td>UDF</td><td>Data16</td><td>Data16</td></tr></table>

Table 5. Data Descriptions for Different Qualifier Types

adlink\_acl\_action\_info\_t
```c
typedef struct adlink_acl_action_info
{
    adlink_action_type_t type;
    adlink_acl_data_t param0;//union,use the correct member for different types
    adlink_acl_data_t param1;//union,use the correct member for different types
} adlink_acl_action_info_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

<table><tr><td>Action Type</td><td>Param0</td><td>Param1</td></tr><tr><td>REDIRECTPORT</td><td>data32 (port id)</td><td>None</td></tr><tr><td>REDIRECTTRUNK</td><td>Data16 (trunk id)</td><td>None</td></tr><tr><td>DROP</td><td>None</td><td>None</td></tr></table>

Table 6. Data Descriptions for Different Action Types

adlink\_acl\_rule\_info\_t
```txt
typedef struct adlink_acl_rule_info
{
    UINT16 priority; // the priority of the ACL rule
    UINT16 qualifier_num; // the number of qualifier of the ACL rule
    adlink_acl_qualifier_info_t qualifier[MAX_QUALIFIER_NUM]; // record the qualifier info
    adlink_acl_action_info_t action; // record the action info
} adlink_acl_rule_info_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# 2.9.4 Functions

adlink\_acl\_rule\_add ()
Prototype
```txt
status_t adlink_acl_rule_add (CLIENT* clnt, adlink_acl_rule_info_t *rule_info,UINT16 *rule_id);
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Description

This function is used to add an ACL rule.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>rule_info</td><td>[IN] The ACL rule info needed to be added.</td></tr><tr><td>rule_id</td><td>[OUT] The pointer for saving the rule ID.</td></tr></table>

# Return

status\_t.

# adlink\_acl\_rule\_delete ()

# Prototype

status\_t adlink\_acl\_rule\_delete (CLIENT\* clnt, UINT16 rule\_id);

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Description

This function is used to delete an ACL rule.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>rule _id</td><td>[IN] The ID of the ACL rule that want to delete.</td></tr></table>

# Return

status\_t.

# adlink\_acl\_rule\_clear ()

# Prototype

status\_t adlink\_acl\_clear (CLIENT\* clnt);

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Description

This function is used to clear the ACL table in the system. After executing this function, all ACL rules in the system will be lost.

# Parameters

clnt [IN] RPC client that the init function returned.

# Return

status\_t

# adlink\_acl\_rule\_get ()

# Prototype

status\_t adlink\_acl\_rule\_get (CLIENT\* clnt, UINT16 rule\_id, adlink\_acl\_rule\_info\_t \*rule\_info);

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Description

This function is used to get the detail information of an ACL rule.

# Parameters

clnt [IN] RPC client that the init function returned.

rule\_id [IN] The ID of the rule that want to get information.

rule\_info [OUT] The pointer for saving the rule information.

# Return

status\_t

# adlink\_udf\_data\_set ()

# adlink\_udf\_data\_delete()

# adlink\_udf\_data\_get()

# Prototype

status\_t adlink\_udf\_data\_set(CLIENT\* clnt,adlink\_udf\_data\_info\_t \*udf\_info);

status\_t adlink\_udf\_data\_delete(CLIENT\* clnt,UINT16 index);

status\_t adlink\_udf\_data\_get(CLIENT\* clnt,UINT16 index,adlink\_udf\_data\_info\_t \*udf\_info);

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Description

This functions are used for udf.

# Parameters

clnt [IN] RPC client that the init function returned.

Index [IN] udf date index.

udf\_info [IN/OUT] The udf data information.

# Return

status\_t

# 2.10 Spanning Tree Protocol

This section describes the macro, enum, struct and functions for Spanning Tree Protocol (STP). They are defined in the header file “adlink\_api\_stp.h”. This feature related APIs are only applied to cPCI-6S10 and MXN-0410. STP feature not support trunk port now.

Spanning Tree Protocol management interfaces include the following services:

Create and delete bridge.
Add ports to and delete ports from a bridge.
Set bridge status, priority, forward delay time, hello time, max age time.
Set port path cost, port priority
Get bridge info
Print bridge and port STP info

# 2.10.1 Macro Definitions

# MAX\_BR\_NUM

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

This is used to define the maxiumum bridge numbers in our system. Actually our system now just support only one bridge.

# MAX\_BR\_PORTS

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

This defines the maxiumum ports that can be add to a bridge.

# 2.10.2 Enum Type

# stp\_status

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

enum stp\_status{

STP\_ON = 1,

STP\_OFF = 2,

};

The stp status for bridge.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>STP_ON</td><td>Bridge status is on</td></tr><tr><td>STP_OFF</td><td>Bridge status is off</td></tr></table>

# 2.10.3 Data Structure

# bridge\_id\_t

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

typedef struct bridge\_id\_s{

unsigned char prio[2];

unsigned char addr[6];

}bridge\_id\_t;

Define the bridge id info.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>prio</td><td>Birdge priority</td></tr><tr><td>addr</td><td>MAC address for the bridge.</td></tr></table>

# stp\_para\_t

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

union stp\_para\_u{

int stp\_status;

int br\_pri;

int path\_cost;

int port\_pri;

uint time;

};

Defines the stp parameters to use.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>stp_status</td><td>STP staus.</td></tr><tr><td>br_pri</td><td>Bridge priority.</td></tr><tr><td>path_cost</td><td>Ports path cost.</td></tr><tr><td>port_pri</td><td>Ports priority.</td></tr><tr><td>time</td><td>Time value for hello time, forward dealy or max age.</td></tr></table>

# proxy\_stp\_para\_item\_t

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

typedef struct proxy\_stp\_para\_item\_s{

char bridge\_name[32];

int port\_id;

union stp\_para\_u stp\_para;

}proxy\_stp\_para\_item\_t;

Defines the STP parameters for a port or bridge

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>bridge_name</td><td>Bridge name</td></tr><tr><td>port_id</td><td>Port id</td></tr><tr><td>stp_para</td><td>See union stp_para_u</td></tr></table>

# adlink\_br\_info\_t

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

typedef struct adlink\_br\_info\_s{

char br\_name[32];

bridge\_id\_t br\_id;

unsigned char stp\_enabled;

int port\_num;

struct port\_name port\_name\_list[MAX\_BR\_PORTS];

}adlink\_br\_info\_t;

Defines the bridge info.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>br_name</td><td>Bridge name</td></tr><tr><td>br_id</td><td>Birdge id</td></tr><tr><td>stp_enabled</td><td>Bridge status</td></tr><tr><td>port_num</td><td>Num of ports in the bridge</td></tr><tr><td>port_name_list</td><td>Port name list</td></tr></table>

# adlink\_br\_list\_info\_t

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

typedef struct adlink\_br\_list\_info\_s{

int br\_num;

adlink\_br\_info\_t br\_info[MAX\_BR\_NUM];

}adlink\_br\_list\_info\_t;

Defines the bridge list info of the whole system.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>br_num</td><td>Num of bridges</td></tr><tr><td>br_info</td><td>Bridge related info</td></tr></table>

# bridge\_stp\_info

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

struct bridge\_stp\_info

{

bridge\_id\_t designated\_root;

bridge\_id\_t bridge\_id;

unsigned root\_path\_cost;

struct time\_val max\_age;

struct time\_val hello\_time;

struct time\_val forward\_delay;

struct time\_val bridge\_max\_age;

struct time\_val bridge\_hello\_time;

struct time\_val bridge\_forward\_delay;

unsigned short root\_port;

unsigned char stp\_enabled;

unsigned char topology\_change;

unsigned char topology\_change\_detected;

struct time\_val ageing\_time;

struct time\_val hello\_timer\_value;

struct time\_val tcn\_timer\_value;

struct time\_val topology\_change\_timer\_value;

struct time\_val gc\_timer\_value;

};

Defines detailed STP info of bridge.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>designated_root</td><td>Designated root bridge id</td></tr><tr><td>bridge_id</td><td>Bridge id</td></tr><tr><td>root_path_cost</td><td>Root path cost</td></tr><tr><td>max_age</td><td>For internal use</td></tr><tr><td>hello_time</td><td>BPDU hello time</td></tr><tr><td>forward_delay</td><td>Forward delay time</td></tr><tr><td>bridge_max_age</td><td>Bridge max age time</td></tr><tr><td>bridge_hello_time</td><td>Bridge hello time</td></tr><tr><td>bridge_forward_delay</td><td>Birdge forward delay time</td></tr><tr><td>root_port</td><td>Root port</td></tr><tr><td>stp_enabled</td><td>STP status</td></tr><tr><td>topology_change</td><td>Topology change flag.</td></tr><tr><td>topology_change_detected</td><td>Topology change detect flag.</td></tr><tr><td>ageing_time</td><td>For internal use</td></tr><tr><td>hello_timer_value</td><td>Timer to send BPDU hello packets</td></tr><tr><td>tcn_timer_value</td><td>TCN timer for internal use</td></tr><tr><td>topology_change_timer_value</td><td>Topology change timer for internal use</td></tr><tr><td>gc_timer_value</td><td>GC timer value for internal use</td></tr></table>

# br\_stp\_port\_info

# Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

```c
struct br_stp_port_info
{
    unsigned port_no;
    bridge_id_t designated_root;
    bridge_id_t designated_bridge;
    unsigned short port_id;
    unsigned short designated_port;
    unsigned char priority;
    unsigned char top_change_ack;
    unsigned char config_pending;
    unsigned char state;
    unsigned path_cost;
    unsigned designated_cost;
    struct time_val message_age_timer_value;
    struct time_val forward_delay_timer_value;
    struct time_val hold_timer_value;
};
```

Defines the detailed port info of bridge.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>port_no</td><td>Port index of the current port for the bridge.Start from 1</td></tr><tr><td>designated_root</td><td>Designated root bridge id</td></tr><tr><td>designated_bridge</td><td>Designated bridge id</td></tr><tr><td>port_id</td><td>Port id for the bridge, It consist of port no and priority.</td></tr><tr><td>designated_port</td><td>Designed port id</td></tr><tr><td>priority</td><td>Port priority</td></tr><tr><td>top_change_ack</td><td>For internal use</td></tr><tr><td>config_pending</td><td>For internal use</td></tr><tr><td>state</td><td>Port stp state.Disable/listening/learning//forwarding/ blocking</td></tr><tr><td>path_cost</td><td>Ports&#x27; path cost</td></tr><tr><td>designated_cost</td><td>Designated path cost</td></tr><tr><td>message_age_timer_value</td><td>For internal use</td></tr><tr><td>forward_delay_timer_value</td><td>Forward delay timer</td></tr><tr><td>hold_timer_value</td><td>Hold timer for internal use</td></tr></table>

# adlink\_stp\_modify\_t

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

typedef struct adlink\_stp\_modify\_s {

int unit;

char bridge\_name[32];

int portbmp;

}adlink\_stp\_modify\_t;

Used for STP modify operation.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>unit</td><td>Fabric or Base unit</td></tr><tr><td>bridge_name</td><td>Specific the bridge to operate.</td></tr><tr><td>portbmp</td><td>Specific the ports to operate</td></tr></table>

# adlink\_stp\_para\_set\_t

# Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

typedef struct adlink\_stp\_para\_set\_s{

int unit;

char bridge\_name[32];

int port\_id;

union stp\_para\_u stp\_para;

}adlink\_stp\_para\_set\_t;

Used to set STP parameters.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>unit</td><td>Fabric or Base unit</td></tr><tr><td>bridge_name</td><td>Specific the bridge to operate.</td></tr><tr><td>port_id</td><td>Specific the port to operate</td></tr><tr><td>stp_para</td><td>STP related parameters</td></tr></table>

# adlink\_br\_stp\_info\_t

# Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

typedef struct adlink\_br\_stp\_info\_s{

int bridge\_find;

struct bridge\_stp\_info bridge\_stp;

int port\_num;

struct port\_name br\_port\_name[MAX\_BR\_PORTS];

struct br\_stp\_port\_info port\_info[MAX\_BR\_PORTS];

}adlink\_br\_stp\_info\_t;

Defines the bridge ports infos.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>bridge_find</td><td>Bridge exist or not.</td></tr><tr><td>bridge_stp</td><td>Bridge info</td></tr><tr><td>port_num</td><td>Port in the bridge</td></tr><tr><td>Br_port_name</td><td>Port name</td></tr><tr><td>Port_info</td><td>Port infos</td></tr></table>

# 2.10.4 Functions

adlink\_stp\_bridge\_add ()

adlink\_stp\_bridge\_del ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_stp\_bridge\_add(adlink\_stp\_modify\_t \*status)

status\_t adlink\_stp\_bridge\_del(adlink\_stp\_modify\_t \*status)

# Description

This function is used to add/delete the specific bridge.

# Parameters

status [IN] Modification info include unit and bridge name.

# Return

status\_t.

adlink\_stp\_itf\_add ()

adlink\_stp\_itf\_del ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_stp\_itf\_add (adlink\_stp\_modify\_t \*status)

status\_t adlink\_stp\_itf\_del (adlink\_stp\_modify\_t \*status)

# Description

This function is used to add/delete the ports from the specific bridge.

# Parameters

status [IN] Modification info include unit ,bridge name and ports.

# Return

status\_t.

# adlink\_stp\_status\_set ()

# Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_stp\_status\_set (adlink\_stp\_para\_set\_t \*status)

# Description

This function is used to set STP status.

# Parameters

status [IN]. Parameters include unit, bridge name and stp status

# Return

status\_t.

# adlink\_stp\_br\_pri\_set ()

# Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_stp\_br\_pri\_set (adlink\_stp\_para\_set\_t \*status)

# Description

This function is used to set bridge priority.

# Parameters

status [IN]. Parameters include unit, bridge name and bridge priority.

The bridge priority shoud in range &lt;0-61440&gt; and in step of 4096

# Return

status\_t.

# adlink\_stp\_fd\_time\_set()

# Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_stp\_fd\_time\_set (adlink\_stp\_para\_set\_t \*status)

# Description

This function is used to set bridge priority.

# Parameters

status [IN]. Parameters include unit, bridge name and forward delay time. The forward delay time should in range &lt;2-30&gt; and follow (2\*(Hello-time +1) &lt;= Max-Age &lt;= 2\*(Forward-Delay - 1) )

# Return

status\_t.

# adlink\_stp\_hello\_time\_set ()

# Supported on

&lt;table&gt;<tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_stp\_hello\_time\_set (adlink\_stp\_para\_set\_t \*status)

# Description

This function is used to set hello time.

# Parameters

status [IN]. Parameters include unit, bridge name and hello time. The hello time should in range &lt;1-10&gt; and follow (2\*(Hello-time +1) &lt;= Max-Age &lt;= 2\*(Forward-Delay - 1) )

# Return

status\_t.

# adlink\_stp\_max\_age\_time\_set ()

# Supported on

&lt;table&gt;<tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_stp\_fd\_time\_set (adlink\_stp\_para\_set\_t \*status)

# Description

This function is used to set max age time.

# Parameters

status [IN]. Parameters include unit, bridge name and max age time. The max age time should in range &lt;6-40&gt; and follow $( 2 ^ { \ast } ( \mathsf { H e l l o - t i m e } + 1 ) &lt; = \mathsf { M a x - A g e } &lt; = 2 ^ { \ast } ( \mathsf { F o r w a r d - D e l a y - 1 } ) )$

# Return

status\_t.

# adlink\_stp\_path\_cost\_set ()

# Supported on

&lt;table&gt;<tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_stp\_path\_cost\_set (adlink\_stp\_para\_set\_t \*status)

# Description

This function is used to set port path cost.

# Parameters

status [IN]. Parameters include unit, bridge name, port id and path cost. adlink\_port\_id\_get\_by\_bcmname () is used to get port id from port name. The path cost should in range &lt;1-100&gt;

# Return

status\_t.

# adlink\_stp\_port\_pri\_set ()

# Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_stp\_port\_pri\_set (adlink\_stp\_para\_set\_t \*status)

# Description

This function is used to set port priority.

# Parameters

status [IN]. Parameters include unit, bridge name, port id and port priority. The path cost should in range &lt;1-100&gt;

# Return

status\_t.

# adlink\_stp\_br\_list\_info\_get ()

# Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_stp\_br\_list\_info\_get (adlink\_br\_list\_info\_t \*stat)

# Description

This function is used to get bridge list information. The info contains the bridge name, brige state and bridge ports. Refer to “adlink\_br\_list\_info\_t” for more details.

# Parameters

status [IN]. Pointer to the bridge list infos.

# Return

status\_t.

# adlink\_stp\_br\_list\_info\_print ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_stp\_br\_list\_info\_print (adlink\_br\_list\_info\_t \*stat)

# Description

This function is used to print bridge list informations.

# Parameters

status [IN]. Pointer to the bridge list infos.

# Return

status\_t.

# adlink\_br\_stp\_info\_get ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_br\_stp\_info\_get (char \*br\_name, adlink\_br\_stp\_info\_t \*stat)

# Description

This function is used to get bridge detail STP informations by bridge name.

# Parameters

br\_name [IN]. bridge name

status [OUT]. Pointer to the bridge STP information.

# Return

status\_t.

# adlink\_br\_info\_print ()

# Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_br\_info\_print (char \*br\_name, adlink\_br\_stp\_info\_t \*stat)

# Description

This function is used to print bridge’s detail STP informations (Not include port’s info).

# Parameters

br\_name [IN]. bridge name

status [IN]. Pointer to the bridge STP information.

# Return

status\_t.

# adlink\_br\_port\_info\_print ()

# Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_br\_port\_info\_print (adlink\_br\_stp\_info\_t \*stat)

# Description

This function is used to print port’s detail STP informations.

# Parameters

status [IN]. Pointer to the port’s STP information.

# Return

status\_t.

# adlink\_br\_stp\_info\_print ()

# Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_br\_stp\_info\_print (char \*br\_name, adlink\_br\_stp\_info\_t \*stat)

# Description

This function is used to print current bridge’s detail STP informations. It is equalivalent to using adlink\_br\_info\_print () and adlink\_br\_port\_info\_print ().

# Parameters

status [IN]. Pointer to the bridge’s detail STP information, including bridge info and its port info.

# Return

status\_t.

# 2.11 Rapid Spanning Tree Protocol

This section describes the macro, enum, struct and functions for Rapid Spanning Tree Protocol (RSTP). They are defined in the header file “adlink\_api\_stp\_rstp.h”. RSTP feature not support trunk/LAG port now.

This feature related API include the following services:

Enable and disable the RSTP feature.
Force this feature work at STP or RSTP mode.
• Set bridge priority, forward delay time, hello time, max age time.
• Set port path cost, port priority, port STP status, port P2P status, port edge status, port mcheck function.
Get current spanning tree global info and port info.

# 2.11.1 Macro Definitions

# STP\_PORT\_NAME\_MAX\_LEN

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

This is used to define the max length of the STP/RSTP port name.

# 2.11.2 Enum Type

# INFO\_IS\_T

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

```txt
typedef enum
{
Mine,
Aged,
Received,
Disabled
} INFO_IS_T;
```

The origin/state of the port’s spanning tree information (port info) held for ports.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>Mine</td><td>The port has been derived from the root port for the bridge (with the addition of root port cost information). This includes the possibility that the root port is “Port 0”, i.e., the bridge is the root bridge for the bridged Local Area Network (LAN).</td></tr><tr><td>Aged</td><td>The root bridge has been aged out.</td></tr><tr><td>Received</td><td>The port has received current (not aged out) information from the designated bridge for the attached LAN (a point-to-point bridge link being a special case of a LAN).</td></tr><tr><td>Disabled</td><td>Port is disabled.</td></tr></table>

# RCVD\_MSG\_T

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

```c
typedef enum
{
    SuperiorDesignateMsg = ADLINK_FALSE,
    RepeatedDesignateMsg = ADLINK_TRUE,
    ConfirmedRootMsg,
    OtherMsg
} RCVD_MSG_T;
```

This is used to set the result of the rcvBPDU procedure. Mostly used for internal state machine.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>SuperiorDesignateMsg</td><td>Superior designate message.</td></tr><tr><td>RepeatedDesignateMsg</td><td>Repeated designate message</td></tr><tr><td>ConfirmedRootMsg</td><td>Confirmed root message</td></tr><tr><td>OtherMsg</td><td>Other message</td></tr></table>

This is used to set the result of the rcvBPDU procedure.

# PORT\_ROLE\_T

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

```txt
typedef enum
{
    DisabledPort = 0,
    AlternatePort,
    BackupPort,
    RootPort,
    DesignatedPort,
    MasterPort,
    NonStpPort
} PORT_ROLE_T;
```

This is used to assign Port Role.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>DisabledPort</td><td>Disabled Port</td></tr><tr><td>AlternatePort</td><td>Alternate Port</td></tr><tr><td>BackupPort</td><td>Backup Port</td></tr><tr><td>RootPort</td><td>Root Port</td></tr><tr><td>DesignatedPort</td><td>Designated Port</td></tr><tr><td>MasterPort</td><td>Master Port</td></tr><tr><td>NonStpPort</td><td>Non-STP Port</td></tr></table>

# ADMIN\_P2P\_T

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

```c
typedef enum
{
    P2P_FORCE_TRUE,
    P2P_FORCE_FALSE,
    P2P_AUTO,
} ADMIN_P2P_T;
```

This is used to set port p2p mode

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>P2P_FORCE_TRUE</td><td>Force port work at P2P mode</td></tr><tr><td>P2P_FORCE_FALSE</td><td>Force port work not at P2P mode</td></tr><tr><td>P2P_AUTO</td><td>Force port work at P2P auto mode</td></tr></table>

# UID\_STP\_MODE\_T

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

```txt
typedef enum
{
    STP_DISABLED,
    STP_ENABLED,
} UID_STP_MODE_T;
```

Enums the feature status.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>STP_DISABLED</td><td>Feature disabled</td></tr><tr><td>STP_ENABLED</td><td>Feature enabled</td></tr><tr><td>STP_REENABLE</td><td>Feature Reenable.</td></tr></table>

# PROTOCOL\_VERSION\_T

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

```c
typedef enum PROTOCOL_VERSION
{
    FORCE_STP_COMPAT = 0,
    NORMAL_RSTP = 2,
    FORCE_MSTP = 3
```

} PROTOCOL\_VERSION\_T;

This is used to indicate the force protocol version parameter for the bridge.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>FORCE_STP_COMPAT</td><td>STP mode</td></tr><tr><td>NORMAL_RSTP</td><td>RSTP mode(Default mode)</td></tr><tr><td>FORCE_MSTP</td><td>MSTP mdoe(Not support now)</td></tr></table>

# INTF\_TYPES\_t

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

```c
typedef enum INTF_TYPES_s
{
    PHYSICAL_INTF = 3,
    LAG_INTF,
    VLAN_INTF,
    CPU_INTF,
} INTF_TYPES_t;
```

The interface type.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>PHYSICAL_INTF</td><td>Physical type interface</td></tr><tr><td>LAG INTF</td><td>Lag type interface</td></tr><tr><td>VLAN INTF</td><td>Vlan type interface</td></tr><tr><td>CPU INTF</td><td>CPU type interface</td></tr></table>

# 2.11.3 Data Structure

# BRIDGE\_ID

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

```c
typedef struct bridge_id_def
{
    unsigned short    prio;
    unsigned char    addr[6];
} BRIDGE_ID;
```

Define the bridge id info.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>prio</td><td>Birdge priority</td></tr><tr><td>addr</td><td>MAC address for the bridge.</td></tr></table>

# TIMEVALUES\_T

# Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

```c
typedef struct timevalues_t
{
    unsigned short MessageAge;
    unsigned short MaxAge;
    unsigned short ForwardDelay;
    unsigned short HelloTime;
    char Remaining_Hops;
} TIMEVALUES_T;
```

Define the spanning tree time values.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>MessageAge</td><td>Birdge priority</td></tr><tr><td>MaxAge</td><td>MAC address for the bridge.</td></tr><tr><td>ForwardDelay</td><td>Forward delay time</td></tr><tr><td>HelloTime</td><td>Hello time</td></tr><tr><td>Remaining_Hops</td><td>Not used</td></tr></table>

# PRIO\_VECTOR\_T

# Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

```c
typedef struct prio_vector_t
{
BRIDGE_ID root_bridge;
unsigned long root_path_cost;
BRIDGE_ID region_root_bridge;
unsigned long region_root_path_cost;
BRIDGE_ID design_bridge;
PORT_ID design_port;
PORT_ID bridge_port;
} PRIO_VECTOR_T;
```

The port priority vector is the spanning tree priority vector held for the port when the reception of BPDUs and any pending update of information have been completed.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>root_bridge</td><td>Root Bridge Identifier, the Bridge Identifier of the Bridge believed to be the Root by the transmitter</td></tr><tr><td>root_path_cost</td><td>Root Path Cost, to that Root Bridge from the transmitting Bridge</td></tr><tr><td>region_root_bridge</td><td>Not used</td></tr><tr><td>region_root_path_cost</td><td>Not used</td></tr><tr><td>design_bridge</td><td>Bridge Identifier, of the transmitting Bridge</td></tr><tr><td>design_port</td><td>Port Identifier, of the Port through which the message was transmitted</td></tr><tr><td>bridge_port</td><td>Port Identifier, of the Port through which the message was received (where relevant)</td></tr></table>

# usp

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

typedef struct usp\_s

{

UINT32 unit;

UINT32 port;

} usp;

unit and port info structure.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>unit</td><td>Switch unit</td></tr><tr><td>port</td><td>For MXN-3610/MXN-4100, this is the port id. For other blades, the port id is a logical index for the port. For Fabric unit, port = port id – MIN_FABRIC_PORT_ID; For Base unit, port= port id – MIN_BASE_PORT_ID. (This make port value start from 0)</td></tr></table>

# usl

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

typedef struct usl\_s

{

UINT32 unit;

UINT32 lag\_id;

} usl;

Unit and lag id info structure.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>unit</td><td>Switch unit</td></tr><tr><td>lag_id</td><td>Trunk id.</td></tr></table>

# intf\_info\_t

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

```c
typedef struct intf_info_s
{
    INTF_TYPES_t intf_type;
    union
    {
    usl usl_info;
    usp usp_info;
    } port_info;
} intf_info_t;
```

Interface info structure.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>Intf_type</td><td>Switch unit</td></tr><tr><td>port_info</td><td>Physical port info or lag interface info</td></tr></table>

# adlink\_rstp\_port\_info\_t

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

```c
typedef struct adlink_rstp_port_info
{
    UINT16 port_index;
    intf_info_t intf_info;
    char port_name[STP_PORT_NAME_MAX_LEN + 1];
    PORT_ID port_id;
    INFO_IS_T infols;
    RCVD_MSG_T rcvdMsg;
    PORT_ROLE_T role;
    PORT_ROLE_T selectedRole;
    ADMIN_P2P_T adminPointToPointMac;
    PRIO_VECTOR_T designPrio;
    TIMEVALUES_T designTimes;
```

```c
PRIO_VECTOR_T portPrio;
TIMEVALUES_T portTimes;
RCVD_MSG_T rcvdInfo ;
unsigned long adminPCost;
unsigned long operPCost;
unsigned long operSpeed;
unsigned long usedSpeed;
int LinkDelay;
unsigned long rx_cfg_bpdu_cnt;
unsigned long rx_rstp_bpdu_cnt;
unsigned long rx_tcn_bpdu_cnt;
unsigned long uptime;
unsigned long forwarding_uptime;
```

```txt
} adlink_rstp_port_info_t;
```

Define the port RSTP related info.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>port_index</td><td>Port id</td></tr><tr><td>Intf_info</td><td>Port or lag info (include unit info)</td></tr><tr><td>port_name</td><td>Port's name</td></tr><tr><td>port_id</td><td>The port identifier. It forms with port priority and port id. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>infols</td><td>A variable that takes the values Mine, Aged, Received, or Disabled, to indicate the origin/state of the Port's Spanning Tree information (portInfo) held for the Port. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>rcvdMsg</td><td>An internal bool value used for communicate with state machines. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>role</td><td>The Rapid Spanning Tree Algorithm assigns one of the following Port Roles to each Bridge Port: Root Port, Designated Port, Alternate Port, Backup Port, or Disabled Port. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>selectedRole</td><td>The newly computed role for the port. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>adminPointToPointMac</td><td>P2P mode, TRUE/FALSE/AUTO</td></tr><tr><td>admin_non_stp</td><td>0 --- STP port 1 -- Non-STP port</td></tr><tr><td>adminEnable</td><td>Port link up or not</td></tr><tr><td>portEnabled</td><td>A boolean. Set if the Bridge's MAC Relay Entity and Spanning Tree Protocol Entity can use theMAC Service provided by the Port's MAC entity to transmit and receive frames to and from the attached LAN, i.e., portEnabled is TRUE if and only if:a) MAC_Operational is TRUE; andb) Administrative Bridge Port State for the Port is Enabled; andc) AuthControlledPortStatus is Authorized [if the port is a network access port (IEEE Std 802.1X)].See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>adminEdge</td><td>Present in implementations that support the identification of edge ports.See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>operEdge</td><td>A boolean. The value of the operEdgePort parameter, as determined by the operation of the Bridge Detection state machine.See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>agree</td><td>Set if syncedis set for all other Ports. An RST BPDU with the Agreement flag set is transmitted and proposedis reset when agreeis first set, and when proposed is set. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>agreed</td><td>Set when an RST BPDU is received with a Port Role of Root, Alternate, or Backup Port, the Agreement flag set, and a message priority the same or worse than the port priority.When agreedis set, the Designated Port knows that its neighbouring Bridge has confirmed that it can proceed to the Forwarding state without further delay. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>forward</td><td>State machine forward state. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>forwarding</td><td>Port forwarding state. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>initPm</td><td>Internal used</td></tr><tr><td>learn</td><td>State machine learn state. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>learning</td><td>State machine learing state. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>mcheck</td><td>May be set by management to force the Port Protocol Migration state machine to transmit RST BPDUs for a MigrateTime period, to test whether all STP Bridges on the attached LAN have been removed and the Port can continue to transmit RSTP BPDUs. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>newInfo</td><td>Set if a BPDU is to be transmitted. Reset by the Port Transmit state machine. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>proposed</td><td>Set when an RST BPDU with a Designated Port role and the Proposal flag set is received. If agreeis not set, proposedcauses syncto be set for all other Ports.of the Bridge. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>proposing</td><td>Set by a Designated Port that is not Forwarding, and conveyed to the Root Port or Alternate Port of a neighboring Bridge in the Proposal flag of an RST BPDU.See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>rcvdBpdu</td><td>Set by system dependent processes, this variable notifies the Port Receive state machine When a valid Configuration, TCN, or RST BPDU is received on the Port. Reset by the Port Receive state machine. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>rcvdRSTP</td><td>RSTP BPDU received. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>rcvdSTP</td><td>STP BPDU received. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>rcvdTc</td><td>Received Topology change. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>rcvdTcAck</td><td>Received Topology change Ack. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>rcvdTcn</td><td>Received TCN. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>reRoot</td><td>Root port role state machine reRoot state. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>reselect</td><td>Port role selection state machine at reselect state. See the IEEE802.1D RSTP part for moredetails.</td></tr><tr><td>selected</td><td>Port role selection state machine at selected state. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>sendRSTP</td><td>Port Protocol Migration state machine's sendRSTP state. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>sync</td><td>If set the Port transitions to Discarding, unless it is an Edge Port or syncedis set.</td></tr><tr><td>synced</td><td>Set when the Port is Discarding or agreedis set.</td></tr><tr><td>tc</td><td>Port Timers state machine 's tick parameter</td></tr><tr><td>tcAck</td><td>Set if a Configuration Message with a topology change acknowledge flag set is to be transmitted</td></tr><tr><td>tcProp</td><td>A boolean. Set by the Topology Change state machine of any other Port, to indicate that a topology change should be propagated through this Port.</td></tr><tr><td>updtInfo</td><td>A boolean. Set by the Port Role Selection state machine to tell the Port Information state machine that it should copy designated Priority to port Priority and designatedTimes to portTimes.</td></tr><tr><td>wasInitBpdu</td><td>Port received BPDU packets.</td></tr><tr><td>p2p_recompute</td><td>P2P enter recomputed state</td></tr><tr><td>operPointToPointMac</td><td>P2P state</td></tr><tr><td>designPrio</td><td>The first four components of the Port's designated priority vector value. The fifth component of the designated priority vector value is portId. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>designTimes</td><td>The designatedTimes variable comprises the set of timer parameter values (Message Age, Max Age, Forward Delay, and Hello Time) that used to update Port Times when updtInfo is set. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>portPrio</td><td>The first four components of the Port's port priority vector value.</td></tr><tr><td>portTimes</td><td>The portTimes variable comprises the Port's timer parameter values (Message Age, Max Age, Forward Delay, and Hello Time). Thesetimer values are used in BPDUs transmitted from the Port.</td></tr><tr><td>rcvdInfo</td><td>Set to the result of the rcvInfo() procedure. See the IEEE802.1D RSTP part for more details.</td></tr><tr><td>adminPCost</td><td>The method to set port path cost. AUTO or FORCE.</td></tr><tr><td>operPCost</td><td>Port's operate path cost.</td></tr><tr><td>operSpeed</td><td>Port's operate speed.</td></tr><tr><td>usedSpeed</td><td>Port's speed.</td></tr><tr><td>LinkDelay</td><td>A link delay timer for port.</td></tr><tr><td>rx_cfg_bpdu_cnt</td><td>Received config BPDU number</td></tr><tr><td>rx_rstp_bpdu_cnt</td><td>Received rstp BPDU number</td></tr><tr><td>rx_tcn_bpdu_cnt</td><td>Received tcn bpdu number</td></tr><tr><td>uptime</td><td>Feature enabled time</td></tr><tr><td>forwarding_uptime</td><td>Forwarding up time</td></tr></table>

# adlink\_rstp\_br\_port\_t

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

```c
typedef struct adlink_rstp_br_port_s
{
    int br_port_id;
    intf_info_t port_info;
} adlink_rstp_br_port_t;
```

Define the RSTP bridge port info

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>br_port_id</td><td>The port id that related to the bridge. This is automatically assigned when port add to bridge.</td></tr><tr><td>port_info</td><td>Port or lag info (include type and unit info)</td></tr></table>

# adlink\_rstp\_br\_unit\_port\_t

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

```txt
typedef struct adlink_rstp_br_unit_port_s
{
    int unit;
}
```

int br\_port\_id; } adlink\_rstp\_br\_unit\_port\_t;

Define the RSTP unit and bridge port id info.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>unit</td><td>Switch unit</td></tr><tr><td>br_port_id</td><td>The port id that related to the bridge. This is automatically assigned when port add to bridge</td></tr></table>

# adlink\_rstp\_br\_info\_t

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

```c
typedef struct adlink_rstp_br_info_t
{
    UID_STP_MODE_T admin_state; //STP bridge admin state
    PROTOCOL_VERSION_T ForceVersion; //Force Version
    BRIDGE_ID BrId; //Bridge id
    TIMEVALUES_T BrTimes; //Bridge timers
    PORT_ID rootPortId; //Root port id
    PRIO_VECTOR_T rootPrio; //Root priority
    TIMEVALUES_T rootTimes; //Root times
    unsigned long timeSince_Topo_Change; //time since topology change
    unsigned long Topo_Change_Count; //time change count
    unsigned char Topo_Change; //topo change flag
    int port_nums; //Port numbers belongs to bridge
    adlink_rstp_br_port_t port_info[32]; //Port info
} adlink_rstp_br_info_t;
```

Define RSTP bridge info.

<table><tr><td>Fields</td><td>Description</td></tr><tr><td>admin_state</td><td>STP bridge admin state</td></tr><tr><td>ForceVersion</td><td>Feature work mode, STP or RSTP, not support MSTP</td></tr><tr><td>BrId</td><td>Bridge id</td></tr><tr><td>BrTimes</td><td>Bridge timers</td></tr><tr><td>rootPortId</td><td>Root port id</td></tr><tr><td>rootPrio</td><td>Root priority</td></tr><tr><td>rootTimes</td><td>Root timer values</td></tr><tr><td>timeSince_Topo_Change</td><td>Time since topology change</td></tr><tr><td>Topo_Change_Count</td><td>Topology change count</td></tr><tr><td>Topo_Change</td><td>Topology change</td></tr><tr><td>port_nums</td><td>Number of ports</td></tr><tr><td>port_info</td><td>Port info</td></tr></table>

# 2.11.4 Functions

adlink\_stp\_br\_status\_set ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_stp\_br\_status\_set(CLIENT\* clnt, UINT32 unit, UINT32 br\_config\_status);

# Description

This function is used to enable/disable the RSTP feature. After this feature eabled, all of the port will be added to the spanning-tree in default.

# Parameters

clnt [IN] RPC client that the init function returned.

unit [IN] switch unit

br\_config\_status [IN] bridge config status, ENABLE or DISABLE

# Return

status\_t.

adlink\_stp\_br\_force\_version\_set ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_stp\_br\_force\_version\_set(CLIENT\* clnt, UINT32 unit, UINT32

br\_force\_version);

# Description

This function is used to set the force version of the bridge.

# Parameters

clnt [IN] RPC client that the init function returned.

unit [IN] switch unit

br\_force\_version [IN] FORCE\_STP\_COMPAT or NORMAL\_RSTP

# Return

status\_t.

# adlink\_stp\_br\_priority\_set ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_stp\_br\_priority\_set(CLIENT\* clnt, UINT32 unit, UINT32 br\_priority);

# Description

This function is used to set RSTP bridge priority;

# Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN]switch unit</td></tr><tr><td>br_priority</td><td>[IN] bridge priority</td></tr></table>

# Return

status\_t.

# adlink\_stp\_br\_hello\_time\_set ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_stp\_br\_hello\_time\_set (CLIENT\* clnt, UINT32 unit, UINT32 br\_hello\_time);

# Description

This function is used to set bridge hello time.

# Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN] switch unit</td></tr><tr><td>br_hello_time</td><td>[IN] bridge hello time</td></tr></table>

# Return

status\_t.

# adlink\_stp\_br\_max\_age\_set ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_stp\_br\_max\_age\_set (CLIENT\* clnt, UINT32 unit, UINT32 br\_max\_age);

# Description

This function is used to set maximum age timer.

# Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN] switch unit</td></tr><tr><td>br_max_age</td><td>[IN]bridge max age time</td></tr></table>

# Return

status\_t.

# adlink\_stp\_br\_forward\_delay\_set ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_stp\_br\_forward\_delay\_set (CLIENT\* clnt, UINT32 unit, UINT32 br\_fwd\_delay);

# Description

This function is used to set forward delay timer.

# Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN] Switch unit</td></tr><tr><td>br_fwd_delay</td><td>[IN] forward delay timer</td></tr></table>

# Return

status\_t.

# adlink\_stp\_port\_path\_cost\_set ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_stp\_port\_path\_cost\_set (CLIENT\* clnt, UINT32 unit, UINT32 port\_id, UINT32 path\_cost);

# Description

This function is used to set port path cost.

# Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN] unit</td></tr><tr><td>port_id</td><td>[IN] port id</td></tr><tr><td>path_cost</td><td>[IN] path cost</td></tr></table>

# Return

status\_t.

# adlink\_stp\_port\_priority\_set ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_stp\_port\_priority\_set (CLIENT\* clnt, UINT32 unit, UINT32 port\_id, UINT32 priority);

# Description

This function is used to set port priority.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN] switch unit</td></tr><tr><td>port id</td><td>[IN] port id</td></tr><tr><td>priority</td><td>[IN]Port priority</td></tr></table>

# Return

status\_t

# adlink\_stp\_port\_status\_set ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_stp\_port\_status\_set(CLIENT\* clnt, UINT32 unit, UINT32 pbmp, UINT32 port\_stp\_status);

# Description

The function is used to set the port’s STP status.

# Parameters

clnt [IN] RPC client that the init function returned.

unit [IN] switch unit

pbmp [IN] input port bitmap

port\_stp\_status [IN] enable:2 disable:1

# Return

status\_t.

# adlink\_stp\_port\_p2p\_set()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_stp\_port\_p2p\_set(CLIENT\* clnt, UINT32 unit, UINT32 port\_id, UINT32

port\_p2p\_status)

# Description

This function is used to set the port’s p2p mode.

# Parameters

clnt [IN] RPC client that the init function returned.

unit [IN] switch unit

port id [IN] port id

port\_p2p\_status [IN] port P2P status 1:yes 2:no 3:auto

# Return

status\_t.

# adlink\_stp\_port\_edge\_set ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_stp\_port\_edge\_set (CLIENT\* clnt, UINT32 unit, UINT32 port\_id, UINT32 port\_edge\_status);

# Description

The function is used to set port edge status.

# Parameters

clnt [IN] RPC client that the init function returned.

unit [IN] switch unit

port id [IN] port id

port\_edge\_status [IN]yes:1 no:0.

# Return

status\_t.

# adlink\_stp\_port\_mcheck\_set ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_stp\_port\_mcheck\_set (CLIENT\* clnt, UINT32 unit, UINT32 port\_id)

# Description

The function is used to set port mcheck.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN] switch unit</td></tr><tr><td>port id</td><td>[IN] port id</td></tr></table>

# Return

status\_t

# adlink\_stp\_info\_get ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_stp\_info\_get(CLIENT\* clnt, UINT32 unit, adlink\_rstp\_br\_info\_t \*rstp\_br\_info);

# Description

The function is used to set port mcheck.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN] switch unit</td></tr><tr><td>rstp_br_info</td><td>[OUT] RSTP bridge info</td></tr></table>

# Return

status\_t.

# adlink\_stp\_br\_port\_info\_get ()

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-N700</td><td>aTCA-3430</td><td>MXN-3610/MXN-4100</td><td>cPCI-6S10</td><td>MXN-0410</td></tr></table>

# Prototype

status\_t adlink\_stp\_br\_port\_info\_get (CLIENT\*clnt, int unit, int br\_port\_id,

adlink\_rstp\_port\_info\_t \*rstp\_port\_info);

# Description

The function is used to set port mcheck.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN] switch unit</td></tr><tr><td>int</td><td>[IN]bridge port id</td></tr><tr><td>rstp_br_info</td><td>[OUT] RSTP port info</td></tr></table>

# Return

status\_t.

This section describes the macro, enum, struct and functions for Rapid Spanning Tree Protocol

(RSTP). They are defined in the header file “adlink\_api\_stp\_rstp.h”.

# 2.12 LLDP

This section describes the macro,enum,data structure functions for Link Layer Discovery Protocol.They are defined in the head file “adlink\_api\_lldp.h”

# 2.12.1 Macro Definitions

# LLDP\_VIA\_LEN

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

The max length of the via string of neighbor infomation

# LLDP\_CHISSIS\_SUBTYPE\_LEN

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

The max length of the string used to identify the chassis type

# LLDP\_IFNAME\_LEN

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

The max length of the name string of interfaces

# LLDP\_AGE\_LEN

Support on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

The max length of the age string of neighbor infomation

# LLDP\_SYSNAME\_LEN

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

The max length of system name string

# LLDP\_MGMTIP\_LEN

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

The max length of the management IP address string

# LLDP\_MAC\_ID\_LEN

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

The max length of the ID string identified with MAC address

# LLDP\_CHASSISDESC\_LEN

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

The max length of the string describing the system chassis

# LLDP\_SYSDESC\_LEN

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

The max length of the string used to identify the system description

# 2.12.2 Enum Type

# OPERATION\_TYPE\_t

Prototype
```txt
typedef enum OPERATION_TYPE
{
    DEFAULT_NUM = 0,
    LLDP_PAUSE,
    LLDP_RESUME,
    LLDP_UPDATE,
    LLDP_TX_INTERVAL,
    LLDP_TX_HOLD,
}OPERATION_TYPE_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To enumerate operation types of lldp cli commands.

# 2.12.3 Data Structure

# adlink\_lldp\_neighbor\_t

# Prototype

```objectivec
typedef struct adlink_lldp_neighbor_s{
    char itfacename[LLDP_IFNAME_LEN];
    char via[LLDP_VIA_LEN];
    UINT16 rid;
    char age[LLDP_AGE_LEN];
    char chassisidsubtype[LLDP_CHISSIS_SUBTYPE_LEN];
    char chassisid[LLDP_MAC_ID_LEN];
    char chassisdesc[LLDP_CHASSISDESC_LEN];
    char sysname[LLDP_SYSNAME_LEN];
    char mgmtip[LLDP_MGMTIP_LEN];
    UINT8 portsubtype;
    char portsubid[LLDP_MAC_ID_LEN];
    char portdesc[LLDP_PORTDESC_LEN];
}adlink_lldp_neighbor_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Structure used to transmit neighbor information by cli command “show neighbor”

# adlink\_lldp\_configure\_t

# Prototype

```txt
typedef struct adlink_lldp_configure_s{
    UINT32 lldpMessageTxInterval;
    UINT32 lldpMessageTxHoldMultiplier;
    UINT32 lldpReinitDelay;
    UINT32 lldpTxDelay;
    UINT32 lldpNotificationInterval;
}adlink_lldp_configure_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Structure for lldp base configuration information.

# adlink\_lldp\_stats\_rem\_table\_t

# Prototype

```objectivec
typedef struct adlink_lldp_stats_rem_table_s{
    UINT32 lldpStatsRemTablesLastChangeTime;
    UINT32 lldpStatsRemTablesDeletes;
    UINT32 lldpStatsRemTablesDrops;
    UINT32 lldpStatsRemTablesAgeout;
}adlink_lldp_stats_rem_table_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Structure for lldp statistics of remote tables.

# adlink\_lldp\_local\_system\_t

# Prototype

```objectivec
typedef struct adlink_lldp_local_system_s{
    UINT32 lldpLocChassisIdSubtype;
    UINT8 lldpLocChassisId[MAC_SIZE];
    char lldpLocSysName[48];
    char lldpLocSysDesc[LLDP_SYSDESC_LEN];
    UINT8 lldpLocSysCapSupported;
    UINT8 lldpLocSysCapEnabled;
}adlink_lldp_local_system_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Structure for lldp local system data.

# adlink\_lldp\_stats\_tx\_port\_t

# Prototype

```c
typedef struct adlink_1ldp_stats_tx_port_s {
    UINT32 1ldpStatsTxPortNum;
    char lldpStatsTxPortName[MAX_PORT_NUM][IFNAMSIZ];
```

UINT32 lldpStatsTxPortFramesTotal[MAX\_PORT\_NUM]; }adlink\_lldp\_stats\_tx\_port\_t;

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Structure for lldp tx port stats.

# stats\_rx\_port\_content\_t;

# Prototype

```txt
typedef struct stats_rx_port_content {
    UINT32 lldpStatsRxPortFramesDiscardedTotal;
    UINT32 lldpStatsRxPortFramesErrors;
    UINT32 lldpStatsRxPortFramesTotal;
    UINT32 lldpStatsRxPortTLVsDiscardedTotal;
    UINT32 lldpStatsRxPortTLVsUnrecognizedTotal;
    UINT32 lldpStatsRxPortAgeoutsTotal;
}stats_rx_port_content_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Structure for one lldp rx port stats.

# adlink\_lldp\_stats\_rx\_port\_t

# Prototype

```c
typedef struct adlink_lldp_stats_rx_port_s {
    UINT32 lldpStatsRxPortNum;
    stats_rx_port_content_t stats_rx_port_content_st[MAX_PORT_NUM];
}adlink_lldp_stats_rx_port_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Structure forall lldp rx port stats.

# adlink\_lldp\_local\_port\_t

# Prototype

```sql
typedef struct adlink_lldp_local_port_s {
UINT16 lldpLocPortIdSubtype;
```

```c
UINT8 lldpLocPortId[MAC_SIZE];
char lldpLocPortDesc[LLDP_PORTDESC_LEN];
}adlink_lldp_local_port_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Structure about local ports component.

# adlink\_lldp\_rem\_port\_t

# Prototype

```c
typedef struct adlink_lldp_rem_port_s {
    UINT16 lldpRemChassisIdSubtype;
    UINT16 lldpRemPortIdSubtype;
    UINT8 lldpRemChassisId[MAC_SIZE];
    UINT8 lldpRemPortId[MAC_SIZE];
    char lldpRemPortDesc[LLDP_PORTDESC_LEN];
    char lldpRemSysName[48];
    char lldpRemSysDesc[LLDP_SYSDESC_LEN];
    UINT8 lldpRemSysCapSupported;
    UINT8 lldpRemSysCapEnabled;
}adlink_lldp_rem_port_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Suructure about information of a remote port component.

# adlink\_lldp\_rem\_man\_addr\_t

# Prototype

```c
typedef struct adlink_lldp_rem_man_addr_s{
    UINT16 lldpRemManAddrSubtype;
    UINT16 lldpRemManAddrIfId;
    UINT32 lldpRemManAddrOID;
}adlink_lldp_rem_man_addr_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Structure for management address information about a chassis component.

# operation\_set\_t

# Prototype

```c
typedef struct operation_set
{
    OPERATION_TYPE_t type;
    UINT32 val;
}operation_set_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Structure for lldp set operation by cli command.

# 2.12.4 Functions

# adlink\_lldp\_neibor\_info\_get\_by\_port\_id()

# Prototype

status\_t adlink\_lldp\_neighbor\_info\_get\_by\_port\_id(CLIENT\* clnt,UINT32 unit,UINT32 port, adlink\_lldp\_neighbor\_t \*info);

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Function used to get neighbor infomation by port id.

# Parameters

```txt
clnt [IN] RPC client that the init function returned.
unit [IN] switch unit
port [IN] logic port id
info [IN] lldp neighbor info
```

# Return

status\_t

# adlink\_lldp\_configuration\_get()

# Prototype

status\_t adlink\_lldp\_configuration\_get(CLIENT\* clnt,UINT32 unit,adlink\_lldp\_configure\_t \*info);

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Function used to get lldp base configuration info.

# Parameters

clnt [IN] RPC client that the init function returne.

unit [IN] switch unit

info [IN] lldp base configration info

# Return

status\_t

# adlink\_lldp\_stats\_rem\_tables\_get()

# Prototype

status\_t adlink\_lldp\_stats\_rem\_tables\_get(CLIENT\* clnt,UINT32 unit,

adlink\_lldp\_stats\_rem\_table\_t \*info);

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Function used to get lldp statistics info about remote tables

# Parameters

clnt [IN] RPC client that the init function returned

unit [IN] switch unit

info [IN] lldp statistics info about remote table

# Return

status\_t

# adlink\_lldp\_local\_system\_get()

# Prototype

status\_t adlink\_lldp\_local\_system\_get(CLIENT\* clnt,UINT32 unit,adlink\_lldp\_local\_system\_t

\*info);

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Function used to get local system info

# Parameters

clnt [IN] RPC client that the init function returned unit [IN] switch unit info [IN] lldp local system info

# Return

status\_t

# adlink\_lldp\_stats\_tx\_port\_get()

# Prototype

status\_t adlink\_lldp\_stats\_tx\_port\_get(CLIENT\* clnt,UINT32 unit,adlink\_lldp\_stats\_tx\_port\_t \*info);

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Function used to get lldp tx port statistics

# Parameters

clnt [IN] RPC client that the init function returned unit [IN] switch unit info [IN] lldp statistics info about tx ports

# Return

status\_t

# adlink\_lldp\_stats\_rx\_port\_get()

# Prototype

status\_t adlink\_lldp\_stats\_rx\_port\_get(CLIENT\* clnt,UINT32 unit,adlink\_lldp\_stats\_rx\_port\_t \*info);

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Function used to get lldp rx port statistics

# Parameters

clnt [IN] RPC client that the init function returned unit [IN] switch unit info [IN] lldp statistics info about rx ports

Return status\_t

# status\_t adlink\_lldp\_local\_port\_get()

# Prototype

status\_t adlink\_lldp\_local\_port\_get(CLIENT\* clnt,UINT32 unit,UINT32 port, adlink\_lldp\_local\_port\_t \*info);

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Function used to get lldp local port table info

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned</td></tr><tr><td>unit</td><td>[IN] switch unit</td></tr><tr><td>port</td><td>[IN] logic port id</td></tr><tr><td>info</td><td>[IN] lldp local port table info</td></tr></table>

# Return

status\_t

# adlink\_lldp\_rem\_chassis\_port\_get()

# Prototype

status\_t adlink\_lldp\_rem\_chassis\_port\_get(CLIENT\* clnt,UINT32 unit,UINT32 port, adlink\_lldp\_rem\_port\_t \*info);

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

Function used to get lldp remote ports and chassis info

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned</td></tr><tr><td>unit</td><td>[IN] switch unit</td></tr><tr><td>port</td><td>[IN] logic port id</td></tr><tr><td>info</td><td>[IN] lldp remote ports info</td></tr></table>

# Return

status\_t

# adlink\_lldp\_rem\_man\_addr\_get()

# Prototype

status\_t adlink\_lldp\_rem\_man\_addr\_get(CLIENT\* clnt,UINT32 unit,UINT32 port, adlink\_lldp\_rem\_man\_addr\_t \*info);

# Description

Function used to get lldp management address info of a remote chassis component

# Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned</td></tr><tr><td>unit</td><td>[IN] switch unit</td></tr><tr><td>port</td><td>[IN] logic port id</td></tr><tr><td>info</td><td>[IN] lldp remote management info</td></tr></table>

# Return

status\_t

# adlink\_lldp\_operation\_set()

# Prototype

status\_t adlink\_lldp\_operation\_set(CLIENT\* clnt,operation\_set\_t operation,int \*result);

# Description

Function used to do the lldp set operation

# Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned</td></tr><tr><td>operation</td><td>[IN]Operation type and value</td></tr><tr><td>result</td><td>[IN] To store the operation excu result</td></tr></table>

# Return

status\_t

# 2.13 VRRP

This section describes the macro,enum,data structure functions for Link Layer Discovery Protocol.They are defined in the head file “adlink\_api\_vrrp.h”

# 2.13.1 Macro Definitions

# MIN\_VRID

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

The minimum virtual router ID.

# MAX\_VRID

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

The max virtual router ID.

# VRRP\_MAX\_IP\_NUM

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

The max virtual ip address number one virtual router can been added to.

# 2.13.2 EnumType

# vrrp\_setType

# Prototype

typedef enum {

PRI\_SET,

PREEMPTION\_SET,

AUTHMODE\_SET,

}vrrp\_setType;

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To enumerate vrrp setting operation type.

# vrrp\_state\_enum

# Prototype

```c
typedef enum {
    VRRP_MASTER = 1,
    VRRP_BACKUP = 2,
} vrrp_state_enum
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To enumerate virtual router state.

# 2.13.3 Data Structure

# vrrp\_setOpt\_u

# Prototype

```c
typedef union {
    int vrid;
    vrrp_state_enum state;
    int priority;
    BOOL preemption;
    UINT32 ipaddr;
    int auth_mode;
    char macaddr[ETHER_ADDR_LENGTH];
}vrrp_setOpt_u
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

The union for setting operation to transfer the value.

# vrrp\_vRoute\_info\_t

# Prototype

```txt
typedef struct {
    int vlanid;
    int vrid;
    int priority;
```

```txt
int naddr;
int adver_int;
int state;
UINT32 ipaddr[VRRP_MAX_IP_NUM];
BOOL preempt;
char vmac[ETHER_ADDR_LENGTH];
int result; //0-success;-1 no vrid
} vrrp_vRoute_info_t
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To transfer the virtual router information.

# 2.13.4 Functions

# adlink\_vrrp\_vRoute\_add()

# Prototype

status\_t adlink\_vrrp\_vRoute\_add(CLIENT\* clnt, int unit, int vlanid, int vrid,UINT32 vip)

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To add a new virtual router on a vlan-interface.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN] Fabric or Base chip unit.</td></tr><tr><td>vlanid</td><td>[IN]VLAN id.</td></tr><tr><td>vrid</td><td>[IN]virtual router id set by user.</td></tr><tr><td>vip</td><td>[IN]virtual ip address.</td></tr></table>

# Return

status\_t

# adlink\_vrrp\_vRoute\_rmv()

# Prototype

status\_t adlink\_vrrp\_vRoute\_rmv(CLIENT\* clnt, int unit, int vrid)

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To remove a virtual router on a vlan-interface.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN] Fabric or Base chip unit.</td></tr><tr><td>vrid</td><td>[IN] virtual router id set by user.</td></tr></table>

# Return

status\_t

# adlink\_vrrp\_config\_set()

# Prototype

status\_t adlink\_vrrp\_config\_set(CLIENT\* clnt, int unit, int vrid, vrrp\_setType opt\_type, vrrp\_setOpt\_u opt\_value)

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To do vrrp attribute setting.

Parameters

<table><tr><td>clnt</td><td>[IN] RPC client that the init function returned.</td></tr><tr><td>unit</td><td>[IN] Fabric or Base chip unit.</td></tr><tr><td>vrid</td><td>[IN] virtual router id set by user.</td></tr><tr><td>opt_type</td><td>[IN]indicate a setting operation type, PRI_SET, PREEMPTION_SET,or others to expand</td></tr><tr><td>opt_value</td><td>[IN]a value crosspond with the opt_type.</td></tr></table>

# Return

status\_t

# adlink\_vrrp\_vRoute\_get()

# Prototype

status\_t adlink\_vrrp\_vRoute\_get(CLIENT\* clnt, int unit, int vrid,vrrp\_vRoute\_info\_t \*vrt\_info)

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To get the current vrrp arttribute and state information.

# Parameters

clnt [IN] RPC client that the init function returned.

unit [IN] Fabric or Base chip unit.

vrid [IN] virtual router id set by user.

vrt\_info [IN] a pointer indicate the structure which isused to store vrrp infomation when the function return.

# Return

status\_t

# 2.14 CMM

This section describes the macro, enum, struct and functions for trunk. They are defined in the header file “adlink\_api\_cmm.h”.

# 2.14.1 Macro Definitions

# AD\_IPMI\_BUF\_LEN.

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

The max ipmi message data length.

# 2.14.2 EnumType

None.

# 2.14.3 Data Structure

# adIpmiReqT

Prototype

<table><tr><td colspan="3">typedef struct {</td></tr><tr><td>uint8_t</td><td>netFun;</td><td>/* IPMI network function */</td></tr><tr><td>uint8_t</td><td>cmd;</td><td>/* IPMI command Id */</td></tr><tr><td>uint8_t</td><td>reqData[AD_IPMI_BUF_LEN];</td><td>/* IPMI request data */</td></tr><tr><td>uint8_t</td><td>reqLen;</td><td>/* IPMI request data length */</td></tr><tr><td colspan="3">} adIpmiReqT;</td></tr></table>

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To load the ipmi request data.

# adlink\_cmm\_raw\_send\_req\_t

# Prototype

```c
typedef struct adlink_cmm_raw_send_req_st {
    char res_id_str[32]; // The name of the board, Ex: shelf, board_1, board_2....
    adlpmiReqT req; // ipmi request data
} adlink_cmm_raw_send_req_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To load the raw ipmi request message data.

# adIpmiRspT

# Prototype

```c
typedef struct {
    uint8_t netFun; /* IPMI network function */
    uint8_t cmd; /* IPMI command Id */
    uint8_t rspData[AD_IPMI_BUF_LEN]; /* IPMI response data */
    uint8_t rspLen; /* IPMI request data length */
} adIpmiRspT;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To load the ipmi response data.

# adlink\_cmm\_raw\_send\_rsp\_t

# Prototype

```txt
typedef struct adlink_cmm_raw_send_rsp_st {
    int rc; // return 0 means success;
    adlpmiRspT rsp; // ipmi response data
} adlink_cmm_raw_send_rsp_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To load the raw ipmi response message data.

# adlink\_cmm\_set\_hotswap\_state\_req\_t

# Prototype

```txt
typedef struct adlink_cmm_set_hotswap_state_req_st {
    uint8_t msg_type; // 0 - hotplug ready; 1 - hotplug request; 3 - hotplug success; 4 - hotplug failed
    uint8_t cpu_node; // CPU node ID
} adlink_cmm_set_hotswap_state_req_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To tell CMM the hotplug state of CPU node.

# adlink\_cmm\_get\_hotswap\_state\_rsp\_t

# Prototype

```c
typedef struct adlink_cmm_get_hotswap_state_rsp_st {
    int rc; // return 0 – means success
    uint8_t msg_type; // 0 – hotplug ready; 1 – hotplug request; 3 – hotplug success; 4 – hotplug failed
} adlink_cmm_get_hotswap_state_rsp_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To let CPU node read hotplug event detected by CMM.

# adlink\_cmm\_reset\_payload\_req\_t

# Prototype

```c
typedef struct adlink_cmm_get_hotswap_state_rsp_st {
    char res_id_str[32]; // The name of the board, Ex: shelf, board_1, board_2....
    uint8_t reset_type; // reset type: 0 - power down; 1 - power up; 2 - powercycle; 3 - hard reset; 5 - soft shutdown;
} adlink_cmm_get_hotswap_state_rsp_t;
```

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To reset CPU node & COMe of switch.

# adlink\_cmd\_syserror\_rsp\_st

# Prototype

typedef struct adlink\_cmd\_syserror\_rsp\_st{

int rc; // return 0 – means success;

} adlink\_cmmd\_syserror\_rsp\_t;

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To general error return struct for CMM APIs.

# adlink\_cmm\_get\_payload\_slot\_rsp\_t

# Prototype

typedef struct adlink\_cmm\_get\_payload\_slot\_rsp\_st{

int rc; // 0 means success;

uint8\_t slot\_count; // the number of slots of this chassis

uint16\_t use\_mask; // A bit mask to tell whether a slot is used. A bit is set to 1 if the corresponding slot is used. else

wise it is cleared to 0

} adlink\_cmm\_get\_payload\_slot\_rsp\_t;

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To tell how much CPU nodes are inserted, and tell in which slot the CPU board plug.

# adlink\_cmm\_get\_switch\_number\_rsp\_t

# Prototype

typedef struct adlink\_cmm\_get\_switch\_number\_rsp\_st{

int rc; // 0 means success;

uint8\_t sw\_num; // number of switch boards that plugin;

} adlink\_cmm\_get\_switch\_number\_rsp\_t;

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To tell one or two switch board plugged in the Chassis.

# adlink\_cmm\_get\_switch\_cmm\_state\_rsp\_t

# Prototype

typedef struct adlink\_cmm\_get\_switch\_cmm\_state\_rsp\_st{

int rc; // 0 means success;

uint8\_t slot\_id; // switch slot id: 0 or 1;

uint8\_t state; // 0 - CMM is backup, 1 - CMM is main;

} adlink\_cmm\_get\_switch\_cmm\_state\_rsp\_t;

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To tell current switch board slot id and its state.

# adlink\_cmm\_get\_id\_rsp\_t

# Prototype

typedef struct adlink\_cmm\_get\_id\_rsp\_st {

int rc; // 0 means success;

uint16\_t buf\_len; // chassis ID length of byte;

uint8\_t buff[255]; // point of buf that stores the chassis ID string;

} adlink\_cmm\_get\_chassis\_id\_rsp\_t;

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To read the chassis ID information.

# 2.14.4 Functions

# adlink\_sys\_chassis\_raw\_send ()

# Prototype

sadSysErrorT adlink\_sys\_chassis\_raw\_send(CLIENT\* clnt, adlink\_cmm\_raw\_send\_req\_t\* req\_data, adlink\_cmm\_raw\_send\_rsp\_t\* rsp\_data)

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To send raw ipmi command to CMM or CPU board.

# Parameters

clnt [IN] RPC client that the init function returned.

req\_data [IN] ipmi raw request data.

rsp\_data [OUT] ipmi raw response data.

# Return

sadSysErrorT

# adlink\_sys\_chassis\_set\_rrc\_hotswap\_state ()

# Prototype

adSysErrorT adlink\_sys\_chassis\_set\_rrc\_hotswap\_state(CLIENT\* clnt,

adlink\_cmm\_set\_hotplug\_state\_req\_t\* req\_data)

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To tell CMM the hotplug state of CPU board.

# Parameters

clnt [IN] RPC client that the init function returned.

req\_data [IN] ipmi set hotplug request data.

# Return

sadSysErrorT

# adlink\_sys\_chassis\_get\_rrc\_hotswap\_state ()

# Prototype

adSysErrorT adlink\_sys\_chassis\_set\_rrc\_hotswap\_state(CLIENT\* clnt,

adlink\_cmm\_get\_hotswap\_state\_rsp\_t\* pRsp)

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To get the hotplug state from CMM.

# Parameters

clnt [IN] RPC client that the init function returned.

pRsp [OUT] ipmi get hotplug response data.

# Return

sadSysErrorT

# adlink\_sys\_chassis\_reset\_payload ()

# Prototype

adSysErrorT adlink\_sys\_chassis\_reset\_payload (CLIENT\* clnt, adlink\_cmm\_reset\_payload\_req\_t\* req\_data)

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To reset CPU board & Switch COME.

# Parameters

clnt [IN] RPC client that the init function returned. req\_data [IN] ipmi reset payload request data.

# Return

sadSysErrorT

# adlink\_sys\_chassis\_get\_payload\_slot\_usemask ()

# Prototype

adSysErrorT adlink\_sys\_chassis\_get\_payload\_slot\_usemask (CLIENT\* clnt, adlink\_cmm\_get\_payload\_slot\_rsp\_t\* pRsp)

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To read information of plugged CPU board number, and slot id, etc.

# Parameters

clnt [IN] RPC client that the init function returned. pRsp [OUT] ipmi read chassis CPU board information response data.

# Return

sadSysErrorT

# adlink\_sys\_chassis\_get\_switch\_number ()

# Prototype

adSysErrorT adlink\_sys\_chassis\_get\_switch\_number (CLIENT\* clnt, adlink\_cmm\_get\_switch\_number\_rsp\_t\* pRsp)

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To read information of switch board number that plugged in chassis.

# Parameters

clnt [IN] RPC client that the init function returned.

pRsp [OUT] ipmi read chassis CPU board information response data.

# Return

sadSysErrorT

# adlink\_sys\_chassis\_get\_switch\_cmm\_state ()

# Prototype

adSysErrorT adlink\_sys\_chassis\_get\_switch\_cmm\_state (CLIENT\* clnt, adlink\_cmm\_get\_switch\_cmm\_state\_rsp\_t\* pRsp)

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To read onboard CMM state and slot id.

# Parameters

clnt [IN] RPC client that the init function returned.

pRsp [OUT] ipmi read onboard CMM state and slot id information response data.

# Return

sadSysErrorT

# adlink\_sys\_chassis\_get\_id ()

# Prototype

adSysErrorT adlink\_sys\_chassis\_get\_id (CLIENT\* clnt, adlink\_cmm\_get\_chassis\_id\_rsp\_t\* pRsp)

Supported on

<table><tr><td>aTCA-3710</td><td>aTCA-3430</td><td>aTCA-N700</td><td>cPCI-6S10</td><td>MXN-0410</td><td>MXN-3610/MXN-4100</td></tr></table>

# Description

To read information of chassis identification, such like chassis serial number, etc.

# Parameters

clnt [IN] RPC client that the init function returned.

pRsp [OUT] ipmi read chassis identification information response data.

# Return

sadSysErrorT

# Getting Service

Ask an Expert: http://askanexpert.adlinktech.com

# ADLINK Technology, Inc.

Address: 9F, No.166 Jian Yi Road, Zhonghe District

New Taipei City 235, Taiwan

新北市中和區建一路 166號 9樓

Tel: +886-2-8226-5877

Fax: +886-2-8226-5717

Email: service@adlinktech.com

# Ampro ADLINK Technology, Inc.

Address: 5215 Hellyer Avenue, #110, San Jose, CA 95138, USA

Tel: +1-408-360-0200

Toll Free: +1-800-966-5200 (USA only)

Fax: +1-408-360-0222

Email: info@adlinktech.com

# ADLINK Technology (China) Co., Ltd.

Address: 上海市浦东新区张江高科技园区芳春路 300 号 (201203)

300 Fang Chun Rd., Zhangjiang Hi-Tech Park, Pudong New Area

Shanghai, 201203 China

Tel: +86-21-5132-8988

Fax: +86-21-5132-3588

Email: market@adlinktech.com

# ADLINK Technology GmbH

Address: Hans-Thoma-Strasse 11, D-68163, Mannheim, Germany

Tel: +49-621-43214-0

Fax: +49-621 43214-30

Email: emea@adlinktech.com

Please visit the Contact page at www.adlinktech.com for information on how to contact the ADLINK regional office nearest you.
[🔗 Link to the original document](.packetmanager-manual-en-20170818-v1/packetmanager-manual-en-20170818-v1.pdf)
