radius

package
v0.0.0-...-7c66ffc Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

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

type AccessResponse struct {
	Accept        bool
	IPAddress     net.IP
	RejectMessage string
}

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"`
	SharedSecret string `param:"desc=RADIUS shared secret;default=radiussharedsecret"`
}

ServerParameters holds the configuration for the RADIUS server

Directories

Path Synopsis
Package threegpp contains the 3GPP RADIUS extensions.
Package threegpp contains the 3GPP RADIUS extensions.

Jump to

Keyboard shortcuts

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