Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.6.0.3
Data Structures | Macros | Typedefs | Enumerations | Functions
openapi_common.h File Reference
#include <stdint.h>
#include <arpa/inet.h>
#include <netinet/in.h>

Go to the source code of this file.

Data Structures

struct  open_buffdesc
 
struct  open_in6_addr_s
 Hash Mode names. More...
 
struct  open_inet_addr_s
 
struct  open_inet_pfx_s
 
struct  open_revision_data_t
 
struct  open_USP_t
 
struct  openapiClientHandle_s
 
struct  openapiEventList_t
 

Macros

#define OPEN_CLIENT_INSTANCE_FIRST   1
 
#define OPEN_INTF_NAME_MAX_LENGTH   60
 
#define OPEN_IP_ADDR_DISP_LENGTH   46
 
#define OPEN_IP_ADDR_LENGTH   16
 
#define OPEN_IS_ADDR_EQUAL(xaddr, yaddr)
 
#define OPEN_MAC_ADDR_LEN   6
 
#define OPEN_MIN_U64_STR_BUFFER_SIZE   21
 20 chars + terminating nul
 
#define OPEN_PACKED_STRUCT   typedef struct
 
#define OPEN_REGISTRATION_SERVICE_USERAPPS   100001 /* all user-provided applications */
 
#define OPENAPI_PROTOCOL_HEX_ARP   0x0806
 HEX code for the ARP protocol. More...
 
#define OPENAPI_PROTOCOL_HEX_IP   0x0800
 OpEN uses these defines to define hex codes of the protocols. More...
 
#define OPENAPI_PROTOCOL_HEX_IPX   0x8137
 HEX code for the IPX protocol. More...
 
#define OPENAPI_PROTOCOL_HEX_MAX   0xFFFF
 Maximim HEX code of the protocol. More...
 
#define OPENAPI_PROTOCOL_HEX_MIN   0x0600
 Minumum HEX code of the protocol. More...
 
#define OPENAPI_VER_BUFF_MAX_SIZE   128
 
#define OPENAPI_VER_BUFF_MAX_SIZE   128
 

Typedefs

typedef struct open_in6_addr_s open_in6_addr_t
 Hash Mode names.
 
typedef struct open_inet_addr_s open_inet_addr_t
 
typedef struct open_inet_pfx_s open_inet_pfx_t
 
typedef struct openapiClientHandle_s openapiClientHandle_t
 

Enumerations

enum  OPEN_ACCESS_LINE_t { OPEN_ACCESS_LINE_UNKNOWN = 0, OPEN_ACCESS_LINE_CONSOLE = 1, OPEN_ACCESS_LINE_TELNET = 2, OPEN_ACCESS_LINE_SSH = 3 }
 
enum  OPEN_ACTION_t { OPEN_ACTION_ADD = 0, OPEN_ACTION_DELETE = 1 }
 OPEN uses these enumerators to indicate the interface types. More...
 
enum  OPEN_AF_t { OPEN_AF_NONE = 0, OPEN_AF_INET = 1, OPEN_AF_INET6 = 2 }
 OPEN uses these enumerators to indicate address family, IPV4 or IPV6. More...
 
enum  OPEN_AFX_t { OPEN_AFX_IP4 = 0, OPEN_AFX_IP6 = 1 }
 OPEN uses these enumerators to indicate BGP address family index of routes or policy for IPV4 or IPV6. More...
 
enum  OPEN_BOOL_t { OPEN_FALSE = 0, OPEN_TRUE = 1 }
 OPEN uses these enumerators to indicate true or false for a given config or status parameter. More...
 
enum  OPEN_CONTROL_t { OPEN_DISABLE = 0, OPEN_ENABLE = 1 }
 OPEN uses these enumerators to indicate enable or disable for a given config or status parameter. More...
 
enum  OPEN_DOT1Q_ACCEPT_FRAME_TYPE_t { OPEN_DOT1Q_ADMIT_ALL = 1, OPEN_DOT1Q_ADMIN_ONLY_VLAN_TAGGED = 2, OPEN_DOT1Q_ADMIN_ONLY_VLAN_UNTAGGED = 3 }
 OPEN uses these enumerators to indicate the types of frames that may be received on this port. More...
 
