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
No related branches found
No related tags found
1 merge request!9First gosdn code
......@@ -2,28 +2,29 @@ package nucleus
import (
"fmt"
"github.com/openconfig/ygot/ygot"
"net"
gosdn "project-beachhead/goSDN"
)
func AssembleJSON() {
// Build my device
d := &gosdn.Device{}
//d := &gosdn.Device{}
interfaces, _ := net.Interfaces()
for _, iface := range interfaces {
fmt.Println(iface.Name)
/*
i, err := d.NewInterface(iface.Name)
if err != nil {
panic(err)
}
i.Mtu = ygot.Uint16(234)
//i.Mtu = ygot.Uint16(iface.MTU)
*/
}
// EmitJSON from the ygot library directly does .Validate() and outputs JSON in
// the specified format.
/*
json, err := ygot.EmitJSON(d, &ygot.EmitJSONConfig{
Format: ygot.RFC7951,
Indent: " ",
......@@ -34,5 +35,5 @@ func AssembleJSON() {
if err != nil {
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 (
"log"
"net"
pb "project-beachhead/grpc_interface"
sbiPcap "project-beachhead/southbound-interfaces"
"time"
)
......@@ -56,10 +55,8 @@ func StartUp() {
log.Println("Starting my ducks")
go getCLIGoing()
// controller.AssembleJSON()
AssembleJSON()
// Bootup the pcap interface
sbiPcap.GetPCAPGoing()
log.Println("and ready for take off")
}
......
......@@ -4,7 +4,6 @@ import (
"fmt"
"github.com/spf13/cobra"
"os"
"project-beachhead/nucleus"
)
......@@ -14,7 +13,7 @@ func init() {
var versionCmd = &cobra.Command{
Use: "version",
Short: "Print the version number of beachhead",
Short: "Print the version number of goSDN",
Long: `A version is a version.`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("Beachead -- unkown HEAD")
......@@ -27,8 +26,8 @@ var rootCmd = &cobra.Command{
Long: "Incomplete network operating system. Complete documentation is available at XXX",
Run: func(cmd *cobra.Command, args []string) {
// Do Stuff Here
nucleus.StartUp()
nucleus.Run()
StartUp()
Run()
},
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment