portal

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PortalServerIP       = "10.253.0.237"
	PortalDomain         = "@dx-uestc"
	PortalDomainDX       = "@dx"
	PortalGetChallenge   = "http://" + PortalServerIP + "/cgi-bin/get_challenge?callback=%s&username=%s" + PortalDomain + "&ip=%v&_=%d"
	PortalGetChallengeDX = "http://" + PortalServerIP + "/cgi-bin/get_challenge?callback=%s&username=%s" + PortalDomainDX + "&ip=%v&_=%d"
	PortalLogin          = "http://" + PortalServerIP + "/cgi-bin/srun_portal?callback=%s&action=login&username=%s" + PortalDomain + "&password={MD5}%s&ac_id=1&ip=%v&chksum=%s&info={SRBX1}%s&n=200&type=1&os=Windows+10&name=Windows&double_stack=0&_=%d"
	PortalLoginDX        = "http://" + PortalServerIP + "/cgi-bin/srun_portal?callback=%s&action=login&username=%s" + PortalDomainDX + "&password={MD5}%s&ac_id=1&ip=%v&chksum=%s&info={SRBX1}%s&n=200&type=1&os=Windows+10&name=Windows&double_stack=0&_=%d"
)
View Source
const (
	PortalUserInfo   = `{"username":"%s` + PortalDomain + `","password":"%s","ip":"%v","acid":"1","enc_ver":"srun_bx1"}`
	PortalUserInfoDX = `{"username":"%s` + PortalDomainDX + `","password":"%s","ip":"%v","acid":"1","enc_ver":"srun_bx1"}`
)
View Source
const (
	PortalHeaderUA = "" /* 129-byte string literal not displayed */
)

Variables

View Source
var (
	ErrIllegalIPv4                 = errors.New("illegal ipv4")
	ErrUnexpectedChallengeResponse = errors.New("unexpected challenge response")
	ErrUnexpectedLoginResponse     = errors.New("unexpected login response")
)

Functions

func EncodeUserInfo

func EncodeUserInfo(info, challenge string) string

Types

type Portal

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

func NewPortal

func NewPortal(name, password string, ipv4 net.IP) (*Portal, error)

func (*Portal) CheckSum

func (p *Portal) CheckSum(domain, challenge, hmd5, info string) string

func (*Portal) GetChallenge

func (p *Portal) GetChallenge(u string) (string, error)

func (*Portal) Login

func (p *Portal) Login(u, domain, challenge string) error

func (*Portal) PasswordHMd5

func (p *Portal) PasswordHMd5(challenge string) string

func (*Portal) String

func (p *Portal) String() string

Jump to

Keyboard shortcuts

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