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
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
27 additions
and
48 deletions
+27
-48
controller.rs
src/controller.rs
+5
-8
mod.rs
src/openflow/mod.rs
+2
-3
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
+4
-7
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
+4
-2
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};
use
crate
::{
etherparser
::
ether_type
::
EtherType
,
openflow
::{
ofp10
::{
self
,
events
::{
flow_mod
::
MatchFields
,
Action
},
ofp_manager
::
Openflow10
,
ControllerFrame10
,
FlowModEvent
,
PacketInEvent
,
},
traiter
::
OfpMsgEvent
,
openflow
::
ofp10
::{
self
,
events
::{
flow_mod
::
MatchFields
,
Action
},
ofp_manager
::
Openflow10
,
ControllerFrame10
,
FlowModEvent
,
OfpMsgEvent
,
PacketInEvent
,
},
};
/**
...
...
src/openflow/mod.rs
View file @
490eb6e7
pub
mod
ofp10
;
pub
mod
traiter
;
\ No newline at end of file
pub
mod
ofp10
;
\ No newline at end of file
src/openflow/ofp10/controller_frame.rs
View file @
490eb6e7
use
crate
::
openflow
::{
ofp10
::{
ErrorEvent
,
Msg
,
PacketInEvent
},
traiter
::{
MessageMarshal
,
OfpMsgEvent
},
};
use
crate
::
openflow
::
ofp10
::{
ErrorEvent
,
Msg
,
PacketInEvent
};
use
std
::{
io
::{
Read
,
Write
},
net
::
TcpStream
,
};
use
super
::
tcp_listener_handler
;
use
super
::
{
tcp_listener_handler
,
MessageMarshal
,
OfpMsgEvent
}
;
pub
trait
ControllerFrame10
{
fn
get_ofp
(
&
self
)
->
&
impl
OfpMsgEvent
;
...
...
src/openflow/ofp10/events/error/error_handler.rs
View file @
490eb6e7
...
...
@@ -4,10 +4,7 @@ use std::{
};
use
super
::
error_type
::
ErrorType
;
use
crate
::
openflow
::{
ofp10
::
Msg
,
traiter
::{
MessageMarshal
,
OfpMsgEvent
},
};
use
crate
::
openflow
::
ofp10
::{
MessageMarshal
,
Msg
,
OfpMsgEvent
};
use
byteorder
::{
BigEndian
,
ReadBytesExt
};
pub
struct
ErrorEvent
{
...
...
src/openflow/ofp10/events/features_req.rs
View file @
490eb6e7
use
crate
::
openflow
::{
ofp10
::
Msg
,
traiter
::{
MessageMarshal
,
OfpMsgEvent
},
};
use
crate
::
openflow
::
ofp10
::{
MessageMarshal
,
Msg
,
OfpMsgEvent
};
pub
struct
FeaturesReqEvent
{}
...
...
src/openflow/ofp10/events/flow_mod/flow_mod_handler.rs
View file @
490eb6e7
...
...
@@ -2,13 +2,10 @@ use std::io::Cursor;
use
byteorder
::{
BigEndian
,
ReadBytesExt
,
WriteBytesExt
};
use
crate
::
openflow
::{
ofp10
::{
events
::{
actions
::
SizeCheck
,
Action
},
ofp_port
::
OfpPort
,
Msg
,
PseudoPort
,
},
traiter
::{
MessageMarshal
,
OfpMsgEvent
},
use
crate
::
openflow
::
ofp10
::{
events
::{
actions
::
SizeCheck
,
Action
},
ofp_port
::
OfpPort
,
MessageMarshal
,
Msg
,
OfpMsgEvent
,
PseudoPort
,
};
use
super
::{
FlowModCommand
,
MatchFields
};
...
...
src/openflow/ofp10/events/hello.rs
View file @
490eb6e7
use
crate
::
openflow
::{
ofp10
::
Msg
,
traiter
::{
MessageMarshal
,
OfpMsgEvent
},
};
use
crate
::
openflow
::
ofp10
::{
MessageMarshal
,
Msg
,
OfpMsgEvent
};
pub
struct
HelloEvent
{}
...
...
src/openflow/ofp10/events/packet_out.rs
View file @
490eb6e7
...
...
@@ -3,11 +3,8 @@ use std::{
mem
::
size_of
,
};
use
crate
::
openflow
::
ofp10
::{
ofp_port
::
OfpPort
,
Msg
};
use
crate
::
openflow
::{
ofp10
::
PseudoPort
,
traiter
::{
MessageMarshal
,
OfpMsgEvent
},
};
use
crate
::
openflow
::
ofp10
::
PseudoPort
;
use
crate
::
openflow
::
ofp10
::{
ofp_port
::
OfpPort
,
MessageMarshal
,
Msg
,
OfpMsgEvent
};
use
byteorder
::{
BigEndian
,
ReadBytesExt
,
WriteBytesExt
};
use
super
::{
actions
::
SizeCheck
,
Action
,
Payload
};
...
...
src/openflow/ofp10/mod.rs
View file @
490eb6e7
...
...
@@ -14,4 +14,7 @@ pub mod controller_frame;
pub
use
controller_frame
::
ControllerFrame10
;
pub
mod
tcp_listener
;
pub
use
tcp_listener
::
tcp_listener_handler
;
\ No newline at end of file
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
>
{
ofp_header
:
OFH
,
...
...
src/openflow/ofp10/ofp_header/ofp_header_v1_0.rs
View file @
490eb6e7
use
byteorder
::{
BigEndian
,
ReadBytesExt
,
WriteBytesExt
};
use
std
::{
io
::
Cursor
,
mem
::
size_of
};
use
crate
::
openflow
::
traiter
::
header_trait
::
OpenflowHeader
;
use
crate
::
openflow
::
ofp10
::
OpenflowHeader
;
pub
struct
OfpHeader10
{
pub
version
:
u8
,
...
...
src/openflow/ofp10/ofp_manager.rs
View file @
490eb6e7
use
super
::{
events
::{
Action
,
FeaturesReqEvent
,
Payload
},
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
{}
...
...
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
crate
::
openflow
::
ofp10
::
HelloEvent
;
use
super
::
ControllerFrame10
;
use
super
::
{
ControllerFrame10
,
OfpMsgEvent
}
;
pub
fn
tcp_listener_handler
(
address
:
&
str
)
{
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