enum  open_error_t {
  OPEN_E_NONE = 0, OPEN_E_RPC = -20, OPEN_E_INTERNAL = -21, OPEN_E_PARAM = -22,
  OPEN_E_FULL = -23, OPEN_E_EXISTS = -24, OPEN_E_TIMEOUT = -25, OPEN_E_FAIL = -26,
  OPEN_E_DISABLED = -27, OPEN_E_UNAVAIL = -28, OPEN_E_NOT_FOUND = -29, OPEN_E_EMPTY = -30,
  OPEN_E_ERROR = -31
}
 OPEN uses these enumerators to indicate the error codes. More...
 
enum  OPEN_EVENT_e {
  OPEN_EVENT_INTERFACE = 0, OPEN_EVENT_VLAN = 1, OPEN_EVENT_ROUTE = 2, OPEN_EVENT_ROUTING_INTERFACE = 3,
  OPEN_EVENT_ISSU_START = 4, OPEN_EVENT_READY_STATE = 5, OPEN_EVENT_CONFIG = 6, OPEN_EVENT_LAST
}
 Open API Events for which clients can register. More...
 
enum  OPEN_INTF_TYPE_t {
  OPEN_INTF_TYPE_PHY = 0, OPEN_INTF_TYPE_CPU = 1, OPEN_INTF_TYPE_LAG = 2, OPEN_INTF_TYPE_VLAN = 3,
  OPEN_INTF_TYPE_LOOPBACK = 4, OPEN_INTF_TYPE_TUNNEL = 5, OPEN_INTF_TYPE_SERVICE_PORT = 6, OPEN_INTF_TYPE_OTHER = 7,
  OPEN_INTF_TYPE_ANY = 8
}
 
enum  OPEN_IP_ADDRESS_TYPE_t { OPEN_IP_ADDRESS_UNKNOWN = 0, OPEN_IP_ADDRESS_IPV4 = 1, OPEN_IP_ADDRESS_IPV6 = 2, OPEN_IP_ADDRESS_DNS = 16 }
 OpEN uses this enumeration to define IP address types. More...
 
enum  OPEN_LINK_STATE_t { OPEN_LINK_UP = 0, OPEN_LINK_DOWN = 1 }
 OPEN uses these enumerators to indicate the link status. More...
 
enum  OPEN_PASSWORD_ENCRYPT_ALG_t { OPEN_PASSWORD_ENCRYPT_NONE = 0, OPEN_PASSWORD_ENCRYPT_AES = 1, OPEN_PASSWORD_ENCRYPT_MD5 = 2 }
 OpEN uses this enumeration to define encryption types.
 
enum  OPEN_PORT_STATE_t { OPEN_PORT_DISABLE = 0, OPEN_PORT_ENABLE = 1, OPEN_PORT_DIAG_DISABLE = 2 }
 OPEN uses these enumerators to indicate port admin mode enable, disable or diag_disable. More...
 
enum  OPEN_PREF_INDICES_t {
  OPEN_PREF_RESERVED = 0, OPEN_PREF_LOCAL = 1, OPEN_PREF_STATIC = 2, OPEN_PREF_MPLS = 3,
  OPEN_PREF_OSPF_INTRA_AREA = 4, OPEN_PREF_OSPF_INTER_AREA = 5, OPEN_PREF_OSPF_EXTERNAL = 6, OPEN_PREF_RIP = 7,
  OPEN_PREF_IBGP = 8, OPEN_PREF_EBGP = 9, OPEN_PREF_6TO4 = 10, OPEN_PREF_GLOBAL_DEFAULT_GATEWAY = 11,
  OPEN_PREF_DEFAULT_DHCP = 12, OPEN_PREF_LOCAL_BGP = 13, OPEN_PREF_LAST
}
 Route Preference Types.
 
enum  OPEN_RATE_UNIT_t { OPEN_RATE_UNIT_NONE = 0, OPEN_RATE_UNIT_PERCENT = 1, OPEN_RATE_UNIT_PPS = 2, OPEN_RATE_UNIT_KBPS = 3 }
 OpEN uses this enumeration to define rate units. More...
 
