diff --git a/nucleus/controller.go b/nucleus/controller.go index c396048c3eca069a21648cadfa43fc60ffbeb880..b35703203877512934e3d823f910d03e5995b1b1 100644 --- a/nucleus/controller.go +++ b/nucleus/controller.go @@ -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 diff --git a/nucleus/nucleus-core.go b/nucleus/nucleus-core.go index 48d452a45b110e9ad056fcfe554464470ae66dd0..2b4de231c4ea14bf13469ad30dcc7b0e6a61d4e6 100644 --- a/nucleus/nucleus-core.go +++ b/nucleus/nucleus-core.go @@ -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") } diff --git a/nucleus/root.go b/nucleus/root.go index b555b2c1c7386b61ca32fa82056a338fcc3f7055..acb8fff77fe09f75334d181de99cbede95780fbf 100644 --- a/nucleus/root.go +++ b/nucleus/root.go @@ -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() }, }