-
Notifications
You must be signed in to change notification settings - Fork 694
[swss] Support FIPS MACSec POST #3836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
e82f1ce
Initial change to support FIPS MACSec POST.
ysmanman 5a01c32
Fix typo.
ysmanman 4ca5e4e
Fail POST if SAI does not support it.
ysmanman d38e593
Fix sai_serialize function name.
ysmanman 697d9ea
Add test coverage
ysmanman 5d01e93
Move test to tests directory
ysmanman 78f3e2d
Remove unused import.
ysmanman 41d0516
Change table entry key to "sai"
ysmanman 3aba0c0
Add syslog to log wrong POST notification.
ysmanman cdd95b2
Fix typo
ysmanman a0d571a
Remove duplicate code used to access POST state in State DB.
ysmanman 197ff71
Check POST state in main loop
ysmanman e5c0686
Enable MACSec POST if FIPS is enabled.
ysmanman 0c1f447
Update test.
ysmanman c50aa56
Timestamp the update of POST state.
ysmanman 6c06b56
Remove copyright.
ysmanman 81d57ac
Fix typo
ysmanman 2e2ec8d
Fix test.
ysmanman 3f88f37
update and add syslogs.
ysmanman 225f845
Update test.
ysmanman 59eefad
Merge branch 'master' into macsec-post
judyjoseph 55f6ad8
Don't set POST state to fail in stateDb if SAI doesn't support POST.
ysmanman 1f5e0d2
Set POST state to "disabled" in stateDb if SAI does not support POST.
ysmanman 77e3d85
Enable SAI MACSec POST by default and add an option to disable it.
ysmanman d8c64e5
Merge branch 'master' into macsec-post
ysmanman 2fb6d77
Remove unused import.
ysmanman 384e74d
Disable MACSec POST by default. Use -M option to enable it.
ysmanman 4aed6a6
Update test
ysmanman bef66ad
Fix typo
ysmanman 204125a
Fix indentation.
ysmanman 4412e30
Add delay after restarting swss.
ysmanman 9d8f741
modify orchagent.sh before restarting container
ysmanman 876edd0
Remove unused import
ysmanman 9fde5a3
Merge branch 'master' into macsec-post
judyjoseph File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,42 @@ | ||
| #include "dbconnector.h" | ||
| #include "macsecpost.h" | ||
| #include "redisutility.h" | ||
| #include "schema.h" | ||
| #include "table.h" | ||
|
|
||
| namespace swss { | ||
|
|
||
| void setMacsecPostState(DBConnector *stateDb, string postState) | ||
| { | ||
| Table macsecPostStateTable = Table(stateDb, STATE_FIPS_MACSEC_POST_TABLE_NAME); | ||
| vector<FieldValueTuple> fvts; | ||
| FieldValueTuple postStateFvt("post_state", postState); | ||
| fvts.push_back(postStateFvt); | ||
ysmanman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| auto now = std::chrono::system_clock::now(); | ||
| std::time_t now_c = std::chrono::system_clock::to_time_t(now); | ||
| char buffer[32]; | ||
| std::strftime(buffer, sizeof(buffer), "%a %b %d %H:%M:%S %Y", std::gmtime(&now_c)); | ||
| FieldValueTuple lastUpdateTimeFvt("last_update_time", buffer); | ||
| fvts.push_back(lastUpdateTimeFvt); | ||
|
|
||
| macsecPostStateTable.set("sai", fvts); | ||
| } | ||
|
|
||
| string getMacsecPostState(DBConnector *stateDb) | ||
| { | ||
| std::string postState = ""; | ||
| std::vector<FieldValueTuple> fvts; | ||
| Table macsecPostStateTable = Table(stateDb, STATE_FIPS_MACSEC_POST_TABLE_NAME); | ||
| if (macsecPostStateTable.get("sai", fvts)) | ||
| { | ||
| auto state = fvsGetValue(fvts, "post_state", true); | ||
| if (state) | ||
| { | ||
| postState = *state; | ||
| } | ||
| } | ||
| return postState; | ||
| } | ||
|
|
||
| } | ||
This file contains hidden or 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,13 @@ | ||
| #ifndef ORCHAGENT_MACSECPOST_H | ||
| #define ORCHAGENT_MACSECPOST_H | ||
|
|
||
| using namespace std; | ||
|
|
||
| namespace swss { | ||
|
|
||
| void setMacsecPostState(DBConnector *stateDb, string postState); | ||
| string getMacsecPostState(DBConnector *stateDb); | ||
|
|
||
| } | ||
|
|
||
| #endif // ORCHAGENT_MACSECPOST_H |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.