| Home | Trees | Index | Help |
|---|
| Package pyrad :: Module server :: Class Server |
|
Host --+
|
Server
ProxyBasic 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.| Method Summary | |
|---|---|
Constructor. | |
Add an address to listen to. | |
Create a reply packet. | |
Accounting packet handler. | |
Authentication packet handler. | |
Main loop. | |
| Packet class instance |
Read a packet from a network connection. |
Process a packet received on the accounting port | |
Process a packet received on the authentication port | |
Prepare all sockets to receive packets. | |
Process available data. | |
| Inherited from Host | |
| pyrad.packet.Packet |
Create a new RADIUS packet. |
| pyrad.packet.Packet |
Create a new RADIUS packet. |
Send a packet. | |
Send a packet. | |
| Instance Variable Summary | |
|---|---|
| dictionary of Host class instances | hosts: hosts who are allowed to talk to us |
| dictionary | _fdmap: map of filedescriptors to network sockets |
| select.poll class instance | _poll: poll object for network sockets |
| Inherited from Host | |
| integer | acctport: port to listen on for accounting packets |
| integer | authport: port to listen on for authentication packets |
| pyrad.dictionary.Dictionary | dict: RADIUS dictionary |
| Class Variable Summary | |
|---|---|
| integer | MaxPacketSize: maximum size of a RADIUS packet |
| Method Details |
|---|
__init__(self,
addresses=[],
authport=1812,
acctport=1813,
hosts={},
dict=None)
Constructor.
|
BindToAddress(self, addr)Add an address to listen to. An empty string indicated you want to listen on all addresses.
|
CreateReplyPacket(self, pkt, **attributes)Create a reply packet. Create a new packet which can be returned as a reply to a received packet.
|
HandleAcctPacket(self, 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.
|
HandleAuthPacket(self, 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.
|
Run(self)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. |
_GrabPacket(self, pktgen, fd)Read a packet from a network connection. This method assumes there is data waiting for to be read.
|
_HandleAcctPacket(self, pkt)Process a packet received on the accounting port If this packet should be dropped instead of processed a PacketError exception should be raised. The main loop will drop the packet and log the reason.
|
_HandleAuthPacket(self, pkt)Process a packet received on the authentication port If this packet should be dropped instead of processed a PacketError exception should be raised. The main loop will drop the packet and log the reason.
|
_PrepareSockets(self)Prepare all sockets to receive packets. |
_ProcessInput(self, fd)Process available data. If this packet should be dropped instead of processed a PacketError exception should be raised. The main loop will drop the packet and log the reason. This function calls either HandleAuthPacket() or HandleAcctPacket() depending on which socket is being processed.
|
| Instance Variable Details |
|---|
hostshosts who are allowed to talk to us
|
_fdmapmap of filedescriptors to network sockets
|
_pollpoll object for network sockets
|
| Class Variable Details |
|---|
MaxPacketSizemaximum size of a RADIUS packet
|
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Wed Jun 2 14:19:55 2004 | http://epydoc.sf.net |