Versions in this module Expand all Collapse all v0 v0.1.0 Jan 25, 2021 Changes in this version + func CloseCSess(token string) v0.0.8 Jan 12, 2021 v0.0.6 Dec 28, 2020 Changes in this version + const BandwidthPeriodSec + const MaxMtu + var IpPool = &ipPoolConfig + func AcquireIp(username, macAddr string) net.IP + func CloseSess(token string) + func CopyStruct(a interface{}, b interface{}, fields ...string) (err error) + func DelSess(token string) + func DelSessByStoken(stoken string) + func GenToken() string + func LimitClient(user string, close bool) bool + func ReleaseIp(ip net.IP, macAddr string) + func Start() + type ConnSession struct + BandwidthDown uint32 + BandwidthDownAll uint32 + BandwidthDownPeriod uint32 + BandwidthUp uint32 + BandwidthUpAll uint32 + BandwidthUpPeriod uint32 + Client string + CloseChan chan struct{} + CstpDpd int + Group *dbdata.Group + IpAddr net.IP + Limit *LimitRater + LocalIp net.IP + MacHw net.HardwareAddr + MasterSecret string + Mtu int + PayloadIn chan *Payload + PayloadOut chan *Payload + RemoteAddr string + Sess *Session + TunName string + func (cs *ConnSession) Close() + func (cs *ConnSession) RateLimit(byt int, isUp bool) error + func (cs *ConnSession) SetMtu(mtu string) + func (cs *ConnSession) SetTunName(name string) + type LType int8 + const LTypeEthernet + const LTypeIPData + type LimitRater struct + func NewLimitRater(lim, burst int) *LimitRater + func (l *LimitRater) Wait(bt int) error + type Online struct + BandwidthDown string + BandwidthDownAll string + BandwidthUp string + BandwidthUpAll string + Client string + Group string + Ip net.IP + LastLogin time.Time + MacAddr string + Mtu int + RemoteAddr string + Token string + TunName string + Username string + func OnlineSess() []Online + type Onlines []Online + func (o Onlines) Len() int + func (o Onlines) Less(i, j int) bool + func (o Onlines) Swap(i, j int) + type Payload struct + Data []byte + LType LType + PType byte + type Session struct + AuthPass string + AuthStep string + CSess *ConnSession + DtlsSid string + Group string + IsActive bool + LastLogin time.Time + MacAddr string + Sid string + Token string + UniqueIdGlobal string + Username string + func Dtls2Sess(dtlsid []byte) *Session + func NewSession(token string) *Session + func SToken2Sess(stoken string) *Session + func Token2Sess(token string) *Session + func (s *Session) NewConn() *ConnSession