Documentation
¶
Index ¶
- func ParseRoutes(routeStrings []string) ([]net.IPNet, error)
- func ReadMessage(r io.Reader) ([]byte, error)
- func WriteMessage(w io.Writer, data []byte) error
- type Controller
- func (c *Controller) Init() error
- func (c *Controller) RegisterClientRoute(ctx context.Context, name string, routes []net.IPNet, conn io.ReadWriteCloser)
- func (c *Controller) Run() error
- func (c *Controller) StartServerConnReadLoop(ctx context.Context, conn io.ReadWriteCloser, onClose func())
- func (c *Controller) Stop() error
- func (c *Controller) UnregisterClientRoute(name string)
- type TunDevice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseRoutes ¶
ParseRoutes Convert route strings to IPNet objects
func ReadMessage ¶
ReadMessage reads a framed message from the reader
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController(cfg v1.VirtualNetConfig) *Controller
func (*Controller) Init ¶
func (c *Controller) Init() error
func (*Controller) RegisterClientRoute ¶
func (c *Controller) RegisterClientRoute(ctx context.Context, name string, routes []net.IPNet, conn io.ReadWriteCloser)
RegisterClientRoute registers a client route (based on destination IP CIDR) and starts the read loop
func (*Controller) Run ¶
func (c *Controller) Run() error
func (*Controller) StartServerConnReadLoop ¶ added in v0.62.1
func (c *Controller) StartServerConnReadLoop(ctx context.Context, conn io.ReadWriteCloser, onClose func())
StartServerConnReadLoop starts the read loop for a server connection (dynamically associates with source IPs)
func (*Controller) Stop ¶
func (c *Controller) Stop() error
func (*Controller) UnregisterClientRoute ¶
func (c *Controller) UnregisterClientRoute(name string)
UnregisterClientRoute Remove client route from routing table
Click to show internal directories.
Click to hide internal directories.