Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.13.1.2
Data Structures | Macros | Enumerations | Functions
This Code Implements The APIs Required For OpEN Event Notifications [OPENAPI_EVENT_NOTIFY]

Data Structures

struct  OPEN_ARP_EVENT_t
 Information received in notification for event OPEN_NOTIFY_EVENT_ARP. More...
 
struct  OPEN_DEVICE_EVENT_t
 The notification event encapsulating all event types. More...
 
struct  OPEN_FDB_EVENT_t
 Information received in notification for event OPEN_NOTIFY_EVENT_FDB_ENTRY. More...
 
struct  OPEN_IP_INFO_EVENT_t
 Information received in notification for event OPEN_NOTIFY_EVENT_IP_INFO. More...
 
struct  OPEN_IPV4_ROUTE_EVENT_t
 Information received in notification for event OPEN_NOTIFY_EVENT_IPV4_ROUTE. More...
 
struct  OPEN_LLDP_NEIGHBOR_EVENT_t
 Information received in notification for event OPEN_NOTIFY_EVENT_LLDP_NEIGHBORS. More...
 
struct  OPEN_POE_PORT_STATUS_EVENT_t
 Information received in notification for event OPEN_NOTIFY_EVENT_POE_STATUS. More...
 
struct  OPEN_PORT_INFO_EVENT_t
 Information received in notification for event OPEN_NOTIFY_EVENT_PORT_INFO. More...
 
struct  openEventNotifyConfig_t
 Configuration for each event to control the frequency of notifications. More...
 

Macros

#define OPEN_ARP_MAX_EVENTS   256
 Maximum no of arp events.
 
#define OPEN_ARP_MAX_TIMEOUT   600
 Maximum time out for arp events.
 
#define OPEN_ARP_MIN_EVENTS   16
 Minimum no of arp events.
 
#define OPEN_ARP_MIN_TIMEOUT   10
 Minimum time out for arp events.
 
#define OPEN_EVENT_CREATE   1
 Event change type : Create.
 
#define OPEN_EVENT_DELETE   2
 Event change type : Delete.
 
#define OPEN_EVENT_NOTIFY_DATA_MAX_SIZE   16384
 Maximum size of the data for socket.
 
#define OPEN_EVENT_NOTIFY_MAX_STR_LEN   256
 Maximum string length.
 
#define OPEN_EVENT_NOTIFY_SOCK_NAME   "/tmp/event_notify/sockets/client-notify-sock-%d"
 Socket name.
 
#define OPEN_EVENT_UPDATE   3
 Event change type : Update.
 
#define OPEN_FDB_ENTRY_MAX_EVENTS   512
 Maximum no of fdb events.
 
#define OPEN_FDB_ENTRY_MAX_TIMEOUT   600
 Maximum time out for fdb events.
 
#define OPEN_FDB_ENTRY_MIN_EVENTS   16
 Minimum no of fdb events.
 
#define OPEN_FDB_ENTRY_MIN_TIMEOUT   20
 Minimum time out for fdb events.
 
#define OPEN_IP_INFO_MAX_EVENTS   32
 Maximum no of ip info events.
 
#define OPEN_IP_INFO_MAX_TIMEOUT   600
 Maximum time out for ip info events.
 
#define OPEN_IP_INFO_MIN_EVENTS   1
 Lower/Upper limit for number of events to wait before sending notification per event type. More...
 
#define OPEN_IP_INFO_MIN_TIMEOUT   10
 Lower/Upper limit of timeout before sending notification per event type. More...
 
#define OPEN_IPV4_ROUTE_MAX_EVENTS   256
 Maximum no of ipv4 route events.
 
#define OPEN_IPV4_ROUTE_MAX_TIMEOUT   600
 Maximum time out for ipv4 route events.
 
#define OPEN_IPV4_ROUTE_MIN_EVENTS   16
 Minimum no of ipv4 route events.
 
#define OPEN_IPV4_ROUTE_MIN_TIMEOUT   10
 Minimum time out for ipv4 route events.
 
