-
Notifications
You must be signed in to change notification settings - Fork 329
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
Add crypto extern to behavioral-model #834
base: main
Are you sure you want to change the base?
Changes from 18 commits
0f3bfe2
e9e1785
2847992
02c01d5
4e9d5be
fc17434
7d5a5a9
30f2879
353b462
84a43b5
fb7b8f3
e7d89e7
11f02c9
19656e2
e1fe58c
a3c273a
d32443a
9ff1f4d
c357ef5
1dc5f2c
f031ac7
3ca057f
f187058
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# ADD CRYPTO to SIMPLE_SWITCH | ||
|
||
For reference, the extern is implemented in crypto.cpp in this directory. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are no instructions here on how to compile the attached P4 program using p4c. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can add text. In the macsec repo this Makefile is used to compile with p4c. https://github.com/uni-tue-kn/p4-macsec/blob/master/p4/p4/Makefile |
||
This cpp code is to be incorporated in | ||
behavioral-model/targets/simple_switch/simple_switch.cpp | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should provide a mechanism for using this code that does not require copying the code to simple_switch.cpp. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thinking of this more, adding a separate Makefile and not making it part of the simple_switch build is definitely the right way to go. There is no reason to unconditionally compile and link this example extern to bmv2, and I think the separate Makefile is more representative of the "correct" workflow for someone who wants to add an extern type without changing any of the bmv2 code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added a Makefile to |
||
|
||
The code is crypto.cpp is also available in the repo URL included below | ||
so that testing can be done using MACsec (MAC security) code. A | ||
README.md is available at the repo below with steps for how to test | ||
the code. | ||
|
||
https://github.com/uni-tue-kn/p4-macsec | ||
|
||
The extern is defined in the following P4 file. Search for ExternCrypt | ||
for the extern definition. Additionally the extern is used in P4 code | ||
as crypt.validate() which is decryption and crypt.protect() which is | ||
encryption. | ||
|
||
https://github.com/uni-tue-kn/p4-macsec/p4/p4/basic.p4 | ||
|
||
basic.p4 is used to test the cryto extern code with simple_switch. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strange typography