enum  OPEN_REDIST_RT_INDICES_t {
  OPEN_REDIST_RT_FIRST = 0, OPEN_REDIST_RT_LOCAL = 1, OPEN_REDIST_RT_STATIC = 2, OPEN_REDIST_RT_RIP = 3,
  OPEN_REDIST_RT_OSPF = 4, OPEN_REDIST_RT_BGP = 5, OPEN_REDIST_RT_OSPFV3 = 6, OPEN_REDIST_RT_LAST
}
 Redistribution route types.
 
enum  OPEN_REGISTER_FLAGS_t { OPEN_REGISTER_FLAGS_NONE = 0x00000000, OPEN_REGISTER_FLAGS_THREADED = 0x00000001 }
 Open API enhanced registration flags. More...
 
enum  OPEN_VLAN_PARTICIPATION_MODE_t { OPEN_VLAN_PARTICIPATION_MODE_INCLUDE = 0, OPEN_VLAN_PARTICIPATION_MODE_AUTO = 1, OPEN_VLAN_PARTICIPATION_MODE_EXCLUDE = 2 }
 OPEN uses these enumerators to indicate the VLAN participation of a given interface. More...
 

Functions

open_error_t openapiApiVersionGet (openapiClientHandle_t *client_handle, open_revision_data_t *version)
 Returns the revision of the OPEN API. More...
 
int openapiClientNotifySocketFDGet (openapiClientHandle_t *client_handle)
 Accessor function to retrieve the socket FD for event notifications from OpEN. More...
 
open_error_t openapiClientRegister (char *client_name, openapiClientHandle_t *client_handle)
 Register as a client with the OpEN API and wait until OpEN API services are available. More...
 
open_error_t openapiClientRegisterEnhanced (char *client_name, OPEN_REGISTER_FLAGS_t reg_flags, openapiClientHandle_t *client_handle)
 Register as a client with the OpEN API using enhanced options and wait until OpEN API services are available. More...
 
open_error_t openapiClientTearDown (openapiClientHandle_t *client_handle)
 Teardown and cleanup the connection resources. More...
 
open_error_t openapiConnectivityCheck (openapiClientHandle_t *client_handle)
 Return code indicates whether the OpEN remote procedure call infrastructure is ready. More...
 
open_error_t openapiCpuIntfGet (openapiClientHandle_t *client_handle, uint32_t *intf)
 Returns the CPU control plane interface number. More...
 
open_error_t openapiCurrentSDMGet (openapiClientHandle_t *client_handle, uint32_t *sdm_template)
 Get the current active SDM template in the system. More...
 
int openapiEventIsSet (openapiEventList_t *event_mask, OPEN_EVENT_e event_handle)
 Check if a particular event is set in a bit mask of events. More...
 
void openapiEventListClear (openapiEventList_t *event_mask)
 
open_error_t openapiEventRegister (openapiClientHandle_t *client_handle, openapiEventList_t *event_mask)
 Register the client to receive event notifications for one or more event types. More...
 
void openapiEventSet (openapiEventList_t *event_mask, OPEN_EVENT_e event_handle)
 
open_error_t openapiEventWait (openapiClientHandle_t *client_handle, int32_t timeout_secs)
 Wait for Open API events for this client. More...
 
open_error_t openapiHardwareVersionGet (openapiClientHandle_t *client_handle, open_buffdesc *version)
 Returns hardware version of the switch. More...
 
open_error_t openapiImageFileNameMaxLengthGet (openapiClientHandle_t *client_handle, uint32_t *fileNameLen)
 Get the maximum length of an image file name (excluding its path) in the file system. More...
 
open_error_t openapiInetAddrCompare (openapiClientHandle_t *client_handle, open_buffdesc *ip1Str, open_buffdesc *ip2Str, OPEN_BOOL_t *equal)
 Check if the two IP address strings refer to the same address. More...
 
