|ClearBox Server v1.2 Developer's Guide|
Common Programming Considerations
All integer values passed by server to server extension and back to server in interface methods are all in host byte order (less significant octet first, or so-called "little-Endian" order). This includes integer values of RADIUS attributes and dates.
Important note. All IP addresses are in network byte order. This includes NAS and client addresses, user's IP addresses used in synchronization.
If extension needs to use TACACS+ constants (such as TAC_PLUS_AUTHEN_SVC_PPP, TAC_PLUS_AUTHEN_TYPE_CHAP, etc.), it should include tacacs_codes.h file located in /SDK subdirectory of ClearBox Server installation.
According to COM programming considerations caller should allocate and free memory for the arguments passed to the callee. If callee allocates memory, it's freed by the caller.
Arguments with BSTR type are allocated by SysAllocString and released by SysFreeString. Memory for arrays is allocated calling CoTaskMemAlloc and freed by CoTaskMemFree.
Extension may need to read some configuration parameters, and is free in the way how to do it. It may them from ini-file, for instance. ClearBox Server offers standard mechanism to allow user configure extension properties. In order to use it:
Different errors may occur during extension execution, and all of them should be logged. At minimal level, extension may return standard HRESULT error code describing the error. If it is not sufficient, extension may use standard COM-exceptions mechanism.
In this case extension implements ISupportErrorInfo to tell server
what interfaces do provide information about an error.
Important note. Extension methods should not return error codes (values other than S_OK and S_FALSE) in normal conditions as COM-exception mechanism is rather slow, and it might affect performance greatly, especially if error is returned for every packet extension processes.
© 2001-2003 XPerience Technologies. www.xperiencetech.com
|Created by chm2web html help conversion utility.|