ClearBox Server™ v1.2 Developer's Guide


Called by server when code of the packet is accepted in preceding call to IRADIUSProcessor::CanProcessPacket.

HRESULT ProcessPacket(
	[in] long clientIPAdress,
	[in] long tag,
	[in] RADIUS_PACKET * inpPacket,
	[out] RADIUS_PACKET * retPacket,
	[out] VARIANT_BOOL * statusOK);


[in] IP address of the client that sent the packet.
[in] Unique value identifying RADIUS packet in whose context this method is called.
[in] Received packet.
[out] If extension has processed packet successfully, it must fill this structure with RADIUS response attributes. attrNum and attributes must be set. All other fields are set by server.
[out] If extension has processed packet successfully and packet supplied by extension must be returned to client, this parameter must be set to VARIANT_TRUE. If server must proceed with processing, extension must set it to VARIANT_FALSE.

Return Values

If extension returns error code, it is assumed that packet was not processed by the server extension.

Thread Safety

This method is called in context of WORK thread. (See Server Threads Model for details.) You should synchronize data which is shared with other threads.

Memory Management

Memory for contents of inpPacket is allocated and freed by server, so extension must not change them.

Extension may allocate memory for attributes field of retPacket, and it is freed by server.


Server extension may set statusOK to VARIANT_FALSE and still process packet, making framework continue the processing.

Example Code

This code processes Status-Server packet and replies with Reply-Message. Packets with other codes are passed to the framework processing.

STDMETHODIMP CTest::ProcessPacket(
	long clientIPAdress, long tag,
	RADIUS_PACKET * inpPacket,
	RADIUS_PACKET * retPacket, VARIANT_BOOL * statusOK)
	if (inpPacket->packetCode==12) // "Status-Server" code
		retPacket->attributes[0].type=18; // "Reply-Message" attribute
		retPacket->attributes[0].txtValue=SysAllocString(L"Hello, world!");

	return S_OK;

See Also

IRADIUSProcessor, IRADIUSProcessor::CanProcessPacket, RADIUS authentication packet processing, RADIUS accounting packet processing

© 2001-2003 XPerience Technologies.

Created by chm2web html help conversion utility.