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
fec3d6cb
Commit
fec3d6cb
authored
Jul 26, 2024
by
Nawasan Wisitsingkhon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create handle features reply
parent
c5a87ff1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
controller_frame.rs
src/openflow/ofp13/controller_frame.rs
+13
-3
features_reply.rs
src/openflow/ofp13/events/features_reply.rs
+1
-1
No files found.
src/openflow/ofp13/controller_frame.rs
View file @
fec3d6cb
...
@@ -6,7 +6,8 @@ use std::{
...
@@ -6,7 +6,8 @@ use std::{
use
super
::{
use
super
::{
events
::{
echo_reply
::
EchoReplyEvent
,
EchoRequestEvent
},
events
::{
echo_reply
::
EchoReplyEvent
,
EchoRequestEvent
},
tcp_listener_handler
,
MessageMarshal
,
OfpMsgEvent
,
Openflow13
,
OpenflowHeader
,
tcp_listener_handler
,
FeaturesReplyEvent
,
MessageMarshal
,
OfpMsgEvent
,
Openflow13
,
OpenflowHeader
,
};
};
pub
trait
ControllerFrame13
pub
trait
ControllerFrame13
...
@@ -55,7 +56,10 @@ where
...
@@ -55,7 +56,10 @@ where
Msg
::
EchoRequest
=>
{
Msg
::
EchoRequest
=>
{
self
.echo_request_handler
(
xid
,
EchoRequestEvent
::
new
(
payload
),
stream
)
self
.echo_request_handler
(
xid
,
EchoRequestEvent
::
new
(
payload
),
stream
)
}
}
Msg
::
FeaturesReply
=>
{}
Msg
::
FeaturesReply
=>
match
FeaturesReplyEvent
::
parse
(
&
payload
)
{
Ok
(
features
)
=>
self
.switch_features_handler
(
xid
,
features
,
stream
),
Err
(
_
)
=>
(),
},
Msg
::
PacketIn
=>
match
PacketInEvent
::
parse
(
&
payload
)
{
Msg
::
PacketIn
=>
match
PacketInEvent
::
parse
(
&
payload
)
{
Ok
(
pkt_in
)
=>
self
.packet_in_handler
(
xid
,
pkt_in
,
stream
),
Ok
(
pkt_in
)
=>
self
.packet_in_handler
(
xid
,
pkt_in
,
stream
),
Err
(
_
)
=>
(),
Err
(
_
)
=>
(),
...
@@ -88,5 +92,11 @@ where
...
@@ -88,5 +92,11 @@ where
fn
echo_request_handler
(
&
self
,
xid
:
u32
,
echo
:
EchoRequestEvent
,
stream
:
&
mut
TcpStream
)
{
fn
echo_request_handler
(
&
self
,
xid
:
u32
,
echo
:
EchoRequestEvent
,
stream
:
&
mut
TcpStream
)
{
self
.send_msg
(
EchoReplyEvent
::
new
(
echo
.payload
),
xid
,
stream
);
self
.send_msg
(
EchoReplyEvent
::
new
(
echo
.payload
),
xid
,
stream
);
}
}
fn
switch_features_handler
(
&
self
)
{}
fn
switch_features_handler
(
&
self
,
xid
:
u32
,
features_reply
:
FeaturesReplyEvent
,
stream
:
&
mut
TcpStream
,
)
{
}
}
}
src/openflow/ofp13/events/features_reply.rs
View file @
fec3d6cb
...
@@ -13,7 +13,7 @@ pub struct FeaturesReplyEvent {
...
@@ -13,7 +13,7 @@ pub struct FeaturesReplyEvent {
}
}
impl
FeaturesReplyEvent
{
impl
FeaturesReplyEvent
{
pub
fn
parse
(
bytes
:
&
mut
Vec
<
u8
>
)
->
Result
<
Self
,
Error
>
{
pub
fn
parse
(
bytes
:
&
Vec
<
u8
>
)
->
Result
<
Self
,
Error
>
{
let
mut
bytes
=
Cursor
::
new
(
bytes
);
let
mut
bytes
=
Cursor
::
new
(
bytes
);
let
datapath_id
=
bytes
.read_u64
::
<
BigEndian
>
()
?
;
let
datapath_id
=
bytes
.read_u64
::
<
BigEndian
>
()
?
;
let
n_buffers
=
bytes
.read_u32
::
<
BigEndian
>
()
?
;
let
n_buffers
=
bytes
.read_u32
::
<
BigEndian
>
()
?
;
...
...
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