forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement new serialization methods (sonic-net#103)
- Loading branch information
Showing
18 changed files
with
2,763 additions
and
1,986 deletions.
There are no files selected for viewing
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,56 @@ | ||
#include <map> | ||
|
||
#include "swss/logger.h" | ||
|
||
extern "C" { | ||
#include <sai.h> | ||
} | ||
|
||
const char* profile_get_value( | ||
_In_ sai_switch_profile_id_t profile_id, | ||
_In_ const char* variable) | ||
{ | ||
SWSS_LOG_ENTER(); | ||
|
||
return NULL; | ||
} | ||
|
||
int profile_get_next_value( | ||
_In_ sai_switch_profile_id_t profile_id, | ||
_Out_ const char** variable, | ||
_Out_ const char** value) | ||
{ | ||
SWSS_LOG_ENTER(); | ||
|
||
if (value == NULL) | ||
{ | ||
SWSS_LOG_INFO("resetting profile map iterator"); | ||
|
||
return 0; | ||
} | ||
|
||
if (variable == NULL) | ||
{ | ||
SWSS_LOG_WARN("variable is null"); | ||
return -1; | ||
} | ||
|
||
SWSS_LOG_INFO("iterator reached end"); | ||
return -1; | ||
} | ||
|
||
service_method_table_t test_services = { | ||
profile_get_value, | ||
profile_get_next_value | ||
}; | ||
|
||
int main() | ||
{ | ||
swss::Logger::getInstance().setMinPrio(swss::Logger::SWSS_DEBUG); | ||
|
||
SWSS_LOG_ENTER(); | ||
|
||
sai_api_initialize(0, (service_method_table_t*)&test_services); | ||
|
||
return 0; | ||
} |
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
Oops, something went wrong.