#define OPEN_LLDP_NEIGHBORS_MAX_EVENTS   8
 Maximum no of lldp neighbor events.
 
#define OPEN_LLDP_NEIGHBORS_MAX_TIMEOUT   600
 Maximum time out for lldp neighbor events.
 
#define OPEN_LLDP_NEIGHBORS_MIN_EVENTS   1
 Minimum no of lldp neighbor events.
 
#define OPEN_LLDP_NEIGHBORS_MIN_TIMEOUT   10
 Minimum time out for lldp neighbor events.
 
#define OPEN_POE_STATUS_MAX_EVENTS   256
 Maximum no of poe status events.
 
#define OPEN_POE_STATUS_MAX_TIMEOUT   600
 Maximum time out for poe status events.
 
#define OPEN_POE_STATUS_MIN_EVENTS   1
 Minimum no of poe status events.
 
#define OPEN_POE_STATUS_MIN_TIMEOUT   10
 Minimum time out for poe status events.
 
#define OPEN_PORT_INFO_MAX_EVENTS   256
 Maximum no of port info events.
 
#define OPEN_PORT_INFO_MAX_TIMEOUT   600
 Maximum time out for port info events.
 
#define OPEN_PORT_INFO_MIN_EVENTS   1
 Minimum no of port info events.
 
#define OPEN_PORT_INFO_MIN_TIMEOUT   10
 Minimum time out for port info events.
 
#define OPEN_PORT_MDIX_AUTO   0
 Mdix auto mode.
 
#define OPEN_PORT_MDIX_FORCE_AUTO   1
 Mdix force auto mode.
 
#define OPEN_PORT_MDIX_NORMAL   2
 Mdix normal mode.
 
#define OPEN_PORT_MDIX_UNKNOWN   4
 Unknown mdix mode.
 
#define OPEN_PORT_MDIX_XOVER   3
 Mdix cross over mode.
 

Enumerations

enum  OPEN_NOTIFY_EVENT_t {
  OPEN_NOTIFY_EVENT_IP_INFO = 1, OPEN_NOTIFY_EVENT_ARP = 2, OPEN_NOTIFY_EVENT_IPV4_ROUTE = 3, OPEN_NOTIFY_EVENT_PORT_INFO = 4,
  OPEN_NOTIFY_EVENT_LLDP_NEIGHBORS = 5, OPEN_NOTIFY_EVENT_POE_STATUS = 6, OPEN_NOTIFY_EVENT_FDB_ENTRY = 7, OPEN_NOTIFY_EVENT_LAST = 8
}
 OpEN events for which clients can register. More...
 
enum  OPEN_POE_TRAP_PORT_CHANGE_t { OPEN_POE_PORT_ON = 1, OPEN_POE_PORT_OFF = 2, OPEN_POE_PORT_ADMIN_DISABLE = 3, OPEN_POE_PORT_ADMIN_ENABLE = 4 }
 enum values to indicate the change on POE port More...
 

Functions

open_error_t openapiEventNotifyClientDeregister (openapiClientHandle_t *client_handle)
 Deregister a client from receiving OpEN Event Notifications. More...
 
open_error_t openapiEventNotifyClientRegister (openapiClientHandle_t *client_handle, open_buffdesc *clientDescription)
 Register a client for receiving OpEN Event Notifications. More...
 
open_error_t openapiEventNotifyDataReceive (openapiClientHandle_t *client_handle, open_error_t(*callBack)(OPEN_DEVICE_EVENT_t *eventInfo))
 Initialize the socket to receive notification data, register a callback function and wait on socket to receive notification data. More...
 
open_error_t openapiEventNotifyEventDeregister (openapiClientHandle_t *client_handle)
 Deregister for receiving OpEN Event Notifications for all events. More...
 
open_error_t openapiEventNotifyEventRegister (openapiClientHandle_t *client_handle, uint32_t numOfNotifyEvents, open_buffdesc *eventNotifyCfg)
 Register for receiving notifications of specific events. More...
 

Detailed Description

Macro Definition Documentation

#define OPEN_IP_INFO_MIN_EVENTS   1

Lower/Upper limit for number of events to wait before sending notification per event type.

Minimum no of ip info events

Definition at line 77 of file openapi_event_notify.h.

#define OPEN_IP_INFO_MIN_TIMEOUT   10

Lower/Upper limit of timeout before sending notification per event type.

Minimum time out for ip info events

Definition at line 102 of file openapi_event_notify.h.

Enumeration Type Documentation

OpEN events for which clients can register.

Enumerator
OPEN_NOTIFY_EVENT_IP_INFO 

Change in IP address/Gateway/DNS server/Hostname.

OPEN_NOTIFY_EVENT_ARP 

Add/Remove of ARP entries.

OPEN_NOTIFY_EVENT_IPV4_ROUTE 

Add/Remove/Change of ipv4 route entry.

OPEN_NOTIFY_EVENT_PORT_INFO 

Change in admin/oper status or speed/AN/duplex/mdix of port.

OPEN_NOTIFY_EVENT_LLDP_NEIGHBORS 

Add/Remove LLDP neighbor.

OPEN_NOTIFY_EVENT_POE_STATUS 

Delivering power/disabled/fault status of PoE port.

OPEN_NOTIFY_EVENT_FDB_ENTRY 

Add/Remove/Age-out of FDB entries.

OPEN_NOTIFY_EVENT_LAST 

For bounds checking.

Definition at line 50 of file openapi_event_notify.h.

enum values to indicate the change on POE port

Enumerator
OPEN_POE_PORT_ON 

port is turned on

OPEN_POE_PORT_OFF 

port is turned off

OPEN_POE_PORT_ADMIN_DISABLE 

port admin state is disable

OPEN_POE_PORT_ADMIN_ENABLE 

port admin state is enable

Definition at line 165 of file openapi_event_notify.h.

Function Documentation

open_error_t openapiEventNotifyClientDeregister ( openapiClientHandle_t client_handle)

Deregister a client from receiving OpEN Event Notifications.

Parameters
[in]client_handleclient handle from OpEN client registration API
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.

OpEN API Version: 1.28

Examples:
event_notify_example.c.
open_error_t openapiEventNotifyClientRegister ( openapiClientHandle_t client_handle,
open_buffdesc clientDescription 
)

Register a client for receiving OpEN Event Notifications.

Parameters
[in]client_handleclient handle from OpEN client registration API
[in]clientDescriptionDescription of the registering client
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.

OpEN API Version: 1.28

Examples:
event_notify_example.c.
open_error_t openapiEventNotifyDataReceive ( openapiClientHandle_t client_handle,
open_error_t(*)(OPEN_DEVICE_EVENT_t *eventInfo)  callBack 
)

Initialize the socket to receive notification data, register a callback function and wait on socket to receive notification data.

Parameters
[in]client_handleclient handle from OpEN client registration API
[in]callBackCallback function to be invoked on receiving the notification data.
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.

OpEN API Version: 1.28

Examples:
event_notify_example.c.
open_error_t openapiEventNotifyEventDeregister ( openapiClientHandle_t client_handle)

Deregister for receiving OpEN Event Notifications for all events.

Parameters
[in]client_handleclient handle from OpEN client registration API
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
Note
Client handle still remains valid. Client can re-register for a new set of events.

OpEN API Version: 1.28

Examples:
event_notify_example.c.
open_error_t openapiEventNotifyEventRegister ( openapiClientHandle_t client_handle,
uint32_t  numOfNotifyEvents,
open_buffdesc eventNotifyCfg 
)

Register for receiving notifications of specific events.

Parameters
[in]client_handleclient handle from OpEN client registration API
[in]numOfNotifyEventsNumber of event types to be registered.
[in]eventNotifyCfgConfiguration specific to events (openEventNotifyConfig_t).
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.

OpEN API Version: 1.28

Examples:
event_notify_example.c.