pyrad.server – basic server

class pyrad.server.RemoteHost(address, secret, name, authport=1812, acctport=1813)

Remote RADIUS capable host we can talk to.

class pyrad.server.ServerPacketError

Exception class for bogus packets. ServerPacketError exceptions are only used inside the Server class to abort processing of a packet.

class pyrad.server.Server(addresses=, []authport=1812, acctport=1813, hosts=None, dict=None)

Basic RADIUS server. This class implements the basics of a RADIUS server. It takes care of the details of receiving and decoding requests; processing of the requests should be done by overloading the appropriate methods in derived classes.

Variables:
  • hosts – hosts who are allowed to talk to us
  • _poll – poll object for network sockets
  • _fdmap – map of filedescriptors to network sockets
  • MaxPacketSize – maximum size of a RADIUS packet
BindToAddress(addr)

Add an address to listen to. An empty string indicated you want to listen on all addresses.

Parameters:addr (string) – IP address to listen on
CreateReplyPacket(pkt, **attributes)

Create a reply packet. Create a new packet which can be returned as a reply to a received packet.

Parameters:pkt (Packet instance) – original packet
HandleAcctPacket(pkt)

Accounting packet handler. This is an empty function that is called when a valid accounting packet has been received. It can be overriden in derived classes to add custom behaviour.

Parameters:pkt (Packet class instance) – packet to process
HandleAuthPacket(pkt)

Authentication packet handler. This is an empty function that is called when a valid authentication packet has been received. It can be overriden in derived classes to add custom behaviour.

Parameters:pkt (Packet class instance) – packet to process
Run()

Main loop. This method is the main loop for a RADIUS server. It waits for packets to arrive via the network and calls other methods to process them.

Previous topic

pyrad.proxy – basic proxy

This Page