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) error
- func (c *Controller) RegisterServerConn(ctx context.Context, name string, conn io.ReadWriteCloser) error
- func (c *Controller) Run() error
- func (c *Controller) Stop() error
- func (c *Controller) UnregisterClientRoute(name string)
- func (c *Controller) UnregisterServerConn(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) error
RegisterClientRoute Register client route (based on destination IP CIDR)
func (*Controller) RegisterServerConn ¶
func (c *Controller) RegisterServerConn(ctx context.Context, name string, conn io.ReadWriteCloser) error
RegisterServerConn Register server connection (dynamically associates with source IPs)
func (*Controller) Run ¶
func (c *Controller) Run() error
func (*Controller) Stop ¶
func (c *Controller) Stop() error
func (*Controller) UnregisterClientRoute ¶
func (c *Controller) UnregisterClientRoute(name string)
UnregisterClientRoute Remove client route from routing table
func (*Controller) UnregisterServerConn ¶
func (c *Controller) UnregisterServerConn(name string)
UnregisterServerConn Remove server connection from routing table
Click to show internal directories.
Click to hide internal directories.