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
78cf45a2
Commit
78cf45a2
authored
May 12, 2024
by
Nawasan Wisitsingkhon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add packet_out to ofp trait and ofp v1.0
parent
5e3ca5f4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
packet_out.rs
src/openflow/events/packet_out.rs
+7
-0
ofp_v1_0.rs
src/openflow/ofp_manager/ofp_v1_0.rs
+9
-1
traiter.rs
src/openflow/ofp_manager/traiter.rs
+2
-1
No files found.
src/openflow/events/packet_out.rs
View file @
78cf45a2
...
@@ -13,6 +13,13 @@ pub struct PacketOutEvent {
...
@@ -13,6 +13,13 @@ pub struct PacketOutEvent {
}
}
impl
PacketOutEvent
{
impl
PacketOutEvent
{
pub
fn
new
(
port_id
:
Option
<
u16
>
,
payload
:
Payload
,
actions
:
Vec
<
FlowAction
>
)
->
Self
{
Self
{
port_id
,
payload
,
actions
,
}
}
pub
fn
parse
(
buf
:
&
Vec
<
u8
>
)
->
Self
{
pub
fn
parse
(
buf
:
&
Vec
<
u8
>
)
->
Self
{
let
mut
bytes
=
Cursor
::
new
(
buf
);
let
mut
bytes
=
Cursor
::
new
(
buf
);
let
buf_id
=
match
bytes
let
buf_id
=
match
bytes
...
...
src/openflow/ofp_manager/ofp_v1_0.rs
View file @
78cf45a2
use
crate
::
openflow
::{
use
crate
::
openflow
::{
events
::{
FeaturesReq
,
HelloEvent
},
events
::{
FeaturesReq
,
FlowAction
,
HelloEvent
,
PacketOutEvent
,
Payload
},
ofp_header
::{
OfpHeader10
,
OpenflowHeader
},
ofp_header
::{
OfpHeader10
,
OpenflowHeader
},
OfpHeader
,
OfpHeader
,
};
};
...
@@ -29,6 +29,14 @@ impl OfpMsgEvent for Openflow10 {
...
@@ -29,6 +29,14 @@ impl OfpMsgEvent for Openflow10 {
fn
fetures_req
(
&
self
)
->
FeaturesReq
{
fn
fetures_req
(
&
self
)
->
FeaturesReq
{
FeaturesReq
::
new
()
FeaturesReq
::
new
()
}
}
fn
packet_out
(
&
self
,
port_id
:
Option
<
u16
>
,
payload
:
Payload
,
actions
:
Vec
<
FlowAction
>
,
)
->
PacketOutEvent
{
PacketOutEvent
::
new
(
port_id
,
payload
,
actions
)
}
fn
ofp_version
()
->
usize
{
fn
ofp_version
()
->
usize
{
1
1
}
}
...
...
src/openflow/ofp_manager/traiter.rs
View file @
78cf45a2
use
crate
::
openflow
::{
use
crate
::
openflow
::{
events
::{
FeaturesReq
,
HelloEvent
},
events
::{
FeaturesReq
,
FlowAction
,
HelloEvent
,
PacketOutEvent
,
Payload
},
ofp_header
::
OpenflowHeader
,
ofp_header
::
OpenflowHeader
,
OfpHeader
,
OfpHeader
,
};
};
...
@@ -31,4 +31,5 @@ pub trait OfpMsgEvent {
...
@@ -31,4 +31,5 @@ pub trait OfpMsgEvent {
fn
msg_parse
(
&
self
,
msg
:
u16
)
->
OfpMsg
;
fn
msg_parse
(
&
self
,
msg
:
u16
)
->
OfpMsg
;
fn
hello_event
(
&
self
)
->
HelloEvent
;
fn
hello_event
(
&
self
)
->
HelloEvent
;
fn
fetures_req
(
&
self
)
->
FeaturesReq
;
fn
fetures_req
(
&
self
)
->
FeaturesReq
;
fn
packet_out
(
&
self
,
port_id
:
Option
<
u16
>
,
payload
:
Payload
,
actions
:
Vec
<
FlowAction
>
)
->
PacketOutEvent
;
}
}
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