Documentation ¶
Index ¶
Constants ¶
View Source
const ( // HandlerNotRegisteredErrorMsg is used when there is no // AccessRequestHandler has been set HandlerNotRegisteredErrorMsg = "Server error 1" // IPAddressInvalid is used when the AccessRequestHandler returns // an invalid IP address such as 0.0.0.0 IPAddressInvalid = "Server error 2" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessRequest ¶
type AccessRequest struct { Username string Password string NASIPAddress net.IP NASIdentifier string IMSI string IMSIMccMnc string UserLocationInfo []byte MSTimezone []byte IMEISV string }
AccessRequest contains all the attributes we might be interested in from the 4G network.
type AccessRequestHandlerFunc ¶
type AccessRequestHandlerFunc func(AccessRequest) AccessResponse
AccessRequestHandlerFunc allows a function to implement AccessRequestHandler
type AccessResponse ¶
AccessResponse is used by the handler to signal what the Radius server should do with the request. If Accept is true the Access-Request is granted and a Access-Accept is returned. When accepting IPAddress and Netmask must be set.
If Accept is false an Access-Reject message is sent. The RejectMessage should be set.
type Server ¶
type Server interface { // Start launches the server. The supplied ranges is // the ranges the server will handle Start() error // Stop stops the server Stop() error // Address is the local address of the server Address() string }
Server is the RADIUS server
func NewRADIUSServer ¶
func NewRADIUSServer(config ServerParameters, handler AccessRequestHandlerFunc) Server
NewRADIUSServer creates a new RADIUS server
type ServerParameters ¶
type ServerParameters struct { Endpoint string `param:"desc=RADIUS Authentication listen endpoint;default=localhost:1812"` }
ServerParameters holds the configuration for the RADIUS server
Click to show internal directories.
Click to hide internal directories.