38 #ifndef OPENAPI_EVENT_NOTIFY_H_INCLUDED
39 #define OPENAPI_EVENT_NOTIFY_H_INCLUDED
63 #define OPEN_EVENT_CREATE 1
64 #define OPEN_EVENT_DELETE 2
65 #define OPEN_EVENT_UPDATE 3
67 #define OPEN_PORT_MDIX_AUTO 0
68 #define OPEN_PORT_MDIX_FORCE_AUTO 1
69 #define OPEN_PORT_MDIX_NORMAL 2
70 #define OPEN_PORT_MDIX_XOVER 3
71 #define OPEN_PORT_MDIX_UNKNOWN 4
77 #define OPEN_IP_INFO_MIN_EVENTS 1
78 #define OPEN_IP_INFO_MAX_EVENTS 32
80 #define OPEN_ARP_MIN_EVENTS 16
81 #define OPEN_ARP_MAX_EVENTS 256
83 #define OPEN_IPV4_ROUTE_MIN_EVENTS 16
84 #define OPEN_IPV4_ROUTE_MAX_EVENTS 256
86 #define OPEN_PORT_INFO_MIN_EVENTS 1
87 #define OPEN_PORT_INFO_MAX_EVENTS 256
89 #define OPEN_LLDP_NEIGHBORS_MIN_EVENTS 1
90 #define OPEN_LLDP_NEIGHBORS_MAX_EVENTS 8
92 #define OPEN_POE_STATUS_MIN_EVENTS 1
93 #define OPEN_POE_STATUS_MAX_EVENTS 256
95 #define OPEN_FDB_ENTRY_MIN_EVENTS 16
96 #define OPEN_FDB_ENTRY_MAX_EVENTS 512
102 #define OPEN_IP_INFO_MIN_TIMEOUT 10
103 #define OPEN_IP_INFO_MAX_TIMEOUT 600
105 #define OPEN_ARP_MIN_TIMEOUT 10
106 #define OPEN_ARP_MAX_TIMEOUT 600
108 #define OPEN_IPV4_ROUTE_MIN_TIMEOUT 10
109 #define OPEN_IPV4_ROUTE_MAX_TIMEOUT 600
111 #define OPEN_PORT_INFO_MIN_TIMEOUT 10
112 #define OPEN_PORT_INFO_MAX_TIMEOUT 600
114 #define OPEN_LLDP_NEIGHBORS_MIN_TIMEOUT 10
115 #define OPEN_LLDP_NEIGHBORS_MAX_TIMEOUT 600
117 #define OPEN_POE_STATUS_MIN_TIMEOUT 10
118 #define OPEN_POE_STATUS_MAX_TIMEOUT 600
120 #define OPEN_FDB_ENTRY_MIN_TIMEOUT 20
121 #define OPEN_FDB_ENTRY_MAX_TIMEOUT 600
124 #define OPEN_EVENT_NOTIFY_MAX_STR_LEN 256
125 #define OPEN_EVENT_NOTIFY_DATA_MAX_SIZE 16384
126 #define OPEN_EVENT_NOTIFY_SOCK_NAME "/tmp/event_notify/sockets/client-notify-sock-%d"
161 unsigned char srcMac[OPEN_MAC_ADDR_LEN];
190 unsigned char mac[OPEN_MAC_ADDR_LEN];
212 unsigned char hostName[OPEN_HOSTNAME_MAX_LEN + 1];
296 uint32_t numOfNotifyEvents,
OPEN_POE_TRAP_PORT_CHANGE_t
enum values to indicate the change on POE port
OPEN_PORT_SPEEDS_t
OpEN port speed enum values.
OPEN_NOTIFY_EVENT_t eventType
Event type to interpret the eventData.
OPEN_PORT_DUPLEX_t duplex
duplex mode
uint32_t timestamp
timestamp also a part index to identify remote port data
Information received in notification for event OPEN_NOTIFY_EVENT_IP_INFO.
OPEN_POE_TRAP_PORT_CHANGE_t state
Current port state.
uint32_t intIfNum
Internal interface number if port type is not service or network.
uint32_t remIndex
part index to identify remote port data
uint32_t ifNum
Port number on which the station is learned.
OPEN_PORT_SPEEDS_t ifSpeed
port speed
uint32_t ipAddr
Host IP address.
Information received in notification for event OPEN_NOTIFY_EVENT_PORT_INFO.
Change in admin/oper status or speed/AN/duplex/mdix of port.
OPEN_PORT_AUTO_NEG_t autoneg
auto-negotiation enabled/disabled
OPEN_PORT_CABLE_MEDIA_TYPE_t
OPEN uses these enumerators to indicate the interface active media type.
OPEN_LINK_STATE_t linkState
Link state up/down.
OPEN_POE_DETECTION_t
PoE detection mode.
open_error_t
OPEN uses these enumerators to indicate the error codes.
Add/Remove LLDP neighbor.
uint8_t eventChangeType
Create, delete or update.
uint32_t powerLimit
Allowed power on the port.
port admin state is enable
OPEN_NOTIFY_EVENT_t eventType
Type of the event.
open_error_t openapiEventNotifyClientDeregister(openapiClientHandle_t *client_handle)
Deregister a client from receiving OpEN Event Notifications.
open_error_t openapiEventNotifyEventDeregister(openapiClientHandle_t *client_handle)
Deregister for receiving OpEN Event Notifications for all events.
Add/Remove/Change of ipv4 route entry.
uint32_t netMask
Host network mask.
open_buffdesc eventData
Buffer with event information for eventCount number of events of eventType.
OPEN_DISABLE_REASON_t
OPEN uses these enumerators to indicate the reason a port is diagnostically disabled.
uint32_t eventCount
Number of events in this notification packed in eventData.
uint32_t routePref
Route preference (administrative distance).
OPEN_NOTIFY_EVENT_t
OpEN events for which clients can register.
open_error_t openapiEventNotifyEventRegister(openapiClientHandle_t *client_handle, uint32_t numOfNotifyEvents, open_buffdesc *eventNotifyCfg)
Register for receiving notifications of specific events.
uint32_t globalSeqNum
Sequence number of all the events delievered so far.
uint32_t routeMask
Route mask.
OPEN_ARP_ENTRY_t arpEntry
Arp entry information.
uint8_t eventChangeType
Create, delete or update.
#define OPEN_DNS_NAME_SERVER_ENTRIES
maximum value
uint32_t eventCount
Number of events before triggering Notification.
OPEN_PORT_CABLE_MEDIA_TYPE_t medium
active medium for this port copper/fiber
OPEN_POE_PORT_POWER_CLASS_t
PoE port power class.
uint32_t vlanId
VLAN ID on which the station is learned.
OPEN_POE_PORT_FAULT_STATUS_t status
Fault code on the POE port.
OPEN_PORT_STATE_t
OPEN uses these enumerators to indicate port admin mode enable, disable or diag_disable.
Information received in notification for event OPEN_NOTIFY_EVENT_ARP.
Add/Remove of ARP entries.
Add/Remove/Age-out of FDB entries.
uint32_t routeDest
IP address of the route destination.
Change in IP address/Gateway/DNS server/Hostname.
Configuration for each event to control the frequency of notifications.
OPEN_PORT_AUTO_NEG_t
OpEN port auto neg enum values.
OPEN_BOOL_t
OPEN uses these enumerators to indicate true or false for a given config or status parameter...
uint32_t maxPower
Maximum power possible to deliver on the port.
OPEN_POE_DETECTION_t detectionStatus
Detection status of power device connected on the port.
OPEN_DISABLE_REASON_t disableReason
disable reason applicable when portState is diag-disabled
port admin state is disable
OPEN_BOOL_t eventMissFlag
Flag indicating one or more events of this eventType are missed.
Delivering power/disabled/fault status of PoE port.
uint8_t mdixMode
mdix mode
OPEN_POE_TYPE_t
PoE types.
Information received in notification for event OPEN_NOTIFY_EVENT_IPV4_ROUTE.
uint32_t eventChangeType
indicates add/remove
uint32_t routeProto
Value of OPEN_RTO_PROTOCOL_INDICES_t (refer to IP route table).
The notification event encapsulating all event types.
OPEN_POE_PORT_POWER_CLASS_t pdClass
Class of the connected power device.
uint32_t ifNum
Index to identify port uniquely.
OPEN_PORT_STATE_t portState
Admin state disabled/enabled/diag-disabled.
OPEN_POE_PORT_FAULT_STATUS_t
PoE port error code.
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 t...
Information received in notification for event OPEN_NOTIFY_EVENT_FDB_ENTRY.
uint32_t timeout
Time interval between two notifications.
OPEN_PORT_DUPLEX_t
OpEN port duplex enum values.
uint8_t eventChangeType
Create or delete.
OPEN_POE_TYPE_t pdType
Device type (poe/pos+/upoe/BT)
OPEN_LINK_STATE_t
OPEN uses these enumerators to indicate the link status.
uint8_t eventChangeType
Create, delete or update.
uint32_t ifNum
index to identify port uniquely
uint32_t ifNum
index to identify local port
open_error_t openapiEventNotifyClientRegister(openapiClientHandle_t *client_handle, open_buffdesc *clientDescription)
Register a client for receiving OpEN Event Notifications.
uint32_t eventSeqNum
Sequence number for the event identified by eventType.
Information received in notification for event OPEN_NOTIFY_EVENT_POE_STATUS.
OPEN_FLOWCONTROL_OPER_t flowControl
Active or inactive.
OPEN_MGMT_PORT_TYPE_t mgmtPortType
Management port type.
Information received in notification for event OPEN_NOTIFY_EVENT_LLDP_NEIGHBORS.
OPEN_FDB_ADDR_FLAG_t entryType
Flag indicate the learnt mode.