rjsocks

package
v0.0.0-...-bca9f4d Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SrvStatStart = SrvStat(iota)
	SrvStatRespIdentity
	SrvStatRespMd5Chall
	SrvStatSuccess
	SrvStatFailure
	SrvStatKeepAlive
	SrvStatError
)

Variables

View Source
var (
	DefaultSnaplen int32 = 1024
	// MultiCastAddr        = net.HardwareAddr{0x01, 0x80, 0xc2, 0x00, 0x00, 0x03}
	MultiCastAddr = net.HardwareAddr{0x01, 0xD0, 0xF8, 0x00, 0x00, 0x03}
)

Functions

func GbkToUtf8

func GbkToUtf8(s []byte) ([]byte, error)

func ListNetworkAdapter

func ListNetworkAdapter() ([]string, error)

func ListNetworkDev

func ListNetworkDev() ([]string, error)

func SelectNetworkAdapter

func SelectNetworkAdapter(adapter string) (net.HardwareAddr, error)

func SelectNetworkDev

func SelectNetworkDev(dev string) (*pcap.Interface, error)

func Symmetric

func Symmetric(data []byte)

Types

type CronItem

type CronItem struct {
	Func2run   func()
	LastAccess time.Time
	Interval   time.Duration
}

func NewCronItem

func NewCronItem(f func(), interval time.Duration) *CronItem

type Crontab

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

func NewCrontab

func NewCrontab() *Crontab

func (*Crontab) Close

func (c *Crontab) Close()

func (*Crontab) Delete

func (c *Crontab) Delete(name string) bool

func (*Crontab) Exist

func (c *Crontab) Exist(name string) bool

func (*Crontab) ForceRegister

func (c *Crontab) ForceRegister(name string, item *CronItem)

func (*Crontab) Register

func (c *Crontab) Register(name string, item *CronItem)

func (*Crontab) Run

func (c *Crontab) Run() error

func (*Crontab) UpdateLastAccess

func (c *Crontab) UpdateLastAccess(name string, tm time.Time) bool

type Handle

type Handle struct {
	PcapHandle *pcap.Handle
	// contains filtered or unexported fields
}

func NewHandle

func NewHandle(dev *pcap.Interface, srcMacAddr net.HardwareAddr) (*Handle, error)

func (*Handle) Close

func (h *Handle) Close()

Close cleans up the pcap Handle.

func (*Handle) SendEchoPkt

func (h *Handle) SendEchoPkt(echoNo, echoKey uint32) error

func (*Handle) SendLogoffPkt

func (h *Handle) SendLogoffPkt() error

func (*Handle) SendResponseIdentity

func (h *Handle) SendResponseIdentity(id uint8, identity []byte) error

func (*Handle) SendResponseMD5Chall

func (h *Handle) SendResponseMD5Chall(id uint8, salt, user, pass []byte) error

func (*Handle) SendStartPkt

func (h *Handle) SendStartPkt() error

func (*Handle) SetDstMacAddr

func (h *Handle) SetDstMacAddr(addr net.HardwareAddr)

type Service

type Service struct {
	State SrvStat
	// contains filtered or unexported fields
}

func NewService

func NewService(usr, pass, dev, adap string) (*Service, error)

func (*Service) Close

func (s *Service) Close()

func (*Service) Continue

func (s *Service) Continue()

func (*Service) GetAdvertisement

func (s *Service) GetAdvertisement() (ret string)

func (*Service) Run

func (s *Service) Run() error

func (*Service) Stop

func (s *Service) Stop()

type SrvStat

type SrvStat int

func (SrvStat) String

func (s SrvStat) String() string

Jump to

Keyboard shortcuts

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