OpenNSL API Guide and Reference Manual
|
With few exceptions, all OpenNSL API routines return an integer indicating the success or error status of the call. All error codes (except OPENNSL_E_NONE) are negative and are one of the values given in table error_codes . Success is usually indicated by the return value of OPENNSL_E_NONE, which is defined to be zero. Some routines may also return other success indications as positive numbers. Any such deviations from the table 'error_codes' will be described in the individual API routine descriptions.
In the API descriptions, an arbitrary error return code is specified by writing OPENNSL_E_XXX. This means that the routine will return some error code listed in table 'error_codes'.
Routines may also propagate error indications from lower-level driver and utility routines. The error codes thus propagated are compatible with these OpenNSL error codes, and can be treated identically.
Access to the error definitions is through the include file <opennsl/error.h>.
Checking for the failure of an API call can be done by testing if its return value is negative or by using OPENNSL_FAILURE macro:
TABLE: Error Codes :: ERROR CODE [String Value]
DESCRIPTION
[Ok]
The routine completed successfully.[Internal error]
Some internal operations failed in an unexpected way. This usually indicates that an access to some hardware resource failed.[Out of memory]
Dynamically allocated memory was not available to complete the operation.[Invalid unit]
The first argument of any OpenNSL API routine is a unit number. This error occurs if that number does not refer to a currently attached unit.[Invalid parameter]
A parameter to a OpenNSL API routines was invalid. A null pointer value may have been passed to the routine, or an integer parameter may be outside of its allowed range.[Table empty]
The routine expected a table not to be empty.[Table full]
The routine could not add an entry to the table[Entry not found]
The specific entry in a table could not be found.[Entry exists]
The specific entry was already in a table[Operation timed out]
The routine started an operation that did not complete.[Operation still running]
The routine tried to start an operation, but a previous operation was still running.[Operation failed]
The routine attempted an operation that could not be completed. This may be because of a hardware failure or a configuration failure.[Operation disabled]
The routine could not complete because a required feature was temporarily disabled. This often relates to auto-negotiation.[Invalid identifier]
An identifier was not valid.[No resources for operation]
The routine needed more hardware resources than were available.[Invalid configuration]
The hardware does not support the requested configuration.[Feature unavailable]
The hardware does not support the requested routine.[Feature not initialized]
The routine used a part of the API that was not yet initialized.[Invalid port]
A port parameter was given that is not valid.