ClearBox Server v1.2 Developer's Guide |
ICSVAccounting::LogRADPacketCSVExWhen server extension calls this method and passes it an array of RADIUS attributes found in the RADIUS Accounting-Request packet (although this type of packets is not restricted), then server logs these attributes to the accounting logfile, every set of attributes on a new line, separating their values by a delimiter set in SetCSVOptions. This method differs from LogRADPacketCSV in the way that server extension is responsible for creating and managing the file passed to this method, while LogRADPacketCSVEx uses log files automatically managed by the server. Server extension should define logfile parameters before calling this method. It is done by making call to ILivingstonAccounting::SetLoggingOptionsEx or ILivingstonAccounting::SetLoggingOptions, inherited by ICSVAccounting interface. Besides this, SetLoggedAttributes or SetLoggedAttributesNames should be called to specify what attributes should be logged. HRESULT LogRADPacketCSVEx( [in] unsigned long attributesNum, [in] RADIUS_ATTRIBUTE* inpAttributes, [in] USERINFOLITE* userInf, [in] long fileHandle); Parameters
Return ValuesThis method may return E_INVALIDARG if attributesNum=0, inpAttributes=NULL, SetLoggedAttributes or SetLoggedAttributesNames were not called before. Thread SafetyThis method can be called from any thread. Memory ManagementServer extension should allocate and free memory for inpAttributes and userInf parameters. If server extension uses inpAttributes and userInf parameters passed to IRADIUSAccounting::ProcessAccounting implementation, then this memory is managed by the server. RemarksServer extension may pass any RADIUS attributes to this method, but only attributes that were specified explicitly in call to SetLoggedAttributes or SetLoggedAttributesNames are logged. If an attribute was listed in array passed to SetLoggedAttributes(Names) but it's not present in the inpAttributes array, empty value is logged. Example CodeThis code uses m_pAcc as ICSVAccounting interface pointer stored in ICommonExtenderEx::InitializeEx implementation. It makes server log accounting data into the file created by server extension. //Implementation of IRADIUSAccounting::ProcessAccounting STDMETHODIMP CTest::ProcessAccounting( long tag, USERINFOLITE * userInf, unsigned long attributesNum, RADIUS_ATTRIBUTE * inpAttributes, USERADDRESS * userAddr, ACCOUNTINGSTATUS * status) { *status=A_OK; // m_hFileHandle is a handle for a file created by server extension somewhere return m_pAcc->LogRADPacketCSVEx(attributesNum,inpAttribures,userInf, (long)m_hFileHandle); } See AlsoICSVAccounting, Server services, CSV Accounting Logging, SetLoggedAttributesNames, LogRADPacketCSV © 2001-2003 XPerience Technologies. www.xperiencetech.com |
Created by chm2web html help conversion utility. |