access

package
v0.0.0-...-04092ee Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2023 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EvSocConed   = "conned"
	EvSocRecon   = "reconn"
	EvSocClosed  = "closed"
	EvSocSuccess = "success"
	EvSocSignIn  = "signIn"
	EvSocLogin   = "login"
	EvTapIpAddr  = "ipAddr"
	EvTapReadErr = "readErr"
	EvTapReset   = "reset"
	EvTapOpenErr = "openErr"
)

Functions

func GetSocketClient

func GetSocketClient(p *config.Point) libol.SocketClient

func GetTapCfg

func GetTapCfg(c *config.Point) network.TapConfig

Types

type KeepAlive

type KeepAlive struct {
	Interval int64
	LastTime int64
}

func (*KeepAlive) Should

func (k *KeepAlive) Should() bool

func (*KeepAlive) Update

func (k *KeepAlive) Update()

type MixPoint

type MixPoint struct {
	// contains filtered or unexported fields
}

func NewMixPoint

func NewMixPoint(config *config.Point) MixPoint

func (*MixPoint) Addr

func (p *MixPoint) Addr() string

func (*MixPoint) Alias

func (p *MixPoint) Alias() string

func (*MixPoint) Client

func (p *MixPoint) Client() libol.SocketClient

func (*MixPoint) Config

func (p *MixPoint) Config() *config.Point

func (*MixPoint) Device

func (p *MixPoint) Device() network.Taper

func (*MixPoint) IfAddr

func (p *MixPoint) IfAddr() string

func (*MixPoint) IfName

func (p *MixPoint) IfName() string

func (*MixPoint) Initialize

func (p *MixPoint) Initialize()

func (*MixPoint) Network

func (p *MixPoint) Network() *models.Network

func (*MixPoint) Protocol

func (p *MixPoint) Protocol() string

func (*MixPoint) Record

func (p *MixPoint) Record() map[string]int64

func (*MixPoint) Start

func (p *MixPoint) Start()

func (*MixPoint) Status

func (p *MixPoint) Status() libol.SocketStatus

func (*MixPoint) Stop

func (p *MixPoint) Stop()

func (*MixPoint) Tenant

func (p *MixPoint) Tenant() string

func (*MixPoint) UUID

func (p *MixPoint) UUID() string

func (*MixPoint) UpTime

func (p *MixPoint) UpTime() int64

func (*MixPoint) User

func (p *MixPoint) User() string

type Neighbor

type Neighbor struct {
	HwAddr  []byte
	IpAddr  []byte
	Uptime  int64
	NewTime int64
}

type NeighborListener

type NeighborListener struct {
	Interval func(dest []byte)
	Expire   func(dest []byte)
}

type Neighbors

type Neighbors struct {
	// contains filtered or unexported fields
}

func (*Neighbors) Add

func (n *Neighbors) Add(h *Neighbor)

func (*Neighbors) Clear

func (n *Neighbors) Clear()

func (*Neighbors) Expire

func (n *Neighbors) Expire()

func (*Neighbors) Get

func (n *Neighbors) Get(d uint32) *Neighbor

func (*Neighbors) GetByBytes

func (n *Neighbors) GetByBytes(d []byte) *Neighbor

func (*Neighbors) Interval

func (n *Neighbors) Interval()

func (*Neighbors) Start

func (n *Neighbors) Start()

func (*Neighbors) Stop

func (n *Neighbors) Stop()

type PingMsg

type PingMsg struct {
	DateTime   int64  `json:"datetime"`
	UUID       string `json:"uuid"`
	Alias      string `json:"alias"`
	Connection string `json:"connection"`
	Address    string `json:"address"`
}

type Point

type Point struct {
	MixPoint
	// contains filtered or unexported fields
}

func NewPoint

func NewPoint(config *config.Point) *Point

func (*Point) AddAddr

func (p *Point) AddAddr(ipStr string) error

func (*Point) AddBypass

func (p *Point) AddBypass(routes []*models.Route)

func (*Point) AddRoutes

func (p *Point) AddRoutes(routes []*models.Route) error

func (*Point) DelAddr

func (p *Point) DelAddr(ipStr string) error

func (*Point) DelBypass

func (p *Point) DelBypass(routes []*models.Route)

func (*Point) DelRoutes

func (p *Point) DelRoutes(routes []*models.Route) error

func (*Point) GetRemote

func (p *Point) GetRemote() string

func (*Point) Initialize

func (p *Point) Initialize()

func (*Point) OnTap

func (p *Point) OnTap(w *TapWorker) error

func (*Point) UpBr

func (p *Point) UpBr(name string) *netlink.Bridge

type Pointer

type Pointer interface {
	Addr() string
	IfName() string
	IfAddr() string
	Client() libol.SocketClient
	Device() network.Taper
	Status() libol.SocketStatus
	UpTime() int64
	UUID() string
	Protocol() string
	User() string
	Record() map[string]int64
	Tenant() string
	Alias() string
	Config() *config.Point
	Network() *models.Network
}

type PrefixRule

type PrefixRule struct {
	Type        int
	Destination net.IPNet
	NextHop     net.IP
}

type SocketWorker

type SocketWorker struct {
	// contains filtered or unexported fields
}

func NewSocketWorker

func NewSocketWorker(client libol.SocketClient, c *config.Point) *SocketWorker

