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
2a1ef305
Commit
2a1ef305
authored
May 05, 2024
by
Nawasan Wisitsingkhon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create struct for openflow1.0
parent
0b80948b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
main.rs
src/main.rs
+3
-2
message.rs
src/openflow/message.rs
+9
-1
No files found.
src/main.rs
View file @
2a1ef305
use
std
::
io
::
Read
;
use
std
::
net
::
TcpListener
;
use
tenjin
::
openflow
::
events
::
packet_in
::
PacketInEvent
;
use
tenjin
::
openflow
::{
Controller
,
OfpMsg
,
OfpHeader
};
use
tenjin
::
openflow
::
message
::
Openflow10
;
use
tenjin
::
openflow
::{
Controller
,
OfpHeader
,
OfpMsg
};
extern
crate
byteorder
;
fn
main
()
->
Result
<
(),
std
::
io
::
Error
>
{
let
mut
controller
=
Controller
::
new
(
Controller
::
OFP_1_0
);
let
mut
controller
=
Controller
::
new
(
Openflow10
::
new
()
);
let
listener
=
TcpListener
::
bind
((
"127.0.0.1"
,
6633
))
.unwrap
();
let
mut
buf
=
vec!
[
0u8
;
8
];
...
...
src/openflow/message.rs
View file @
2a1ef305
...
...
@@ -14,7 +14,15 @@ pub enum OfpMsg {
NotFound
=
-
1
,
}
impl
OfpMsgEvent
for
OfpMsg
{
pub
struct
Openflow10
{}
impl
Openflow10
{
pub
fn
new
()
->
Self
{
Openflow10
{}
}
}
impl
OfpMsgEvent
for
Openflow10
{
fn
hello_event
(
&
self
)
->
HelloEvent
{
HelloEvent
::
new
()
}
...
...
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