ntapi.h

Reference Documentation

product_line_custom
Napatech SmartNIC
category
Reference Information

Go to the documentation of this file.

1/* 2 * %NT_SOFTWARE_LICENSE% 3 */ 4 5/** 6 * @file 7 * 8 * This header file contains NTAPI function prototypes 9 */ 10#ifndef __NTAPI_H__ 11#define __NTAPI_H__ 12 13/** 14 * @brief Initializes the NTAPI library 15 * 16 * This function <em>must</em> be called prior to any other 17 * NTAPI function. It will initialize the NTAPI library and perform 18 * compatibility checks based on the version applied. 19 * The version is used to indicate to NTAPI what version of the API the 20 * application supports and will enable NTAPI to act on this and adapt to that 21 * version of the API if possible. This means that if the application is compiled 22 * to e.g. version 1 of the API and the current API is version 9, NT_Init will 23 * check if it is possible to enable backward compatibility to version 1 and 24 * thereby allow the application to run on a version 9 library with version 1 API. 25 * 26 * @param[in] version The version that the calling application supports 27 * 28 * @retval NT_SUCCESS Success 29 * @retval !=0 Error 30 */ 31int NT_Init(uint32_t version); 32 33/** 34 * @brief Closes down the NTAPI library 35 * 36 * @retval NT_SUCCESS Success 37 */ 38int NT_Done(void); 39 40/** 41 * @brief Explains an error code returned by NTAPI functions 42 * 43 * This function will convert the error code to text 44 * 45 * @param[in] error The error code to explain 46 * @param[in,out] buf Location of the explanation 47 * @param[in] buflen The buffer length to prevent buffer overrun. The define @ref NT_ERRBUF_SIZE "NT_ERRBUF_SIZE" should be used as buflen. 48 * 49 * @retval A pointer to buf 50 */ 51char *NT_ExplainError(int error, char *buf, uint32_t buflen); 52 53#endif // __NTAPI_H__