func (*SocketWorker) Auth

func (t *SocketWorker) Auth() (string, string)

func (*SocketWorker) DoWrite

func (t *SocketWorker) DoWrite(frame *libol.FrameMessage) error

func (*SocketWorker) Initialize

func (t *SocketWorker) Initialize()

func (*SocketWorker) Loop

func (t *SocketWorker) Loop()

func (*SocketWorker) Read

func (t *SocketWorker) Read(client libol.SocketClient)

func (*SocketWorker) SetAuth

func (t *SocketWorker) SetAuth(auth string)

func (*SocketWorker) SetUUID

func (t *SocketWorker) SetUUID(v string)

func (*SocketWorker) Start

func (t *SocketWorker) Start()

func (*SocketWorker) Stop

func (t *SocketWorker) Stop()

func (*SocketWorker) Write

func (t *SocketWorker) Write(frame *libol.FrameMessage) error

type SocketWorkerListener

type SocketWorkerListener struct {
	OnClose   func(w *SocketWorker) error
	OnSuccess func(w *SocketWorker) error
	OnIpAddr  func(w *SocketWorker, n *models.Network) error
	ReadAt    func(frame *libol.FrameMessage) error
}

type TapWorker

type TapWorker struct {
	// contains filtered or unexported fields
}

func NewTapWorker

func NewTapWorker(devCfg network.TapConfig, pinCfg *config.Point) (a *TapWorker)

func (*TapWorker) DoWrite

func (a *TapWorker) DoWrite(frame *libol.FrameMessage) error

func (*TapWorker) Initialize

func (a *TapWorker) Initialize()

func (*TapWorker) IsTun

func (a *TapWorker) IsTun() bool

func (*TapWorker) Loop

func (a *TapWorker) Loop()

func (*TapWorker) OnArpAlive

func (a *TapWorker) OnArpAlive(dest []byte)

func (*TapWorker) OnIpAddr

func (a *TapWorker) OnIpAddr(addr string)

func (*TapWorker) Read

func (a *TapWorker) Read(device network.Taper)

func (*TapWorker) Start

func (a *TapWorker) Start()

func (*TapWorker) Stop

func (a *TapWorker) Stop()

func (*TapWorker) Write

func (a *TapWorker) Write(frame *libol.FrameMessage) error

type TapWorkerListener

type TapWorkerListener struct {
	OnOpen   func(w *TapWorker) error
	OnClose  func(w *TapWorker)
	FindNext func(dest []byte) []byte
	ReadAt   func(frame *libol.FrameMessage) error
}

type Terminal

type Terminal struct {
	Pointer Pointer
	Console *readline.Instance
}

func NewTerminal

func NewTerminal(pointer Pointer) *Terminal

func (*Terminal) CmdBye

func (t *Terminal) CmdBye(args []string)

func (*Terminal) CmdCd

func (t *Terminal) CmdCd(args []string)

func (*Terminal) CmdEdit

func (t *Terminal) CmdEdit(args []string)

func (*Terminal) CmdHelp

func (t *Terminal) CmdHelp(args []string)

func (*Terminal) CmdMode

func (t *Terminal) CmdMode(args []string)

func (*Terminal) CmdPwd

func (t *Terminal) CmdPwd(args []string)

func (*Terminal) CmdShell

func (t *Terminal) CmdShell(args []string)

func (*Terminal) CmdShow

func (t *Terminal) CmdShow(args []string)

func (*Terminal) Prompt

func (t *Terminal) Prompt() string

func (*Terminal) Start

func (t *Terminal) Start()

func (*Terminal) Trim

func (t *Terminal) Trim(v string) string

type TunEther

type TunEther struct {
	HwAddr []byte
	IpAddr []byte
}

type Worker

type Worker struct {
	// contains filtered or unexported fields
}

func NewWorker

func NewWorker(cfg *config.Point) *Worker

func (*Worker) FindNext

func (w *Worker) FindNext(dest []byte) []byte

func (*Worker) FlushStatus

func (w *Worker) FlushStatus()

func (*Worker) FreeIpAddr

func (w *Worker) FreeIpAddr()

func (*Worker) Initialize

func (w *Worker) Initialize()

func (*Worker) OnClose

func (w *Worker) OnClose(s *SocketWorker) error

func (*Worker) OnIpAddr

func (w *Worker) OnIpAddr(s *SocketWorker, n *models.Network) error

func (*Worker) OnSuccess

func (w *Worker) OnSuccess(s *SocketWorker) error

func (*Worker) SetUUID

func (w *Worker) SetUUID(v string)

func (*Worker) Start

func (w *Worker) Start()

func (*Worker) Stop

func (w *Worker) Stop()

func (*Worker) UUID

func (w *Worker) UUID() string

func (*Worker) UpTime

func (w *Worker) UpTime() int64

type WorkerEvent

type WorkerEvent struct {
	Type   string
	Reason string
	Time   int64
	Data   interface{}
}

func NewEvent

func NewEvent(newType, reason string) *WorkerEvent

func (*WorkerEvent) String

func (e *WorkerEvent) String() string

type WorkerListener

type WorkerListener struct {
	AddAddr   func(ipStr string) error
	DelAddr   func(ipStr string) error
	OnTap     func(w *TapWorker) error
	AddRoutes func(routes []*models.Route) error
	DelRoutes func(routes []*models.Route) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL