Skip to content

Commit 0e9a841

Browse files
marian-pritsakwni0812
authored andcommitted
[DASH] Add flow bulk get session event data struct (opencomputeproject#2175)
* [DASH] Add flow bulk get session event data struct Add flow bulk get event callback and supporting structures to provide ability to query flows in asynchronous manner.
1 parent 170d8bb commit 0e9a841

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

experimental/saiswitchextensions.h

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
#include <saiswitch.h>
2929
#include <saitypesextensions.h>
30+
#include <saiexperimentaldashflow.h>
3031

3132
/**
3233
* @brief DASH capability HA scope level
@@ -131,6 +132,52 @@ typedef void (*sai_ha_scope_event_notification_fn)(
131132
_In_ uint32_t count,
132133
_In_ const sai_ha_scope_event_data_t *data);
133134

135+
/**
136+
* @brief Flow bulk get session event type
137+
*/
138+
typedef enum _sai_flow_bulk_get_session_event_t
139+
{
140+
/** Bulk get session finished */
141+
SAI_FLOW_BULK_GET_SESSION_EVENT_FINISHED,
142+
143+
/** Flow entry received */
144+
SAI_FLOW_BULK_GET_SESSION_EVENT_FLOW_ENTRY,
145+
146+
} sai_flow_bulk_get_session_event_t;
147+
148+
/**
149+
* @brief Notification data format received from SAI flow bulk get session callback
150+
*
151+
* @count attr[attr_count]
152+
*/
153+
typedef struct _sai_flow_bulk_get_session_event_data_t
154+
{
155+
/**
156+
* @brief Event type
157+
*
158+
* If event_type is SAI_FLOW_BULK_GET_SESSION_EVENT_FINISHED, attr is NULL, flow_entry is invalid.
159+
* If event_type is SAI_FLOW_BULK_GET_SESSION_EVENT_FLOW_ENTRY, attr is not NULL.
160+
*/
161+
sai_flow_bulk_get_session_event_t event_type;
162+
163+
} sai_flow_bulk_get_session_event_data_t;
164+
165+
/**
166+
* @brief Flow bulk get session event notification
167+
*
168+
* Passed as a parameter into sai_initialize_switch()
169+
*
170+
* @count data[count]
171+
*
172+
* @param[in] flow_bulk_session_id ID of the flow bulk session
173+
* @param[in] count Number of notifications
174+
* @param[in] data Array of flow bulk get session events
175+
*/
176+
typedef void (*sai_flow_bulk_get_session_event_notification_fn)(
177+
_In_ sai_object_id_t flow_bulk_session_id,
178+
_In_ uint32_t count,
179+
_In_ const sai_flow_bulk_get_session_event_data_t *data);
180+
134181
/**
135182
* @brief SAI switch attribute extensions.
136183
*
@@ -191,6 +238,17 @@ typedef enum _sai_switch_attr_extensions_t
191238
*/
192239
SAI_SWITCH_ATTR_HA_SCOPE_EVENT_NOTIFY,
193240

241+
/**
242+
* @brief DASH flow bulk get session event notification
243+
*
244+
* Use sai_flow_bulk_get_session_event_notification_fn as notification function.
245+
*
246+
* @type sai_pointer_t sai_flow_bulk_get_session_event_notification_fn
247+
* @flags CREATE_AND_SET
248+
* @default NULL
249+
*/
250+
SAI_SWITCH_ATTR_FLOW_BULK_GET_SESSION_EVENT_NOTIFY,
251+
194252
SAI_SWITCH_ATTR_EXTENSIONS_RANGE_END
195253

196254
} sai_switch_attr_extensions_t;

0 commit comments

Comments
 (0)