NTPL

Reference Documentation

product_line_custom
IntelĀ® PAC
Napatech SmartNIC
category
Reference Information
Napatech Software Suite: NTPL

Detailed Description

Introduction

This section explains the NTPL syntax supported by the Napatech Software Suite. Only features included in feature sets N-ANL4 and up are described.

NTPL (NapaTech Programming Language) is a simple yet powerful adapter configuration interface that enables configuration of, for instance, filtering, hashing, multi-CPU buffer splitting and packet annotation.

Use of NTPL

NTPL is a simple plain text scripting language that can be used for adapter configuration in a number of ways:

  • For fast prototyping, NTPL commands can be issued on the command line using the Napatech NTPL tool. In this way filters, hash keys, multi-CPU buffer splitting and so on, can be changed on the fly without the need for compilation of code.
  • When the Napatech LibPCAP library or the Napatech WinPCAP library is used, an NTPL command file can be used to configure the working of the library.
  • NTPL commands written during prototyping using the ntpl tool can be moved unmodified into application source code by applying the NT_NTPL function of the NTAPI.

Note: When NTPL commands are delivered to the API or to the ntpl tool, they must be contained in one line, which can be up to approximately 4000 characters long. If you place your commands in a file, you may split a command over multiple lines. To tell that the command continues on the next line, place the continuation symbol '\' at the end of the line. If "#" or "//" is found, the rest of the line will be considered a comment.

The NTPL Commands

Backus-Naur Form

Throughout this document the syntax for the NTPL commands is specified using Backus-Naur form (BNF) notation. This section describes the Backus-Naur form.

The following table explains the BNF semantics.

SymbolMeaning
::=Consists of (is defined as)
<...>Syntactic category (nonterminal)
'...'As is (literal word - terminal)
[...]Optional, can appear zero or 1 time
{...}Optional, can appear zero or more times
|Or (separates alternatives)
()Used as normal parentheses

Note: Even though the BNF notation in the documentation might allow the same option to be set several times in an NTPL command, it is a general rule in NTPL that the same option cannot be set more than once.

Syntax for the NTPL Commands

This section specifies the syntax for the NTPL commands.

Note: The commands are not case-sensitive.

The syntax for the NTPL commands is shown below.

<FilterOperation> ::= <AssignAction> | <RetransmitAction> | <MacroAction> |
                      <DeleteAction> | <HashModeAction> | <HashMaskAction> |
                      <SetupAction> | <IPFModeAction> | <IPMatchListAction> |
                      <DefineAction>

Note: The commands Assign, HashMode, HashMask, IPFMode, IPMatchList, return an Ntpl ID. This id is used when deleting the specific filter or resource.

The detailed syntax is described in detail in the sections below.

Syntax for Comments

This section specifies the syntax for comments.

Note: Comments can be added to any command line. Adding a comment has the effect that the rest of the line is ignored by the NTPL interface.

The syntax for comments is shown below.

<Comment> ::= '//' <Ascii char> { <Ascii char> } <End of Line>

Modules

 Assign Command
 
 Retransmit Command
 
 Macro Command
 
 Delete Command
 
 HashMode Command
 
 HashMask Command
 
 Setup Command
 
 IPFMode Command
 
 IPMatchList Command
 
 KeyType Command
 
 KeyDef Command
 
 KeyList Command
 
 Define Command
 
 FilterInfo Command
 
 DeduplicationConfig Command
 
 Filter Expressions
 
 Protocol Tests
 
 Data Tests
 
 IP Match Tests
 
 Key Match Tests
 
 Key Tests
 
 Length Tests
 
 Port Tests
 
 Error Tests
 
 Shared Definitions