-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into ledamping_sairedis
- Loading branch information
Showing
20 changed files
with
558 additions
and
3 deletions.
There are no files selected for viewing
Submodule SAI
updated
13 files
+2 −0 | .gitignore | |
+6 −0 | inc/sai.h | |
+5 −5 | inc/saifdb.h | |
+9 −1 | inc/saitypes.h | |
+0 −1 | meta/ancestry.9f8efee.history | |
+1 −0 | meta/ancestry.eaf2812.history | |
+1 −0 | meta/aspell.en.pws | |
+2 −2 | meta/checkancestry.sh | |
+6 −1 | meta/saisanitycheck.c | |
+6 −6 | meta/saiserializetest.c | |
+3 −0 | test/saithrift/src/switch_sai.thrift | |
+115 −0 | test/saithrift/src/switch_sai_rpc_server.cpp | |
+23 −0 | test/saithrift/tests/switch.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#include "NotificationTwampSessionEvent.h" | ||
|
||
#include "swss/logger.h" | ||
|
||
#include "meta/sai_serialize.h" | ||
|
||
using namespace sairedis; | ||
|
||
NotificationTwampSessionEvent::NotificationTwampSessionEvent( | ||
_In_ const std::string& serializedNotification): | ||
Notification( | ||
SAI_SWITCH_NOTIFICATION_TYPE_TWAMP_SESSION_EVENT, | ||
serializedNotification), | ||
m_twampSessionEventNotificationData(nullptr) | ||
{ | ||
SWSS_LOG_ENTER(); | ||
|
||
sai_deserialize_twamp_session_event_ntf( | ||
serializedNotification, | ||
m_count, | ||
&m_twampSessionEventNotificationData); | ||
} | ||
|
||
NotificationTwampSessionEvent::~NotificationTwampSessionEvent() | ||
{ | ||
SWSS_LOG_ENTER(); | ||
|
||
sai_deserialize_free_twamp_session_event_ntf(m_count, m_twampSessionEventNotificationData); | ||
} | ||
|
||
sai_object_id_t NotificationTwampSessionEvent::getSwitchId() const | ||
{ | ||
SWSS_LOG_ENTER(); | ||
|
||
// this notification don't contain switch id field | ||
|
||
return SAI_NULL_OBJECT_ID; | ||
} | ||
|
||
sai_object_id_t NotificationTwampSessionEvent::getAnyObjectId() const | ||
{ | ||
SWSS_LOG_ENTER(); | ||
|
||
if (m_twampSessionEventNotificationData == nullptr) | ||
{ | ||
return SAI_NULL_OBJECT_ID; | ||
} | ||
|
||
for (uint32_t idx = 0; idx < m_count; idx++) | ||
{ | ||
if (m_twampSessionEventNotificationData[idx].twamp_session_id != SAI_NULL_OBJECT_ID) | ||
{ | ||
return m_twampSessionEventNotificationData[idx].twamp_session_id; | ||
} | ||
} | ||
|
||
return SAI_NULL_OBJECT_ID; | ||
} | ||
|
||
void NotificationTwampSessionEvent::processMetadata( | ||
_In_ std::shared_ptr<saimeta::Meta> meta) const | ||
{ | ||
SWSS_LOG_ENTER(); | ||
|
||
meta->meta_sai_on_twamp_session_event(m_count, m_twampSessionEventNotificationData); | ||
} | ||
|
||
void NotificationTwampSessionEvent::executeCallback( | ||
_In_ const sai_switch_notifications_t& switchNotifications) const | ||
{ | ||
SWSS_LOG_ENTER(); | ||
|
||
if (switchNotifications.on_twamp_session_event) | ||
{ | ||
switchNotifications.on_twamp_session_event(m_count, m_twampSessionEventNotificationData); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#pragma once | ||
|
||
#include "Notification.h" | ||
|
||
namespace sairedis | ||
{ | ||
class NotificationTwampSessionEvent: | ||
public Notification | ||
{ | ||
public: | ||
|
||
NotificationTwampSessionEvent( | ||
_In_ const std::string& serializedNotification); | ||
|
||
virtual ~NotificationTwampSessionEvent(); | ||
|
||
public: | ||
|
||
virtual sai_object_id_t getSwitchId() const override; | ||
|
||
virtual sai_object_id_t getAnyObjectId() const override; | ||
|
||
virtual void processMetadata( | ||
_In_ std::shared_ptr<saimeta::Meta> meta) const override; | ||
|
||
virtual void executeCallback( | ||
_In_ const sai_switch_notifications_t& switchNotifications) const override; | ||
|
||
private: | ||
|
||
uint32_t m_count; | ||
|
||
sai_twamp_session_event_notification_data_t *m_twampSessionEventNotificationData; | ||
}; | ||
} |
Oops, something went wrong.