Skip to content
Snippets Groups Projects
Commit fa53225c authored by Martin Stiemerling's avatar Martin Stiemerling
Browse files

more cleaning -- not ready yet

parent 3e6e0ede
Branches
Tags
1 merge request!9First gosdn code
...@@ -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
...@@ -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")
} }
......
...@@ -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()
}, },
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment