Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // AccountingStart represents the start of RADIUS accounting session for a specific User AccountingStart = Attribute{AccountingStatusType, 6, fourOctet(1)} // AccountingStop represents the stop of a RADIUS accounting session for a specific USer AccountingStop = Attribute{AccountingStatusType, 6, fourOctet(2)} // ? InterimUpdate = Attribute{AccountingStatusType, 6, fourOctet(3)} // ? AccountingOn = Attribute{AccountingStatusType, 6, fourOctet(7)} // ? AccountingOff = Attribute{AccountingStatusType, 6, fourOctet(8)} UserRequest = Attribute{AccountingTerminateCause, 6, fourOctet(1)} LostCarrier = Attribute{AccountingTerminateCause, 6, fourOctet(2)} LostService = Attribute{AccountingTerminateCause, 6, fourOctet(3)} IdleTimeout = Attribute{AccountingTerminateCause, 6, fourOctet(4)} SessionTimeout = Attribute{AccountingTerminateCause, 6, fourOctet(5)} AdminReset = Attribute{AccountingTerminateCause, 6, fourOctet(6)} AdminReboot = Attribute{AccountingTerminateCause, 6, fourOctet(7)} PortError = Attribute{AccountingTerminateCause, 6, fourOctet(8)} NASError = Attribute{AccountingTerminateCause, 6, fourOctet(9)} NASRequest = Attribute{AccountingTerminateCause, 6, fourOctet(10)} NASReboot = Attribute{AccountingTerminateCause, 6, fourOctet(11)} PortUnneeded = Attribute{AccountingTerminateCause, 6, fourOctet(12)} PortPreempted = Attribute{AccountingTerminateCause, 6, fourOctet(13)} PortSuspended = Attribute{AccountingTerminateCause, 6, fourOctet(14)} Callback = Attribute{AccountingTerminateCause, 6, fourOctet(16)} UserError = Attribute{AccountingTerminateCause, 6, fourOctet(17)} HostRequest = Attribute{AccountingTerminateCause, 6, fourOctet(18)} )
Functions ¶
This section is empty.
Types ¶
type Attribute ¶
type Attribute struct { Type AttributeType Length int8 Values []Writer }
An Attribute is a Key-Value pair attached to a request or response
func StringAttribute ¶
func StringAttribute(t AttributeType, str string) Attribute
StringAttribute builds an attribute of length >= 3 with the given string
type AttributeType ¶
type AttributeType int64
AttributeType defines types for an Attribute
const ( // AccountingStatusType indicates whether the AccountingRequest is the beginning of a user service (Start) or the end of a user service (Stop) AccountingStatusType AttributeType = 40 // AccountingDelayTime indicates how many seconds the client has been trying to send this record for AccountingDelayTime AttributeType = 41 // AccountingInputOctets indicates how many octets have been received from this port over the course of this service being provided and is only usable when AccountingStatusType is Stop AccountingInputOctets AttributeType = 42 // AccountingOutputOctets indicates how many octets have been sent from this from this port over the course of this service being provided and is only usable when AccountingStatusType is Stop AccountingOutputOctets AttributeType = 43 // AccountingSessionID indicates the session ID for the accounting session, must match for the matching Start and Stop message, and must be present on all Accounting messages AccountingSessionID AttributeType = 44 // AccountingAuthentic indicates how the user was authenticated and MAY be included. AccountingAuthentic AttributeType = 45 // AccountingSessionTime indicates how many seconds the user has received service for and can only be included when AccountingStatusType is Stop AccountingSessionTime AttributeType = 46 // AccountingInputPackets incidates how many packets have been received from the port over the course of this service being provided to a Framed (?) User and is only usable when AccountingStatusType is Stop AccountingInputPackets AttributeType = 47 // AccountingOutputPackets incidates how many packets have been sent from the port over the course of this service being provided to a Framed (?) User and is only usable when AccountingStatusType is Stop AccountingOutputPackets AttributeType = 48 // AccountingTerminateCause indicates how the session was terminated and is only usable when AccountingStatusType is Stop AccountingTerminateCause AttributeType = 49 // AccountingMultiSessionID is used to mark multiple related sessions together AccountingMultiSessionID AttributeType = 50 // AccountingMultiLinkCount is used to convey how many related sessions are linked together via the AccountingMultiSessionID AccountingMultiLinkCount AttributeType = 51 // AccessUserName is used to mark the attribute as the username field AccessUserName AttributeType = 1 )
type AttributeValue ¶
type AttributeValue Writer
An AttributeValue is a value attached to an attribute
type Authenticator ¶
An Authenticator is responsible for calculating the Authenticator field of the packet
func AccountingRequestAuthenticator ¶
func AccountingRequestAuthenticator(sharedSecret string) Authenticator
AccountingRequestAuthenticator returns an implementation of Authenticator used for sending RADIUS accounting requests
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client is the representation of a connection to a RADIUS server
type Identifier ¶
type Identifier uint8
Identifier is the unique ID of a Packet
type Options ¶
type Options struct { Host string }
Options defines the options used to connect to a RADIUS server (currently only supporting accounting)
type Packet ¶
type Packet struct { Code PacketCode ID Identifier Attributes []Attribute // contains filtered or unexported fields }
A Packet is a RADIUS message
type PacketCode ¶
type PacketCode int64
A PacketCode is a code that defines the type of the packet
const ( // AccountingRequest represents a RADIUS accounting request packet AccountingRequest PacketCode = 4 // AccountingResponse respresents a RADIUS accounting response packet AccountingResponse PacketCode = 5 )
type Session ¶
type Session struct { ID string // contains filtered or unexported fields }
A Session represents an Accounting session
func (*Session) AddInputOctets ¶
func (*Session) AddOutputOctets ¶
func (*Session) InterimUpdate ¶
InterimUpdate sends an update