mirror of
				https://github.com/luscis/openlan.git
				synced 2025-10-31 12:36:26 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			29 lines
		
	
	
		
			556 B
		
	
	
	
		
			Go
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			556 B
		
	
	
	
		
			Go
		
	
	
		
			Executable File
		
	
	
	
	
| package main
 | |
| 
 | |
| import (
 | |
| 	"log"
 | |
| 
 | |
| 	"github.com/luscis/openlan/cmd/api"
 | |
| 	"github.com/luscis/openlan/pkg/cache"
 | |
| 	"github.com/luscis/openlan/pkg/config"
 | |
| 	"github.com/luscis/openlan/pkg/libol"
 | |
| 	"github.com/luscis/openlan/pkg/switch"
 | |
| )
 | |
| 
 | |
| func main() {
 | |
| 	log.SetFlags(0)
 | |
| 	udp := api.GetEnv("ESPUDP", "4500")
 | |
| 	config.SetLocalUdp(udp)
 | |
| 	c := config.NewSwitch()
 | |
| 	libol.SetLogger(c.Log.File, c.Log.Verbose)
 | |
| 	libol.Debug("main %s", c)
 | |
| 	cache.Init(&c.Perf)
 | |
| 	s := cswitch.NewSwitch(c)
 | |
| 	libol.PreNotify()
 | |
| 	s.Initialize()
 | |
| 	s.Start()
 | |
| 	libol.SdNotify()
 | |
| 	libol.Wait()
 | |
| 	s.Stop()
 | |
| }
 | 
