| ClearBox Server v2.3 Developer's Guide |
IRADIUSProcessor::ProcessPacketCalled 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); Parameters
Return ValuesIf extension returns error code, it is assumed that packet was not processed by the server extension. Thread SafetyThis 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 ManagementMemory 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. RemarksServer extension may set statusOK to VARIANT_FALSE and still process packet, making framework continue the processing. Example CodeThis 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)
{
*statusOK=VARIANT_FALSE;
if (inpPacket->packetCode==12) // "Status-Server" code
{
retPacket->attrNum=1;
retPacket->attributes=
reinterpret_cast<RADIUS_ATTRIBUTE>(
CoTaskMemAlloc(sizeof(RADIUS_ATTRIBUTE)));
retPacket->attributes[0].type=18; // "Reply-Message" attribute
retPacket->attributes[0].valType=RADTXT;
retPacket->attributes[0].txtValue=SysAllocString(L"Hello, world!");
retPacket->attributes[0].flags=0;
*statusOK=VARIANT_TRUE;
}
return S_OK;
}See AlsoIRADIUSProcessor, IRADIUSProcessor::CanProcessPacket, RADIUS authentication packet processing, RADIUS accounting packet processing © 2001-2004 XPerience Technologies. www.xperiencetech.com |
| Browser Based Help. Published by chm2web software. |