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
490eb6e7
Commit
490eb6e7
authored
Jun 14, 2024
by
Nawasan Wisitsingkhon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move traiter into ofp10
parent
3c3c717f
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
19 additions
and
40 deletions
+19
-40
controller.rs
src/controller.rs
+2
-5
mod.rs
src/openflow/mod.rs
+0
-2
controller_frame.rs
src/openflow/ofp10/controller_frame.rs
+2
-5
error_handler.rs
src/openflow/ofp10/events/error/error_handler.rs
+1
-4
features_req.rs
src/openflow/ofp10/events/features_req.rs
+1
-4
flow_mod_handler.rs
src/openflow/ofp10/events/flow_mod/flow_mod_handler.rs
+2
-5
hello.rs
src/openflow/ofp10/events/hello.rs
+1
-4
packet_out.rs
src/openflow/ofp10/events/packet_out.rs
+2
-5
mod.rs
src/openflow/ofp10/mod.rs
+3
-0
ofp_header.rs
src/openflow/ofp10/ofp_header/ofp_header.rs
+1
-1
ofp_header_v1_0.rs
src/openflow/ofp10/ofp_header/ofp_header_v1_0.rs
+1
-1
ofp_manager.rs
src/openflow/ofp10/ofp_manager.rs
+1
-2
tcp_listener.rs
src/openflow/ofp10/tcp_listener.rs
+2
-2
event_trait.rs
src/openflow/ofp10/traiter/event_trait.rs
+0
-0
header_trait.rs
src/openflow/ofp10/traiter/header_trait.rs
+0
-0
mod.rs
src/openflow/ofp10/traiter/mod.rs
+0
-0
No files found.
src/controller.rs
View file @
490eb6e7
...
@@ -4,14 +4,11 @@ use std::{collections::HashMap, net::TcpStream};
...
@@ -4,14 +4,11 @@ use std::{collections::HashMap, net::TcpStream};
use
crate
::{
use
crate
::{
etherparser
::
ether_type
::
EtherType
,
etherparser
::
ether_type
::
EtherType
,
openflow
::{
openflow
::
ofp10
::{
ofp10
::{
self
,
self
,
events
::{
flow_mod
::
MatchFields
,
Action
},
events
::{
flow_mod
::
MatchFields
,
Action
},
ofp_manager
::
Openflow10
,
ofp_manager
::
Openflow10
,
ControllerFrame10
,
FlowModEvent
,
PacketInEvent
,
ControllerFrame10
,
FlowModEvent
,
OfpMsgEvent
,
PacketInEvent
,
},
traiter
::
OfpMsgEvent
,
},
},
};
};
/**
/**
...
...
src/openflow/mod.rs
View file @
490eb6e7
pub
mod
ofp10
;
pub
mod
ofp10
;
pub
mod
traiter
;
\ No newline at end of file
src/openflow/ofp10/controller_frame.rs
View file @
490eb6e7
use
crate
::
openflow
::{
use
crate
::
openflow
::
ofp10
::{
ErrorEvent
,
Msg
,
PacketInEvent
};
ofp10
::{
ErrorEvent
,
Msg
,
PacketInEvent
},
traiter
::{
MessageMarshal
,
OfpMsgEvent
},
};
use
std
::{
use
std
::{
io
::{
Read
,
Write
},
io
::{
Read
,
Write
},
net
::
TcpStream
,
net
::
TcpStream
,
};
};
use
super
::
tcp_listener_handler
;
use
super
::
{
tcp_listener_handler
,
MessageMarshal
,
OfpMsgEvent
}
;
pub
trait
ControllerFrame10
{
pub
trait
ControllerFrame10
{
fn
get_ofp
(
&
self
)
->
&
impl
OfpMsgEvent
;
fn
get_ofp
(
&
self
)
->
&
impl
OfpMsgEvent
;
...
...
src/openflow/ofp10/events/error/error_handler.rs
View file @
490eb6e7
...
@@ -4,10 +4,7 @@ use std::{
...
@@ -4,10 +4,7 @@ use std::{
};
};
use
super
::
error_type
::
ErrorType
;
use
super
::
error_type
::
ErrorType
;
use
crate
::
openflow
::{
use
crate
::
openflow
::
ofp10
::{
MessageMarshal
,
Msg
,
OfpMsgEvent
};
ofp10
::
Msg
,
traiter
::{
MessageMarshal
,
OfpMsgEvent
},
};
use
byteorder
::{
BigEndian
,
ReadBytesExt
};
use
byteorder
::{
BigEndian
,
ReadBytesExt
};
pub
struct
ErrorEvent
{
pub
struct
ErrorEvent
{
...
...
src/openflow/ofp10/events/features_req.rs
View file @
490eb6e7
use
crate
::
openflow
::{
use
crate
::
openflow
::
ofp10
::{
MessageMarshal
,
Msg
,
OfpMsgEvent
};
ofp10
::
Msg
,
traiter
::{
MessageMarshal
,
OfpMsgEvent
},
};
pub
struct
FeaturesReqEvent
{}
pub
struct
FeaturesReqEvent
{}
...
...
src/openflow/ofp10/events/flow_mod/flow_mod_handler.rs
View file @
490eb6e7
...
@@ -2,13 +2,10 @@ use std::io::Cursor;
...
@@ -2,13 +2,10 @@ use std::io::Cursor;
use
byteorder
::{
BigEndian
,
ReadBytesExt
,
WriteBytesExt
};
use
byteorder
::{
BigEndian
,
ReadBytesExt
,
WriteBytesExt
};
use
crate
::
openflow
::{
use
crate
::
openflow
::
ofp10
::{
ofp10
::{
events
::{
actions
::
SizeCheck
,
Action
},
events
::{
actions
::
SizeCheck
,
Action
},
ofp_port
::
OfpPort
,
ofp_port
::
OfpPort
,
Msg
,
PseudoPort
,
MessageMarshal
,
Msg
,
OfpMsgEvent
,
PseudoPort
,
},
traiter
::{
MessageMarshal
,
OfpMsgEvent
},
};
};
use
super
::{
FlowModCommand
,
MatchFields
};
use
super
::{
FlowModCommand
,
MatchFields
};
...
...
src/openflow/ofp10/events/hello.rs
View file @
490eb6e7
use
crate
::
openflow
::{
use
crate
::
openflow
::
ofp10
::{
MessageMarshal
,
Msg
,
OfpMsgEvent
};
ofp10
::
Msg
,
traiter
::{
MessageMarshal
,
OfpMsgEvent
},
};
pub
struct
HelloEvent
{}
pub
struct
HelloEvent
{}
...
...
src/openflow/ofp10/events/packet_out.rs
View file @
490eb6e7
...
@@ -3,11 +3,8 @@ use std::{
...
@@ -3,11 +3,8 @@ use std::{
mem
::
size_of
,
mem
::
size_of
,
};
};
use
crate
::
openflow
::
ofp10
::{
ofp_port
::
OfpPort
,
Msg
};
use
crate
::
openflow
::
ofp10
::
PseudoPort
;
use
crate
::
openflow
::{
use
crate
::
openflow
::
ofp10
::{
ofp_port
::
OfpPort
,
MessageMarshal
,
Msg
,
OfpMsgEvent
};
ofp10
::
PseudoPort
,
traiter
::{
MessageMarshal
,
OfpMsgEvent
},
};
use
byteorder
::{
BigEndian
,
ReadBytesExt
,
WriteBytesExt
};
use
byteorder
::{
BigEndian
,
ReadBytesExt
,
WriteBytesExt
};
use
super
::{
actions
::
SizeCheck
,
Action
,
Payload
};
use
super
::{
actions
::
SizeCheck
,
Action
,
Payload
};
...
...
src/openflow/ofp10/mod.rs
View file @
490eb6e7
...
@@ -15,3 +15,6 @@ pub use controller_frame::ControllerFrame10;
...
@@ -15,3 +15,6 @@ pub use controller_frame::ControllerFrame10;
pub
mod
tcp_listener
;
pub
mod
tcp_listener
;
pub
use
tcp_listener
::
tcp_listener_handler
;
pub
use
tcp_listener
::
tcp_listener_handler
;
pub
mod
traiter
;
pub
use
traiter
::{
MessageMarshal
,
OfpMsgEvent
,
OpenflowHeader
};
src/openflow/ofp10/ofp_header/ofp_header.rs
View file @
490eb6e7
use
crate
::
openflow
::
traiter
::
header_trait
::
OpenflowHeader
;
use
crate
::
openflow
::
ofp10
::
OpenflowHeader
;
pub
struct
OfpHeader
<
OFH
:
OpenflowHeader
>
{
pub
struct
OfpHeader
<
OFH
:
OpenflowHeader
>
{
ofp_header
:
OFH
,
ofp_header
:
OFH
,
...
...
src/openflow/ofp10/ofp_header/ofp_header_v1_0.rs
View file @
490eb6e7
use
byteorder
::{
BigEndian
,
ReadBytesExt
,
WriteBytesExt
};
use
byteorder
::{
BigEndian
,
ReadBytesExt
,
WriteBytesExt
};
use
std
::{
io
::
Cursor
,
mem
::
size_of
};
use
std
::{
io
::
Cursor
,
mem
::
size_of
};
use
crate
::
openflow
::
traiter
::
header_trait
::
OpenflowHeader
;
use
crate
::
openflow
::
ofp10
::
OpenflowHeader
;
pub
struct
OfpHeader10
{
pub
struct
OfpHeader10
{
pub
version
:
u8
,
pub
version
:
u8
,
...
...
src/openflow/ofp10/ofp_manager.rs
View file @
490eb6e7
use
super
::{
use
super
::{
events
::{
Action
,
FeaturesReqEvent
,
Payload
},
events
::{
Action
,
FeaturesReqEvent
,
Payload
},
ofp_header
::{
OfpHeader
,
OfpHeader10
},
ofp_header
::{
OfpHeader
,
OfpHeader10
},
HelloEvent
,
Msg
,
PacketOutEvent
,
HelloEvent
,
Msg
,
OfpMsgEvent
,
OpenflowHeader
,
PacketOutEvent
,
};
};
use
crate
::
openflow
::
traiter
::{
event_trait
::
OfpMsgEvent
,
header_trait
::
OpenflowHeader
};
pub
struct
Openflow10
{}
pub
struct
Openflow10
{}
...
...
src/openflow/ofp10/tcp_listener.rs
View file @
490eb6e7
use
crate
::
{
openflow
::
traiter
::
OfpMsgEvent
,
Controller
}
;
use
crate
::
Controller
;
use
std
::{
io
::
Read
,
net
::
TcpListener
,
thread
};
use
std
::{
io
::
Read
,
net
::
TcpListener
,
thread
};
use
crate
::
openflow
::
ofp10
::
HelloEvent
;
use
crate
::
openflow
::
ofp10
::
HelloEvent
;
use
super
::
ControllerFrame10
;
use
super
::
{
ControllerFrame10
,
OfpMsgEvent
}
;
pub
fn
tcp_listener_handler
(
address
:
&
str
)
{
pub
fn
tcp_listener_handler
(
address
:
&
str
)
{
let
listener
=
TcpListener
::
bind
(
address
)
.unwrap
();
let
listener
=
TcpListener
::
bind
(
address
)
.unwrap
();
...
...
src/openflow/traiter/event_trait.rs
→
src/openflow/
ofp10/
traiter/event_trait.rs
View file @
490eb6e7
File moved
src/openflow/traiter/header_trait.rs
→
src/openflow/
ofp10/
traiter/header_trait.rs
View file @
490eb6e7
File moved
src/openflow/traiter/mod.rs
→
src/openflow/
ofp10/
traiter/mod.rs
View file @
490eb6e7
File moved
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