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
04ef7b62
Commit
04ef7b62
authored
Jun 15, 2024
by
Nawasan Wisitsingkhon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change msg_usize: remove unneeded code
parent
f2d84128
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
19 additions
and
19 deletions
+19
-19
controller_frame.rs
src/openflow/ofp10/controller_frame.rs
+1
-1
echo_reply.rs
src/openflow/ofp10/events/echo_reply.rs
+1
-1
echo_request.rs
src/openflow/ofp10/events/echo_request.rs
+1
-1
error_handler.rs
src/openflow/ofp10/events/error/error_handler.rs
+3
-3
features_req.rs
src/openflow/ofp10/events/features_req.rs
+3
-3
flow_mod_handler.rs
src/openflow/ofp10/events/flow_mod/flow_mod_handler.rs
+3
-3
hello.rs
src/openflow/ofp10/events/hello.rs
+3
-3
packet_out.rs
src/openflow/ofp10/events/packet_out.rs
+3
-3
event_trait.rs
src/openflow/ofp10/traiter/event_trait.rs
+1
-1
No files found.
src/openflow/ofp10/controller_frame.rs
View file @
04ef7b62
...
@@ -55,7 +55,7 @@ pub trait ControllerFrame10 {
...
@@ -55,7 +55,7 @@ pub trait ControllerFrame10 {
let
mut
body_bytes
:
Vec
<
u8
>
=
Vec
::
new
();
let
mut
body_bytes
:
Vec
<
u8
>
=
Vec
::
new
();
msg
.marshal
(
&
mut
body_bytes
);
msg
.marshal
(
&
mut
body_bytes
);
let
ofp_header
=
ofp
.header
(
msg
.msg_usize
(
&
ofp
)
as
u8
,
body_bytes
.len
()
as
u16
,
xid
);
let
ofp_header
=
ofp
.header
(
msg
.msg_usize
()
as
u8
,
body_bytes
.len
()
as
u16
,
xid
);
ofp_header
.marshal
(
&
mut
header_bytes
);
ofp_header
.marshal
(
&
mut
header_bytes
);
header_bytes
.append
(
&
mut
body_bytes
);
header_bytes
.append
(
&
mut
body_bytes
);
let
_
=
stream
.write_all
(
&
header_bytes
);
let
_
=
stream
.write_all
(
&
header_bytes
);
...
...
src/openflow/ofp10/events/echo_reply.rs
View file @
04ef7b62
...
@@ -21,7 +21,7 @@ impl MessageMarshal for EchoReplyEvent {
...
@@ -21,7 +21,7 @@ impl MessageMarshal for EchoReplyEvent {
ofp10
::
Msg
::
EchoReply
ofp10
::
Msg
::
EchoReply
}
}
fn
msg_usize
<
OFP
:
ofp10
::
OfpMsgEvent
>
(
&
self
,
ofp
:
&
OFP
)
->
usize
{
fn
msg_usize
(
&
self
)
->
usize
{
ofp10
::
Msg
::
EchoReply
as
usize
ofp10
::
Msg
::
EchoReply
as
usize
}
}
...
...
src/openflow/ofp10/events/echo_request.rs
View file @
04ef7b62
...
@@ -21,7 +21,7 @@ impl MessageMarshal for EchoRequestEvent {
...
@@ -21,7 +21,7 @@ impl MessageMarshal for EchoRequestEvent {
Msg
::
EchoRequest
Msg
::
EchoRequest
}
}
fn
msg_usize
<
OFP
:
ofp10
::
OfpMsgEvent
>
(
&
self
,
_
:
&
OFP
)
->
usize
{
fn
msg_usize
(
&
self
)
->
usize
{
Msg
::
EchoRequest
as
usize
Msg
::
EchoRequest
as
usize
}
}
...
...
src/openflow/ofp10/events/error/error_handler.rs
View file @
04ef7b62
...
@@ -4,7 +4,7 @@ use std::{
...
@@ -4,7 +4,7 @@ use std::{
};
};
use
super
::
error_type
::
ErrorType
;
use
super
::
error_type
::
ErrorType
;
use
crate
::
openflow
::
ofp10
::{
MessageMarshal
,
Msg
,
OfpMsgEvent
};
use
crate
::
openflow
::
ofp10
::{
MessageMarshal
,
Msg
};
use
byteorder
::{
BigEndian
,
ReadBytesExt
};
use
byteorder
::{
BigEndian
,
ReadBytesExt
};
pub
struct
ErrorEvent
{
pub
struct
ErrorEvent
{
...
@@ -36,8 +36,8 @@ impl MessageMarshal for ErrorEvent {
...
@@ -36,8 +36,8 @@ impl MessageMarshal for ErrorEvent {
Msg
::
Error
Msg
::
Error
}
}
fn
msg_usize
<
OFP
:
OfpMsgEvent
>
(
&
self
,
ofp
:
&
OFP
)
->
usize
{
fn
msg_usize
(
&
self
)
->
usize
{
ofp
.msg_usize
(
Msg
::
Error
)
Msg
::
Error
as
usize
}
}
fn
size_of
(
&
self
)
->
usize
{
fn
size_of
(
&
self
)
->
usize
{
...
...
src/openflow/ofp10/events/features_req.rs
View file @
04ef7b62
use
crate
::
openflow
::
ofp10
::{
MessageMarshal
,
Msg
,
OfpMsgEvent
};
use
crate
::
openflow
::
ofp10
::{
MessageMarshal
,
Msg
};
pub
struct
FeaturesReqEvent
{}
pub
struct
FeaturesReqEvent
{}
...
@@ -19,7 +19,7 @@ impl MessageMarshal for FeaturesReqEvent {
...
@@ -19,7 +19,7 @@ impl MessageMarshal for FeaturesReqEvent {
0
0
}
}
fn
msg_usize
<
OFP
:
OfpMsgEvent
>
(
&
self
,
ofp
:
&
OFP
)
->
usize
{
fn
msg_usize
(
&
self
)
->
usize
{
ofp
.msg_usize
(
Msg
::
FeaturesRequest
)
Msg
::
FeaturesRequest
as
usize
}
}
}
}
src/openflow/ofp10/events/flow_mod/flow_mod_handler.rs
View file @
04ef7b62
...
@@ -5,7 +5,7 @@ use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
...
@@ -5,7 +5,7 @@ use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
use
crate
::
openflow
::
ofp10
::{
use
crate
::
openflow
::
ofp10
::{
events
::{
actions
::
SizeCheck
,
Action
},
events
::{
actions
::
SizeCheck
,
Action
},
ofp_port
::
OfpPort
,
ofp_port
::
OfpPort
,
MessageMarshal
,
Msg
,
OfpMsgEvent
,
PseudoPort
,
MessageMarshal
,
Msg
,
PseudoPort
,
};
};
use
super
::{
FlowModCommand
,
FlowModFlags
,
MatchFields
};
use
super
::{
FlowModCommand
,
FlowModFlags
,
MatchFields
};
...
@@ -96,8 +96,8 @@ impl FlowModEvent {
...
@@ -96,8 +96,8 @@ impl FlowModEvent {
}
}
impl
MessageMarshal
for
FlowModEvent
{
impl
MessageMarshal
for
FlowModEvent
{
fn
msg_usize
<
OFP
:
OfpMsgEvent
>
(
&
self
,
ofp
:
&
OFP
)
->
usize
{
fn
msg_usize
(
&
self
)
->
usize
{
ofp
.msg_usize
(
Msg
::
FlowMod
)
Msg
::
FlowMod
as
usize
}
}
fn
size_of
(
&
self
)
->
usize
{
fn
size_of
(
&
self
)
->
usize
{
24
24
...
...
src/openflow/ofp10/events/hello.rs
View file @
04ef7b62
use
crate
::
openflow
::
ofp10
::{
MessageMarshal
,
Msg
,
OfpMsgEvent
};
use
crate
::
openflow
::
ofp10
::{
MessageMarshal
,
Msg
};
pub
struct
HelloEvent
{}
pub
struct
HelloEvent
{}
...
@@ -19,7 +19,7 @@ impl MessageMarshal for HelloEvent {
...
@@ -19,7 +19,7 @@ impl MessageMarshal for HelloEvent {
0
0
}
}
fn
msg_usize
<
OFP
:
OfpMsgEvent
>
(
&
self
,
ofp
:
&
OFP
)
->
usize
{
fn
msg_usize
(
&
self
)
->
usize
{
ofp
.msg_usize
(
Msg
::
Hello
)
Msg
::
Hello
as
usize
}
}
}
}
src/openflow/ofp10/events/packet_out.rs
View file @
04ef7b62
...
@@ -4,7 +4,7 @@ use std::{
...
@@ -4,7 +4,7 @@ use std::{
};
};
use
crate
::
openflow
::
ofp10
::
PseudoPort
;
use
crate
::
openflow
::
ofp10
::
PseudoPort
;
use
crate
::
openflow
::
ofp10
::{
ofp_port
::
OfpPort
,
MessageMarshal
,
Msg
,
OfpMsgEvent
};
use
crate
::
openflow
::
ofp10
::{
ofp_port
::
OfpPort
,
MessageMarshal
,
Msg
};
use
byteorder
::{
BigEndian
,
ReadBytesExt
,
WriteBytesExt
};
use
byteorder
::{
BigEndian
,
ReadBytesExt
,
WriteBytesExt
};
use
super
::{
actions
::
SizeCheck
,
Action
,
Payload
};
use
super
::{
actions
::
SizeCheck
,
Action
,
Payload
};
...
@@ -40,8 +40,8 @@ impl MessageMarshal for PacketOutEvent {
...
@@ -40,8 +40,8 @@ impl MessageMarshal for PacketOutEvent {
Msg
::
PacketOut
Msg
::
PacketOut
}
}
fn
msg_usize
<
OFP
:
OfpMsgEvent
>
(
&
self
,
ofp
:
&
OFP
)
->
usize
{
fn
msg_usize
(
&
self
)
->
usize
{
ofp
.msg_usize
(
Msg
::
PacketOut
)
Msg
::
PacketOut
as
usize
}
}
fn
size_of
(
&
self
)
->
usize
{
fn
size_of
(
&
self
)
->
usize
{
...
...
src/openflow/ofp10/traiter/event_trait.rs
View file @
04ef7b62
...
@@ -11,7 +11,7 @@ use crate::openflow::ofp10::{
...
@@ -11,7 +11,7 @@ use crate::openflow::ofp10::{
pub
trait
MessageMarshal
{
pub
trait
MessageMarshal
{
fn
marshal
(
&
self
,
bytes
:
&
mut
Vec
<
u8
>
);
fn
marshal
(
&
self
,
bytes
:
&
mut
Vec
<
u8
>
);
fn
msg_code
(
&
self
)
->
Msg
;
fn
msg_code
(
&
self
)
->
Msg
;
fn
msg_usize
<
OFP
:
OfpMsgEvent
>
(
&
self
,
ofp
:
&
OFP
)
->
usize
;
fn
msg_usize
(
&
self
)
->
usize
;
fn
size_of
(
&
self
)
->
usize
;
fn
size_of
(
&
self
)
->
usize
;
}
}
...
...
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