forked from sonic-net/sonic-sairedis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNotificationFlowBulkGetSessionEvent.cpp
More file actions
80 lines (63 loc) · 1.96 KB
/
NotificationFlowBulkGetSessionEvent.cpp
File metadata and controls
80 lines (63 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#include "NotificationFlowBulkGetSessionEvent.h"
#include "swss/logger.h"
#include "meta/sai_serialize.h"
#include "sairediscommon.h"
using namespace sairedis;
NotificationFlowBulkGetSessionEvent::NotificationFlowBulkGetSessionEvent(
_In_ const std::string& serializeNotification):
Notification(
SAI_SWITCH_NOTIFICATION_TYPE_FLOW_BULK_GET_SESSION_EVENT,
serializeNotification),
m_flow_bulk_session_id(SAI_NULL_OBJECT_ID),
m_count(0),
m_data(nullptr)
{
SWSS_LOG_ENTER();
sai_deserialize_flow_bulk_get_session_event_ntf(
serializeNotification,
m_flow_bulk_session_id,
m_count,
&m_data);
}
NotificationFlowBulkGetSessionEvent::~NotificationFlowBulkGetSessionEvent()
{
SWSS_LOG_ENTER();
sai_deserialize_free_flow_bulk_get_session_event_ntf(m_count, m_data);
}
sai_object_id_t NotificationFlowBulkGetSessionEvent::getSwitchId() const
{
SWSS_LOG_ENTER();
// Flow bulk get session event does not have switch id directly
// We can extract it from flow_bulk_session_id if needed
return SAI_NULL_OBJECT_ID;
}
sai_object_id_t NotificationFlowBulkGetSessionEvent::getAnyObjectId() const
{
SWSS_LOG_ENTER();
if (m_flow_bulk_session_id != SAI_NULL_OBJECT_ID)
{
return m_flow_bulk_session_id;
}
return SAI_NULL_OBJECT_ID;
}
void NotificationFlowBulkGetSessionEvent::processMetadata(
_In_ std::shared_ptr<saimeta::Meta> meta) const
{
SWSS_LOG_ENTER();
meta->meta_sai_on_flow_bulk_get_session_event(
m_flow_bulk_session_id,
m_count,
m_data);
}
void NotificationFlowBulkGetSessionEvent::executeCallback(
_In_ const sai_switch_notifications_t& switchNotifications) const
{
SWSS_LOG_ENTER();
if (switchNotifications.on_flow_bulk_get_session_event)
{
switchNotifications.on_flow_bulk_get_session_event(
m_flow_bulk_session_id,
m_count,
m_data);
}
}