open_error_t openapiInetAddrFromIPAddrHostNameStr (openapiClientHandle_t *client_handle, open_buffdesc *ipOrHostStr, open_inet_addr_t *inetAddr)
 Converts network address string containing either an IPv4/IPv6 address or a host name into an inetAddr in network byte order. More...
 
open_error_t openapiInetAddrGet (openapiClientHandle_t *client_handle, open_buffdesc *ipStr, open_inet_addr_t *ipAddr)
 Get the IP address in network byte order from string format. More...
 
open_error_t openapiInternalClientRegister (char *client_name, openapiClientHandle_t *client_handle)
 Register as an internal client with the OpEN API and wait until OpEN API services are available. More...
 
open_error_t openapiInternalClientTearDown (openapiClientHandle_t *client_handle)
 Deregister an internal OpEN client. More...
 
open_error_t openapiIntfDisplayNameGet (openapiClientHandle_t *client_handle, uint32_t unit, uint32_t slot, uint32_t port, open_buffdesc *bufdName)
 Get the display name of given interface. More...
 
open_error_t openapiIntfNameGet (openapiClientHandle_t *client_handle, uint32_t intfNum, open_buffdesc *bufdName)
 Get interface name for a given internal interface number. More...
 
open_error_t openapiIntfNameMaxLengthGet (openapiClientHandle_t *client_handle, uint32_t *maxLen)
 Get maximum length of interface name. More...
 
open_error_t openapiIpAddressMaxStringLength (openapiClientHandle_t *client_handle, uint32_t *maxLen)
 Get maximum string length of IP address. More...
 
open_error_t openapiIsInetAddrZero (openapiClientHandle_t *client_handle, open_inet_addr_t ipAddr, OPEN_BOOL_t *isZero)
 Check if the given IP address is zero or not. More...
 
open_error_t openapiMaxInterfaceCountGet (openapiClientHandle_t *client_handle, uint32_t *max_interface_count)
 Get the maximum number of interfaces on this switch. More...
 
open_error_t openapiNetworkOSVersionGet (openapiClientHandle_t *client_handle, open_buffdesc *version)
 Returns the revision of the network operating system running on the switch. More...
 
open_error_t openapiOpenIPtoStringGet (openapiClientHandle_t *client_handle, open_inet_addr_t openAddr, open_buffdesc *bufdName)
 Get human readable string format of given IP address. More...
 
open_error_t openapiOspfEqualCostRoutesMax (openapiClientHandle_t *client_handle, uint32_t *maxPaths)
 Get the number of equal cost routes supported by this platform. More...
 
open_error_t openapiPendingEventsGet (openapiClientHandle_t *client_handle, openapiEventList_t *changed_mask, openapiEventList_t *purged_mask)
 Check what events are pending for this client. More...
 
open_error_t openapiPingCallback (openapiClientHandle_t *client_handle, uint16_t seqNo, uint32_t rtt, uint32_t type, open_buffdesc *srcIp)
 Send the ping response to the client(CLI/Telnet/SSH) session. More...
 
open_error_t openapiServiceClientRegister (char *client_name, int32_t client_inst, int32_t server_id, openapiClientHandle_t *client_handle)
 Register as a client of a specified OpEN API service and wait until the service is available. More...
 
open_error_t openapiSystemFileNameMaxLengthGet (openapiClientHandle_t *client_handle, uint32_t *fileNameLen)
 Get the maximum length of a file name (including its path) in the file system. More...
 
open_error_t openapiSystemReadyStateGet (openapiClientHandle_t *client_handle, uint32_t *system_is_ready)
 Determine whether the system is currently operational or not operational. More...
 
open_error_t openapiSystemReadyStateTransitionNextGet (openapiClientHandle_t *client_handle, uint32_t *system_is_ready)
 Get the next configurator state transition event. More...
 
open_error_t openapiTraceRouteCallbackFn (openapiClientHandle_t *client_handle, uint32_t num_probes, uint32_t ttl, uint32_t ipDa, uint16_t hopCount, uint16_t probeCount, uint32_t rtt, uint8_t errSym)
 Send the traceroute response to the client(CLI/Telnet/SSH) session. More...