client

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

RADIUS Generic Client implementation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func InitialiseClient

func InitialiseClient(dictionary protocol.Dictionary, server string, secret string, retries uint16, timeout uint16) Client

InitialiseClient initialises client

Please note that you would need to call **SetPort** manually to initialise Client in full

func (*Client) CreateAcctRadiusPacket

func (client *Client) CreateAcctRadiusPacket() protocol.RadiusPacket

CreateAcctRadiusPacket creates RADIUS packet with AccountingRequest TypeCode without attributes

You would need to set attributes manually via *set_attributes()* function

func (*Client) CreateAttributeByID

func (client *Client) CreateAttributeByID(attrID uint8, value *[]uint8) (protocol.RadiusAttribute, error)

CreateAttributeByID creates RADIUS packet attribute by ID, that is defined in dictionary file

func (*Client) CreateAttributeByName

func (client *Client) CreateAttributeByName(attrName string, value *[]uint8) (protocol.RadiusAttribute, error)

CreateAttributeByName creates RADIUS packet attribute by Name, that is defined in dictionary file

func (*Client) CreateAuthRadiusPacket

func (client *Client) CreateAuthRadiusPacket() protocol.RadiusPacket

CreateAuthRadiusPacket creates RADIUS packet with AccessRequest TypeCode without attributes

You would need to set attributes manually via *set_attributes()* function

func (*Client) CreateCoaRadiusPacket

func (client *Client) CreateCoaRadiusPacket() protocol.RadiusPacket

CreateCoaRadiusPacket creates RADIUS packet with CoARequest TypeCode without attributes

You would need to set attributes manually via *set_attributes()* function

func (*Client) CreateRadiusPacket

func (client *Client) CreateRadiusPacket(typeCode protocol.TypeCode) protocol.RadiusPacket

CreateRadiusPacket creates RADIUS packet with any TypeCode without attributes

You would need to set attributes manually via *set_attributes()* function

func (*Client) InitialiseRadiusPacketFromBytes

func (client *Client) InitialiseRadiusPacketFromBytes(reply *[]uint8) (protocol.RadiusPacket, error)

InitialisePacketFromBytes creates RADIUS packet attribute by ID, that is defined in dictionary file

func (*Client) Port

func (client *Client) Port(typeCode protocol.TypeCode) (uint16, bool)

Port returns port of RADIUS server, that receives given type of RADIUS message/packet

func (*Client) RadiusAttrOriginalIntegerValue

func (client *Client) RadiusAttrOriginalIntegerValue(attribute protocol.RadiusAttribute) (uint32, error)

RadiusAttrOriginalIntegerValue creates RADIUS packet attribute by ID, that is defined in dictionary file

func (*Client) RadiusAttrOriginalStringValue

func (client *Client) RadiusAttrOriginalStringValue(attribute protocol.RadiusAttribute) (string, error)

RadiusAttrOriginalStringValue creates RADIUS packet attribute by ID, that is defined in dictionary file

func (*Client) Retries

func (client *Client) Retries() uint16

Retries returns retries

func (*Client) Secret

func (client *Client) Secret() string

Secret returns secret

func (*Client) Server

func (client *Client) Server() string

Server returns hostname/FQDN of RADIUS Server

func (*Client) SetPort

func (client *Client) SetPort(msgType protocol.RadiusMsgType, port uint16)

**Required/Optional**

SetPort sets remote port, that responsible for specific RADIUS Message Type

func (*Client) Timeout

func (client *Client) Timeout() uint16

Timeout returns timeout

func (*Client) VerifyMessageAuthenticator

func (client *Client) VerifyMessageAuthenticator(packet *[]uint8) error

VerifyMessageAuthenticator verifies that reply packet's Message-Authenticator attribute is valid

func (*Client) VerifyPacketAttributes

func (client *Client) VerifyPacketAttributes(packet *[]uint8) error

VerifyPacketAttributes verifies that reply packet's attributes have valid values

func (*Client) VerifyReply

func (client *Client) VerifyReply(request *protocol.RadiusPacket, reply *[]uint8) (bool, error)

VerifyReply creates RADIUS packet attribute by ID, that is defined in dictionary file

Jump to

Keyboard shortcuts

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