Documentation ¶
Index ¶
Constants ¶
View Source
const ( // 重试连接 DisconnectActionRetry = iota // 重启程序 DisconnectActionRestart )
断连行为
Variables ¶
View Source
var CLI struct { Dhcp struct{} `cmd:"" help:"Use DHCP mode"` // DHCP模式 DhcpAuto struct{} `cmd:"" help:"Use DHCP mode with auto configuration"` // DHCP自动配置模式 Pppoe struct{} `cmd:"" help:"Use PPPoE mode"` // PPPoE模式 Web struct{} `cmd:"" help:"Imitate web login"` // 模拟网页登录 Conf string `help:"Configuration file path" short:"c" default:"/etc/drcom.conf" type:"path"` // 配置文件目录 BindIP string `help:"IP address to bind to" short:"b" default:"0.0.0.0"` // 绑定IP地址 Log string `help:"Log ONLY to specified path" short:"l" default:""` // 日志文件目录 Daemon bool `help:"Run as daemon" short:"d" default:"false"` // 是否在后台运行 Eternal bool `help:"Keep trying to reconnect" short:"e" default:"false"` // 是否一直尝试重连 Debug bool `help:"Print debug level logging" short:"D" default:"false"` // 是否打印调试信息 AutoLogout bool `help:"Logout (shut the connection) when exiting" short:"L" default:"false"` // 是否在退出时注销 }
View Source
var ExtConf struct { // 检查连接(204)使用的 URL ConnectionTestServer string // 检查连接使用的 DNS DnsServer string // 断连行为 ActionOnDisconnect int // 连接成功后执行的外部命令 ExecOnConnect string // 连接失败后执行的外部命令 ExecOnDisconnect string }
drcom-go 专有扩展配置
View Source
var Logger *zap.Logger
Functions ¶
func CheckConnection ¶
CheckConnection 检查网络连接,如发现不通,向 ch 中发送信号
Types ¶
type BaseConf ¶
type BaseConf struct { Server string Username string Password string ControlCheckStatus byte AdapterNum byte HostIP string IpDog byte Hostname string PrimaryDns string DhcpServer string AuthVersion [2]byte Mac string MacBytes []byte HostOs string KeepAliveVersion [2]byte RorVersion bool }
对应 drcom-generic 配置
var Conf BaseConf
Click to show internal directories.
Click to hide internal directories.