pktdescr.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/pktdescr.h Source File
pktdescr.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  * This source file contains the packet macros available.\n
35  * See the @ref PacketMacros for details.
36  */
37 
38 #ifndef __PKT_DESCR_H__
39 #define __PKT_DESCR_H__
40 
41 #ifndef DOXYGEN_INTERNAL_ONLY
42 
43 /* In debug mode add assert to all general RX macros */
44 #ifdef NDEBUG
45 #define _NT_NET_ASSERT(x) (x)
46 #define _NT_NET_DESCR_CAST_ASSERT(x) (x)
47 #else
48 #define _NT_NET_ASSERT(x) (assert(0 && "macro argument: unsupported descriptor type"), x)
49 #define _NT_NET_DESCR_CAST_ASSERT(x) (assert(0 && "descriptor cast error."), x)
50 #endif
51 
52 #include "pktdescr_impl.h"
53 #include "pktdescr_std0.h"
54 #include "pktdescr_ext7.h"
55 #include "pktdescr_ext8.h"
56 #include "pktdescr_ext9.h"
57 #include "pktdescr_dyn.h"
58 #include "pktdescr_dyn1.h"
59 #include "pktdescr_dyn2.h"
60 #include "pktdescr_dyn3.h"
61 #include "pktdescr_dyn4.h"
62 
63 #endif // DOXYGEN_INTERNAL_ONLY
64 
65 /** @addtogroup DataMacros
66  * @{
67  */
68 
69 /** @defgroup PacketMacros Packet macros
70  * @{
71  * The following is only possible on packet-based streams.
72  *
73  * Unless specified otherwise, the NT_NET_GET_PKT_XYZ macros will return
74  * integer type values.
75  *
76  * In debug mode some packet macros contain an assert which asserts
77  * that the descriptor is supported for a given macro. Define the macro
78  * NDEBUG to remove the assert or use the build option -DNDEBUG. When
79  * the assert is removed the unsupported descriptors cause macros to return -1.
80  *
81  * The descriptor support for the various macros is as follows:
82  *
83  * <table border="1">
84  * <tr>
85  * <th>Macro group</th>
86  * <th>NT</th><th>Ext7</th><th>Ext8</th><th>Ext9</th><th>Dyn</th>
87  * </tr>
88  * <tr><td>Basic descriptor macros</td>
89  * <td> X </td><td> X </td><td> X </td><td> X </td><td> X </td></tr>
90  * <tr><td>NT descriptor macros</td>
91  * <td> X </td><td> X </td><td> X </td><td> X </td><td> </td></tr>
92  * <tr><td>Extended NT descriptor macros</td>
93  * <td> </td><td> X </td><td> X </td><td> X </td><td> </td></tr>
94  * <tr><td>Extended NT descriptor IPF macros</td>
95  * <td> </td><td> </td><td> X </td><td> X </td><td> </td></tr>
96  * <tr><td>Extended NT descriptor Tunneling macros</td>
97  * <td> </td><td> </td><td> </td><td> X </td><td> </td></tr>
98  * <tr><td>TX macros</td>
99  * <td> X </td><td> X </td><td> X </td><td> X </td><td> </td></tr>
100  * </table>
101  *
102  * Note that some macros may exist in different variants for each descriptor
103  * type. In that case, the supported descriptor is part of the macro name.
104  *
105  */
106 
107 /** @defgroup BasicDescriptorMacros Basic descriptor macros
108  * @{
109  * The following macros are always available.
110  */
111 
112 /** @def NT_DESCR_STD_LENGTH
113  * @brief Constant integer with length of the NT standard descriptor
114  * @hideinitializer
115  */
116 #define NT_DESCR_STD_LENGTH (sizeof(NtStd0Descr_t))
117 
118 /** @def NT_DESCR_EXT7_LENGTH
119  * @brief Length of the NT Extended 7 descriptor
120  * @brief Constant integer with length of the NT Extended 7 descriptor
121  * @hideinitializer
122  */
123 #define NT_DESCR_EXT7_LENGTH (sizeof(NtExt7Descr_t))
124 
125 /** @def NT_DESCR_EXT8_LENGTH
126  * @brief Constant integer with length of the NT Extended 8 descriptor
127  * @hideinitializer
128  */
129 #define NT_DESCR_EXT8_LENGTH (sizeof(NtExt8Descr_t))
130 
131 /** @def NT_DESCR_EXT9_LENGTH
132  * @brief Constant integer with length of the NT Extended 9 descriptor
133  * @hideinitializer
134  */
135 #define NT_DESCR_EXT9_LENGTH (sizeof(NtExt9Descr_t))
136 
137 /** @def NT_DESCR_DYN1_LENGTH
138  * @brief Constant integer with length of the NT Dynamic 1 descriptor
139  * @hideinitializer
140  */
141 #define NT_DESCR_DYN1_LENGTH (sizeof(NtDyn1Descr_t))
142 
143 /** @def NT_DESCR_DYN2_LENGTH
144  * @brief Constant integer with length of the NT Dynamic 2 descriptor
145  * @hideinitializer
146  */
147 #define NT_DESCR_DYN2_LENGTH (sizeof(NtDyn2Descr_t))
148 
149 /** @def NT_DESCR_DYN3_LENGTH
150  * @brief Constant integer with length of the NT Dynamic 3 descriptor
151  * @hideinitializer
152  */
153 #define NT_DESCR_DYN3_LENGTH (sizeof(NtDyn3Descr_t))
154 
155 /** @def NT_DESCR_DYN4_LENGTH
156  * @brief Constant integer with length of the NT Dynamic 4 descriptor
157  * @hideinitializer
158  */
159 #define NT_DESCR_DYN4_LENGTH (sizeof(NtDyn4Descr_t))
160 
161 /** @def NT_NET_SET_PKT_CLEAR_DESCR_STD
162  * @brief Clears the STD descriptor
163  * @param[in] "_hNetBuf_" Packet container reference
164  * @hideinitializer
165  */
166 #define NT_NET_SET_PKT_CLEAR_DESCR_STD(_hNetBuf_) do{ memset((_hNetBuf_)->hHdr, 0, sizeof(NtStd0Descr_t)); } while(0)
167 
168 /** @def NT_NET_SET_PKT_CLEAR_DESCR_EXT7
169  * @brief Clears the EXT7 descriptor
170  * @param[in] "_hNetBuf_" Packet container reference
171  * @hideinitializer
172  */
173 #define NT_NET_SET_PKT_CLEAR_DESCR_EXT7(_hNetBuf_) do{ memset((_hNetBuf_)->hHdr, 0, sizeof(NtExt7Descr_t)); } while(0)
174 
175 /** @def NT_NET_SET_PKT_CLEAR_DESCR_EXT8
176  * @brief Clears the EXT8 descriptor
177  * @param[in] "_hNetBuf_" Packet container reference
178  * @hideinitializer
179  */
180 #define NT_NET_SET_PKT_CLEAR_DESCR_EXT8(_hNetBuf_) do{ memset((_hNetBuf_)->hHdr, 0, sizeof(NtExt8Descr_t)); } while(0)
181 
182 /** @def NT_NET_SET_PKT_CLEAR_DESCR_EXT9
183  * @brief Clears the EXT9 descriptor
184  * @param[in] "_hNetBuf_" Packet container reference
185  * @hideinitializer
186  */
187 #define NT_NET_SET_PKT_CLEAR_DESCR_EXT9(_hNetBuf_) do{ memset((_hNetBuf_)->hHdr, 0, sizeof(NtExt9Descr_t)); } while(0)
188 
189 /** @def NT_NET_SET_PKT_CLEAR_DESCR_DYN1
190  * @brief Clears the DYN1 descriptor
191  * @param[in] "_hNetBuf_" Packet container reference
192  * @hideinitializer
193  */
194 #define NT_NET_SET_PKT_CLEAR_DESCR_DYN1(_hNetBuf_) do{ memset((_hNetBuf_)->hHdr, 0, sizeof(NtDyn1Descr_t)); } while(0)
195 
196 /** @def NT_NET_SET_PKT_CLEAR_DESCR_DYN2
197  * @brief Clears the DYN2 descriptor
198  * @param[in] "_hNetBuf_" Packet container reference
199  * @hideinitializer
200  */
201 #define NT_NET_SET_PKT_CLEAR_DESCR_DYN2(_hNetBuf_) do{ memset((_hNetBuf_)->hHdr, 0, sizeof(NtDyn2Descr_t)); } while(0)
202 
203 /** @def NT_NET_SET_PKT_CLEAR_DESCR_DYN3
204  * @brief Clears the DYN3 descriptor
205  * @param[in] "_hNetBuf_" Packet container reference
206  * @hideinitializer
207  */
208 #define NT_NET_SET_PKT_CLEAR_DESCR_DYN3(_hNetBuf_) do{ memset((_hNetBuf_)->hHdr, 0, sizeof(NtDyn3Descr_t)); } while(0)
209 
210 /** @def NT_NET_SET_PKT_CLEAR_DESCR_DYN4
211  * @brief Clears the DYN4 descriptor
212  * @param[in] "_hNetBuf_" Packet container reference
213  * @hideinitializer
214  */
215 #define NT_NET_SET_PKT_CLEAR_DESCR_DYN4(_hNetBuf_) do{ memset((_hNetBuf_)->hHdr, 0, sizeof(NtDyn4Descr_t)); } while(0)
216 
217 /** @def NT_NET_GET_PKT_DESCR_TYPE
218  * @brief Get the packet descriptor type.
219  * @param[in] "_hNetBuf_" Packet container reference
220  * @return Returns the packet descriptor type. See @ref NtPacketDescriptorType_e for values.
221  * @hideinitializer
222  */
223 #define NT_NET_GET_PKT_DESCR_TYPE(_hNetBuf_) _NT_NET_GET_PKT_DESCR_TYPE(_hNetBuf_)
224 
225 /** @def NT_NET_SET_PKT_DESCR_TYPE_STD
226  * @brief Sets the packet descriptor type to NT
227  * @param[in] "_hNetBuf_" Packet container reference
228  * @hideinitializer
229  */
230 #define NT_NET_SET_PKT_DESCR_TYPE_STD(_hNetBuf_) do{ _NT_NET_GET_PKT_DESCR_PTR_STD0(_hNetBuf_)->descriptorType = 1; } while(0)
231 
232 /** @def NT_NET_SET_PKT_DESCR_TYPE_EXT7
233  * @brief Sets the packet descriptor type to EXT7
234  * @param[in] "_hNetBuf_" Packet container reference
235  * @hideinitializer
236  */
237 #ifndef DOXYGEN_INTERNAL_ONLY
238 #define NT_EXTENDED_DESCRIPTOR_07_LENGTH 2
239 #define NT_EXTENDED_DESCRIPTOR_07_TYPE 7
240 #endif // DOXYGEN_INTERNAL_ONLY
241 #define NT_NET_SET_PKT_DESCR_TYPE_EXT7(_hNetBuf_) \
242  do{ _NT_NET_GET_PKT_DESCR_PTR_STD0(_hNetBuf_)->descriptorType = 1; \
243  _NT_NET_GET_PKT_DESCR_PTR_STD0(_hNetBuf_)->extensionFormat = NT_EXTENDED_DESCRIPTOR_07_TYPE; \
244  _NT_NET_GET_PKT_DESCR_PTR_STD0(_hNetBuf_)->extensionLength = NT_EXTENDED_DESCRIPTOR_07_LENGTH; } while(0)
245 
246 /** @def NT_NET_SET_PKT_DESCR_TYPE_EXT8
247  * @brief Sets the packet descriptor type to EXT8
248  * @param[in] "_hNetBuf_" Packet container reference
249  * @hideinitializer
250  */
251 #ifndef DOXYGEN_INTERNAL_ONLY
252 #define NT_EXTENDED_DESCRIPTOR_08_LENGTH 2
253 #define NT_EXTENDED_DESCRIPTOR_08_TYPE 8
254 #endif // DOXYGEN_INTERNAL_ONLY
255 #define NT_NET_SET_PKT_DESCR_TYPE_EXT8(_hNetBuf_) \
256  do{ _NT_NET_GET_PKT_DESCR_PTR_STD0(_hNetBuf_)->descriptorType = 1; \
257  _NT_NET_GET_PKT_DESCR_PTR_STD0(_hNetBuf_)->extensionFormat = NT_EXTENDED_DESCRIPTOR_08_TYPE; \
258  _NT_NET_GET_PKT_DESCR_PTR_STD0(_hNetBuf_)->extensionLength = NT_EXTENDED_DESCRIPTOR_08_LENGTH; } while(0)
259 
260 /** @def NT_NET_SET_PKT_DESCR_TYPE_EXT9
261  * @brief Sets the packet descriptor type to EXT9
262  * @param[in] "_hNetBuf_" Packet container reference
263  * @hideinitializer
264  */
265 #ifndef DOXYGEN_INTERNAL_ONLY
266 #define NT_EXTENDED_DESCRIPTOR_09_LENGTH 3
267 #define NT_EXTENDED_DESCRIPTOR_09_TYPE 9
268 #endif // DOXYGEN_INTERNAL_ONLY
269 #define NT_NET_SET_PKT_DESCR_TYPE_EXT9(_hNetBuf_) \
270  do{ _NT_NET_GET_PKT_DESCR_PTR_STD0(_hNetBuf_)->descriptorType = 1; \
271  _NT_NET_GET_PKT_DESCR_PTR_STD0(_hNetBuf_)->extensionFormat = NT_EXTENDED_DESCRIPTOR_09_TYPE; \
272  _NT_NET_GET_PKT_DESCR_PTR_STD0(_hNetBuf_)->extensionLength = NT_EXTENDED_DESCRIPTOR_09_LENGTH; } while(0)
273 
274 /** @def NT_NET_SET_PKT_DESCR_TYPE_DYN1
275  * @brief Sets the packet descriptor type to DYN1
276  * @param[in] "_hNetBuf_" Packet container reference
277  * @hideinitializer
278  */
279 #ifndef DOXYGEN_INTERNAL_ONLY
280 #define NT_DYNAMIC_DESCRIPTOR_01_FORMAT 1
281 #define NT_DYNAMIC_DESCRIPTOR_01_LENGTH 18
282 #endif // DOXYGEN_INTERNAL_ONLY
283 #define NT_NET_SET_PKT_DESCR_TYPE_DYN1(_hNetBuf_) \
284  do{ _NT_NET_GET_PKT_DESCR_PTR_DYN(_hNetBuf_)->ntDynDescr = 1; \
285  _NT_NET_GET_PKT_DESCR_PTR_DYN(_hNetBuf_)->descrFormat = NT_DYNAMIC_DESCRIPTOR_01_FORMAT; \
286  _NT_NET_GET_PKT_DESCR_PTR_DYN(_hNetBuf_)->descrLength = NT_DYNAMIC_DESCRIPTOR_01_LENGTH; } while(0)
287 
288 /** @def NT_NET_SET_PKT_DESCR_TYPE_DYN2
289  * @brief Sets the packet descriptor type to DYN2
290  * @param[in] "_hNetBuf_" Packet container reference
291  * @hideinitializer
292  */
293 #ifndef DOXYGEN_INTERNAL_ONLY
294 #define NT_DYNAMIC_DESCRIPTOR_02_FORMAT 2
295 #define NT_DYNAMIC_DESCRIPTOR_02_LENGTH 22
296 #endif // DOXYGEN_INTERNAL_ONLY
297 #define NT_NET_SET_PKT_DESCR_TYPE_DYN2(_hNetBuf_) \
298  do{ _NT_NET_GET_PKT_DESCR_PTR_DYN(_hNetBuf_)->ntDynDescr = 1; \
299  _NT_NET_GET_PKT_DESCR_PTR_DYN(_hNetBuf_)->descrFormat = NT_DYNAMIC_DESCRIPTOR_02_FORMAT; \
300  _NT_NET_GET_PKT_DESCR_PTR_DYN(_hNetBuf_)->descrLength = NT_DYNAMIC_DESCRIPTOR_02_LENGTH; } while(0)
301 
302 /** @def NT_NET_SET_PKT_DESCR_TYPE_DYN3
303  * @brief Sets the packet descriptor type to DYN3
304  * @param[in] "_hNetBuf_" Packet container reference
305  * @hideinitializer
306  */
307 #ifndef DOXYGEN_INTERNAL_ONLY
308 #define NT_DYNAMIC_DESCRIPTOR_03_FORMAT 3
309 #define NT_DYNAMIC_DESCRIPTOR_03_LENGTH 22
310 #endif // DOXYGEN_INTERNAL_ONLY
311 #define NT_NET_SET_PKT_DESCR_TYPE_DYN3(_hNetBuf_) \
312  do{ _NT_NET_GET_PKT_DESCR_PTR_DYN(_hNetBuf_)->ntDynDescr = 1; \
313  _NT_NET_GET_PKT_DESCR_PTR_DYN(_hNetBuf_)->descrFormat = NT_DYNAMIC_DESCRIPTOR_03_FORMAT; \
314  _NT_NET_GET_PKT_DESCR_PTR_DYN(_hNetBuf_)->descrLength = NT_DYNAMIC_DESCRIPTOR_03_LENGTH; } while(0)
315 
316 /** @def NT_NET_SET_PKT_DESCR_TYPE_DYN4
317  * @brief Sets the packet descriptor type to DYN4
318  * @param[in] "_hNetBuf_" Packet container reference
319  * @hideinitializer
320  */
321 #ifndef DOXYGEN_INTERNAL_ONLY
322 #define NT_DYNAMIC_DESCRIPTOR_04_FORMAT 4
323 #define NT_DYNAMIC_DESCRIPTOR_04_LENGTH 24
324 #endif // DOXYGEN_INTERNAL_ONLY
325 #define NT_NET_SET_PKT_DESCR_TYPE_DYN4(_hNetBuf_) \
326  do{ _NT_NET_GET_PKT_DESCR_PTR_DYN(_hNetBuf_)->ntDynDescr = 1; \
327  _NT_NET_GET_PKT_DESCR_PTR_DYN(_hNetBuf_)->descrFormat = NT_DYNAMIC_DESCRIPTOR_04_FORMAT; \
328  _NT_NET_GET_PKT_DESCR_PTR_DYN(_hNetBuf_)->descrLength = NT_DYNAMIC_DESCRIPTOR_04_LENGTH; } while(0)
329 
330 /** @def NT_NET_GET_PKT_DESCR_PTR_STD
331  * @brief Get standard packet descriptor pointer
332  * @param[in] "_hNetBuf_" Packet container reference
333  * @return Returns a pointer to the packet descriptor
334  * @hideinitializer
335  */
336 #define NT_NET_GET_PKT_DESCR_PTR_STD(_hNetBuf_) _NT_NET_GET_PKT_DESCR_PTR_STD0(_hNetBuf_)
337 
338 /** @def NT_NET_GET_PKT_DESCR_PTR_EXT7
339  * @brief Get extended packet descriptor 7 pointer
340  * @param[in] "_hNetBuf_" Packet container reference
341  * @return Returns a pointer to the packet descriptor
342  * @hideinitializer
343  */
344 #define NT_NET_GET_PKT_DESCR_PTR_EXT7(_hNetBuf_) _NT_NET_GET_PKT_DESCR_PTR_EXT7(_hNetBuf_)
345 
346 /** @def NT_NET_GET_PKT_DESCR_PTR_EXT8
347  * @brief Get extended packet descriptor 8 pointer
348  * @param[in] "_hNetBuf_" Packet container reference
349  * @return Returns a pointer to the packet descriptor
350  * @hideinitializer
351  */
352 #define NT_NET_GET_PKT_DESCR_PTR_EXT8(_hNetBuf_) _NT_NET_GET_PKT_DESCR_PTR_EXT8(_hNetBuf_)
353 
354 /** @def NT_NET_GET_PKT_DESCR_PTR_EXT9
355  * @brief Get extended packet descriptor 9 pointer
356  * @param[in] "_hNetBuf_" Packet container reference
357  * @return Returns a pointer to the packet descriptor
358  * @hideinitializer
359  */
360 #define NT_NET_GET_PKT_DESCR_PTR_EXT9(_hNetBuf_) _NT_NET_GET_PKT_DESCR_PTR_EXT9(_hNetBuf_)
361 
362 /** @def NT_NET_GET_PKT_DESCR_PTR_DYN1
363  * @brief Get dynamic packet descriptor 1 pointer
364  * @param[in] "_hNetBuf_" Packet container reference
365  * @return Returns a pointer to the packet descriptor
366  * @hideinitializer
367  */
368 #define NT_NET_GET_PKT_DESCR_PTR_DYN1(_hNetBuf_) _NT_NET_GET_PKT_DESCR_PTR_DYN1(_hNetBuf_)
369 
370 /** @def NT_NET_GET_PKT_DESCR_PTR_DYN2
371  * @brief Get dynamic packet descriptor 2 pointer
372  * @param[in] "_hNetBuf_" Packet container reference
373  * @return Returns a pointer to the packet descriptor
374  * @hideinitializer
375  */
376 #define NT_NET_GET_PKT_DESCR_PTR_DYN2(_hNetBuf_) _NT_NET_GET_PKT_DESCR_PTR_DYN2(_hNetBuf_)
377 
378 /** @def NT_NET_GET_PKT_DESCR_PTR_DYN3
379  * @brief Get dynamic packet descriptor 3 pointer
380  * @param[in] "_hNetBuf_" Packet container reference
381  * @return Returns a pointer to the packet descriptor
382  * @hideinitializer
383  */
384 #define NT_NET_GET_PKT_DESCR_PTR_DYN3(_hNetBuf_) _NT_NET_GET_PKT_DESCR_PTR_DYN3(_hNetBuf_)
385 
386 /** @def NT_NET_GET_PKT_DESCR_PTR_DYN4
387  * @brief Get dynamic packet descriptor 4 pointer
388  * @param[in] "_hNetBuf_" Packet container reference
389  * @return Returns a pointer to the packet descriptor
390  * @hideinitializer
391  */
392 #define NT_NET_GET_PKT_DESCR_PTR_DYN4(_hNetBuf_) _NT_NET_GET_PKT_DESCR_PTR_DYN4(_hNetBuf_)
393 
394 /** @def NT_NET_GET_PKT_L2_PTR
395  * @brief A pointer to the L2 packet data. If an ISL header is present it will point to the ISL header.
396  * @param[in] "_hNetBuf_" Packet container reference
397  * @return Returns a void pointer to L2 packet data.
398  * @hideinitializer
399  */
400 #define NT_NET_GET_PKT_L2_PTR(_hNetBuf_) _NT_NET_GET_PKT_L2_PTR(_hNetBuf_)
401 
402 /** @def NT_NET_UPDATE_PKT_L2_PTR
403  * @brief When creating packets within a segment it is required to update the L2 pointer using this macro after applying the descriptor info
404  * @param[in] "_hNetBuf_" Packet container reference
405  * @hideinitializer
406  */
407 #define NT_NET_UPDATE_PKT_L2_PTR(_hNetBuf_) _NT_NET_UPDATE_PKT_L2_PTR(_hNetBuf_)
408 
409 
410 /** @def NT_NET_GET_PKT_DESCR_LENGTH
411  * @brief Get the length of the packet descriptor
412  * @param[in] "_hNetBuf_" Packet container reference
413  * @return Return the length of the packet descriptor in bytes
414  * @hideinitializer
415  */
416 #define NT_NET_GET_PKT_DESCR_LENGTH(_hNetBuf_) _NT_NET_GET_PKT_DESCR_LENGTH(_hNetBuf_)
417 
418 /** @def NT_NET_GET_PKT_DESCR_FORMAT
419  * @brief Indicates if extended packet descriptor 7, 8, or 9 is used, if the
420  * standard packet descriptor is used, or what dynamic packet descriptor type is used.
421  * @param[in] "_hNetBuf_" Packet container reference
422  * @return Returns the packet descriptor format used
423  * @hideinitializer
424  */
425 #define NT_NET_GET_PKT_DESCR_FORMAT(_hNetBuf_) _NT_NET_GET_PKT_DESCR_FORMAT(_hNetBuf_)
426 
427 /** @def NT_NET_GET_PKT_TIMESTAMP
428  * @brief Get the packet timestamp
429  * @param[in] "_hNetBuf_" Packet container reference
430  * @return Returns the time when the packet was captured as an 64bit unsigned value
431  * @hideinitializer
432  */
433 #define NT_NET_GET_PKT_TIMESTAMP(_hNetBuf_) _NT_NET_GET_PKT_TIMESTAMP(_hNetBuf_)
434 
435 /** @def NT_NET_SET_PKT_TIMESTAMP
436  * @brief Sets the packet time stamp - useful when controlling the traffic rate
437  * @param[in] "_hNetBuf_" Packet container reference
438  * @param[in] "_ts_" The timestamp value in 10ns resolution NATIVE format
439  * @hideinitializer
440  */
441 #define NT_NET_SET_PKT_TIMESTAMP(_hNetBuf_, _ts_) _NT_NET_SET_PKT_TIMESTAMP(_hNetBuf_, _ts_)
442 
443 /** @def NT_NET_GET_PKT_TIMESTAMP_TYPE
444  * @brief Get the packet time stamp type. See @ref NtTimestampType_e
445  * @param[in] "_hNetBuf_" Packet container reference
446  * @return Returns the packet time stamp type. See @ref NtTimestampType_e for values
447  * @hideinitializer
448  */
449 #define NT_NET_GET_PKT_TIMESTAMP_TYPE(_hNetBuf_) _NT_NET_GET_PKT_TIMESTAMP_TYPE(_hNetBuf_)
450 
451 /** @def NT_NET_GET_PKT_CAP_LENGTH
452  * @brief Returns the total stored length of the received frame including
453  * packet descriptors, in bytes, after any slicing. The value is a multiple
454  * of eight for frames received on 3GA adapters, or if the capture length
455  * was set with the ALIGN macro.
456  * The value is also rounded up for unsliced frames with wire lengths
457  * that are not a multiple of eight (bytes).
458  * NT_NET_GET_PKT_CAP_LENGTH returns a value of type uint16_t.
459  * @param[in] "_hNetBuf_" Packet container reference
460  * @return Returns an uint16_t value that is the total stored length of the received frame
461  * @hideinitializer
462  */
463 #define NT_NET_GET_PKT_CAP_LENGTH(_hNetBuf_) ((uint16_t)(_NT_NET_GET_PKT_CAP_LENGTH(_hNetBuf_)))
464 
465 /** @def NT_NET_SET_PKT_CAP_LENGTH_NOALIGN
466  * @brief Calculates and sets the packet capture length. Input is wire length. Capture length is calculated from the value - no alignment is applied
467  * @param[in] "_hNetBuf_" Packet container reference
468  * @param[in] "_Length_" The length value
469  * @hideinitializer
470  */
471 #define NT_NET_SET_PKT_CAP_LENGTH_NOALIGN(_hNetBuf_, _Length_) _NT_NET_SET_PKT_CAP_LENGTH_NOALIGN(_hNetBuf_, _Length_)
472 
473 /** @} */
474 
475 /** @defgroup NtDescriptorMacros NT descriptor macros
476  * @{
477 
478  * The following is only available if "PacketDescriptor = NT or Ext7 or Ext8 or Ext9" has been selected in the ntservice.ini file
479  * and if @ref NT_NET_GET_PKT_DESCRIPTOR_TYPE returns @ref NT_PACKET_DESCRIPTOR_TYPE_NT || @ref NT_PACKET_DESCRIPTOR_TYPE_NT_EXTENDED.
480  * The following macros constitute the collection extracting data from the "NT" descriptor.
481  */
482 
483 /** @def NT_NET_SET_PKT_CAP_LENGTH_ALIGN_NT
484  * @brief Calculates and sets the packet capture length. Input is wire length. Capture length is calculated from the value.
485  * @param[in] "_hNetBuf_" Packet container reference
486  * @param[in] "_Length_" The length value
487  * @hideinitializer
488  */
489 #define NT_NET_SET_PKT_CAP_LENGTH_ALIGN_NT(_hNetBuf_, _Length_) _NT_NET_SET_PKT_CAP_LENGTH_ALIGN_NT(_hNetBuf_, _Length_)
490 
491 /** @def NT_NET_GET_PKT_WIRE_LENGTH_NT
492  * @brief Returns the wire length of the received frame, in bytes, with the
493  * value saturated at 16,383 for longer frames.
494  * NT_NET_GET_PKT_WIRE_LENGTH_NT returns a value of type uint16_t.
495  * @param[in] "_hNetBuf_" Packet container reference
496  * @return Returns an uint16_t value that is the packet wire length
497  * @hideinitializer
498  */
499 #define NT_NET_GET_PKT_WIRE_LENGTH_NT(_hNetBuf_) ((uint16_t)_NT_NET_GET_PKT_WIRE_LENGTH_NT(_hNetBuf_))
500 
501 /** @def NT_NET_SET_PKT_WIRE_LENGTH_NT
502  * @brief Sets the packet wire length
503  * @param[in] "_hNetBuf_" Packet container reference
504  * @param[in] "_Length_" The length value
505  * @hideinitializer
506  */
507 #define NT_NET_SET_PKT_WIRE_LENGTH_NT(_hNetBuf_, _Length_) _NT_NET_SET_PKT_WIRE_LENGTH_NT(_hNetBuf_, _Length_)
508 
509 /** @def NT_NET_GET_PKT_CRC_ERROR_NT
510  * @brief Indicates if the received frame has a layer 2 CRC error.
511  * @param[in] "_hNetBuf_" Packet container reference
512  * @return Returns 1 if the packet has a L2 CRC error - If no L2 CRC error this is 0.
513  * @hideinitializer
514  */
515 #define NT_NET_GET_PKT_CRC_ERROR_NT(_hNetBuf_) _NT_NET_GET_PKT_CRC_ERROR_NT(_hNetBuf_)
516 
517 /** @def NT_NET_SET_PKT_CRC_ERROR_NT
518  * @brief Sets if the packet has a CRC error
519  * @param[in] "_hNetBuf_" Packet container reference
520  * @param[in] "_bval_" Set to 1 if packet has a CRC error, 0 otherwise
521  * @hideinitializer
522  */
523 #define NT_NET_SET_PKT_CRC_ERROR_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_CRC_ERROR_NT(_hNetBuf_, _bval_)
524 
525 /** @def NT_NET_GET_PKT_TCP_CSUM_OK_NT
526  * @brief Indicates if the received TCP checksum is correct
527  * @param[in] "_hNetBuf_" Packet container reference
528  * @return Returns 1 if the packet has a valid TCP checksum - if not a TCP packet this is 0
529  * @hideinitializer
530  */
531 #define NT_NET_GET_PKT_TCP_CSUM_OK_NT(_hNetBuf_) _NT_NET_GET_PKT_TCP_CSUM_OK_NT(_hNetBuf_)
532 
533 /** @def NT_NET_SET_PKT_TCP_CSUM_OK_NT
534  * @brief Sets if the packet has an OK TCP checksum
535  * @param[in] "_hNetBuf_" Packet container reference
536  * @param[in] "_bval_" Set to 1 if packet packet has an OK TCP checksum, 0 otherwise
537  * @hideinitializer
538  */
539 #define NT_NET_SET_PKT_TCP_CSUM_OK_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_TCP_CSUM_OK_NT(_hNetBuf_, _bval_)
540 
541 /** @def NT_NET_GET_PKT_UDP_CSUM_OK_NT
542  * @brief Indicates if the received UDP checksum is correct
543  * @param[in] "_hNetBuf_" Packet container reference
544  * @return Returns 1 if the packet has a valid UDP checksum - if not a UDP packet this is 0
545  * @hideinitializer
546  */
547 #define NT_NET_GET_PKT_UDP_CSUM_OK_NT(_hNetBuf_) _NT_NET_GET_PKT_UDP_CSUM_OK_NT(_hNetBuf_)
548 
549 /** @def NT_NET_SET_PKT_UDP_CSUM_OK_NT
550  * @brief Sets if the packet has an OK UDP checksum
551  * @param[in] "_hNetBuf_" Packet container reference
552  * @param[in] "_bval_" Set to 1 if packet packet has an OK UDP checksum, 0 otherwise
553  * @hideinitializer
554  */
555 #define NT_NET_SET_PKT_UDP_CSUM_OK_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_UDP_CSUM_OK_NT(_hNetBuf_, _bval_)
556 
557 /** @def NT_NET_GET_PKT_IP_CSUM_OK_NT
558  * @brief Indicates if the received IP checksum is correct
559  * @param[in] "_hNetBuf_" Packet container reference
560  * @return Returns 1 if the packet has a valid IP checksum - if not an IP packet this is 0
561  * @hideinitializer
562  */
563 #define NT_NET_GET_PKT_IP_CSUM_OK_NT(_hNetBuf_) _NT_NET_GET_PKT_IP_CSUM_OK_NT(_hNetBuf_)
564 
565 /** @def NT_NET_SET_PKT_IP_CSUM_OK_NT
566  * @brief Sets if the packet has an OK IP checksum
567  * @param[in] "_hNetBuf_" Packet container reference
568  * @param[in] "_bval_" Set to 1 if packet packet has an OK IP checksum, 0 otherwise
569  * @hideinitializer
570  */
571 #define NT_NET_SET_PKT_IP_CSUM_OK_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_IP_CSUM_OK_NT(_hNetBuf_, _bval_)
572 
573 /** @def NT_NET_GET_PKT_CV_ERROR_NT
574  * @brief Indicates if the frame has any coding violations errors.
575  * @param[in] "_hNetBuf_" Packet container reference
576  * @return Returns 1 if the packet has coding violations - If no coding violations this is 0.
577  * @hideinitializer
578  */
579 #define NT_NET_GET_PKT_CV_ERROR_NT(_hNetBuf_) _NT_NET_GET_PKT_CV_ERROR_NT(_hNetBuf_)
580 
581 /** @def NT_NET_SET_PKT_CV_ERROR_NT
582  * @brief Sets if the frame has any coding violations errors.
583  * @param[in] "_hNetBuf_" Packet container reference
584  * @param[in] "_bval_" Set to 1 if packet packet has coding violations errors, 0 otherwise
585  * @hideinitializer
586  */
587 #define NT_NET_SET_PKT_CV_ERROR_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_CV_ERROR_NT(_hNetBuf_, _bval_)
588 
589 /** @def NT_NET_GET_PKT_SLICED_NT
590  * @brief Indicates if the frame has been sliced
591  * @param[in] "_hNetBuf_" Packet container reference
592  * @return Returns 1 if the packet has been sliced - If no slicing has occured this is 0
593  * @hideinitializer
594  */
595 #define NT_NET_GET_PKT_SLICED_NT(_hNetBuf_) _NT_NET_GET_PKT_SLICED_NT(_hNetBuf_)
596 
597 /** @def NT_NET_SET_PKT_SLICED_NT
598  * @brief Sets if the frame has been sliced
599  * @param[in] "_hNetBuf_" Packet container reference
600  * @param[in] "_bval_" Set to 1 if packet packet has been sliced, 0 otherwise
601  * @hideinitializer
602  */
603 #define NT_NET_SET_PKT_SLICED_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_SLICED_NT(_hNetBuf_, _bval_)
604 
605 /** @def NT_NET_GET_PKT_HARD_SLICED_NT
606  * @brief Indicates if the frame has been hard sliced.
607  * @param[in] "_hNetBuf_" Packet container reference
608  * @return Returns 1 if the packet has been hard sliced - If no hard slicing has occured this is 0
609  * @hideinitializer
610  */
611 #define NT_NET_GET_PKT_HARD_SLICED_NT(_hNetBuf_) _NT_NET_GET_PKT_HARD_SLICED_NT(_hNetBuf_)
612 
613 /** @def NT_NET_SET_PKT_HARD_SLICED_NT
614  * @brief Sets if the frame has been hard sliced.
615  * @param[in] "_hNetBuf_" Packet container reference
616  * @param[in] "_bval_" Set to 1 if packet packet has been hard sliced, 0 otherwise
617  * @hideinitializer
618  */
619 #define NT_NET_SET_PKT_HARD_SLICED_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_HARD_SLICED_NT(_hNetBuf_, _bval_)
620 
621 /** @def NT_NET_GET_PKT_RXPORT_NT
622  * @brief Specifies the port number where the frame was received.
623  * NT_NET_GET_PKT_RXPORT_NT returns a value of type uint8_t.
624  * @param[in] "_hNetBuf_" Packet container reference
625  * @return Returns an uint8_t value that is the port that received this packet
626  * @hideinitializer
627  */
628 #define NT_NET_GET_PKT_RXPORT_NT(_hNetBuf_) _NT_NET_GET_PKT_RXPORT_NT(_hNetBuf_)
629 
630 /** @def NT_NET_GET_PKT_IS_TCP_NT
631  * @brief Indicates if the received frame is a TCP frame.
632  * @param[in] "_hNetBuf_" Packet container reference
633  * @return Returns 1 if the packet has a TCP header - returns 0 if the packet does not have a TCP header
634  * @hideinitializer
635  */
636 #define NT_NET_GET_PKT_IS_TCP_NT(_hNetBuf_) _NT_NET_GET_PKT_TCP_FRAME_NT(_hNetBuf_)
637 
638 /** @def NT_NET_SET_PKT_IS_TCP_NT
639  * @brief Sets if the packet is TCP
640  * @param[in] "_hNetBuf_" Packet container reference
641  * @param[in] "_bval_" Set to 1 if TCP packet, 0 otherwise
642  * @hideinitializer
643  */
644 #define NT_NET_SET_PKT_IS_TCP_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_IS_TCP_NT(_hNetBuf_, _bval_)
645 
646 /** @def NT_NET_GET_PKT_IS_UDP_NT
647  * @brief Indicates if the received frame is a UDP frame.
648  * @param[in] "_hNetBuf_" Packet container reference
649  * @return Returns 1 if the packet has an UDP header - returns 0 if the packet does not have an UDP header
650  * @hideinitializer
651  */
652 #define NT_NET_GET_PKT_IS_UDP_NT(_hNetBuf_) _NT_NET_GET_PKT_UDP_FRAME_NT(_hNetBuf_)
653 
654 /** @def NT_NET_SET_PKT_IS_UDP_NT
655  * @brief Sets if the packet is UDP
656  * @param[in] "_hNetBuf_" Packet container reference
657  * @param[in] "_bval_" Set to 1 if UDP packet, 0 otherwise
658  * @hideinitializer
659  */
660 #define NT_NET_SET_PKT_IS_UDP_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_IS_UDP_NT(_hNetBuf_, _bval_)
661 
662 /** @def NT_NET_GET_PKT_IS_IP_NT
663  * @brief Indicates if the received frame is an IP frame
664  * @param[in] "_hNetBuf_" Packet container reference
665  * @return Returns 1 if the packet has an IP header - returns 0 if the packet does not have an IP header
666  * @hideinitializer
667  */
668 #define NT_NET_GET_PKT_IS_IP_NT(_hNetBuf_) _NT_NET_GET_PKT_IP_FRAME_NT(_hNetBuf_)
669 
670 /** @def NT_NET_SET_PKT_IS_IP_NT
671  * @brief Sets if the packet is IP
672  * @param[in] "_hNetBuf_" Packet container reference
673  * @param[in] "_bval_" Set to 1 if IP packet, 0 otherwise
674  * @hideinitializer
675  */
676 #define NT_NET_SET_PKT_IS_IP_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_IS_IP_NT(_hNetBuf_, _bval_)
677 
678 /** @def NT_NET_GET_PKT_TXPORT_NT
679  * @brief Get TX port
680  * @param[in] "_hNetBuf_" Packet container reference
681  * @return Returns the port number where the frame is to be transmitted.
682  * @hideinitializer
683  */
684 #define NT_NET_GET_PKT_TXPORT_NT(_hNetBuf_) _NT_NET_GET_PKT_TXPORT_NT(_hNetBuf_)
685 
686 /** @def NT_NET_SET_PKT_TXPORT_NT
687  * @brief Sets the packet port where the packets should be transmitted @note This feature only works on the CaptureReplay profile and the TX port can only be within the range of one adapter
688  * @param[in] "_hNetBuf_" Packet container reference
689  * @param[in] "_Port_" Port number
690  * @hideinitializer
691  */
692 #define NT_NET_SET_PKT_TXPORT_NT(_hNetBuf_, _Port_) _NT_NET_SET_PKT_TXPORT_NT(_hNetBuf_, _Port_)
693 
694 /** @def NT_NET_GET_PKT_RECALC_L2_CRC_NT
695  * @brief Indicates if the original CRC in the received frame will be recalculated and overwritten in the transmitted frame.
696  * @param[in] "_hNetBuf_" Packet container reference
697  * @return Returns 1 if the packet has L2 CRC recalc/override set - Returns 0 if L2 CRC recalc/override is not set
698  * @hideinitializer
699  */
700 #define NT_NET_GET_PKT_RECALC_L2_CRC_NT(_hNetBuf_) _NT_NET_GET_PKT_RECALC_L2_CRC_NT(_hNetBuf_)
701 
702 /** @def NT_NET_SET_PKT_RECALC_L2_CRC_NT
703  * @brief Asks the adapter to re-generate the CRC
704  * @param[in] "_hNetBuf_" Packet container reference
705  * @param[in] "_bval_" Set to 1 if CRC should be re-generated, 0 otherwise
706  * @hideinitializer
707  */
708 #define NT_NET_SET_PKT_RECALC_L2_CRC_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_RECALC_L2_CRC_NT(_hNetBuf_, _bval_)
709 
710 /** @def NT_NET_GET_PKT_TXNOW_NT
711  * @brief Indicates if the frame is to be transmitted according to time stamp or as fast as possible.
712  * @param[in] "_hNetBuf_" Packet container reference
713  * @return Returns 1 if the packet has TxNow set - Returns 0 if TxNow is not set
714  * @hideinitializer
715  */
716 #define NT_NET_GET_PKT_TXNOW_NT(_hNetBuf_) _NT_NET_GET_PKT_TXNOW_NT(_hNetBuf_)
717 
718 /** @def NT_NET_SET_PKT_TXNOW_NT
719  * @brief If set the IPG is ignored - this will result in line rate TX
720  * @param[in] "_hNetBuf_" Packet container reference
721  * @param[in] "_bval_" Set to 1 if line rate, 0 otherwise
722  * @hideinitializer
723  */
724 #define NT_NET_SET_PKT_TXNOW_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_TXNOW_NT(_hNetBuf_, _bval_)
725 
726 /** @def NT_NET_GET_PKT_TXIGNORE_NT
727  * @brief Indicates if the frame is to be transmitted or not.
728  * @param[in] "_hNetBuf_" Packet container reference
729  * @return Returns 1 if the packet has TxIgnore set - Returns 0 if TxIgnore is not set
730  * @hideinitializer
731  */
732 #define NT_NET_GET_PKT_TXIGNORE_NT(_hNetBuf_) _NT_NET_GET_PKT_TXIGNORE_NT(_hNetBuf_)
733 
734 /** @def NT_NET_SET_PKT_TXIGNORE_NT
735  * @brief Marks the packet not to be sent - useful in in-line scenarios where some packets should not be retransmitted
736  * @param[in] "_hNetBuf_" Packet container reference
737  * @param[in] "_bval_" Set to 1 to not transmit the packet, 0 otherwise
738  * @hideinitializer
739  */
740 #define NT_NET_SET_PKT_TXIGNORE_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_TXIGNORE_NT(_hNetBuf_, _bval_)
741 
742 /** @def NT_NET_SET_PKT_TXSETCLOCK_NT
743  * @brief Cause the adapter transmission delta to by incremented by the configured delta adjustment before transmitting the packet
744  * @param[in] "_hNetBuf_" Packet container reference
745  * @param[in] "_bval_" Set to 1 to increment delta before transmitting this packet, 0 otherwise
746  * @hideinitializer
747  */
748 #define NT_NET_SET_PKT_TXSETCLOCK_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_TXSETCLOCK_NT(_hNetBuf_, _bval_)
749 
750 /** @} */
751 
752 /** @defgroup ExtendedNtDescriptorMacros Extended NT descriptor macros
753  * @{
754  * The following is only available if "PacketDescriptor = Ext7, Ext8 or Ext9" has been set in the ntservice.ini
755  * file and if @ref NT_NET_GET_PKT_DESCRIPTOR_TYPE returns @ref NT_PACKET_DESCRIPTOR_TYPE_NT_EXTENDED
756  */
757 
758 /** @def NT_NET_GET_PKT_HASH_EXT
759  * @brief Get the packet hash value
760  * @param[in] "_hNetBuf_" Packet container reference
761  * @return Returns the packet hash value. If the hash calculation is invalid, the value is 0x00.
762  * @hideinitializer
763  */
764 #define NT_NET_GET_PKT_HASH_EXT(_hNetBuf_) _NT_NET_GET_PKT_HASH_EXT(_hNetBuf_)
765 
766 /** @def NT_NET_GET_PKT_HASH_TYPE_EXT
767  * @brief Get the number of the used hash key type
768  * @param[in] "_hNetBuf_" Packet container reference
769  * @return Returns the number of the used hash key type.
770  * @hideinitializer
771  */
772 #define NT_NET_GET_PKT_HASH_TYPE_EXT(_hNetBuf_) _NT_NET_GET_PKT_HASH_TYPE_EXT(_hNetBuf_)
773 
774 /** @def NT_NET_GET_PKT_HASH_VALID_EXT
775  * @brief Indicates if the hash calculation is valid.
776  * @param[in] "_hNetBuf_" Packet container reference
777  * @return Returns 1 if the hash value/type is valid - Returns 0 if the hash value/type is invalid
778  * @hideinitializer
779  */
780 #define NT_NET_GET_PKT_HASH_VALID_EXT(_hNetBuf_) _NT_NET_GET_PKT_HASH_VALID_EXT(_hNetBuf_)
781 
782 /** @def NT_NET_GET_PKT_JUMBO_EXT
783  * @brief Indicates if the frame is a jumbo frame.
784  * @param[in] "_hNetBuf_" Packet container reference
785  * @return Returns 1 if the packet has a jumbo frame - Returns 0 if the packet does not have a jumbo frame
786  * @hideinitializer
787  */
788 #define NT_NET_GET_PKT_JUMBO_EXT(_hNetBuf_) _NT_NET_GET_PKT_JUMBO_EXT(_hNetBuf_)
789 
790 /** @def NT_NET_GET_PKT_BROADCAST_EXT
791  * @brief Indicates if the destination MAC address is broadcast.
792  * @param[in] "_hNetBuf_" Packet container reference
793  * @return Returns 1 if the destination MAC is a broadcast address - Returns 0 if the destination MAC is not a broadcast address
794  * @hideinitializer
795  */
796 #define NT_NET_GET_PKT_BROADCAST_EXT(_hNetBuf_) _NT_NET_GET_PKT_BROADCAST_EXT(_hNetBuf_)
797 
798 /** @def NT_NET_GET_PKT_L4_PORT_TYPE_EXT
799  * @brief Get the layer 4 port type
800  * When using extended descriptor 9 it is advised to use @ref NT_NET_GET_PKT_TUNNEL_TYPE instead.
801  * @param[in] "_hNetBuf_" Packet container reference
802  * @return Return the layer 4 port type - see @ref NtL4PortType_e for values
803  * @hideinitializer
804  */
805 #define NT_NET_GET_PKT_L4_PORT_TYPE_EXT(_hNetBuf_) _NT_NET_GET_PKT_L4_PORT_TYPE_EXT(_hNetBuf_)
806 
807 /** @def NT_NET_GET_PKT_L4_FRAME_TYPE_EXT
808  * @brief Get layer 4 frame type
809  * @param[in] "_hNetBuf_" Packet container reference
810  * @return Returns layer 4 frame type - see @ref NtL4FrameType_e for values
811  * @hideinitializer
812  */
813 #define NT_NET_GET_PKT_L4_FRAME_TYPE_EXT(_hNetBuf_) _NT_NET_GET_PKT_L4_FRAME_TYPE_EXT(_hNetBuf_)
814 
815 /** @def NT_NET_GET_PKT_L3_FRAME_TYPE_EXT
816  * @brief Get layer 3 frame type
817  * @param[in] "_hNetBuf_" Packet container reference
818  * @return Returns layer 3 frame type - see @ref NtL3FrameType_e for values
819  * @hideinitializer
820  */
821 #define NT_NET_GET_PKT_L3_FRAME_TYPE_EXT(_hNetBuf_) _NT_NET_GET_PKT_L3_FRAME_TYPE_EXT(_hNetBuf_)
822 
823 /** @def NT_NET_GET_PKT_L2_FRAME_TYPE_EXT
824  * @brief Get layer 2 frame type
825  * @param[in] "_hNetBuf_" Packet container reference
826  * @return Returns layer 2 frame type - see @ref NtL2FrameType_e for values
827  * @hideinitializer
828  */
829 #define NT_NET_GET_PKT_L2_FRAME_TYPE_EXT(_hNetBuf_) _NT_NET_GET_PKT_L2_FRAME_TYPE_EXT(_hNetBuf_)
830 
831 /** @def NT_NET_GET_PKT_L4_LENGTH_EXT
832  * @brief Get layer 4 header length (valid for L4 = UDP/TCP only)
833  * @param[in] "_hNetBuf_" Packet container reference
834  * @return Returns layer 4 header length in units of 32 bits
835  * @hideinitializer
836  */
837 #define NT_NET_GET_PKT_L4_LENGTH_EXT(_hNetBuf_) _NT_NET_GET_PKT_L4_LENGTH_EXT(_hNetBuf_)
838 
839 /** @def NT_NET_GET_PKT_L3_LENGTH_EXT
840  * @brief Get layer 3 header length (valid for L3 = IPv4/IPv6 only)
841  * @param[in] "_hNetBuf_" Packet container reference
842  * @return Returns layer 3 header length in units of 32 bits
843  * @hideinitializer
844  */
845 #define NT_NET_GET_PKT_L3_LENGTH_EXT(_hNetBuf_) _NT_NET_GET_PKT_L3_LENGTH_EXT(_hNetBuf_)
846 
847 /** @def NT_NET_GET_PKT_MPLS_COUNT_EXT
848  * @brief Get the number of MPLS shim labels present
849  * @param[in] "_hNetBuf_" Packet container reference
850  * @return Returns the number of MPLS shim labels present
851  * @hideinitializer
852  */
853 #define NT_NET_GET_PKT_MPLS_COUNT_EXT(_hNetBuf_) _NT_NET_GET_PKT_MPLS_COUNT_EXT(_hNetBuf_)
854 
855 /** @def NT_NET_GET_PKT_VLAN_COUNT_EXT
856  * @brief Get the number of VLANs present
857  * @param[in] "_hNetBuf_" Packet container reference
858  * @return Returns the number of VLANs present
859  * @hideinitializer
860  */
861 #define NT_NET_GET_PKT_VLAN_COUNT_EXT(_hNetBuf_) _NT_NET_GET_PKT_VLAN_COUNT_EXT(_hNetBuf_)
862 
863 /** @def NT_NET_GET_PKT_ISL_EXT
864  * @brief Indicates if ISL encapsulation is present.
865  * @param[in] "_hNetBuf_" Packet container reference
866  * @return Returns 1 if ISL encapsulation is present - Returns 0 if ISL encapsulation is not present
867  * @hideinitializer
868  */
869 #define NT_NET_GET_PKT_ISL_EXT(_hNetBuf_) _NT_NET_GET_PKT_ISL_EXT(_hNetBuf_)
870 
871 /** @def NT_NET_GET_PKT_DECODE_ERROR_EXT
872  * @brief Indicates if a frame decoding error is present.
873  * @param[in] "_hNetBuf_" Packet container reference
874  * @return Returns 1 if the frame could not be decoded correctly - Returns 0 otherwise
875  * @hideinitializer
876  */
877 #define NT_NET_GET_PKT_DECODE_ERROR_EXT(_hNetBuf_) _NT_NET_GET_PKT_DECODE_ERROR_EXT(_hNetBuf_)
878 
879 /** @def NT_NET_GET_PKT_FRAME_LARGE_EXT
880  * @brief Indicates if the frame is a large frame.
881  * @param[in] "_hNetBuf_" Packet container reference
882  * @return - Returns 1 when FrameSize > MaxFrameSize. MaxFrameSize is set in ntservice.ini. Returns 0 when FrameSize <= MaxFrameSize
883  * @hideinitializer
884  */
885 #define NT_NET_GET_PKT_FRAME_LARGE_EXT(_hNetBuf_) _NT_NET_GET_PKT_FRAME_LARGE_EXT(_hNetBuf_)
886 
887 /** @def NT_NET_GET_PKT_FRAME_SMALL_EXT
888  * @brief Indicates if the frame is a small frame.
889  * @param[in] "_hNetBuf_" Packet container reference
890  * @return Returns 1 when PktSz < 64 (+ISL and/or VLAN) - Returns 0 when PktSz >= 64
891  * @hideinitializer
892  */
893 #define NT_NET_GET_PKT_FRAME_SMALL_EXT(_hNetBuf_) _NT_NET_GET_PKT_FRAME_SMALL_EXT(_hNetBuf_)
894 
895 /** @def NT_NET_GET_PKT_IPV6_FR_HEADER_EXT
896  * @brief Indicates if an IPv6 fragment header is present.
897  * @param[in] "_hNetBuf_" Packet container reference
898  * @return Returns 1 if IPv6 fragment header is present - Returns 0 if no IPv6 fragment header is present
899  * @hideinitializer
900  */
901 #define NT_NET_GET_PKT_IPV6_FR_HEADER_EXT(_hNetBuf_) _NT_NET_GET_PKT_IPV6_FR_HEADER_EXT(_hNetBuf_)
902 
903 /** @def NT_NET_GET_PKT_IPV6_RT_HEADER_EXT
904  * @brief Indicates if an IPv6 routing header is present.
905  * @param[in] "_hNetBuf_" Packet container reference
906  * @return Returns 1 if IPv6 routing header is present - Returns 0 if no IPv6 routing header is present
907  * @hideinitializer
908  */
909 #define NT_NET_GET_PKT_IPV6_RT_HEADER_EXT(_hNetBuf_) _NT_NET_GET_PKT_IPV6_RT_HEADER_EXT(_hNetBuf_)
910 
911 /** @def NT_NET_GET_PKT_L4_PROTOCOL_NUM_EXT
912  * @brief Get layer 4 protocol number (TCP, UDP, SCTP etc.) - if not an IP packet this is 0
913  * @param[in] "_hNetBuf_" Packet container reference
914  * @return Returns the layer 4 protocol number / next header.
915  * @hideinitializer
916  */
917 #define NT_NET_GET_PKT_L4_PROTOCOL_NUM_EXT(_hNetBuf_) _NT_NET_GET_PKT_L4_PROTOCOL_NUM_EXT(_hNetBuf_)
918 
919 /** @def NT_NET_GET_PKT_L3_FRAGMENTED_EXT
920  * @brief Indicates if the packet is part of a layer 3 fragmented datagram. Only valid for IPv4 if more fragments bit = 1 or fragment offset not equal to 0
921  * @param[in] "_hNetBuf_" Packet container reference
922  * @return Returns 1 if fragmented layer 3 - Returns 0 otherwise
923  * @hideinitializer
924  */
925 #define NT_NET_GET_PKT_L3_FRAGMENTED_EXT(_hNetBuf_) _NT_NET_GET_PKT_L3_FRAGMENTED_EXT(_hNetBuf_)
926 
927 /** @def NT_NET_GET_PKT_L3_FIRST_FRAG_EXT
928  * @brief Layer 3 First fragment (offset = 0) Note: Only valid for IPv4 - always set on IPv6 so use IPV6_FR_HEADER instead
929  * @param[in] "_hNetBuf_" Packet container reference
930  * @return Returns 1 if first fragment or not fragmented - Returns 0 otherwise
931  * @hideinitializer
932  */
933 #define NT_NET_GET_PKT_L3_FIRST_FRAG_EXT(_hNetBuf_) _NT_NET_GET_PKT_L3_FIRST_FRAG_EXT(_hNetBuf_)
934 
935 /** @def NT_NET_GET_PKT_COLOR_EXT
936  * @brief Returns the packet color of the frame, if the frame matches a
937  * filter. The color is automatically assigned as a 6bit color ID when the
938  * filter is defined. If the frame matches more than one filter, the packet
939  * color of the frame is the one from the filter with the highest priority.
940  * @param[in] "_hNetBuf_" Packet container reference
941  * @return Returns the color of the packet as an integer value
942  * @hideinitializer
943  */
944 #define NT_NET_GET_PKT_COLOR_EXT(_hNetBuf_) _NT_NET_GET_PKT_COLOR_EXT(_hNetBuf_)
945 
946 /** @def NT_NET_GET_PKT_L5_OFFSET_EXT
947  * @brief Returns the offset in bytes (0x00 - 0x1FF) from the start of the
948  * frame to the start of layer 5. The value 0x00 indicates an invalid offset.
949  * @param[in] "_hNetBuf_" Packet container reference
950  * @return Returns layer 5 offset as an integer value
951  * @hideinitializer
952  */
953 #define NT_NET_GET_PKT_L5_OFFSET_EXT(_hNetBuf_) _NT_NET_GET_PKT_L5_OFFSET_EXT(_hNetBuf_)
954 
955 /** @def NT_NET_GET_PKT_L4_OFFSET_EXT
956  * @brief Returns the offset in bytes (0x00 - 0x1FF) from the start of the
957  * frame to the start of layer 4. The value 0x00 indicates an invalid offset.
958  * @param[in] "_hNetBuf_" Packet container reference
959  * @return Returns layer 4 offset as an integer value
960  * @hideinitializer
961  */
962 #define NT_NET_GET_PKT_L4_OFFSET_EXT(_hNetBuf_) _NT_NET_GET_PKT_L4_OFFSET_EXT(_hNetBuf_)
963 
964 /** @def NT_NET_GET_PKT_L3_OFFSET_EXT
965  * @brief Returns the offset in bytes (0x00 - 0x1FF) from the start of the
966  * frame to the start of layer 3. The value 0x00 indicates an invalid offset.
967  * @param[in] "_hNetBuf_" Packet container reference
968  * @return Returns layer 3 offset as an integer value
969  * @hideinitializer
970  */
971 #define NT_NET_GET_PKT_L3_OFFSET_EXT(_hNetBuf_) _NT_NET_GET_PKT_L3_OFFSET_EXT(_hNetBuf_)
972 
973 /** @} */
974 
975 /** @defgroup ExtendedNtDescriptorIPFMacros Extended NT descriptor IPF macros
976  * @{
977  * The following are used to help collect IP fragmented data. With theses
978  * macros it is possible to de-fragment IP fragmented data in a
979  * multi-processing application using 5-tuple hashing. It is only available if
980  * "PacketDescriptor" in the ntservice.ini file has been set to "Ext8" or
981  * "Ext9" and if @ref NT_NET_GET_PKT_DESCRIPTOR_TYPE returns @ref
982  * NT_PACKET_DESCRIPTOR_TYPE_NT_EXTENDED @note: These macros do not return
983  * valid values if the IPF engine is not turned on see @ref NtplIPFMode
984  */
985 
986 /** @def NT_NET_GET_PKT_IPF_UNMATCHED_STREAMID_EXT
987  * @brief Stream ID where unmatched fragments are stored
988  * @param[in] "_hNetBuf_" Packet container reference
989  * @return Returns the stream ID where unmatched fragments are stored
990  * @hideinitializer
991  */
992 #define NT_NET_GET_PKT_IPF_UNMATCHED_STREAMID_EXT(_hNetBuf_) _NT_NET_GET_PKT_IPF_UNMATCHED_STREAMID_EXT(_hNetBuf_)
993 
994 /** @def NT_NET_GET_PKT_IPF_UNMATCHED_FLAG_EXT
995  * @brief Indicates if no entry corresponding to the packet was allocated or
996  * found in the datagram lookup table.
997  * @param[in] "_hNetBuf_" Packet container reference
998  * @return Returns 1 if unmatched - Returns 0 otherwise
999  * @hideinitializer
1000  */
1001 #define NT_NET_GET_PKT_IPF_UNMATCHED_FLAG_EXT(_hNetBuf_) _NT_NET_GET_PKT_IPF_UNMATCHED_FLAG_EXT(_hNetBuf_)
1002 
1003 /** @def NT_NET_GET_PKT_IPF_LAST_FRAGMENT_EXT
1004  * @brief Indicates if the packet is the last fragment of a layer 3
1005  * fragmented datagram. (More fragment bit = 0 && offset != 0)
1006  * @param[in] "_hNetBuf_" Packet container reference
1007  * @return Returns 1 if last fragment - Returns 0 otherwise
1008  * @hideinitializer
1009  */
1010 #define NT_NET_GET_PKT_IPF_LAST_FRAGMENT_EXT(_hNetBuf_) _NT_NET_GET_PKT_IPF_LAST_FRAGMENT_EXT(_hNetBuf_)
1011 
1012 /** @} */
1013 
1014 /** @defgroup ExtendedNtDescriptorTunnelMacros Extended NT descriptor Tunneling macros
1015  * @{
1016  *
1017  * The following are used to help accessing GTPv1 and IP-in-IP tunneled
1018  * data. With theses macros it is possible to determine the tunnel type,
1019  * retrieve the frame types and get direct offsets to the layers 3, 4 and 5
1020  * inside the tunnel. Only the first tunnel is decoded, hence a tunnel inside
1021  * a tunnel is not decoded. The following macros are only available if
1022  * "PacketDescriptor" in the ntservice.ini file has been set to "Ext9" or if
1023  * "Ext9" is configured as the descriptor type in the NTPL "assign" statement
1024  * matching the received packet.
1025  */
1026 
1027 /** @def NT_NET_GET_PKT_INNER_L3_OFFSET_EXT9
1028  * @brief Returns the offset in bytes (0x00 - 0x1FF) from the start of the
1029  * frame to the start of inner layer 3. The value 0x00 indicates an invalid
1030  * offset.
1031  * @param[in] "_hNetBuf_" Packet container reference
1032  * @return Returns inner layer 3 offset as an integer value
1033  * @hideinitializer
1034  */
1035 #define NT_NET_GET_PKT_INNER_L3_OFFSET_EXT9(_hNetBuf_) _NT_NET_GET_PKT_INNER_L3_OFFSET_EXT(_hNetBuf_)
1036 
1037 /** @def NT_NET_GET_PKT_INNER_L4_OFFSET_EXT9
1038  * @brief Returns the offset in bytes (0x00 - 0x1FF) from the start of the
1039  * frame to the start of inner layer 4. The value 0x00 indicates an invalid
1040  * offset.
1041  * @param[in] "_hNetBuf_" Packet container reference
1042  * @return Returns inner layer 4 offset as an integer value
1043  * @hideinitializer
1044  */
1045 #define NT_NET_GET_PKT_INNER_L4_OFFSET_EXT9(_hNetBuf_) _NT_NET_GET_PKT_INNER_L4_OFFSET_EXT(_hNetBuf_)
1046 
1047 /** @def NT_NET_GET_PKT_INNER_L5_OFFSET_EXT9
1048  * @brief Returns the offset in bytes (0x00 - 0x1FF) from the start of the
1049  * frame to the start of inner layer 5. The value 0x00 indicates an invalid
1050  * offset.
1051  * @param[in] "_hNetBuf_" Packet container reference
1052  * @return Returns inner layer 5 offset as an integer value
1053  * @hideinitializer
1054  */
1055 #define NT_NET_GET_PKT_INNER_L5_OFFSET_EXT9(_hNetBuf_) _NT_NET_GET_PKT_INNER_L5_OFFSET_EXT(_hNetBuf_)
1056 
1057 /** @def NT_NET_GET_PKT_INNER_L3_FRAME_TYPE_EXT9
1058  * @brief Get the inner tunnel layer 3 frame type
1059  * @param[in] "_hNetBuf_" Packet container reference
1060  * @return Returns the inner tunnel layer 3 frame type - see @ref NtL3FrameType_e for values
1061  * @hideinitializer
1062  */
1063 #define NT_NET_GET_PKT_INNER_L3_FRAME_TYPE_EXT9(_hNetBuf_) _NT_NET_GET_PKT_INNER_L3_FRAME_TYPE_EXT(_hNetBuf_)
1064 
1065 /** @def NT_NET_GET_PKT_INNER_L4_FRAME_TYPE_EXT9
1066  * @brief Get the inner tunnel layer 4 frame type
1067  * @param[in] "_hNetBuf_" Packet container reference
1068  * @return Returns the inner tunnel layer 4 frame type - see @ref NtL4FrameType_e for values
1069  * @hideinitializer
1070  */
1071 #define NT_NET_GET_PKT_INNER_L4_FRAME_TYPE_EXT9(_hNetBuf_) _NT_NET_GET_PKT_INNER_L4_FRAME_TYPE_EXT(_hNetBuf_)
1072 
1073 /** @def NT_NET_GET_PKT_INNER_L3_FRAGMENT_TYPE_EXT9
1074  * @brief Get inner layer 3 fragment type
1075  * @param[in] "_hNetBuf_" Packet container reference
1076  * @return Returns inner layer 3 fragment type - see @ref NtL3FragmentType_e for values
1077  * @hideinitializer
1078  */
1079 #define NT_NET_GET_PKT_INNER_L3_FRAGMENT_TYPE_EXT9(_hNetBuf_) _NT_NET_GET_PKT_INNER_L3_FRAGMENT_TYPE_EXT(_hNetBuf_)
1080 
1081 /** @def NT_NET_GET_PKT_TUNNEL_TYPE_EXT9
1082  * @brief Get the tunnel type
1083  * @param[in] "_hNetBuf_" Packet container reference
1084  * @return Returns the tunnel type - see @ref NtTunnelType_e for values
1085  * @hideinitializer
1086  */
1087 #define NT_NET_GET_PKT_TUNNEL_TYPE_EXT9(_hNetBuf_) _NT_NET_GET_PKT_TUNNEL_TYPE_EXT(_hNetBuf_)
1088 
1089 /** @def NT_NET_GET_PKT_TUNNEL_HDR_LENGTH_EXT9
1090  * @brief Get the tunnel header length
1091  * @param[in] "_hNetBuf_" Packet container reference
1092  * @return Returns the tunnel header length in units of 32 bits
1093  * @hideinitializer
1094  */
1095 #define NT_NET_GET_PKT_TUNNEL_HDR_LENGTH_EXT9(_hNetBuf_) _NT_NET_GET_PKT_TUNNEL_HDR_LENGTH_EXT(_hNetBuf_)
1096 
1097 /** @def NT_NET_GET_PKT_INNER_DECODE_ERROR_EXT9
1098  * @brief Indicates if a inner tunnel frame decoding error is present.
1099  * @param[in] "_hNetBuf_" Packet container reference
1100  * @return Returns 1 if the inner tunnel frame could not be decoded correctly - Returns 0 otherwise
1101  * @hideinitializer
1102  */
1103 #define NT_NET_GET_PKT_INNER_DECODE_ERROR_EXT9(_hNetBuf_) _NT_NET_GET_PKT_INNER_DECODE_ERROR_EXT(_hNetBuf_)
1104 
1105 /** @def NT_NET_GET_PKT_DEDUPLICATION_CRC_EXT9
1106  * @brief The packet deduplication CRC value. Only available on extended descriptor 9.
1107  * @param[in] "_hNetBuf_" Packet container reference
1108  * @return Returns the 24bit packet deduplication CRC value.
1109  * @hideinitializer
1110  */
1111 #define NT_NET_GET_PKT_DEDUPLICATION_CRC_EXT9(_hNetBuf_) _NT_NET_GET_PKT_DEDUPLICATION_CRC_EXT(_hNetBuf_)
1112 
1113 /** @} */
1114 
1115 /** @defgroup TxMacros TX macros
1116  * @{
1117  * The following can only be used on TX or in-line based streams
1118  *
1119  */
1120 
1121 /** @defgroup ExtendedTxMacros Extended TX macros
1122  * @{
1123  * The following can only be used if the TX buffer has an extended NT descriptor
1124  */
1125 
1126 /** @def NT_NET_SET_PKT_INJECT_TIMESTAMP
1127  * @brief Injects a time stamp on TX
1128  *
1129  * The time stamp is injected into the payload at the offset
1130  * provided. Offset range: 0-512. See @ref TimeStampInject "Time
1131  * Stamp Injection" for further information
1132  * @param[in] "_hNetBuf_" Packet container reference
1133  * @param[in] "_offset_" Offset to inject timestamp at
1134  * @hideinitializer
1135  */
1136 #define NT_NET_SET_PKT_INJECT_TIMESTAMP_EXT(_hNetBuf_, _offset_) _NT_NET_SET_PKT_INJECT_TIMESTAMP_EXT(_hNetBuf_, _offset_)
1137 
1138 /** @def NT_NET_SET_PKT_ISL
1139  * @brief Sets if the frame is ISL encapsulated
1140  * @param[in] "_hNetBuf_" Packet container reference
1141  * @param[in] "_bval_" Set 1 if ISL encapsulated, 0 otherwise
1142  * @hideinitializer
1143  */
1144 #define NT_NET_SET_PKT_ISL_EXT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_ISL_EXT(_hNetBuf_, _bval_)
1145 
1146 /** @def NT_NET_SET_PKT_VLAN_COUNT
1147  * @brief Sets the number of VLAN tags
1148  * @param[in] "_hNetBuf_" Packet container reference
1149  * @param[in] "_count_" The VLAN tag count
1150  * @hideinitializer
1151  */
1152 #define NT_NET_SET_PKT_VLAN_COUNT_EXT(_hNetBuf_, _count_) _NT_NET_SET_PKT_VLAN_COUNT_EXT(_hNetBuf_, _count_)
1153 
1154 /** @def NT_NET_SET_PKT_MPLS_COUNT
1155  * @brief Sets the number of MPLS shim labels
1156  * @param[in] "_hNetBuf_" Packet container reference
1157  * @param[in] "_count_" The MPLS shim labels count
1158  * @hideinitializer
1159  */
1160 #define NT_NET_SET_PKT_MPLS_COUNT_EXT(_hNetBuf_, _count_) _NT_NET_SET_PKT_MPLS_COUNT_EXT(_hNetBuf_, _count_)
1161 
1162 /** @def NT_NET_SET_PKT_L2_FRAME_TYPE
1163  * @brief Sets the L2 frame type, see @ref NtL2FrameType_e
1164  * @param[in] "_hNetBuf_" Packet container reference
1165  * @param[in] "_type_" The L2 frame type
1166  * @hideinitializer
1167  */
1168 #define NT_NET_SET_PKT_L2_FRAME_TYPE_EXT(_hNetBuf_, _type_) _NT_NET_SET_PKT_L2_FRAME_TYPE_EXT(_hNetBuf_, _type_)
1169 
1170 /** @def NT_NET_SET_PKT_L3_FRAME_TYPE
1171  * @brief Sets the L3 frame type, see @ref NtL3FrameType_e
1172  * @param[in] "_hNetBuf_" Packet container reference
1173  * @param[in] "_type_" The L3 frame type
1174  * @hideinitializer
1175  */
1176 #define NT_NET_SET_PKT_L3_FRAME_TYPE_EXT(_hNetBuf_, _type_) _NT_NET_SET_PKT_L3_FRAME_TYPE_EXT(_hNetBuf_, _type_)
1177 
1178 /** @def NT_NET_SET_PKT_L4_FRAME_TYPE
1179  * @brief Sets the L4 frame type, see @ref NtL4FrameType_e
1180  * @param[in] "_hNetBuf_" Packet container reference
1181  * @param[in] "_type_" The L4 frame type
1182  * @hideinitializer
1183  */
1184 #define NT_NET_SET_PKT_L4_FRAME_TYPE_EXT(_hNetBuf_, _type_) _NT_NET_SET_PKT_L4_FRAME_TYPE_EXT(_hNetBuf_, _type_)
1185 
1186 /** @def NT_NET_SET_PKT_L3_LENGTH
1187  * @brief L3 length in 32-bit units
1188  * @param[in] "_hNetBuf_" Packet container reference
1189  * @param[in] "_u32len_" The L3 length in 32-bit units
1190  * @hideinitializer
1191  */
1192 #define NT_NET_SET_PKT_L3_LENGTH_EXT(_hNetBuf_, _u32len_) _NT_NET_SET_PKT_L3_LENGTH_EXT(_hNetBuf_, _u32len_)
1193 
1194 /** @def NT_NET_SET_PKT_L4_LENGTH
1195  * @brief L4 length in 32-bit units
1196  * @param[in] "_hNetBuf_" Packet container reference
1197  * @param[in] "_u32len_" The L4 length in 32-bit units
1198  * @hideinitializer
1199  */
1200 #define NT_NET_SET_PKT_L4_LENGTH_EXT(_hNetBuf_, _u32len_) _NT_NET_SET_PKT_L4_LENGTH_EXT(_hNetBuf_, _u32len_)
1201 
1202 /** @def NT_NET_SET_PKT_CALC_L3_CHECKSUM
1203  * @brief If set, the adapter will calculate an IPv4 checksum on transmit
1204  * @param[in] "_hNetBuf_" Packet container reference
1205  * @param[in] "_bval_" Set to 1 calculate an IPv4 checksum on transmit, 0 otherwise
1206  * @hideinitializer
1207  */
1208 #define NT_NET_SET_PKT_CALC_L3_CHECKSUM_EXT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_CALC_L3_CHECKSUM_EXT(_hNetBuf_, _bval_)
1209 
1210 /** @def NT_NET_SET_PKT_CALC_L4_CHECKSUM
1211  * @brief If set, the adapter will calculate an TCP/UDP checksum on transmit
1212  * @param[in] "_hNetBuf_" Packet container reference
1213  * @param[in] "_bval_" Set to 1 calculate an TCP/UDP checksum on transmit, 0 otherwise
1214  * @hideinitializer
1215  */
1216 #define NT_NET_SET_PKT_CALC_L4_CHECKSUM_EXT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_CALC_L4_CHECKSUM_EXT(_hNetBuf_, _bval_)
1217 
1218 /** @} */
1219 
1220 /** @} */
1221 /** @} */
1222 /** @} */
1223 
1224 #endif /* __PKT_DESCR_H__ */