Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
goSDN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
danet
goSDN
Commits
fa53225c
Commit
fa53225c
authored
4 years ago
by
Martin Stiemerling
Browse files
Options
Downloads
Patches
Plain Diff
more cleaning -- not ready yet
parent
3e6e0ede
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!9
First gosdn code
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
nucleus/controller.go
+5
-4
5 additions, 4 deletions
nucleus/controller.go
nucleus/nucleus-core.go
+1
-4
1 addition, 4 deletions
nucleus/nucleus-core.go
nucleus/root.go
+3
-4
3 additions, 4 deletions
nucleus/root.go
with
9 additions
and
12 deletions
nucleus/controller.go
+
5
−
4
View file @
fa53225c
...
@@ -2,28 +2,29 @@ package nucleus
...
@@ -2,28 +2,29 @@ package nucleus
import
(
import
(
"fmt"
"fmt"
"github.com/openconfig/ygot/ygot"
"net"
"net"
gosdn
"project-beachhead/goSDN"
)
)
func
AssembleJSON
()
{
func
AssembleJSON
()
{
// Build my device
// Build my device
d
:=
&
gosdn
.
Device
{}
//
d := &gosdn.Device{}
interfaces
,
_
:=
net
.
Interfaces
()
interfaces
,
_
:=
net
.
Interfaces
()
for
_
,
iface
:=
range
interfaces
{
for
_
,
iface
:=
range
interfaces
{
fmt
.
Println
(
iface
.
Name
)
fmt
.
Println
(
iface
.
Name
)
/*
i, err := d.NewInterface(iface.Name)
i, err := d.NewInterface(iface.Name)
if err != nil {
if err != nil {
panic(err)
panic(err)
}
}
i.Mtu = ygot.Uint16(234)
i.Mtu = ygot.Uint16(234)
//i.Mtu = ygot.Uint16(iface.MTU)
//i.Mtu = ygot.Uint16(iface.MTU)
*/
}
}
// EmitJSON from the ygot library directly does .Validate() and outputs JSON in
// EmitJSON from the ygot library directly does .Validate() and outputs JSON in
// the specified format.
// the specified format.
/*
json, err := ygot.EmitJSON(d, &ygot.EmitJSONConfig{
json, err := ygot.EmitJSON(d, &ygot.EmitJSONConfig{
Format: ygot.RFC7951,
Format: ygot.RFC7951,
Indent: " ",
Indent: " ",
...
@@ -34,5 +35,5 @@ func AssembleJSON() {
...
@@ -34,5 +35,5 @@ func AssembleJSON() {
if err != nil {
if err != nil {
panic(fmt.Sprintf("JSON demo error: %v", err))
panic(fmt.Sprintf("JSON demo error: %v", err))
}
}
fmt
.
Println
(
json
)
fmt.Println(json)
*/
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
nucleus/nucleus-core.go
+
1
−
4
View file @
fa53225c
...
@@ -7,7 +7,6 @@ import (
...
@@ -7,7 +7,6 @@ import (
"log"
"log"
"net"
"net"
pb
"project-beachhead/grpc_interface"
pb
"project-beachhead/grpc_interface"
sbiPcap
"project-beachhead/southbound-interfaces"
"time"
"time"
)
)
...
@@ -56,10 +55,8 @@ func StartUp() {
...
@@ -56,10 +55,8 @@ func StartUp() {
log
.
Println
(
"Starting my ducks"
)
log
.
Println
(
"Starting my ducks"
)
go
getCLIGoing
()
go
getCLIGoing
()
// controller.
AssembleJSON()
AssembleJSON
()
// Bootup the pcap interface
sbiPcap
.
GetPCAPGoing
()
log
.
Println
(
"and ready for take off"
)
log
.
Println
(
"and ready for take off"
)
}
}
...
...
This diff is collapsed.
Click to expand it.
nucleus/root.go
+
3
−
4
View file @
fa53225c
...
@@ -4,7 +4,6 @@ import (
...
@@ -4,7 +4,6 @@ import (
"fmt"
"fmt"
"github.com/spf13/cobra"
"github.com/spf13/cobra"
"os"
"os"
"project-beachhead/nucleus"
)
)
...
@@ -14,7 +13,7 @@ func init() {
...
@@ -14,7 +13,7 @@ func init() {
var
versionCmd
=
&
cobra
.
Command
{
var
versionCmd
=
&
cobra
.
Command
{
Use
:
"version"
,
Use
:
"version"
,
Short
:
"Print the version number of
beachhead
"
,
Short
:
"Print the version number of
goSDN
"
,
Long
:
`A version is a version.`
,
Long
:
`A version is a version.`
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
fmt
.
Println
(
"Beachead -- unkown HEAD"
)
fmt
.
Println
(
"Beachead -- unkown HEAD"
)
...
@@ -27,8 +26,8 @@ var rootCmd = &cobra.Command{
...
@@ -27,8 +26,8 @@ var rootCmd = &cobra.Command{
Long
:
"Incomplete network operating system. Complete documentation is available at XXX"
,
Long
:
"Incomplete network operating system. Complete documentation is available at XXX"
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
// Do Stuff Here
// Do Stuff Here
nucleus
.
StartUp
()
StartUp
()
nucleus
.
Run
()
Run
()
},
},
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment