Manual Revision: 1.00
Revision Date: August 28, 2013
Part Number: 50-1G026-1000
Advance Technologies; Automate the World.
Revision History
Rev Date Description
1.00 28/8/2013 Initial release
Switch Manager API Programming Guide
2
Switch Manager API Programming Guide
Preface
Copyright 2013 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 fun ction and does not represent a commitm ent on the p art 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.
Table 6- 1, Qualifier Type Description............................................................................. 34
Table 6- 2, Action Type Description................................................................................. 34
Table 6- 3, Data Descriptions For Different Qualifier Types............................................ 35
Table 6- 4, Data Descriptions for Different Action Types.................................................36
10
Switch Manager API Programming Guide
Introduction
This guide describes the how to program ADLINK Switch Management APIs on ADLINK's
switch blades, such as the aTCA-3420, aTCA-N700, and aTCA-3710. Firstly, we will introduce
the overall software architecture for programming. Secondly, we define the released
deliverables, including header file, static library, binary files, example project and readme files.
Finally, detailed API definitions and references will be provided to allow customers to easily
program their own APIs.
Architecture Overview
All the APIs listed in this document are programmed using the following hardware architecture,
shown in Figure 1. In this figure, the client is running on a standalone server. However, it also
can run on the LMP on the switch blade.
Switch Manager
API Library
runs on client
Controller
Figure 1,Hardware architecture for programming
The ADLINK Switch Manager implements the network connections between server and client
so that customers do not have to worry about the connections between them. Provided are the
client API libraries, header files and relevant documentation for easy programming.
Ethernet
Switch Manager
core service runs on
blade server with
switch chip
Blade Server
11
Switch Manager API Programming Guide
Deliverables
The ADLINK Switch Manager Library package (adSwitchLib-x.x.x.tar.gz) provides the following
software components
Include: Header files of the ADLINK Switch Manager library
Lib: Static library including the API functions listed in this document
Bin: Binary files for controlling the switch system
Example:
ReadMe: The release notes for different library revisions
Application demo to show usage of the APIs provided
Section 1: Base
This section describes the macro, enum, struct and function for fundamentals. They are defined
in the header file “adlink_api_base.h”.
Enum Type
status_t
typedef enum status
{
ADLINK_E_NONE = 0, /*no error*/
ADLINK_E_PARA = -1, /*parameter error*/
ADLINK_E_RESOURCE = -2, /*no available resource*/
ADLINK_E_EXIST = -3, /*item already exists*/
ADLINK_E_FIND = -4, /*item not found*/
ADLINK_E_SOCKET = -5, /*socket error*/
ADLINK_E_MALLOC = -6, /* mem allocation failed*/
ADLINK_E_OPEN = -7, /* open/fopen failed*/
ADLINK_E_OTHER = -8, /* Error other than above*/
//...
ADLINK_E_SERVER_BASE = -128,/*base error code for server returned*/
}status_t;
This enum describes the return codes of the APIs. They are defined in “adlink_api_base.h”.
Table 1-1 shows the meaning of each error code.
12
Switch Manager API Programming Guide
Table 1- 1, Return Code Description
Return Code Description
ADLINK_E_NONE API run successfully
ADLINK_E_PARA Parameter related error
ADLINK_E_RESOURCE Table item overflow
ADLINK_E_EXIST Table item already existing
ADLINK_E_FIND Table item non-existentent
ADLINK_E_SOCKET Error occurs when connecting to BCM server
ADLINK_E_MALLOC Error occurs when memory allocation
ADLINK_E_OPEN Error occurs when open/fopen a handle
ADLINK_E_OTHER Other error
ADLINK_E_SERVER_BASE 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.
Functions
adlink_switch_chip_init ()
PROTOTYPE
int adlink_switch_chip_init(UINT32 server_ip)
DESCRIPTION
This function is used to init the switch chip.
PARAMETERS
server_ip [IN] IP address of the server
RETURN
See the description of status_t above.
adlink_config_write ()
PROTOTYPE
int adlink_config_write()
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.
13
Loading...
+ 29 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.