Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
Tenjin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nawasan Wisitsingkhon
Tenjin
Commits
6cb489d3
Commit
6cb489d3
authored
May 12, 2024
by
Nawasan Wisitsingkhon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update code in packet_in_handler: add 'send packet to all port'
parent
fddc1a6c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
controller.rs
src/controller.rs
+9
-1
No files found.
src/controller.rs
View file @
6cb489d3
...
...
@@ -30,6 +30,8 @@ impl<OME: OfpMsgEvent> ControllerFrame<OME> for Controller<OME> {
*/
fn
packet_in_handler
(
&
mut
self
,
xid
:
u32
,
packetin
:
PacketInEvent
,
stream
:
&
mut
TcpStream
)
{
let
pkt
=
packetin
.ether_parse
();
self
.mac_to_port
.insert
(
pkt
.mac_src
,
packetin
.port
);
let
mac_dst
=
pkt
.mac_des
;
let
mac_src
=
pkt
.mac_src
;
let
out_port
=
self
.mac_to_port
.get
(
&
mac_dst
);
...
...
@@ -57,7 +59,13 @@ impl<OME: OfpMsgEvent> ControllerFrame<OME> for Controller<OME> {
);
self
.send_msg
(
packet_out
,
xid
,
stream
);
}
None
=>
todo!
(),
None
=>
{
let
packet_out
=
self
.ofp
.packet_out
(
None
,
packetin
.payload
,
vec!
[
FlowAction
::
Oputput
(
PseudoPort
::
AllPorts
)],
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment