Versions in this module Expand all Collapse all v0 v0.7.5 Sep 18, 2021 v0.7.4 Sep 18, 2021 v0.7.3 Sep 18, 2021 v0.7.2 Sep 18, 2021 v0.7.1 Sep 18, 2021 Changes in this version + const BandwidthPeriodSec + const MaxMtu + var IpPool = &ipPoolConfig + func AcquireIp(username, macAddr string) net.IP + func CloseCSess(token string) + func CloseSess(token string) + func CopyStruct(a interface{}, b interface{}, fields ...string) (err error) + func DelSess(token string) + func DelSessByStoken(stoken string) + func Dtls2MasterSecret(did string) 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 uint64 + BandwidthDownPeriod uint32 + BandwidthUp uint32 + BandwidthUpAll uint64 + BandwidthUpPeriod uint32 + Client string + CloseChan chan struct{} + CstpDpd int + Group *dbdata.Group + IfName string + IpAddr net.IP + IpAuditMap map[string]int64 + Limit *LimitRater + LocalIp net.IP + MacHw net.HardwareAddr + MasterSecret string + Mtu int + PayloadIn chan *Payload + PayloadOutCstp chan *Payload + PayloadOutDtls chan *Payload + RemoteAddr string + Sess *Session + func (cs *ConnSession) Close() + func (cs *ConnSession) GetDtlsSession() *DtlsSession + func (cs *ConnSession) NewDtlsConn() *DtlsSession + func (cs *ConnSession) RateLimit(byt int, isUp bool) error + func (cs *ConnSession) SetIfName(name string) + func (cs *ConnSession) SetMtu(mtu string) + type DtlsSession struct + CloseChan chan struct{} + IpAddr net.IP + func (ds *DtlsSession) Close() + 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(did string) *Session + func NewSession(token string) *Session + func SToken2Sess(stoken string) *Session + func Token2Sess(token string) *Session + func (s *Session) NewConn() *ConnSession