ClearBox Server v1.2 Developer's Guide | ||||||||||||
ICSVAccounting::SetLoggedAttributesNamesServer extension should call this method or SetLoggedAttributes (for RADIUS attributes only) to specify list of RADIUS or TACACS attributes that are logged into accounting logfile. It's necessary to call one of these methods prior to using LogRADPacketCSV, LogTACPacketCSV, LogRADPacketCSVEx or LogTACPacketCSVEx methods. HRESULT SetLoggedAttributesNames( [in] unsigned long attributesNum, [in] BSTR * loggedAttributes, [in] VARIANT_BOOL radiusAttributes); Parameters
Return ValuesThis method may return E_INVALIDARG if attributesNum=0, loggedAttributes=NULL, an array element is NULL or RADIUS attribute with a name specified is not found in the dictionary. Thread SafetyThis method can be called from any thread. Memory ManagementServer extension should allocate and free memory for loggedAttributes parameter. RemarksIt's common case to call this method from ICommonExtenderEx::InitializeEx implementation. Server maintains two separate lists for RADIUS and TACACS+ attributes, so call to this method with radiusAttributes set to VARIANT_TRUE (RADIUS attributes) doesn't affect list of TACACS logged attributes. Example CodeThis code uses m_pServer as IServer interface pointer stored in ICommonExtenderEx::InitializeEx implementation. It instructs the server that only 'User-Name', 'Acct-SessionTime' and 'Acct-Termination-Cause' RADIUS attributes will be logged together with current date and time (pseudo-attribute '@time'). ICSVAccounting* pAcc=NULL; m_pServer->QueryInterface(IID_ICSVAccounting,(void**)&pAcc; //QueryInterface will always succeed BSTR* pNames=(BSTR*)CoTaskMemAlloc(sizeof(BSTR)*4); pNames[0]=SysAllocString(L"@time"); // Current date and time pNames[1]=SysAllocString(L"User-Name"); pNames[2]=SysAllocString(L"Acct-Session-Time"); pNames[3]=SysAllocString(L"Acct-Termination-Cause"); HRESULT hRes=pAcc->SetLoggedAttributesNames(4,pNames,VARIANT_TRUE); for (int i=0;i<4;i++) SysFreeString(pNames[i]); CoTaskMemFree(pNames); // Call to pAcc->Release() is not necessary See AlsoICSVAccounting, Server services, CSV Accounting Logging, SetLoggedAttributes, LogRADPacketCSV, LogTACPacketCSV
© 2001-2003 XPerience Technologies. www.xperiencetech.com |
Created by chm2web html help conversion utility. |