pyrad.host – RADIUS host definition

class pyrad.host.Host(authport=1812, acctport=1813, coaport=3799, dict=None)[source]

Generic RADIUS capable host.

Variables:
  • dict – RADIUS dictionary

  • authport – port to listen on for authentication packets

  • acctport – port to listen on for accounting packets

CreateAcctPacket(**args)[source]

Create a new accounting RADIUS packet. This utility function creates a new accounting RADIUS packet which can be used to communicate with the RADIUS server this client talks to. This is initializing the new packet with the dictionary and secret used for the client.

Returns:

a new empty packet instance

Return type:

pyrad.packet.AcctPacket

CreateAuthPacket(**args)[source]

Create a new authentication RADIUS packet. This utility function creates a new RADIUS authentication packet which can be used to communicate with the RADIUS server this client talks to. This is initializing the new packet with the dictionary and secret used for the client.

Returns:

a new empty packet instance

Return type:

pyrad.packet.AuthPacket

CreateCoAPacket(**args)[source]

Create a new CoA RADIUS packet. This utility function creates a new CoA RADIUS packet which can be used to communicate with the RADIUS server this client talks to. This is initializing the new packet with the dictionary and secret used for the client.

Returns:

a new empty packet instance

Return type:

pyrad.packet.CoAPacket

CreatePacket(**args)[source]

Create a new RADIUS packet. This utility function creates a new RADIUS authentication packet which can be used to communicate with the RADIUS server this client talks to. This is initializing the new packet with the dictionary and secret used for the client.

Returns:

a new empty packet instance

Return type:

pyrad.packet.Packet

SendPacket(fd, pkt)[source]

Send a packet.

Parameters:
  • fd (socket class instance) – socket to send packet with

  • pkt (Packet class instance) – packet to send

SendReplyPacket(fd, pkt)[source]

Send a packet.

Parameters:
  • fd (socket class instance) – socket to send packet with

  • pkt (Packet class instance) – packet to send