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
b0041b32
Commit
b0041b32
authored
Aug 07, 2024
by
Nawasan Wisitsingkhon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change some cli and update readme
parent
bcdb310e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
10 deletions
+40
-10
Cargo.toml
Cargo.toml
+1
-0
README.md
README.md
+33
-5
cli_system.rs
src/cli/cli_system.rs
+6
-5
No files found.
Cargo.toml
View file @
b0041b32
...
@@ -8,6 +8,7 @@ edition = "2021"
...
@@ -8,6 +8,7 @@ edition = "2021"
readme
=
"README.md"
readme
=
"README.md"
repository
=
"https://github.com/Arikato111/Tenjin"
repository
=
"https://github.com/Arikato111/Tenjin"
categories
=
["command-line-utilities"]
categories
=
["command-line-utilities"]
keywords
=
[
"sdn"
,
"cli"
,
"openflow"
]
[lib]
[lib]
name
=
"tenjin"
name
=
"tenjin"
...
...
README.md
View file @
b0041b32
...
@@ -6,7 +6,37 @@ Software-defined networking with Rust.
...
@@ -6,7 +6,37 @@ Software-defined networking with Rust.
To understand The software-defined networking well, I trying to create a simple SDN with Rust language to support Openflow 1.0 first and 1.3 later.
To understand The software-defined networking well, I trying to create a simple SDN with Rust language to support Openflow 1.0 first and 1.3 later.
## Get started
## Run with command line
#### Run Controller by default (Controller13 with OpenFlow 1.3)
```
bash
tenjin run
```
#### Run Controller10 with Openflow 1.0
```
bash
tenjin run ctrl10
```
#### Run with specific port
```
bash
tenjin run
--port
6653
```
#### Show details of `run` command
```
bash
tenjin run
--help
```
## Run only Controller
You need to clone source code to your workspace and modify the code.
this code below is the example for run only Controller.
If you would like to modify Controller's code, it waiting for you at ./src/example/
### Openflow 1.3
### Openflow 1.3
...
@@ -16,10 +46,9 @@ To understand The software-defined networking well, I trying to create a simple
...
@@ -16,10 +46,9 @@ To understand The software-defined networking well, I trying to create a simple
use
tenjin
::{
example
,
openflow
::
ofp13
::
ControllerFrame13
};
use
tenjin
::{
example
,
openflow
::
ofp13
::
ControllerFrame13
};
extern
crate
byteorder
;
extern
crate
byteorder
;
fn
main
()
->
Result
<
(),
std
::
io
::
Error
>
{
fn
main
()
{
let
controller
=
example
::
Controller13
::
new
();
let
controller
=
example
::
Controller13
::
new
();
controller
.listener
(
"127.0.0.1:6633"
);
controller
.listener
(
"127.0.0.1:6633"
);
Ok
(())
}
}
```
```
...
@@ -43,10 +72,9 @@ import Controller10 into main func.
...
@@ -43,10 +72,9 @@ import Controller10 into main func.
use
tenjin
::{
example
,
openflow
::
ofp10
::
ControllerFrame10
};
use
tenjin
::{
example
,
openflow
::
ofp10
::
ControllerFrame10
};
extern
crate
byteorder
;
extern
crate
byteorder
;
fn
main
()
->
Result
<
(),
std
::
io
::
Error
>
{
fn
main
()
{
let
controller
=
example
::
Controller10
::
new
();
let
controller
=
example
::
Controller10
::
new
();
controller
.listener
(
"127.0.0.1:6633"
);
controller
.listener
(
"127.0.0.1:6633"
);
Ok
(())
}
}
```
```
...
...
src/cli/cli_system.rs
View file @
b0041b32
...
@@ -22,11 +22,12 @@ enum Commands {
...
@@ -22,11 +22,12 @@ enum Commands {
port
:
u16
,
port
:
u16
,
#[arg(
#[arg(
default_value
=
"127.0.0.1"
,
default_value
=
"127.0.0.1"
,
short
=
'a'
,
short
=
'l'
,
long
=
"address"
,
long
=
"listen"
,
value_name
=
"ADDRESS"
,
help
=
"ip address"
help
=
"ip address"
)]
)]
address
:
String
,
listen
:
String
,
},
},
}
}
...
@@ -44,9 +45,9 @@ pub fn system() {
...
@@ -44,9 +45,9 @@ pub fn system() {
Commands
::
Run
{
Commands
::
Run
{
controller
,
controller
,
port
,
port
,
address
,
listen
,
}
=>
{
}
=>
{
let
addr
=
format!
(
"{}:{}"
,
address
.as_str
(),
port
.to_string
());
let
addr
=
format!
(
"{}:{}"
,
listen
.as_str
(),
port
.to_string
());
match
controller
{
match
controller
{
Some
(
controller
)
=>
match
controller
{
Some
(
controller
)
=>
match
controller
{
Controllers
::
Ctrl13
=>
Controller13
::
new
()
.listener
(
&
addr
),
Controllers
::
Ctrl13
=>
Controller13
::
new
()
.listener
(
&
addr
),
...
...
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