ntapi.h

Reference Documentation

product_line_custom
IntelĀ® PAC
Napatech SmartNIC
category
Reference Information
Napatech Software Suite: include/ntapi/ntapi.h File Reference
ntapi.h File Reference

Detailed Description

This header file contains NTAPI function prototypes

Definition in file ntapi.h.

Go to the source code of this file.

Functions

int NT_Init (uint32_t version)
 Initializes the NTAPI library. More...
 
int NT_Done (void)
 Closes down the NTAPI library. More...
 
char * NT_ExplainError (int error, char *buf, uint32_t buflen)
 Explains an error code returned by NTAPI functions. More...
 

Function Documentation

int NT_Init ( uint32_t  version)

Initializes the NTAPI library.

This function must be called prior to any other NTAPI function. It will initialize the NTAPI library and perform compatibility checks based on the version applied. The version is used to indicate to NTAPI what version of the API the application supports and will enable NTAPI to act on this and adapt to that version of the API if possible. This means that if the application is compiled to e.g. version 1 of the API and the current API is version 9, NT_Init will check if it is possible to enable backward compatibility to version 1 and thereby allow the application to run on a version 9 library with version 1 API.

Parameters
[in]versionThe version that the calling application supports
Return values
NT_SUCCESSSuccess
!=0Error
Examples:
bypass/config/bypass_config_example.c, bypass/info/bypass_info_example.c, bypass/watchdog/bypass_watchdog_example.c, config/config_example.c, event/event_example.c, eventMonitor_example.c, flowmatch/flowmatch_example_main.cpp, info/info_example.c, net/analysis/analysis_example.c, net/capture/capture_example.c, net/checksum/checksum_example.cpp, net/inline/inline_example.c, net/ipfdemo/ipfdemo_example.c, net/netflow/netflow_example.c, net/numa/numa_example.c, net/readcapfile/readcapfile_example.c, net/replay/replay_example.c, net/replay4GA/replay4ga_example.c, net/replayGS/replayGS_example.c, net/streamidstatistics/streamidstatistics_example.c, net/timestamp_inject/timestamp_inject_example.cpp, net/transmit_multifunction/transmit_multifunction_example.c, net/transmit_on_timestamp/transmit_on_timestamp_example.c, net/transmit_on_timestamp_setclock/transmit_on_timestamp_setclock_example.c, net/transmit_packet/transmit_packet_example.c, net/transmit_pcap/transmit_pcap_example.c, net/transmit_segment/transmit_segment_example.c, net/transmit_segment_dyn_descr/transmit_segment_dyn_descr_example.cpp, net/vlandemo/vlandemo_example.c, pps/pps_example.c, sensor/sensor_example.c, stat/stat_example.c, and statUsage/statUsage_example.c.

Referenced by main().

char* NT_ExplainError ( int  error,
char *  buf,
uint32_t  buflen 
)

Explains an error code returned by NTAPI functions.

This function will convert the error code to text

Parameters
[in]errorThe error code to explain
[in,out]bufLocation of the explanation
[in]buflenThe buffer length to prevent buffer overrun. The define NT_ERRBUF_SIZE should be used as buflen.
Return values
Apointer to buf
Examples:
bypass/config/bypass_config_example.c, bypass/info/bypass_info_example.c, bypass/watchdog/bypass_watchdog_example.c, config/config_example.c, event/event_example.c, eventMonitor_example.c, info/info_example.c, net/analysis/analysis_example.c, net/capture/capture_example.c, net/checksum/checksum_example.cpp, net/inline/inline_example.c, net/ipfdemo/ipfdemo_example.c, net/netflow/netflow_example.c, net/numa/numa_example.c, net/readcapfile/readcapfile_example.c, net/replay/replay_example.c, net/replay4GA/replay4ga_example.c, net/replayGS/replayGS_example.c, net/streamidstatistics/streamidstatistics_example.c, net/timestamp_inject/timestamp_inject_example.cpp, net/transmit_multifunction/transmit_multifunction_example.c, net/transmit_on_timestamp/transmit_on_timestamp_example.c, net/transmit_on_timestamp_setclock/transmit_on_timestamp_setclock_example.c, net/transmit_packet/transmit_packet_example.c, net/transmit_pcap/transmit_pcap_example.c, net/transmit_segment/transmit_segment_example.c, net/transmit_segment_dyn_descr/transmit_segment_dyn_descr_example.cpp, net/vlandemo/vlandemo_example.c, pps/pps_example.c, sensor/sensor_example.c, stat/stat_example.c, and statUsage/statUsage_example.c.

Referenced by _NetTxDataCheckHbInfo(), _TxPortRateLimit(), featuresAvailable(), ForceAnEvent(), GetAdapterTimestamp(), GetSensorData(), GetTimeStamp(), handle_error_status(), handleErrorStatus(), if(), Is4GATxSupported(), main(), printError(), PacketReaderThread::processPackets(), SetGlobalSync(), PacketTransmitterThread::transmitPackets(), PacketTransmitterThread::txPacket(), and while().