ClearBox Server v1.2 Developer's Guide |
ICSVAccounting::SetLoggedAttributesServer extension should call this method or SetLoggedAttributesNames to specify list of RADIUS attributes that are logged into accounting logfile. It's necessary to call one of these methods prior to using LogRADPacketCSV or LogRADPacketCSVEx methods. HRESULT SetLoggedAttributes( [in] unsigned long attributesNum, [in] unsigned char * loggedAttributes); Parameters
Return ValuesThis method may return E_INVALIDARG if attributesNum=0 or loggedAttributes=NULL. Thread SafetyThis method can be called from any thread. Memory ManagementServer extension should allocate and free memory for loggedAttributes parameter. RemarksAs vendor-specific attributes are defined not only by an attribute type, they can't be passed to this method. Use SetLoggedAttributesNames instead to address them by name. It's common case to call this method from ICommonExtenderEx::InitializeEx implementation. 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' 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 BYTE* pTypes=(BYTE*)CoTaskMemAlloc(sizeof(BYTE)*4); pTypes[0]=0; // Current date and time pTypes[1]=1; //'User-Name' pTypes[2]=46; //'Acct-Session-Time' pTypes[3]=49; //'Acct-Termination-Cause' pAcc->SetLoggedAttributes(4,pTypes); CoTaskMemFree(pTypes); // Call to pAcc->Release() is not necessary See AlsoICSVAccounting, Server services, CSV Accounting Logging, SetLoggedAttributesNames, LogRADPacketCSV © 2001-2003 XPerience Technologies. www.xperiencetech.com |
Created by chm2web html help conversion utility. |