ClearBox Server v1.2 Developer's Guide |
ITACACSAuthorization::GetAVPairsCalled when server processes authorization packet and requests extension for attribute-value pairs. HRESULT GetAVPairs( [in] long tag, [in] TAC_AUTHORPARAMS * authorParams, [in] BSTR service, [in] BSTR protocol, [out] unsigned long * outpSize, [out] AVPAIR * * outpPairs, [out] BSTR * explainString, [out] unsigned char * tacacsStatus); Parameters
Return ValuesIf extension returns error code, authorization error status is sent back to NAS as if tacacsStatusis set to TAC_PLUS_AUTHOR_STATUS_ERROR. 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 authorParams fields, service, protocol is allocated and freed by server, so extension must not change them. Memory for explainString and outpPairs may be allocated by extension and is freed by server. Example CodeThis code does not allow user John to ping 217.127.2.4 IP address and specifies 15 minutes timeout for his shell session. STDMETHODIMP CTest::GetAVPairs( long tag, TAC_AUTHORPARAMS * authorParams, BSTR service, BSTR protocol, unsigned long * outpSize, AVPAIR * * outpPairs, BSTR * explainString, unsigned char * tacacsStatus) { if (wcscmp(authorParams->user,L"John")==0 && wcscmp(service,L"shell")==0) { *outpSize=2; *outpPairs=reinterpret_cast<AVPAIR*>( CoTaskMemAlloc(sizeof(AVPAIR)*2)); (*outpPairs)[0].attribute=SysAllocString(L"cmd"); (*outpPairs)[0].value=SysAllocString(L"ping 217.127.2.4"); (*outpPairs)[0].mandType=M_MANDATORY; (*outpPairs)[0].access=A_DENY; (*outpPairs)[1].attribute=SysAllocString(L"timeout"); (*outpPairs)[1].value=SysAllocString(L"15"); (*outpPairs)[1].mandType=M_MANDATORY; (*outpPairs)[1].access=A_PERMIT; } return S_OK; } See AlsoITACACSAuthorization, List of TACACS+ Attribute-Value Pairs, Authorization concepts, TACACS+ authorization packet processing © 2001-2003 XPerience Technologies. www.xperiencetech.com |
Created by chm2web html help conversion utility. |