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
2a065fef
Commit
2a065fef
authored
Jul 26, 2024
by
Nawasan Wisitsingkhon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add switch_fatures to controller13
parent
fec3d6cb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
ctrl13.rs
src/example/ctrl13.rs
+18
-0
features_reply.rs
src/openflow/ofp13/events/features_reply.rs
+2
-1
No files found.
src/example/ctrl13.rs
View file @
2a065fef
...
...
@@ -30,6 +30,24 @@ impl ControllerFrame13 for Controller13 {
/**
* Start here for handle packetIn message.
*/
fn
switch_features_handler
(
&
self
,
xid
:
u32
,
features_reply
:
ofp13
::
FeaturesReplyEvent
,
stream
:
&
mut
TcpStream
,
)
{
let
matchs
=
MatchFields
::
match_all
();
let
actions
=
vec!
[
Action
::
Oputput
(
ofp13
::
PseudoPort
::
Controller
(
!
0
))];
self
.add_flow
(
xid
,
0
,
matchs
,
&
actions
,
features_reply
.n_tables
,
Some
(
features_reply
.n_buffers
),
stream
,
)
}
fn
packet_in_handler
(
&
mut
self
,
xid
:
u32
,
packetin
:
PacketInEvent
,
stream
:
&
mut
TcpStream
)
{
let
pkt
=
match
packetin
.ether_parse
()
{
Ok
(
pkt
)
=>
pkt
,
...
...
src/openflow/ofp13/events/features_reply.rs
View file @
2a065fef
use
std
::
io
::{
Cursor
,
Error
};
use
std
::
io
::{
BufRead
,
Cursor
,
Error
};
use
byteorder
::{
BigEndian
,
ReadBytesExt
};
...
...
@@ -19,6 +19,7 @@ impl FeaturesReplyEvent {
let
n_buffers
=
bytes
.read_u32
::
<
BigEndian
>
()
?
;
let
n_tables
=
bytes
.read_u8
()
?
;
let
auxiliary
=
bytes
.read_u8
()
?
;
bytes
.consume
(
2
);
let
capabilities
:
Capabilities
=
bytes
.read_u32
::
<
BigEndian
>
()
?
.into
();
let
reserved
=
bytes
.read_u32
::
<
BigEndian
>
()
?
;
Ok
(
Self
{
...
...
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