Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
P4labs 2023
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ANET
P4labs 2023
Commits
6c9e9c20
Commit
6c9e9c20
authored
1 year ago
by
Djojomoenawie, N.E. (Nathan, Student M-CS)
Browse files
Options
Downloads
Patches
Plain Diff
Fix mistake in source comments
parent
30f68521
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
assignments/firewall/firewall.p4
+5
-5
5 additions, 5 deletions
assignments/firewall/firewall.p4
with
5 additions
and
5 deletions
assignments/firewall/firewall.p4
+
5
−
5
View file @
6c9e9c20
...
...
@@ -186,19 +186,19 @@ control MyIngress(inout headers hdr,
if(tcp_is_valid(packet)):
if(packet_ports_must_be_filtered(packet)):
packet_flow = direction
//first
i
need the hashes to query my filter tables
//first
I
need the hashes to query my filter tables
if(is_outbound(packet_flow)):
compute_hashes(src, dst, srcport, dstport)
else:
compute_hashes(dst, src, dstport, srcport)
//now that
i
have the hashes,
i
can query and take action
//now that
I
have the hashes,
I
can query and take action
if(is_outbound(packet_flow)):
//its an
in
bound connection, so
i
allow everything and must be able to receive the responses
//to receive the responses
i
have to write to the filters, because otherwise it will be blocked
//its an
out
bound connection, so
I
allow everything and must be able to receive the responses
//to receive the responses
I
have to write to the filters, because otherwise it will be blocked
if(is_new_connection(hdr.tcp.syn)):
write_to_filters(reg_pos_one, reg_pos_two, 1)
else:
//its an
out
bound connection, so
i
block everything
//its an
in
bound connection, so
I
block everything
//unless both entries to the filters are set as 1
read_from_filters(read_val_one, reg_pos_one, read_val_two, reg_pos_two)
if((read_val_one OR read_val_two) != 1):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment