Documentation
¶
Index ¶
- Constants
- func ARPReply(frame []byte, localMAC [6]byte, localIP netip.Addr) ([]byte, bool)
- func ARPRequest(localMAC [6]byte, localIP, targetIP netip.Addr) []byte
- func AddPolicy(pack *Pack, policy Policy)
- func DHCPServerReply(frame []byte, serverMAC [6]byte, serverIP, assigned netip.Addr, prefixBits int, ...) ([]byte, netip.Addr, [6]byte, bool)
- func FrameSource(frame []byte) (netip.Addr, [6]byte, bool)
- func IPDestination(packet []byte) (netip.Addr, bool)
- func PasswordResponse(username, password string, challenge []byte) [20]byte
- func ReadSignatureRequest(r *bufio.Reader) error
- func ResolveARP(stream *FrameStream, localMAC [6]byte, localIP, targetIP netip.Addr) ([6]byte, error)
- func SHA0(message []byte) [20]byte
- func UnwrapIP(frame []byte) ([]byte, bool)
- func WrapIPv4(payload []byte, source, destination [6]byte) []byte
- func WritePackRequest(w io.Writer, host string, pack *Pack) error
- func WritePackResponse(w io.Writer, pack *Pack) error
- func WriteSignatureRequest(w io.Writer, host string) error
- type DHCPLease
- type FrameStream
- type Pack
- func (p *Pack) AddBool(name string, value bool)
- func (p *Pack) AddData(name string, value []byte)
- func (p *Pack) AddInt(name string, value uint32)
- func (p *Pack) AddInt64(name string, value uint64)
- func (p *Pack) AddString(name, value string)
- func (p *Pack) AddValues(name string, values ...Value)
- func (p *Pack) GetData(name string) []byte
- func (p *Pack) GetInt(name string) uint32
- func (p *Pack) GetInt64(name string) uint64
- func (p *Pack) GetString(name string) string
- func (p *Pack) Has(name string) bool
- func (p *Pack) MarshalBinary() ([]byte, error)
- func (p *Pack) Values(name string) []Value
- type Policy
- type SessionParameters
- type Value
Constants ¶
View Source
const ( MaxEthernetFrame = 1600 MaxKeepAlive = 512 )
View Source
const ( ConnectPath = "/vpnsvc/connect.cgi" PackPath = "/vpnsvc/vpn.cgi" ContentType = "application/octet-stream" MaxPackSize = 65536 MaxFrames = 4096 )
View Source
const ( TypeInt = 0 TypeData = 1 TypeString = 2 TypeUTF8 = 3 TypeInt64 = 4 )
Variables ¶
This section is empty.
Functions ¶
func DHCPServerReply ¶
func PasswordResponse ¶
func ReadSignatureRequest ¶
func ResolveARP ¶
Types ¶
type DHCPLease ¶
type DHCPLease struct {
Address netip.Prefix
Gateway netip.Addr
DNS []netip.Addr
ServerMAC [6]byte
}
func AcquireDHCP ¶
func AcquireDHCP(stream *FrameStream, mac [6]byte) (DHCPLease, error)
type FrameStream ¶
type FrameStream struct {
// contains filtered or unexported fields
}
func NewFrameStream ¶
func (*FrameStream) ReadFrames ¶
func (s *FrameStream) ReadFrames() ([][]byte, error)
func (*FrameStream) WriteFrames ¶
func (s *FrameStream) WriteFrames(frames ...[]byte) error
func (*FrameStream) WriteKeepAlive ¶
func (s *FrameStream) WriteKeepAlive() error
type Pack ¶
type Pack struct {
// contains filtered or unexported fields
}
func UnmarshalPack ¶
func (*Pack) MarshalBinary ¶
type Policy ¶
type Policy struct {
Access bool
DHCPFilter bool
DHCPNoServer bool
DHCPForce bool
NoBridge bool
NoRouting bool
PrivacyFilter bool
NoServer bool
CheckMAC bool
CheckIP bool
ARPDHCPOnly bool
MonitorPort bool
NoBroadcastLimiter bool
FixPassword bool
NoQoS bool
RSAndRAFilter bool
RAFilter bool
DHCPv6Filter bool
DHCPv6NoServer bool
NoRoutingV6 bool
CheckIPv6 bool
NoServerV6 bool
NoSavePassword bool
FilterIPv4 bool
FilterIPv6 bool
FilterNonIP bool
NoIPv6DefaultRouterInRA bool
NoIPv6DefaultRouterInRAWhenIPv6 bool
MaxConnection uint32
Timeout uint32
MaxMAC uint32
MaxIP uint32
MaxUpload uint32
MaxDownload uint32
MultiLogins uint32
MaxIPv6 uint32
AutoDisconnect uint32
VLANID uint32
}
func PolicyFromPack ¶
type SessionParameters ¶
type SessionParameters struct {
SessionName string
ConnectionName string
MaxConnection uint32
UseEncrypt bool
UseCompress bool
HalfConnection bool
Timeout uint32
QoS bool
SessionKey [20]byte
SessionKey32 uint32
VLANID uint32
Policy Policy
}
func ParseSessionParameters ¶
func ParseSessionParameters(pack *Pack) (SessionParameters, error)
Click to show internal directories.
Click to hide internal directories.