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
937468b3
Commit
937468b3
authored
May 08, 2024
by
Nawasan Wisitsingkhon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change folder name of message to ofp_manager
parent
f34edd49
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
15 additions
and
11 deletions
+15
-11
controller_frame.rs
src/openflow/controller_frame.rs
+4
-5
features_req.rs
src/openflow/events/features_req.rs
+1
-1
flow_mod_handler.rs
src/openflow/events/flow_mod/flow_mod_handler.rs
+1
-1
hello.rs
src/openflow/events/hello.rs
+1
-1
mod.rs
src/openflow/mod.rs
+3
-2
macro_selector.rs
src/openflow/ofp_manager/macro_selector.rs
+0
-0
mod.rs
src/openflow/ofp_manager/mod.rs
+0
-0
ofp_message.rs
src/openflow/ofp_manager/ofp_message.rs
+0
-0
ofp_v1_0.rs
src/openflow/ofp_manager/ofp_v1_0.rs
+3
-0
traiter.rs
src/openflow/ofp_manager/traiter.rs
+1
-0
tcp_listener.rs
src/openflow/tcp_listener.rs
+1
-1
No files found.
src/openflow/controller_frame.rs
View file @
937468b3
...
...
@@ -5,25 +5,25 @@ use std::{
use
super
::{
events
::
PacketInEvent
,
messages
::{
ofp_manager
::{
traiter
::{
MessageMarshal
,
OfpMsgEvent
},
OfpMsg
,
},
tcp_listener_handler
,
OfpHeader
,
tcp_listener_handler
,
};
pub
trait
ControllerFrame
<
OME
:
OfpMsgEvent
>
{
fn
get_ofp
(
&
self
)
->
&
impl
OfpMsgEvent
;
fn
packet_in_handler
(
&
mut
self
,
xid
:
u32
,
packetin
:
PacketInEvent
,
stream
:
&
mut
TcpStream
);
fn
new
(
ofp
:
OME
)
->
Self
;
fn
listener
(
address
:
&
str
,
ofp
:
OME
)
{
tcp_listener_handler
::
<
OME
>
(
address
,
ofp
.version
()
as
u8
);
}
fn
request_handler
(
&
mut
self
,
buf
:
&
mut
Vec
<
u8
>
,
stream
:
&
mut
TcpStream
)
{
let
ofp
=
self
.get_ofp
();
let
ofp_header
=
OfpHeader
::
parse
(
&
buf
);
let
ofp_header
=
ofp
.header_
parse
(
&
buf
);
let
mut
payload
=
vec!
[
0u8
;
ofp_header
.pkt_size
()];
let
_
=
stream
.read
(
&
mut
payload
);
let
message
=
ofp
.msg_parse
(
ofp_header
.message
as
u16
);
...
...
@@ -50,4 +50,3 @@ pub trait ControllerFrame<OME: OfpMsgEvent> {
let
_
=
stream
.write_all
(
&
header_bytes
);
}
}
src/openflow/events/features_req.rs
View file @
937468b3
use
crate
::
openflow
::
messages
::{
MessageMarshal
,
OfpMsg
,
OfpMsgEvent
};
use
crate
::
openflow
::
ofp_manager
::{
MessageMarshal
,
OfpMsg
,
OfpMsgEvent
};
pub
struct
FeaturesReq
{}
...
...
src/openflow/events/flow_mod/flow_mod_handler.rs
View file @
937468b3
...
...
@@ -3,7 +3,7 @@ use std::io::Cursor;
use
byteorder
::{
BigEndian
,
ReadBytesExt
,
WriteBytesExt
};
use
crate
::
openflow
::{
messages
::{
MessageMarshal
,
OfpMsg
,
OfpMsgEvent
},
ofp_manager
::{
MessageMarshal
,
OfpMsg
,
OfpMsgEvent
},
OfpPort
,
PseudoPort
,
};
...
...
src/openflow/events/hello.rs
View file @
937468b3
use
crate
::
openflow
::
messages
::{
MessageMarshal
,
OfpMsg
};
use
crate
::
openflow
::
ofp_manager
::{
MessageMarshal
,
OfpMsg
};
use
crate
::
openflow
::
traiter
::
OfpMsgEvent
;
pub
struct
HelloEvent
{}
...
...
src/openflow/mod.rs
View file @
937468b3
...
...
@@ -8,8 +8,8 @@ pub mod events;
pub
mod
ofp_port
;
pub
use
ofp_port
::{
OfpPort
,
PseudoPort
};
pub
mod
messages
;
pub
use
messages
::{
ofp_v1_0
,
traiter
};
pub
mod
ofp_manager
;
pub
use
ofp_manager
::{
ofp_v1_0
,
traiter
};
pub
mod
tcp_listener
;
pub
use
tcp_listener
::
tcp_listener_handler
;
\ No newline at end of file
src/openflow/
messages
/macro_selector.rs
→
src/openflow/
ofp_manager
/macro_selector.rs
View file @
937468b3
File moved
src/openflow/
messages
/mod.rs
→
src/openflow/
ofp_manager
/mod.rs
View file @
937468b3
File moved
src/openflow/
messages
/ofp_message.rs
→
src/openflow/
ofp_manager
/ofp_message.rs
View file @
937468b3
File moved
src/openflow/
messages
/ofp_v1_0.rs
→
src/openflow/
ofp_manager
/ofp_v1_0.rs
View file @
937468b3
...
...
@@ -15,6 +15,9 @@ impl Openflow10 {
}
impl
OfpMsgEvent
for
Openflow10
{
fn
header_parse
(
&
self
,
bytes
:
&
Vec
<
u8
>
)
->
OfpHeader
{
OfpHeader
::
parse
(
bytes
)
}
fn
header_size
(
&
self
)
->
usize
{
8
}
...
...
src/openflow/
messages
/traiter.rs
→
src/openflow/
ofp_manager
/traiter.rs
View file @
937468b3
...
...
@@ -24,6 +24,7 @@ pub trait OfpMsgEvent {
fn
version
(
&
self
)
->
usize
;
fn
ofp_version
()
->
usize
;
fn
header_size
(
&
self
)
->
usize
;
fn
header_parse
(
&
self
,
bytes
:
&
Vec
<
u8
>
)
->
OfpHeader
;
fn
msg_usize
(
&
self
,
msg
:
OfpMsg
)
->
usize
;
fn
msg_parse
(
&
self
,
msg
:
u16
)
->
OfpMsg
;
...
...
src/openflow/tcp_listener.rs
View file @
937468b3
use
crate
::
openflow
::{
messages
::
Openflow10
,
traiter
::
OfpMsgEvent
};
use
crate
::
openflow
::{
ofp_manager
::
Openflow10
,
traiter
::
OfpMsgEvent
};
use
crate
::{
ofp_from_version
,
Controller
};
use
std
::
sync
::{
Arc
,
Mutex
};
use
std
::{
io
::
Read
,
net
::
TcpListener
,
thread
};
...
...
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