Documentation ¶
Index ¶
Constants ¶
View Source
const ( MAC_STD_REGEXP = "([0-9A-Fa-f]{2}:{5,7})[0-9A-Fa-f]{2}" IP_REGEXP = "([0-9]{1,3}\\.){3}[0-9]{1,3}" USER_REGEXP = "[a-Z0-9\\.]{2,}" PASSWORD_REGEXP = "[a-Z0-9]{8}" )
View Source
const (
MAC_REGEXP = "(([0-9A-Fa-f]{1,2}(:|-)){5,7}[0-9A-Fa-f]{1,2}|([0-9A-Fa-f]{1,4}\\.){2,3}[0-9A-Fa-f]{1,4})"
)
View Source
const ( // Manage the possibility to use the same account on more device SimulaneousConnection = false )
Variables ¶
View Source
var ( E_AUTH_Deny = errors.New("Wrong username password combination") E_AUTH_Expired = errors.New("Your account has beeen expired") E_AUTH_Blacklist = errors.New("Your account is blacklisted") )
View Source
var ( E_ARP_NotInCache error E_ARP_ParsingError error )
View Source
var ( ARP string IPTABLES string TEMPLATE string REDIRECT_URL string )
View Source
var ( // String used to connect to postgresql ConnString string = "dbname=captive sslmode=disable encoding=utf-8" )
View Source
var ( FFLogin = forms.FormFields{ "mac": fields.NewRegexField(fields.Defaults{ "Required": true, "MatchString": MAC_STD_REGEXP, }), "ip": fields.NewRegexField(fields.Defaults{ "Required": true, "MatchString": IP_REGEXP, }), "username": fields.NewRegexField(fields.Defaults{ "Required": true, "MatchString": USER_REGEXP, }), "password": fields.NewRegexField(fields.Defaults{ "Required": true, "MatchString": PASSWORD_REGEXP, }), } )
Functions ¶
func NormalizeMac ¶
func NormalizeMac(mac string) (net.HardwareAddr, error)
Supports standard and not formats: 01:23:45:67:89:ab 01:23:45:67:89:ab:cd:ef 01-23-45-67-89-ab 01-23-45-67-89-ab-cd-ef 0123.4567.89ab 0123.4567.89ab.cdef 0:a:e4:13:f9:1c 0-a-e4-13-f9-1c 0::e4::f9:1c 0--e4--f9-1c
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.