ClearBox Server v1.2 Developer's Guide |
IRADIUSProxyPolicy::GetReplaceAttributesCalled by server before forwarding packet to remote server or sending packet back to client to obtain from extension list of RADIUS attributes which should be added/removed/changed. If any of attributes from packet (both sent and received from remote server) match any of these attributes, they are replaced, deleted or added to the packet sent back. HRESULT GetReplaceAttributes( [in] long tag, [in] USERINFOLITE * userInf, [in] VARIANT_BOOL authenPacket, [in] VARIANT_BOOL proxyResponse, [out] unsigned long * attrNumOut, [out] RADIUS_ATTRIBUTE * * outpAttributesSrc, [out] RADIUS_ATTRIBUTE * * outpAttributesDst); Parameters
Return ValuesIf extension returns error code, it is assumed that no attributes were returned. Thread SafetyThis method is called in context of PROX thread. (See Server Threads Model for details.) You should synchronize data which is shared with other threads. Memory ManagementMemory for userInf fields is allocated and freed by server, so extension must not change them. Memory for outpAttributesSrc and outpAttributesDst may be allocated by extension and is freed by server. outpAttributesSrc and outpAttributesDst arrays must have the same size. RemarksIf type field of an attribute in outpAttributesSrc array is 0 and type field in the item with the same index in outpAttributesDst array is not 0, then attribute from outpAttributesDst is added to the packet. Only type=0 field must be set for attributes in outpAttributesSrc array, no other fields are used. If type field of an attribute in outpAttributesSrc is not 0 and type field in the item with the same index in outpAttributesDst array is 0, then attribute from outpAttributesDst is removed from sent packet (if found). Only type=0 field must be specified for attributes in outpAttributesDst array, no other fields are used. If extension wants to remove an attribute with the specified type, disregarding its value, F_NOVALUE flag must be set for an attribute in outpAttributesSrc array. If type field of an attribute in outpAttributesSrc array is not 0 and type field in the item with the same index in outpAttributesDst array is not 0, then attribute from outpAttributesSrc is replaced by the attribute from outpAttributesDst (if found). If extension wants to replace an attribute with the specified type, disregarding its value, F_NOVALUE flag must be set for an attribute in outpAttributesSrc array. If any attributes are returned in outpAttributesSrc and outpAttributesDst arrays, flags attribute field must be explicitly set to 0 or any appropriate value. Example CodeThis code makes changes in packets returned by remote RADIUS server. First, extension adds Reply-Message attribute. Second, it replaces value of Session-Timeout attribute if returned packet contains it. STDMETHODIMP GetReplaceAttributes(long tag, USERINFOLITE * userInf, VARIANT_BOOL authenPacket, VARIANT_BOOL proxyResponse, unsigned long * attrNumOut, RADIUS_ATTRIBUTE* * outpAttributesSrc, RADIUS_ATTRIBUTE* * outpAttributesDst) { if (proxyResponse==VARIANT_TRUE) { *attrNumOut=2; *outpAttributesSrc=reinterpret_cast See AlsoIRADIUSProxyPolicy, Realms and packet forwarding, RADIUS packet forwarding © 2001-2003 XPerience Technologies. www.xperiencetech.com |
Created by chm2web html help conversion utility. |