ntapi.h Source File

Reference Documentation

Platform
Intel® PAC
Napatech SmartNIC
Content Type
Reference Information
Capture Software Version
Link™ Capture Software 12.10
Napatech Software Suite: include/ntapi/ntapi.h Source File
ntapi.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (C) 2023 Napatech A/S.
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of the Napatech A/S nor the
14  * names of its contributors may be used to endorse or promote products
15  * derived from this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  * DISCLAIMED. IN NO EVENT SHALL NAPATECH A/S BE LIABLE FOR ANY
21  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  *
29 
30  */
31 
32 /**
33  * @file
34  *
35  * This header file contains NTAPI function prototypes
36  */
37 #ifndef __NTAPI_H__
38 #define __NTAPI_H__
39 
40 /**
41  * @brief Initializes the NTAPI library
42  *
43  * This function <em>must</em> be called prior to any other
44  * NTAPI function. It will initialize the NTAPI library and perform
45  * compatibility checks based on the version applied.
46  * The version is used to indicate to NTAPI what version of the API the
47  * application supports and will enable NTAPI to act on this and adapt to that
48  * version of the API if possible. This means that if the application is compiled
49  * to e.g. version 1 of the API and the current API is version 9, NT_Init will
50  * check if it is possible to enable backward compatibility to version 1 and
51  * thereby allow the application to run on a version 9 library with version 1 API.
52  *
53  * @param[in] version The version that the calling application supports
54  *
55  * @retval NT_SUCCESS Success
56  * @retval !=0 Error
57  */
58 NtError_t NT_Init(uint32_t version);
59 
60 /**
61  * @brief Closes down the NTAPI library
62  *
63  * @retval NT_SUCCESS Success
64  */
65 NtError_t NT_Done(void);
66 
67 /**
68  * @brief Explains an error code returned by NTAPI functions
69  *
70  * This function will convert the error code to text
71  *
72  * @param[in] error The error code to explain
73  * @param[in,out] buf Location of the explanation
74  * @param[in] buflen The buffer length to prevent buffer overrun. The define @ref NT_ERRBUF_SIZE "NT_ERRBUF_SIZE" should be used as buflen.
75  *
76  * @retval A pointer to buf
77  */
78 char *NT_ExplainError(NtError_t error, char *buf, uint32_t buflen);
79 
80 #endif // __NTAPI_H__