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
289482a9
Commit
289482a9
authored
May 19, 2024
by
Nawasan Wisitsingkhon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename pcket_in: port -> in_port
parent
19be69bc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
controller.rs
src/controller.rs
+3
-3
packet_in.rs
src/openflow/events/packet_in.rs
+3
-3
No files found.
src/controller.rs
View file @
289482a9
...
@@ -31,7 +31,7 @@ impl<OME: OfpMsgEvent> ControllerFrame<OME> for Controller<OME> {
...
@@ -31,7 +31,7 @@ impl<OME: OfpMsgEvent> ControllerFrame<OME> for Controller<OME> {
*/
*/
fn
packet_in_handler
(
&
mut
self
,
xid
:
u32
,
packetin
:
PacketInEvent
,
stream
:
&
mut
TcpStream
)
{
fn
packet_in_handler
(
&
mut
self
,
xid
:
u32
,
packetin
:
PacketInEvent
,
stream
:
&
mut
TcpStream
)
{
let
pkt
=
packetin
.ether_parse
();
let
pkt
=
packetin
.ether_parse
();
self
.mac_to_port
.insert
(
pkt
.mac_src
,
packetin
.port
);
self
.mac_to_port
.insert
(
pkt
.mac_src
,
packetin
.
in_
port
);
let
mac_dst
=
pkt
.mac_des
;
let
mac_dst
=
pkt
.mac_des
;
let
mac_src
=
pkt
.mac_src
;
let
mac_src
=
pkt
.mac_src
;
...
@@ -49,7 +49,7 @@ impl<OME: OfpMsgEvent> ControllerFrame<OME> for Controller<OME> {
...
@@ -49,7 +49,7 @@ impl<OME: OfpMsgEvent> ControllerFrame<OME> for Controller<OME> {
if
let
PseudoPort
::
PhysicalPort
(
_
)
=
out_port
{
if
let
PseudoPort
::
PhysicalPort
(
_
)
=
out_port
{
let
mut
match_fields
=
MatchFields
::
match_all
();
let
mut
match_fields
=
MatchFields
::
match_all
();
match_fields
.in_port
=
Some
(
packetin
.port
);
match_fields
.in_port
=
Some
(
packetin
.
in_
port
);
match_fields
.mac_dest
=
Some
(
mac_dst
);
match_fields
.mac_dest
=
Some
(
mac_dst
);
match_fields
.mac_src
=
Some
(
mac_src
);
match_fields
.mac_src
=
Some
(
mac_src
);
if
let
Some
(
buf_id
)
=
packetin
.buf_id
{
if
let
Some
(
buf_id
)
=
packetin
.buf_id
{
...
@@ -61,7 +61,7 @@ impl<OME: OfpMsgEvent> ControllerFrame<OME> for Controller<OME> {
...
@@ -61,7 +61,7 @@ impl<OME: OfpMsgEvent> ControllerFrame<OME> for Controller<OME> {
}
}
let
packet_out
=
self
let
packet_out
=
self
.ofp
.ofp
.packet_out
(
Some
(
packetin
.port
),
packetin
.payload
,
actions
);
.packet_out
(
Some
(
packetin
.
in_
port
),
packetin
.payload
,
actions
);
self
.send_msg
(
packet_out
,
xid
,
stream
);
self
.send_msg
(
packet_out
,
xid
,
stream
);
}
}
}
}
...
...
src/openflow/events/packet_in.rs
View file @
289482a9
...
@@ -13,7 +13,7 @@ pub enum PacketInReason {
...
@@ -13,7 +13,7 @@ pub enum PacketInReason {
pub
struct
PacketInEvent
{
pub
struct
PacketInEvent
{
pub
buf_id
:
Option
<
u32
>
,
pub
buf_id
:
Option
<
u32
>
,
pub
total_len
:
u16
,
pub
total_len
:
u16
,
pub
port
:
u16
,
pub
in_
port
:
u16
,
pub
reason
:
PacketInReason
,
pub
reason
:
PacketInReason
,
pub
table_id
:
u8
,
pub
table_id
:
u8
,
pub
payload
:
Payload
,
pub
payload
:
Payload
,
...
@@ -32,7 +32,7 @@ impl PacketInEvent {
...
@@ -32,7 +32,7 @@ impl PacketInEvent {
n
=>
Some
(
n
as
u32
),
n
=>
Some
(
n
as
u32
),
};
};
let
total_len
=
bytes
.read_u16
::
<
BigEndian
>
()
.unwrap
();
let
total_len
=
bytes
.read_u16
::
<
BigEndian
>
()
.unwrap
();
let
port
=
bytes
.read_u16
::
<
BigEndian
>
()
.unwrap
();
let
in_
port
=
bytes
.read_u16
::
<
BigEndian
>
()
.unwrap
();
let
reason
=
match
bytes
.read_u8
()
.unwrap
()
{
let
reason
=
match
bytes
.read_u8
()
.unwrap
()
{
1
=>
PacketInReason
::
NoMatch
,
1
=>
PacketInReason
::
NoMatch
,
2
=>
PacketInReason
::
Action
,
2
=>
PacketInReason
::
Action
,
...
@@ -47,7 +47,7 @@ impl PacketInEvent {
...
@@ -47,7 +47,7 @@ impl PacketInEvent {
PacketInEvent
{
PacketInEvent
{
buf_id
,
buf_id
,
total_len
,
total_len
,
port
,
in_
port
,
reason
,
reason
,
table_id
,
table_id
,
payload
,
payload
,
...
...
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