]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/pa-lld.git/blob - pasahost.h
merged EOAM feature from development branch
[keystone-rtos/pa-lld.git] / pasahost.h
1 #ifndef _PASAHOST_H
2 #define _PASAHOST_H
3 /**
4  *   @file  pasahost.h
5  *
6  *   @brief   
7  *      This file defines constants, data structures and macros used
8  *      among the PA LLD, SA LLD and the host.  
9  *
10  *  \par
11  *  NOTE:
12  *      (C) Copyright 2009-2013 Texas Instruments, Inc.
13  * 
14  *  Redistribution and use in source and binary forms, with or without 
15  *  modification, are permitted provided that the following conditions 
16  *  are met:
17  *
18  *    Redistributions of source code must retain the above copyright 
19  *    notice, this list of conditions and the following disclaimer.
20  *
21  *    Redistributions in binary form must reproduce the above copyright
22  *    notice, this list of conditions and the following disclaimer in the 
23  *    documentation and/or other materials provided with the   
24  *    distribution.
25  *
26  *    Neither the name of Texas Instruments Incorporated nor the names of
27  *    its contributors may be used to endorse or promote products derived
28  *    from this software without specific prior written permission.
29  *
30  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
31  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
32  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
33  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
34  *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
35  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
36  *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
37  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
38  *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
39  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
40  *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41  *
42 */
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 /** @defgroup pasaho_if_module PA/SA/Host Interface
48  *  @{
49  */
50 /** @} */
52 /** @defgroup pasaho_if_macros PA/SA/Host Macros
53  *  @ingroup pasaho_if_module
54  */
56 /** @defgroup pasaho_if_structures PA/SA/Host Data Structures
57  *  @ingroup pasaho_if_module
58  */
60 /** @defgroup pasaho_if_constants PA/SA/Host Constants (enum's and define's)
61  *  @ingroup pasaho_if_module
62  */
65 /**
66  *  @defgroup pasahoCommands PA/SA/Host Commands
67  *  @ingroup pasaho_if_constants
68  *  @{
69  *
70  *  @name PA/SA/Host Commands
71  *
72  *  Define PASS Firmware Commands
73  *  These values are placed in the 3 msbits of the protocol specific information
74  */
75 /*@{*/
76 /**
77  *  @def  PASAHO_CONFIGURE
78  *        PA/SA Configuration command
79  */
81 #define PASAHO_CONFIGURE                        4
83 /* PA commands for receive packet PDSPs */
84 /**
85  *  @def  PASAHO_PARX_PARSECMD
86  *        Instruct PDSP to parse the receive packet
87  */
89 #define PASAHO_PARX_PARSECMD            0
91 /**
92  *  @def  PASAHO_PARX_MULTI_ROUTE
93  *        Instruct PDSP to perform multiple routing
94  */
96 #define PASAHO_PARX_MULTI_ROUTE         5
98 /* PA commands for modify packet PDSPs */
99 /**
100  *  @def  PASAHO_PAMOD_CMPT_CHKSUM
101  *        Instruct PDSP to compute checksum
102  */
104 #define PASAHO_PAMOD_CMPT_CHKSUM        0
106 /**
107  *  @def  PASAHO_PAMOD_CMPT_CRC
108  *        Instruct PDSP to compute CRC
109  */
111 #define PASAHO_PAMOD_CMPT_CRC           1
113 /**
114  *  @def  PASAHO_PAMOD_PATCH
115  *        Instruct PDSP to perform blind patch
116  */
118 #define PASAHO_PAMOD_PATCH                      2
120 /**
121  *  @def  PASAHO_PAMOD_NROUTE
122  *        Provide PDSP with the next routing information
123  */
125 #define PASAHO_PAMOD_NROUTE                     3
128 /**
129  *  @def  PASAHO_PAMOD_EF_OP
130  *        Instruct PDSP to perform egress flow operation
131  */
133 #define PASAHO_PAMOD_EF_OP              5
135 /**
136  *  @def  PASAHO_PAMOD_REPORT_TIMESTAMP
137  *        Instruct PDSP to report the system timestamp at the timestamp field of the packet descriptor 
138  *        when the tx packet is delivered out of the PASS 
139  */
141 #define PASAHO_PAMOD_REPORT_TIMESTAMP  6   
144 /**
145  *  @def  PASAHO_PAMOD_GROUP_7
146  *        Define this group command so that several command can share the same command code. They will be distinguished
147  *        by its unique 5-bit sub-command code as defined at
148  */
150 #define PASAHO_PAMOD_GROUP_7        7   
153 /**
154  *  @def  PASAHO_PAMOD_DUMMY
155  *        No action is required. It is for SA alignment only
156  */
158 #define PASAHO_PAMOD_DUMMY                      PASAHO_PAMOD_GROUP_7
160 /**
161  *  @def  PASAHO_PAMOD_IP_FRAGMENT
162  *        Instruct PDSP to perform IPv4 fragmentation. The transmit IP packets will be divided into smaller 
163  *        IP fragments with the updated IPv4 header and checksum based on the specified MTU size and forwarded 
164  *        to the destination specified by the next route command. It is up to the module user to format the
165  *        correct IPv4 header. The IP fragmentation command will be ignored if any error is detected.
166  */
167 #define PASAHO_PAMOD_IP_FRAGMENT    PASAHO_PAMOD_GROUP_7  
169 /**
170  *  @def  PASAHO_PAMOD_PATCH_MSG_LEN
171  *        Instruct PDSP to perform message length patching after IPv4 fragmentation operation. This command is
172  *        valid only if it is in conjunction with the PASAHO_PAMOD_IP_FRAGMENT command.
173  */
174 #define PASAHO_PAMOD_PATCH_MSG_LEN  PASAHO_PAMOD_GROUP_7  
176 /**
177  *  @def  PASAHO_PAMOD_INSERT_MSG_TIME
178  *        Instruct PDSP to perform message time insert for packets such as Ethernet OAM. 
179  */
180 #define PASAHO_PAMOD_PATCH_MSG_TIME  PASAHO_PAMOD_GROUP_7 
182 /**
183  *  @def  PASAHO_PAMOD_INSERT_MSG_COUNT
184  *        Instruct PDSP to perform message count insert for packets such as Ethernet OAM. 
185  */
186 #define PASAHO_PAMOD_PATCH_MSG_COUNT  PASAHO_PAMOD_GROUP_7 
188 /* SA commands */
189 /**
190  *  @def  PASAHO_SA_LONG_INFO
191  *        Provide SA with the packet parsing information in the long form
192  */
194 #define PASAHO_SA_LONG_INFO         0
196 /**
197  *  @def  PASAHO_SA_SHORT_INFO
198  *        Provide SA with the packet parsing information in the short form
199  */
201 #define PASAHO_SA_SHORT_INFO        1
204 /**
205  *  @def  PASAHO_SA_AIR_INFO
206  *        Provide SA with the packet parsing information for the air ciphering 
207  *        operation
208  */
210 #define PASAHO_SA_AIR_INFO          2
213 /*@}*/
214 /** @} */
216 /** @name PASAHO Common Macros
217  *  
218  */
219 /*@{*/
221 /**
222  *  @ingroup pasaho_if_macros
223  *  @brief  PASAHO_READ_BITFIELD is used to read the specific bit fields
224  *
225  *  @details  It is one of the main macros for accessing configuration bit fields
226  *            Input parameter a contains bit field
227  *            b is bit offset withing bit field
228  *            c is number of bits used by that parameter
229  */
231 #define PASAHO_READ_BITFIELD(a,b,c)    (((a)>>(b)) & ((1UL<<(c))-1))
233 /**
234  *  @ingroup ingroup pasaho_if_macros
235  *  @brief  PASAHO_SET_BITFIELD is used to set the specific bit fields
236  *
237  *  @details  It is one of the main macros for accessing configuration bit fields
238  *            Input parameter a contains bit field
239  *            b is bit offset withing bit field
240  *            c is number of bits used by that parameter
241  *            x is new value of parameter that is packed in this bit field
242  *
243  *  @note    It enforces strict setting to prevent overflow into other bits, would
244  *           cost program space for additional protection. 
245  */
247 #define PASAHO_SET_BITFIELD(a,x,b,c)   (a) &= ~(((1UL<<(c))-1)<<(b)), \
248                                        (a) |= (((x) & ((1UL<<(c))-1))<<(b))
250 /**
251  *  @ingroup ingroup pasaho_if_macros
252  *  @brief  PASAHO_SET_CMDID is used to set the command ID
253  */
254 #define PASAHO_SET_CMDID(x,v)  PASAHO_SET_BITFIELD((x)->word0, (v), 29,3)
256 /**
257  *  @ingroup ingroup pasaho_if_macros
258  *  @brief  PASAHO_PACFG_CMD is used to set the PA configuration command only
259  */
260 #define PASAHO_PACFG_CMD        (((uint32_t)PASAHO_CONFIGURE << 5) << 24)
262 /*@}*/ /* @name PASAHO Common Macros */
265 /**
266  *  @defgroup pasahoHeaderTypes PASS Header Types
267  *  @ingroup pasaho_if_constants
268  *  @{
269  *
270  *  @name PASS Header Types
271  *  Definition of protocol header types used at the PASS PDSP Firmwase. In the 
272  *  long info field these values specify what the next header type will be
273  *  at the next parse offset 
274  */ 
275 /*@{*/
277 typedef enum {
279   PASAHO_HDR_MAC        = 0,        /**< MAC */
280   PASAHO_HDR_VLAN,                  /**< VLAN */
281   PASAHO_HDR_MPLS,                  /**< MPLS */
282   PASAHO_HDR_IPv4,                  /**< IPv4 */
283   PASAHO_HDR_IPv6,                  /**< IPv6 */
284   PASAHO_HDR_IPv6_EXT_HOP,          /**< IPv6 hop by hop extenstion header */
285   PASAHO_HDR_IPv6_EXT_ROUTE,        /**< IPv6 routing extenstion header */
286   PASAHO_HDR_IPv6_EXT_FRAG,         /**< IPv6 fragmentation extention header */
287   PASAHO_HDR_IPv6_EXT_DEST,         /**< IPv6 destination options header */
288   PASAHO_HDR_GRE,                   /**< Generic Routing Encapsulation header */
289   PASAHO_HDR_ESP,                   /**< Encapsulating Security Payload header */
290   PASAHO_HDR_ESP_DECODED,           /**< Decoded Encapsulating Security Payload header */
291   PASAHO_HDR_AUTH,                  /**< Authentication header */
292   PASAHO_HDR_CUSTOM_C1,             /**< Custom classify 1 header */
293   PASAHO_HDR_PPPoE,                 /**< PPPoE Header */
294   PASAHO_HDR_SCTP,                  /**< SCTP Header */
295   PASAHO_HDR_UNKNOWN,               /**< Next header type is unknown */
296   PASAHO_HDR_UDP,                   /**< User Datagram Protocol header */
297   PASAHO_HDR_UDP_LITE,              /**< Lightweight User Datagram Protocol header */
298   PASAHO_HDR_TCP,                   /**< Transmission Control Protocol header */
299   PASAHO_HDR_GTPU,                  /**< GTPU header */
300   PASAHO_HDR_ESP_DECODED_C2,        /**< Decoded Encapsulating Security Payload header at Classifyer2 */
301   PASAHO_HDR_CUSTOM_C2              /**< Custom classify 2 header */
302  
303 } pasaho_HeaderType_e;
304 /*@}*/
305 /** @} */
307 /**
308  *  @defgroup pasahoSubCmdCode PASS Sub-Command Code
309  *  @ingroup pasaho_if_constants
310  *  @{
311  *
312  *  @name PASS Sub-Command Code
313  *  Definition of the 5-bit sub-command codes which is used to specify the group 7 commands. 
314  */ 
315 /*@{*/
317 typedef enum {
319   PASAHO_SUB_CMD_DUMMY        = 0,   /**< Dummy */
320   PASAHO_SUB_CMD_IP_FRAG,            /**< IPv4 fragmentation */
321   PASAHO_SUB_CMD_PATCH_MSG_LEN,      /**< Message length Patching */ 
322   PASAHO_SUB_CMD_INS_TIME,           /**< Ethernet EOAM insert time at specified offset */
323   PASAHO_SUB_CMD_INS_COUNT           /**< Ethernet EOAM insert count at specified offset */
324 } pasaho_SubCmdCode_e;
325 /*@}*/
326 /** @} */
328 /**
329  *  @defgroup pasahoPktType PASS Packet Type
330  *  @ingroup pasaho_if_constants
331  *  @{
332  *
333  *  @name PASS Packet Type
334  *  Definition of the MAC or IP packet types. 
335  */ 
336 /*@{*/
338 typedef enum {
340   PASAHO_PKT_TYPE_UNICAST        = 0,   /**< Unicast MAC/IP  */
341   PASAHO_PKT_TYPE_BROADCAST,            /**< Broadcast MAC/IP */
342   PASAHO_PKT_TYPE_MULTICAST             /**< Multicast MAC/IP */ 
343 } pasaho_pktType_e;
344 /*@}*/
345 /** @} */
349 /**
350  *  @ingroup pasaho_if_structures
351  *  @brief  pasahoCmdInfo_t defines the general short command information
352  *
353  */
355 typedef struct pasahoCmdInfo_s {
356     uint32_t  word0;    /**< Control block word 0 */
357 } pasahoCmdInfo_t;
359 /**
360  *  @ingroup pasaho_if_structures
361  *  @brief  pasahoLongInfo_t defines the packet parsing information in the long format. 
362  *          The information is structured as an array of 32 bit values. These values
363  *          are broken down through macros. This allows the representation to be
364  *          endian independent to the hardware which operates only on 32 bit values.
365  *
366  *  @details  
367  */
369 typedef struct pasahoLongInfo_s  {
371   uint32_t   word0;  /**< Control block word 0 */
372   uint32_t   word1;  /**< Control block word 1 */
373   uint32_t   word2;  /**< Control block word 2 */
374   uint32_t   word3;  /**< Control block word 3 */
375   uint32_t   word4;  /**< Control block word 4 */
376   uint32_t   word5;  /**< Control block word 5 */
377   uint32_t   word6;  /**< Control block word 6 */
378   uint32_t   word7;  /**< Control block word 7 */
379   uint32_t   word8;  /**< Control block word 8 */
380   uint32_t   word9;  /**< Control block word 9 */
381   uint32_t   word10; /**< Control block word 10 (optional) */
382   uint32_t   word11; /**< Control block word 11 (optional) */
383   uint32_t   word12; /**< Control block word 12 (optional) */
384   uint32_t   word13; /**< Control block word 13 (optional) */  
385 } pasahoLongInfo_t;
387 /** 
388  *  @defgroup PASAHO_long_info_command_gen1_macros  PASAHO Long Info Command Macros For First Generation PASS
389  *  @ingroup pasaho_if_macros
390  *  @{
391  *  @name PASAHO Long Info Command Macros For First Generation PASS
392  *  Macros used by the PASAHO Long Info Command
393  */
394 /*@{*/
396 #define PASAHO_LINFO_READ_CMDID_GEN1(x)          PASAHO_READ_BITFIELD((x)->word0,29,3)    /**< Extract the command ID defined at @ref pasahoCommands (PASS Gen1)*/
397 #define PASAHO_LINFO_READ_RECLEN_GEN1(x)         PASAHO_READ_BITFIELD((x)->word0,24,5)    /**< Extract the block length (PASS Gen1)*/
398 #define PASAHO_LINFO_READ_START_OFFSET_GEN1(x)   PASAHO_READ_BITFIELD((x)->word0,0,16)    /**< Extract the next parse start offset (PASS Gen1)*/
400 #define PASAHO_LINFO_IS_MAC_BROADCAST_GEN1(x)    PASAHO_READ_BITFIELD((x)->word0,16,1)    /**< Indicate whether it is a broadcast MAC packet (PASS Gen1)*/
401 #define PASAHO_LINFO_IS_MAC_MULTICAST_GEN1(x)    PASAHO_READ_BITFIELD((x)->word0,17,1)    /**< Indicate whether it is a multicast MAC packet (PASS Gen1)*/
402 #define PASAHO_LINFO_READ_MAC_PKTTYPE_GEN1(x)    PASAHO_READ_BITFIELD((x)->word0,16,2)    /**< Extract the MAC packet type (PASS Gen1)*/
404 #define PASAHO_LINFO_IS_IP_BROADCAST_GEN1(x)     PASAHO_READ_BITFIELD((x)->word0,18,1)    /**< Indicate whether it is a broadcast IP packet (PASS Gen1)*/
405 #define PASAHO_LINFO_IS_IP_MULTICAST_GEN1(x)     PASAHO_READ_BITFIELD((x)->word0,19,1)    /**< Indicate whether it is a multicast IP packet (PASS Gen1)*/
406 #define PASAHO_LINFO_READ_IP_PKTTYPE_GEN1(x)     PASAHO_READ_BITFIELD((x)->word0,18,2)    /**< Extract the IP packet type (PASS Gen1)*/
408 #define PASAHO_LINFO_READ_END_OFFSET_GEN1(x)     PASAHO_READ_BITFIELD((x)->word1,16,16)   /**< Extract the end of packet parse offset (PASS Gen1)*/
409 #define PASAHO_LINFO_READ_EIDX_GEN1(x)           PASAHO_READ_BITFIELD((x)->word1,11,5)    /**< Extract the error index (PASS Gen1)*/
410 #define PASAHO_LINFO_READ_PMATCH_GEN1(x)         PASAHO_READ_BITFIELD((x)->word1,10,1)    /**< Extract the previous match flag (PASS Gen1)*/
411 #define PASAHO_LINFO_READ_L1_PDSP_ID_GEN1(x)     PASAHO_READ_BITFIELD((x)->word1,6,3)     /**< Extract the first parse module ID (PASS Gen1)*/
412 #define PASAHO_LINFO_READ_L1_IDX_GEN1(x)         PASAHO_READ_BITFIELD((x)->word1,0,6)     /**< Extract the first parse module match index (PASS Gen1)*/
414 #define PASAHO_LINFO_READ_L3_OFFSET_GEN1(x)      PASAHO_READ_BITFIELD((x)->word2,24,8)    /**< Extract the offset to the level 3 header (PASS Gen1)*/
415 #define PASAHO_LINFO_READ_L4_OFFSET_GEN1(x)      PASAHO_READ_BITFIELD((x)->word2,16,8)    /**< Extract the offset to the level 4 header (PASS Gen1)*/
416 #define PASAHO_LINFO_READ_L5_OFFSET_GEN1(x)      PASAHO_READ_BITFIELD((x)->word2,8,8)     /**< Extract the offset to the level 5 header (PASS Gen1)*/
417 #define PASAHO_LINFO_READ_ESP_AH_OFFSET_GEN1(x)  PASAHO_READ_BITFIELD((x)->word2,0,8)     /**< Extract the offset to the security header (PASS Gen1)*/
419 #define PASAHO_LINFO_READ_HDR_BITMASK_GEN1(x)    PASAHO_READ_BITFIELD((x)->word3,21,11)   /**< Extract the bitmask of parsed header types (PASS Gen1)*/
420 #define PASAHO_LINFO_READ_HDR_BITMASK2_GEN1(x)   PASAHO_READ_BITFIELD((x)->word3, 4,4)    /**< Extract the bitmask2 of parsed header types (PASS Gen1)*/
421 #define PASAHO_LINFO_READ_NXT_HDR_TYPE_GEN1(x)   PASAHO_READ_BITFIELD((x)->word3,16,5)    /**< Extract the next header to parse type (PASS Gen1)*/
422 #define PASAHO_LINFO_READ_VLAN_COUNT_GEN1(x)     PASAHO_READ_BITFIELD((x)->word3,14,2)    /**< Extract the number of VLAN tags found (PASS Gen1)*/
423 #define PASAHO_LINFO_READ_IP_COUNT_GEN1(x)       PASAHO_READ_BITFIELD((x)->word3,8,3)     /**< Extract the number of IP headers found (PASS Gen1)*/
424 #define PASAHO_LINFO_READ_GRE_COUNT_GEN1(x)      PASAHO_READ_BITFIELD((x)->word3,11,3)    /**< Extract the number of GRE headers found (PASS Gen1)*/
425 #define PASAHO_LINFO_READ_FLAG_FRAG_GEN1(x)      PASAHO_READ_BITFIELD((x)->word3,3,1)     /**< Extract the fragmentation found flag (PASS Gen1)*/
426 #define PASAHO_LINFO_READ_INPORT_GEN1(x)         PASAHO_READ_BITFIELD((x)->word3,0,3)     /**< Extract the (1-based) input EMAC port number  
427                                                                                                0: Indicates that the packet does not enter PASS 
428                                                                                                through CPSW (PASS Gen1)*/
429 #define PASAHO_LINFO_READ_INNER_IP_OFFSET_GEN1(x) PASAHO_READ_BITFIELD((x)->word4,16,8)   /**< Extract the offset to the most inner IP header (PASS Gen1)*/
430 #define PASAHO_LINFO_READ_TSTAMP_MSB_GEN1(x)     (x)->word6                               /**< Extract the most significant 32-bit of the 64-bit timestamp */
431 #define PASAHO_LINFO_READ_TSTAMP_MSB2_GEN1(x)    (x)->word8                               /**< Extract the most significant 32-bit of the 64-bit timestamp 
432                                                                                           where the paylaod data has been copied to word6/7 within  
433                                                                                           pasahoLongInfo_t by using PASS command pa_CMD_COPY_DATA_TO_PSINFO */
435 /*@}*/ /* PASAHO_long_info_command_gen1_macros */
436 /** @}*/ /* @name PASAHO Long Info Command Macros For First Generation PASS */
438 /** 
439  *  @defgroup PASAHO_long_info_command_gen2_macros  PASAHO Long Info Command Macros For Second Generation PASS
440  *  @ingroup pasaho_if_macros
441  *  @{
442  *  @name PASAHO Long Info Command Macros For Second Generation PASS
443  *  Macros used by the PASAHO Long Info Command
444  */
445 /*@{*/
447 #define PASAHO_LINFO_READ_CMDID_GEN2(x)          PASAHO_READ_BITFIELD((x)->word0,29,3)    /**< Extract the command ID defined at @ref pasahoCommands (PASS Gen2)*/
448 #define PASAHO_LINFO_READ_RECLEN_GEN2(x)         PASAHO_READ_BITFIELD((x)->word0,24,5)    /**< Extract the block length (PASS Gen2)*/
449 #define PASAHO_LINFO_READ_START_OFFSET_GEN2(x)   PASAHO_READ_BITFIELD((x)->word0,0,8)     /**< Extract the next parse start offset (PASS Gen2)*/
451 #define PASAHO_LINFO_IS_MAC_BROADCAST_GEN2(x)    PASAHO_READ_BITFIELD((x)->word0,16,1)    /**< Indicate whether it is a broadcast MAC packet (PASS Gen2)*/
452 #define PASAHO_LINFO_IS_MAC_MULTICAST_GEN2(x)    PASAHO_READ_BITFIELD((x)->word0,17,1)    /**< Indicate whether it is a multicast MAC packet (PASS Gen2)*/
453 #define PASAHO_LINFO_READ_MAC_PKTTYPE_GEN2(x)    PASAHO_READ_BITFIELD((x)->word0,16,2)    /**< Extract the MAC packet type (PASS Gen2)*/
455 #define PASAHO_LINFO_IS_IP_BROADCAST_GEN2(x)     PASAHO_READ_BITFIELD((x)->word0,16,1)    /**< Indicate whether it is a broadcast IP packet (PASS Gen2)*/
456 #define PASAHO_LINFO_IS_IP_MULTICAST_GEN2(x)     PASAHO_READ_BITFIELD((x)->word0,17,1)    /**< Indicate whether it is a multicast IP packet (PASS Gen2)*/
457 #define PASAHO_LINFO_READ_IP_PKTTYPE_GEN2(x)     PASAHO_READ_BITFIELD((x)->word0,16,2)    /**< Extract the IP packet type (PASS Gen2)*/
459 #define PASAHO_LINFO_READ_PMATCH_GEN2(x)         PASAHO_READ_BITFIELD((x)->word0,23,1)    /**< Extract the previous match flag (PASS Gen2)*/
460 #define PASAHO_LINFO_READ_FLAG_FRAG_GEN2(x)      PASAHO_READ_BITFIELD((x)->word0,19,1)    /**< Extract the fragmentation found flag (PASS Gen2)*/
462 #define PASAHO_LINFO_READ_END_OFFSET_GEN2(x)     PASAHO_READ_BITFIELD((x)->word1,16,16)   /**< Extract the end of packet parse offset (PASS Gen2)*/
463 #define PASAHO_LINFO_READ_EIDX_GEN2(x)           PASAHO_READ_BITFIELD((x)->word1,10,6)    /**< Extract the exception index (PASS Gen2)*/
464 #define PASAHO_LINFO_READ_NXT_HDR_TYPE_GEN2(x)   PASAHO_READ_BITFIELD((x)->word1,0,6)     /**< Extract the next header to parse type (PASS Gen2)*/
465 #define PASAHO_LINFO_READ_INPORT_GEN2(x)         PASAHO_READ_BITFIELD((x)->word1,6,4)     /**< Extract the (1-based) input EMAC port number  
466                                                                                                through CPSW (PASS Gen2)*/
468 #define PASAHO_LINFO_READ_L3_OFFSET_GEN2(x)      PASAHO_READ_BITFIELD((x)->word2,24,8)    /**< Extract the offset to the level 3 header (PASS Gen2)*/
469 #define PASAHO_LINFO_READ_L4_OFFSET_GEN2(x)      PASAHO_READ_BITFIELD((x)->word2,16,8)    /**< Extract the offset to the level 4 header (PASS Gen2)*/
470 #define PASAHO_LINFO_READ_L5_OFFSET_GEN2(x)      PASAHO_READ_BITFIELD((x)->word2,8,8)     /**< Extract the offset to the level 5 header (PASS Gen2)*/
471 #define PASAHO_LINFO_READ_ESP_AH_OFFSET_GEN2(x)  PASAHO_READ_BITFIELD((x)->word2,0,8)     /**< Extract the offset to the security header (PASS Gen2)*/
473 #define PASAHO_LINFO_READ_L1_PDSP_ID_GEN2(x)     PASAHO_READ_BITFIELD((x)->word3,26,6)    /**< Extract the first parse module ID (PASS Gen2)*/
474 #define PASAHO_LINFO_READ_L1_IDX_GEN2(x)         PASAHO_READ_BITFIELD((x)->word3,16,10)   /**< Extract the first parse module match index (PASS Gen2)*/
475 #define PASAHO_LINFO_READ_HDR_BITMASK_GEN2(x)    PASAHO_READ_BITFIELD((x)->word3,0,16)    /**< Extract the bitmask of parsed header types (PASS Gen2)*/
476 #define PASAHO_LINFO_READ_HDR_BITMASK2_GEN2(x)   0                                        /**< Extract the bitmask2 of parsed header types (PASS Gen2)*/
477 #define PASAHO_LINFO_READ_VLAN_COUNT_GEN2(x)     PASAHO_READ_BITFIELD((x)->word4,6,2)     /**< Extract the number of VLAN tags found (PASS Gen2)*/
478 #define PASAHO_LINFO_READ_IP_COUNT_GEN2(x)       PASAHO_READ_BITFIELD((x)->word4,0,3)     /**< Extract the number of IP headers found (PASS Gen2)*/
479 #define PASAHO_LINFO_READ_GRE_COUNT_GEN2(x)      PASAHO_READ_BITFIELD((x)->word4,3,3)     /**< Extract the number of GRE headers found (PASS Gen2)*/
481 #define PASAHO_LINFO_READ_INNER_IP_OFFSET_GEN2(x) PASAHO_READ_BITFIELD((x)->word5,24,8)   /**< Extract the offset to the inner IP header (PASS Gen2)*/
482 #define PASAHO_LINFO_READ_TSTAMP_MSB_GEN2(x)     (x)->word6                               /**< Extract the most significant 32-bit of the 64-bit timestamp */
483 #define PASAHO_LINFO_READ_TSTAMP_MSB2_GEN2(x)    (x)->word8                               /**< Extract the most significant 32-bit of the 64-bit timestamp 
484                                                                                           where the paylaod data has been copied to word6/7 within  
485                                                                                           pasahoLongInfo_t by using PASS command pa_CMD_COPY_DATA_TO_PSINFO */
486 #define PASAHO_LINFO_READ_PATSTAMP_LSW_GEN2(x)   (x)->word9                               /**< Extract the most significant 32-bit of the 64-bit PA timestamp */
487 #define PASAHO_LINFO_READ_PATSTAMP_MSW_GEN2(x)   (x)->word8                               /**< Extract the least significant 32-bit of the 64-bit PA timestamp */
489 #define PASAHO_LINFO_READ_PATSTAMP_LSW2_GEN2(x)  (x)->word11                              /**< Extract the most significant 32-bit of the 64-bit PA timestamp
490                                                                                           where the paylaod data has been copied to word6/7 within
491                                                                                           pasahoLongInfo_t by using PASS command pa_CMD_COPY_DATA_TO_PSINFO */
492 #define PASAHO_LINFO_READ_PATSTAMP_MSW2_GEN2(x)  (x)->word10                              /**< Extract the most significant 32-bit of the 64-bit PA timestamp
493                                                                                           where the paylaod data has been copied to word6/7 within
494                                                                                           pasahoLongInfo_t by using PASS command pa_CMD_COPY_DATA_TO_PSINFO */
496 /*@}*/ /* PASAHO_long_info_command_gen2 macros */
497 /** @}*/ /* @name PASAHO Long Info Command Macros For Second Generation PASS */
499 /** 
500  *  @defgroup PASAHO_long_info_command_macros  PASAHO Long Info Command Macros
501  *  @ingroup pasaho_if_macros
502  *  @{
503  *  @name PASAHO Long Info Command Macros
504  *  Macros used by the PASAHO Long Info Command
505  */
506 /*@{*/
508 #ifdef NSS_GEN2
509 #define PASAHO_LINFO_READ_CMDID(x)          PASAHO_LINFO_READ_CMDID_GEN2(x)           /**< Extract the command ID defined at @ref pasahoCommands */
510 #define PASAHO_LINFO_READ_RECLEN(x)         PASAHO_LINFO_READ_RECLEN_GEN2(x)          /**< Extract the block length */
511 #define PASAHO_LINFO_READ_START_OFFSET(x)   PASAHO_LINFO_READ_START_OFFSET_GEN2(x)    /**< Extract the next parse start offset */
513 #define PASAHO_LINFO_IS_MAC_BROADCAST(x)    PASAHO_LINFO_IS_MAC_BROADCAST_GEN2(x)     /**< Indicate whether it is a broadcast MAC packet */
514 #define PASAHO_LINFO_IS_MAC_MULTICAST(x)    PASAHO_LINFO_IS_MAC_MULTICAST_GEN2(x)     /**< Indicate whether it is a multicast MAC packet */
515 #define PASAHO_LINFO_READ_MAC_PKTTYPE(x)    PASAHO_LINFO_READ_MAC_PKTTYPE_GEN2(x)     /**< Extract the MAC packet type */
517 #define PASAHO_LINFO_IS_IP_BROADCAST(x)     PASAHO_LINFO_IS_IP_BROADCAST_GEN2(x)      /**< Indicate whether it is a broadcast IP packet */
518 #define PASAHO_LINFO_IS_IP_MULTICAST(x)     PASAHO_LINFO_IS_IP_MULTICAST_GEN2(x)      /**< Indicate whether it is a multicast IP packet */
519 #define PASAHO_LINFO_READ_IP_PKTTYPE(x)     PASAHO_LINFO_READ_IP_PKTTYPE_GEN2(x)      /**< Extract the IP packet type */
521 #define PASAHO_LINFO_READ_PMATCH(x)         PASAHO_LINFO_READ_PMATCH_GEN2(x)          /**< Extract the previous match flag */
522 #define PASAHO_LINFO_READ_FLAG_FRAG(x)      PASAHO_LINFO_READ_FLAG_FRAG_GEN2(x)       /**< Extract the fragmentation found flag */
524 #define PASAHO_LINFO_READ_END_OFFSET(x)     PASAHO_LINFO_READ_END_OFFSET_GEN2(x)      /**< Extract the end of packet parse offset */
525 #define PASAHO_LINFO_READ_EIDX(x)           PASAHO_LINFO_READ_EIDX_GEN2(x)            /**< Extract the exception index */
526 #define PASAHO_LINFO_READ_NXT_HDR_TYPE(x)   PASAHO_LINFO_READ_NXT_HDR_TYPE_GEN2(x)    /**< Extract the next header to parse type */
527 #define PASAHO_LINFO_READ_INPORT(x)         PASAHO_LINFO_READ_INPORT_GEN2(x)          /**< Extract the (1-based) input EMAC port number  
528                                                                                            through CPSW */
530 #define PASAHO_LINFO_READ_L3_OFFSET(x)      PASAHO_LINFO_READ_L3_OFFSET_GEN2(x)       /**< Extract the offset to the level 3 header */
531 #define PASAHO_LINFO_READ_L4_OFFSET(x)      PASAHO_LINFO_READ_L4_OFFSET_GEN2(x)       /**< Extract the offset to the level 4 header */
532 #define PASAHO_LINFO_READ_L5_OFFSET(x)      PASAHO_LINFO_READ_L5_OFFSET_GEN2(x)       /**< Extract the offset to the level 5 header */
533 #define PASAHO_LINFO_READ_ESP_AH_OFFSET(x)  PASAHO_LINFO_READ_ESP_AH_OFFSET_GEN2(x)   /**< Extract the offset to the security header */
535 #define PASAHO_LINFO_READ_L1_PDSP_ID(x)     PASAHO_LINFO_READ_L1_PDSP_ID_GEN2(x)      /**< Extract the first parse module ID */
536 #define PASAHO_LINFO_READ_L1_IDX(x)         PASAHO_LINFO_READ_L1_IDX_GEN2(x)          /**< Extract the first parse module match index */
537 #define PASAHO_LINFO_READ_HDR_BITMASK(x)    PASAHO_LINFO_READ_HDR_BITMASK_GEN2(x)     /**< Extract the bitmask of parsed header types */
538 #define PASAHO_LINFO_READ_HDR_BITMASK2(x)   PASAHO_LINFO_READ_HDR_BITMASK2_GEN2(x)    /**< Extract the bitmask2 of parsed header types */
539 #define PASAHO_LINFO_READ_VLAN_COUNT(x)     PASAHO_LINFO_READ_VLAN_COUNT_GEN2(x)      /**< Extract the number of VLAN tags found */
540 #define PASAHO_LINFO_READ_IP_COUNT(x)       PASAHO_LINFO_READ_IP_COUNT_GEN2(x)        /**< Extract the number of IP headers found */
541 #define PASAHO_LINFO_READ_GRE_COUNT(x)      PASAHO_LINFO_READ_GRE_COUNT_GEN2(x)       /**< Extract the number of GRE headers found */
543 #define PASAHO_LINFO_READ_INNER_IP_OFFSET(x)PASAHO_LINFO_READ_INNER_IP_OFFSET_GEN2(x) /**< Extract the offset to the inner IP header */
544 #define PASAHO_LINFO_READ_TSTAMP_MSB(x)     PASAHO_LINFO_READ_TSTAMP_MSB_GEN2(x)      /**< Extract the most significant 32-bit of the 64-bit timestamp */
545 #define PASAHO_LINFO_READ_TSTAMP_MSB2(x)    PASAHO_LINFO_READ_TSTAMP_MSB2_GEN2(x)     /**< Extract the most significant 32-bit of the 64-bit timestamp 
546                                                                                            where the paylaod data has been copied to word6/7 within  
547                                                                                            pasahoLongInfo_t by using PASS command pa_CMD_COPY_DATA_TO_PSINFO */
548 #else
549 #define PASAHO_LINFO_READ_CMDID(x)          PASAHO_LINFO_READ_CMDID_GEN1(x)           /**< Extract the command ID defined at @ref pasahoCommands */
550 #define PASAHO_LINFO_READ_RECLEN(x)         PASAHO_LINFO_READ_RECLEN_GEN1(x)          /**< Extract the block length */
551 #define PASAHO_LINFO_READ_START_OFFSET(x)   PASAHO_LINFO_READ_START_OFFSET_GEN1(x)    /**< Extract the next parse start offset */
553 #define PASAHO_LINFO_IS_MAC_BROADCAST(x)    PASAHO_LINFO_IS_MAC_BROADCAST_GEN1(x)     /**< Indicate whether it is a broadcast MAC packet */
554 #define PASAHO_LINFO_IS_MAC_MULTICAST(x)    PASAHO_LINFO_IS_MAC_MULTICAST_GEN1(x)     /**< Indicate whether it is a multicast MAC packet */
555 #define PASAHO_LINFO_READ_MAC_PKTTYPE(x)    PASAHO_LINFO_READ_MAC_PKTTYPE_GEN1(x)     /**< Extract the MAC packet type */
557 #define PASAHO_LINFO_IS_IP_BROADCAST(x)     PASAHO_LINFO_IS_IP_BROADCAST_GEN1(x)      /**< Indicate whether it is a broadcast IP packet */
558 #define PASAHO_LINFO_IS_IP_MULTICAST(x)     PASAHO_LINFO_IS_IP_MULTICAST_GEN1(x)      /**< Indicate whether it is a multicast IP packet */
559 #define PASAHO_LINFO_READ_IP_PKTTYPE(x)     PASAHO_LINFO_READ_IP_PKTTYPE_GEN1(x)      /**< Extract the IP packet type */
561 #define PASAHO_LINFO_READ_END_OFFSET(x)     PASAHO_LINFO_READ_END_OFFSET_GEN1(x)      /**< Extract the end of packet parse offset */
562 #define PASAHO_LINFO_READ_EIDX(x)           PASAHO_LINFO_READ_EIDX_GEN1(x)            /**< Extract the error index */
563 #define PASAHO_LINFO_READ_PMATCH(x)         PASAHO_LINFO_READ_PMATCH_GEN1(x)          /**< Extract the previous match flag */
564 #define PASAHO_LINFO_READ_L1_PDSP_ID(x)     PASAHO_LINFO_READ_L1_PDSP_ID_GEN1(x)      /**< Extract the first parse module ID */
565 #define PASAHO_LINFO_READ_L1_IDX(x)         PASAHO_LINFO_READ_L1_IDX_GEN1(x)          /**< Extract the first parse module match index */
567 #define PASAHO_LINFO_READ_L3_OFFSET(x)      PASAHO_LINFO_READ_L3_OFFSET_GEN1(x)       /**< Extract the offset to the level 3 header */
568 #define PASAHO_LINFO_READ_L4_OFFSET(x)      PASAHO_LINFO_READ_L4_OFFSET_GEN1(x)       /**< Extract the offset to the level 4 header */
569 #define PASAHO_LINFO_READ_L5_OFFSET(x)      PASAHO_LINFO_READ_L5_OFFSET_GEN1(x)       /**< Extract the offset to the level 5 header */
570 #define PASAHO_LINFO_READ_ESP_AH_OFFSET(x)  PASAHO_LINFO_READ_ESP_AH_OFFSET_GEN1(x)   /**< Extract the offset to the security header */
572 #define PASAHO_LINFO_READ_HDR_BITMASK(x)    PASAHO_LINFO_READ_HDR_BITMASK_GEN1(x)     /**< Extract the bitmask of parsed header types */
573 #define PASAHO_LINFO_READ_HDR_BITMASK2(x)   PASAHO_LINFO_READ_HDR_BITMASK2_GEN1(x)    /**< Extract the bitmask2 of parsed header types */
574 #define PASAHO_LINFO_READ_NXT_HDR_TYPE(x)   PASAHO_LINFO_READ_NXT_HDR_TYPE_GEN1(x)    /**< Extract the next header to parse type */
575 #define PASAHO_LINFO_READ_VLAN_COUNT(x)     PASAHO_LINFO_READ_VLAN_COUNT_GEN1(x)      /**< Extract the number of VLAN tags found */
576 #define PASAHO_LINFO_READ_IP_COUNT(x)       PASAHO_LINFO_READ_IP_COUNT_GEN1(x)        /**< Extract the number of IP headers found */
577 #define PASAHO_LINFO_READ_GRE_COUNT(x)      PASAHO_LINFO_READ_GRE_COUNT_GEN1(x)       /**< Extract the number of GRE headers found */
578 #define PASAHO_LINFO_READ_FLAG_FRAG(x)      PASAHO_LINFO_READ_FLAG_FRAG_GEN1(x)       /**< Extract the fragmentation found flag */
579 #define PASAHO_LINFO_READ_INPORT(x)         PASAHO_LINFO_READ_INPORT_GEN1(x)          /**< Extract the (1-based) input EMAC port number  
580                                                                                            0: Indicates that the packet does not enter PASS 
581                                                                                            through CPSW */
582 #define PASAHO_LINFO_READ_INNER_IP_OFFSET(x)PASAHO_LINFO_READ_INNER_IP_OFFSET_GEN1(x) /**< Extract the offset to the inner IP header */
583 #define PASAHO_LINFO_READ_TSTAMP_MSB(x)     PASAHO_LINFO_READ_TSTAMP_MSB_GEN1(x)      /**< Extract the most significant 32-bit of the 64-bit timestamp */
584 #define PASAHO_LINFO_READ_TSTAMP_MSB2(x)    PASAHO_LINFO_READ_TSTAMP_MSB2_GEN1(x)     /**< Extract the most significant 32-bit of the 64-bit timestamp 
585                                                                                            where the paylaod data has been copied to word6/7 within  
586                                                                                            pasahoLongInfo_t by using PASS command pa_CMD_COPY_DATA_TO_PSINFO */
587 #endif
589 /* Extract Protocol Information */
591 /*@}*/ /* PASAHO_long_info_command_macros */
592 /** @}*/ /* @name PASAHO Long Info Command Macros */
594 /**
595  *  @defgroup PASAHO_long_info_proto_ind_gen1_macros  PASAHO Long Info Protocol Indication Macros For First Generation PASS
596  *  @ingroup pasaho_if_macros
597  *  @{
598  *  @name PASAHO Long Info Protocol Indication Macros For First Generation PASS
599  */
600 #define PASAHO_LINFO_IS_MAC_GEN1(x)              PASAHO_READ_BITFIELD((x)->word3,21,1)    /**< Indicate whether it is a MAC packet (Pass Gen1)*/
601 #define PASAHO_LINFO_IS_802_3_GEN1(x)            PASAHO_READ_BITFIELD((x)->word3,7,1)     /**< Indicate whether it is a 802.3 packet (Pass Gen1)*/
602 #define PASAHO_LINFO_IS_WITH_VLAN_GEN1(x)        PASAHO_LINFO_READ_VLAN_COUNT(x)          /**< Indicate whether it is a MAC packet with VLAN (Pass Gen1)*/
603 #define PASAHO_LINFO_IS_WITH_MPLS_GEN1(x)        PASAHO_READ_BITFIELD((x)->word3,23,1)    /**< Indicate whether it is a MAC packet with MPLS (Pass Gen1)*/
604 #define PASAHO_LINFO_IS_PPPoE_GEN1(x)            PASAHO_READ_BITFIELD((x)->word3,6,1)     /**< Indicate whether it is a PPPoE packet (Pass Gen1)*/
605 #define PASAHO_LINFO_IS_IP_GEN1(x)               PASAHO_LINFO_READ_IP_COUNT(x)            /**< Indicate whether it is an IP packet (Pass Gen1)*/
606 #define PASAHO_LINFO_IS_IPSEC_ESP_GEN1(x)        PASAHO_READ_BITFIELD((x)->word3,25,1)    /**< Indicate whether it is an IPSEC ESP packet (Pass Gen1)*/
607 #define PASAHO_LINFO_IS_IPSEC_AH_GEN1(x)         PASAHO_READ_BITFIELD((x)->word3,26,1)    /**< Indicate whether it is an IPSEC AH packet (Pass Gen1)*/
608 #define PASAHO_LINFO_IS_UDP_GEN1(x)              PASAHO_READ_BITFIELD((x)->word3,27,1)    /**< Indicate whether it is an UDP packet (Pass Gen1)*/
609 #define PASAHO_LINFO_IS_UDP_LITE_GEN1(x)         PASAHO_READ_BITFIELD((x)->word3,28,1)    /**< Indicate whether it is an UDP Lite packet (Pass Gen1)*/
610 #define PASAHO_LINFO_IS_TCP_GEN1(x)              PASAHO_READ_BITFIELD((x)->word3,29,1)    /**< Indicate whether it is a TCP packet (Pass Gen1)*/
611 #define PASAHO_LINFO_IS_GRE_GEN1(x)              PASAHO_LINFO_READ_GRE_COUNT(x)           /**< Indicate whether it is a GRE packet (Pass Gen1)*/
612 #define PASAHO_LINFO_IS_GTPU_GEN1(x)             PASAHO_READ_BITFIELD((x)->word3,30,1)    /**< Indicate whether it is a GTPU packet (Pass Gen1)*/
613 #define PASAHO_LINFO_IS_CUSTOM_GEN1(x)           PASAHO_READ_BITFIELD((x)->word3,31,1)    /**< Indicate whether it is a Custom packet (Pass Gen1)*/
614 #define PASAHO_LINFO_IS_SCTP_GEN1(x)             PASAHO_READ_BITFIELD((x)->word3,4,1)     /**< Indicate whether it is a SCTP packet (Pass Gen1)*/
615 #define PASAHO_LINFO_IS_IPSEC_NAT_T_GEN1(x)      PASAHO_READ_BITFIELD((x)->word3,5,1)     /**< Indicate whether it is an IPSEC NAT-T packet (Pass Gen1)*/
617 /*@}*/ /* PASAHO_long_info_proto_ind_gen1_macross */
618 /** @}*/ /* @name PASAHO Long Info Protocol Indication Macross For First Generation PASS */
620 /**
621  *  @defgroup PASAHO_long_info_proto_ind_gen2_macros  PASAHO Long Info Protocol Indication Macros For Second Generation PASS
622  *  @ingroup pasaho_if_macros
623  *  @{
624  *  @name PASAHO Long Info Protocol Indication Macros For Second Generation PASS
625  */
626 #define PASAHO_LINFO_IS_MAC_GEN2(x)              PASAHO_READ_BITFIELD((x)->word3,0,1)     /**< Indicate whether it is a MAC packet (Pass Gen2)*/
627 #define PASAHO_LINFO_IS_WITH_VLAN_GEN2(x)        PASAHO_LINFO_READ_VLAN_COUNT(x)          /**< Indicate whether it is a MAC packet with VLAN (Pass Gen2)*/
628 #define PASAHO_LINFO_IS_WITH_MPLS_GEN2(x)        PASAHO_READ_BITFIELD((x)->word3,2,1)     /**< Indicate whether it is a MAC packet with MPLS (Pass Gen2)*/
629 #define PASAHO_LINFO_IS_802_3_GEN2(x)            PASAHO_READ_BITFIELD((x)->word3,3,1)     /**< Indicate whether it is a 802.3 packet (Pass Gen2)*/
630 #define PASAHO_LINFO_IS_PPPoE_GEN2(x)            PASAHO_READ_BITFIELD((x)->word3,4,1)     /**< Indicate whether it is a PPPoE packet (Pass Gen2)*/
631 #define PASAHO_LINFO_IS_IP_GEN2(x)               PASAHO_LINFO_READ_IP_COUNT(x)            /**< Indicate whether it is an IP packet (Pass Gen2)*/
632 #define PASAHO_LINFO_IS_IPv4_GEN2(x)             PASAHO_READ_BITFIELD((x)->word3,5,1)     /**< Indicate whether it is an IPv4 packet (Pass Gen2)*/
633 #define PASAHO_LINFO_IS_IPv6_GEN2(x)             PASAHO_READ_BITFIELD((x)->word3,6,1)     /**< Indicate whether it is an IPv4 packet (Pass Gen2)*/
634 #define PASAHO_LINFO_IS_IP_OPTIONS_GEN2(x)       PASAHO_READ_BITFIELD((x)->word3,7,1)     /**< Indicate whether there are IPV4 options or IPv6 extention headers (Pass Gen2)*/
635 #define PASAHO_LINFO_IS_IPSEC_ESP_GEN2(x)        PASAHO_READ_BITFIELD((x)->word3,8,1)     /**< Indicate whether it is an IPSEC ESP packet (Pass Gen2)*/
636 #define PASAHO_LINFO_IS_IPSEC_AH_GEN2(x)         PASAHO_READ_BITFIELD((x)->word3,9,1)     /**< Indicate whether it is an IPSEC AH packet (Pass Gen2)*/
637 #define PASAHO_LINFO_IS_SCTP_GEN2(x)             PASAHO_READ_BITFIELD((x)->word3,10,1)    /**< Indicate whether it is a SCTP packet (Pass Gen2)*/
638 #define PASAHO_LINFO_IS_UDP_GEN2(x)              PASAHO_READ_BITFIELD((x)->word3,11,1)    /**< Indicate whether it is an UDP packet (Pass Gen2)*/
639 #define PASAHO_LINFO_IS_UDP_LITE_GEN2(x)         PASAHO_READ_BITFIELD((x)->word3,11,1)    /**< Indicate whether it is an UDP Lite packet (Pass Gen2)*/
640 #define PASAHO_LINFO_IS_TCP_GEN2(x)              PASAHO_READ_BITFIELD((x)->word3,12,1)    /**< Indicate whether it is a TCP packet (Pass Gen2)*/
641 #define PASAHO_LINFO_IS_GRE_GEN2(x)              PASAHO_LINFO_READ_GRE_COUNT(x)           /**< Indicate whether it is a GRE packet (Pass Gen2)*/
642 #define PASAHO_LINFO_IS_GTPU_GEN2(x)             PASAHO_READ_BITFIELD((x)->word3,13,1)    /**< Indicate whether it is a GTPU packet (Pass Gen2)*/
643 #define PASAHO_LINFO_IS_CUSTOM_GEN2(x)           PASAHO_READ_BITFIELD((x)->word3,14,1)    /**< Indicate whether it is a Custom packet (Pass Gen2)*/
644 #define PASAHO_LINFO_IS_IPSEC_NAT_T_GEN2(x)      PASAHO_READ_BITFIELD((x)->word3,15,1)    /**< Indicate whether it is an IPSEC NAT-T packet (Pass Gen2)*/
646 /*@}*/ /* PASAHO_long_info_proto_ind_macross */
647 /** @}*/ /* @name PASAHO Long Info Protocol Indication Macross For Second Generation PASS */
649 /**
650  *  @defgroup PASAHO_long_info_proto_ind_macros  PASAHO Long Info Protocol Indication Macros
651  *  @ingroup pasaho_if_macros
652  *  @{
653  *  @name PASAHO Long Info Protocol Indication Macros
654  */
655 #ifdef NSS_GEN2
656 #define PASAHO_LINFO_IS_MAC(x)          PASAHO_LINFO_IS_MAC_GEN2(x)             /**< Indicate whether it is a MAC packet */
657 #define PASAHO_LINFO_IS_WITH_VLAN(x)    PASAHO_LINFO_IS_WITH_VLAN_GEN2(x)       /**< Indicate whether it is a MAC packet with VLAN */
658 #define PASAHO_LINFO_IS_WITH_MPLS(x)    PASAHO_LINFO_IS_WITH_MPLS_GEN2(x)       /**< Indicate whether it is a MAC packet with MPLS */
659 #define PASAHO_LINFO_IS_802_3(x)        PASAHO_LINFO_IS_802_3_GEN2(x)           /**< Indicate whether it is a 802.3 packet */
660 #define PASAHO_LINFO_IS_PPPoE(x)        PASAHO_LINFO_IS_PPPoE_GEN2(x)           /**< Indicate whether it is a PPPoE packet */
661 #define PASAHO_LINFO_IS_IP(x)           PASAHO_LINFO_IS_IP_GEN2(x)              /**< Indicate whether it is an IP packet */
662 #define PASAHO_LINFO_IS_IPv4(x)         PASAHO_LINFO_IS_IPv4_GEN2(x)            /**< Indicate whether it is an IPv4 packet */
663 #define PASAHO_LINFO_IS_IPv6(x)         PASAHO_LINFO_IS_IPv6_GEN2(x)            /**< Indicate whether it is an IPv4 packet */
664 #define PASAHO_LINFO_IS_IP_OPTIONS(x)   PASAHO_LINFO_IS_IP_OPTIONS_GEN2(x)      /**< Indicate whether there are IPV4 options or IPv6 extention headers */
665 #define PASAHO_LINFO_IS_IPSEC_ESP(x)    PASAHO_LINFO_IS_IPSEC_ESP_GEN2(x)       /**< Indicate whether it is an IPSEC ESP packet */
666 #define PASAHO_LINFO_IS_IPSEC_AH(x)     PASAHO_LINFO_IS_IPSEC_AH_GEN2(x)        /**< Indicate whether it is an IPSEC AH packet */
667 #define PASAHO_LINFO_IS_SCTP(x)         PASAHO_LINFO_IS_SCTP_GEN2(x)            /**< Indicate whether it is a SCTP packet */
668 #define PASAHO_LINFO_IS_UDP(x)          PASAHO_LINFO_IS_UDP_GEN2(x)             /**< Indicate whether it is an UDP packet */
669 #define PASAHO_LINFO_IS_UDP_LITE(x)     PASAHO_LINFO_IS_UDP_LITE_GEN2(x)        /**< Indicate whether it is an UDP Lite packet */
670 #define PASAHO_LINFO_IS_TCP(x)          PASAHO_LINFO_IS_TCP_GEN2(x)             /**< Indicate whether it is a TCP packet */
671 #define PASAHO_LINFO_IS_GRE(x)          PASAHO_LINFO_IS_GRE_GEN2(x)             /**< Indicate whether it is a GRE packet */
672 #define PASAHO_LINFO_IS_GTPU(x)         PASAHO_LINFO_IS_GTPU_GEN2(x)            /**< Indicate whether it is a GTPU packet */
673 #define PASAHO_LINFO_IS_CUSTOM(x)       PASAHO_LINFO_IS_CUSTOM_GEN2(x)          /**< Indicate whether it is a Custom packet */
674 #define PASAHO_LINFO_IS_IPSEC_NAT_T(x)  PASAHO_LINFO_IS_IPSEC_NAT_T_GEN2(x)     /**< Indicate whether it is an IPSEC NAT-T packet */
675 #else
676 #define PASAHO_LINFO_IS_MAC(x)          PASAHO_LINFO_IS_MAC_GEN1(x)             /**< Indicate whether it is a MAC packet */
677 #define PASAHO_LINFO_IS_802_3(x)        PASAHO_LINFO_IS_802_3_GEN1(x)           /**< Indicate whether it is a 802.3 packet */
678 #define PASAHO_LINFO_IS_WITH_VLAN(x)    PASAHO_LINFO_IS_WITH_VLAN_GEN1(x)       /**< Indicate whether it is a MAC packet with VLAN */
679 #define PASAHO_LINFO_IS_WITH_MPLS(x)    PASAHO_LINFO_IS_WITH_MPLS_GEN1(x)       /**< Indicate whether it is a MAC packet with MPLS */
680 #define PASAHO_LINFO_IS_PPPoE(x)        PASAHO_LINFO_IS_PPPoE_GEN1(x)           /**< Indicate whether it is a PPPoE packet */
681 #define PASAHO_LINFO_IS_IP(x)           PASAHO_LINFO_IS_IP_GEN1(x)              /**< Indicate whether it is an IP packet */
682 #define PASAHO_LINFO_IS_IPSEC_ESP(x)    PASAHO_LINFO_IS_IPSEC_ESP_GEN1(x)       /**< Indicate whether it is an IPSEC ESP packet */
683 #define PASAHO_LINFO_IS_IPSEC_AH(x)     PASAHO_LINFO_IS_IPSEC_AH_GEN1(x)        /**< Indicate whether it is an IPSEC AH packet */
684 #define PASAHO_LINFO_IS_UDP(x)          PASAHO_LINFO_IS_UDP_GEN1(x)             /**< Indicate whether it is an UDP packet */
685 #define PASAHO_LINFO_IS_UDP_LITE(x)     PASAHO_LINFO_IS_UDP_LITE_GEN1(x)        /**< Indicate whether it is an UDP Lite packet */
686 #define PASAHO_LINFO_IS_TCP(x)          PASAHO_LINFO_IS_TCP_GEN1(x)             /**< Indicate whether it is a TCP packet */
687 #define PASAHO_LINFO_IS_GRE(x)          PASAHO_LINFO_IS_GRE_GEN1(x)             /**< Indicate whether it is a GRE packet */
688 #define PASAHO_LINFO_IS_GTPU(x)         PASAHO_LINFO_IS_GTPU_GEN1(x)            /**< Indicate whether it is a GTPU packet */
689 #define PASAHO_LINFO_IS_CUSTOM(x)       PASAHO_LINFO_IS_CUSTOM_GEN1(x)          /**< Indicate whether it is a Custom packet */
690 #define PASAHO_LINFO_IS_SCTP(x)         PASAHO_LINFO_IS_SCTP_GEN1(x)            /**< Indicate whether it is a SCTP packet */
691 #define PASAHO_LINFO_IS_IPSEC_NAT_T(x)  PASAHO_LINFO_IS_IPSEC_NAT_T_GEN1(x)     /**< Indicate whether it is an IPSEC NAT-T packet */
692 #endif
694 /*@}*/ /* PASAHO_long_info_proto_ind_macross */
695 /** @}*/ /* @name PASAHO Long Info Protocol Indication Macross */
697 /**
698  *  @defgroup PASAHO_long_info_ipReassm_gen1_macros  PASAHO Long Info IP Reassembly Macros For First Generation PASS
699  *  @ingroup pasaho_if_macros
700  *  @{
701  *  @name PASAHO Long Info IpReassm Macros For First Generation PASS
702  *  Macros used by the PASAHO PASS-assisted IP Reassembly Operation
703  *
704  */
705 #define PASAHO_LINFO_READ_TFINDEX_GEN1(x)        PASAHO_READ_BITFIELD((x)->word4,24,8)     /**< Extract the IP Reassembly Traffic Flow Index (PASS Gen1)*/
706 #define PASAHO_LINFO_READ_FRANCNT_GEN1(x)        PASAHO_READ_BITFIELD((x)->word4,16,8)     /**< Extract the IP Reassembly Fragment count (PASS Gen1)*/
708 #define PASAHO_LINFO_SET_TFINDEX_GEN1(x, v)      PASAHO_SET_BITFIELD((x)->word4,(v),24,8)  /**< Set the IP Reassembly Traffic Flow Index (PASS Gen1)*/
709 #define PASAHO_LINFO_SET_FRANCNT_GEN1(x, v)      PASAHO_SET_BITFIELD((x)->word4,(v),16,8)  /**< Set the IP Reassembly Fragment count (PASS Gen1)*/
711 #define PASAHO_LINFO_IS_IPSEC_GEN1(x)            PASAHO_READ_BITFIELD((x)->word3,25,2)     /**< Indicate whether it is an IPSEC packet (PASS Gen1)*/
712 #define PASAHO_LINFO_CLR_IPSEC_GEN1(x)           PASAHO_SET_BITFIELD((x)->word3,0,25,2)    /**< Clear IPSEC indication bits (PASS Gen1)*/
713 #define PASAHO_LINFO_CLR_IPSEC_ESP_GEN1(x)       PASAHO_SET_BITFIELD((x)->word3,0,26,1)    /**< Clear IPSEC ESP indication bit (PASS Gen1)*/
714 #define PASAHO_LINFO_CLR_IPSEC_AH_GEN1(x)        PASAHO_SET_BITFIELD((x)->word3,0,25,1)    /**< Claer IPSEC AH indication bit (PASS Gen1)*/
715 #define PASAHO_LINFO_CLR_FLAG_FRAG_GEN1(x)       PASAHO_SET_BITFIELD((x)->word3,0,3,1)     /**< Clear the fragmentation found flag (PASS Gen1)*/
718 #define PASAHO_LINFO_SET_START_OFFSET_GEN1(x, v) PASAHO_SET_BITFIELD((x)->word0,(v),0,16)  /**< Update the next parse start offset (PASS Gen1)*/
719 #define PASAHO_LINFO_SET_END_OFFSET_GEN1(x, v)   PASAHO_SET_BITFIELD((x)->word1,(v),16,16) /**< Update the end of packet parse offset (PASS Gen1)*/
721 #define PASAHO_LINFO_SET_NULL_PKT_IND_GEN1(x, v) PASAHO_SET_BITFIELD((x)->word0,(v),21,1)  /**< Set the null packet flag which indicates that the packet should be dropped. 
722                                                                                            This flag should be set for the null packet to be delivered to PASS when
723                                                                                            the reassembly timeout occurs    (PASS Gen1)*/
725 /*@}*/ /* PASAHO_long_info_ipReassm_gen1_macros */
726 /** @}*/ /* @name PASAHO Long Info IpReassm Macros For First Generation PASS */
728 /**
729  *  @defgroup PASAHO_long_info_ipReassm_gen2_macros  PASAHO Long Info IP Reassembly Macros For Second Generation PASS
730  *  @ingroup pasaho_if_macros
731  *  @{
732  *  @name PASAHO Long Info IpReassm Macros
733  *  Macros used by the PASAHO PASS-assisted IP Reassembly Operation For Second Generation PASS
734  *
735  */
736 #define PASAHO_LINFO_READ_TFINDEX_GEN2(x)        PASAHO_READ_BITFIELD((x)->word5,24,8)     /**< Extract the IP Reassembly Traffic Flow Index (Pass Gen2)*/
737 #define PASAHO_LINFO_READ_FRANCNT_GEN2(x)        PASAHO_READ_BITFIELD((x)->word5,16,8)     /**< Extract the IP Reassembly Fragment count (Pass Gen2)*/
739 #define PASAHO_LINFO_SET_TFINDEX_GEN2(x, v)      PASAHO_SET_BITFIELD((x)->word5,(v),24,8)  /**< Set the IP Reassembly Traffic Flow Index (Pass Gen2)*/
740 #define PASAHO_LINFO_SET_FRANCNT_GEN2(x, v)      PASAHO_SET_BITFIELD((x)->word5,(v),16,8)  /**< Set the IP Reassembly Fragment count (Pass Gen2)*/
742 #define PASAHO_LINFO_IS_IPSEC_GEN2(x)            PASAHO_READ_BITFIELD((x)->word3,8,2)      /**< Indicate whether it is an IPSEC packet (Pass Gen2)*/
743 #define PASAHO_LINFO_CLR_IPSEC_GEN2(x)           PASAHO_SET_BITFIELD((x)->word3,0,8,2)     /**< Clear IPSEC indication bits (Pass Gen2)*/
744 #define PASAHO_LINFO_CLR_IPSEC_ESP_GEN2(x)       PASAHO_SET_BITFIELD((x)->word3,0,8,1)     /**< Clear IPSEC ESP indication bit (Pass Gen2)*/
745 #define PASAHO_LINFO_CLR_IPSEC_AH_GEN2(x)        PASAHO_SET_BITFIELD((x)->word3,0,9,1)     /**< Claer IPSEC AH indication bit (Pass Gen2)*/
746 #define PASAHO_LINFO_CLR_FLAG_FRAG_GEN2(x)       PASAHO_SET_BITFIELD((x)->word1,0,19,1)    /**< Clear the fragmentation found flag (Pass Gen2)*/
749 #define PASAHO_LINFO_SET_START_OFFSET_GEN2(x, v) PASAHO_SET_BITFIELD((x)->word0,(v),0,8)   /**< Update the next parse start offset (Pass Gen2)*/
750 #define PASAHO_LINFO_SET_END_OFFSET_GEN2(x, v)   PASAHO_SET_BITFIELD((x)->word1,(v),16,16) /**< Update the end of packet parse offset (Pass Gen2)*/
751 #define PASAHO_LINFO_SET_NXT_HDR_TYPE_GEN2(x, v) PASAHO_SET_BITFIELD((x)->word1,(v),0,6)   /**< Update the next header to parse type (Pass Gen2)*/
753 #define PASAHO_LINFO_SET_NULL_PKT_IND_GEN2(x, v) PASAHO_SET_BITFIELD((x)->word0,(v),13,1)  /**< Set the null packet flag which indicates that the packet should be dropped. 
754                                                                                                 This flag should be set for the null packet to be delivered to PASS when
755                                                                                                 the reassembly timeout occurs    (Pass Gen2)*/
756 /*@}*/ /* PASAHO_long_info_ipReassm_gen2_macros */
757 /** @}*/ /* @name PASAHO Long Info IpReassm Macros For Second Generation PASS */
759 /**
760  *  @defgroup PASAHO_long_info_ipReassm_macros  PASAHO Long Info IP Reassembly Macros
761  *  @ingroup pasaho_if_macros
762  *  @{
763  *  @name PASAHO Long Info IpReassm Macros
764  *  Macros used by the PASAHO PASS-assisted IP Reassembly Operation
765  *
766  */
767 #ifdef NSS_GEN2 
768 #define PASAHO_LINFO_READ_TFINDEX(x)        PASAHO_LINFO_READ_TFINDEX_GEN2(x)         /**< Extract the IP Reassembly Traffic Flow Index */
769 #define PASAHO_LINFO_READ_FRANCNT(x)        PASAHO_LINFO_READ_FRANCNT_GEN2(x)         /**< Extract the IP Reassembly Fragment count */
771 #define PASAHO_LINFO_SET_TFINDEX(x, v)      PASAHO_LINFO_SET_TFINDEX_GEN2(x, v)       /**< Set the IP Reassembly Traffic Flow Index */
772 #define PASAHO_LINFO_SET_FRANCNT(x, v)      PASAHO_LINFO_SET_FRANCNT_GEN2(x, v)       /**< Set the IP Reassembly Fragment count */
774 #define PASAHO_LINFO_IS_IPSEC(x)            PASAHO_LINFO_IS_IPSEC_GEN2(x)             /**< Indicate whether it is an IPSEC packet */
775 #define PASAHO_LINFO_CLR_IPSEC(x)           PASAHO_LINFO_CLR_IPSEC_GEN2(x)            /**< Clear IPSEC indication bits */
776 #define PASAHO_LINFO_CLR_IPSEC_ESP(x)       PASAHO_LINFO_CLR_IPSEC_ESP_GEN2(x)        /**< Clear IPSEC ESP indication bit */
777 #define PASAHO_LINFO_CLR_IPSEC_AH(x)        PASAHO_LINFO_CLR_IPSEC_AH_GEN2(x)         /**< Claer IPSEC AH indication bit */
778 #define PASAHO_LINFO_CLR_FLAG_FRAG(x)       PASAHO_LINFO_CLR_FLAG_FRAG_GEN2(x)        /**< Clear the fragmentation found flag */
781 #define PASAHO_LINFO_SET_START_OFFSET(x, v) PASAHO_LINFO_SET_START_OFFSET_GEN2(x, v)  /**< Update the next parse start offset */
782 #define PASAHO_LINFO_SET_END_OFFSET(x, v)   PASAHO_LINFO_SET_END_OFFSET_GEN2(x, v)    /**< Update the end of packet parse offset */
783 #define PASAHO_LINFO_SET_NXT_HDR_TYPE(x, v) PASAHO_LINFO_SET_NXT_HDR_TYPE_GEN2(x, v)  /**< Update the next header to parse type */
785 #define PASAHO_LINFO_SET_NULL_PKT_IND(x, v) PASAHO_LINFO_SET_NULL_PKT_IND_GEN2(x, v)  /**< Set the null packet flag which indicates that the packet should be dropped. 
786                                                                                            This flag should be set for the null packet to be delivered to PASS when
787                                                                                            the reassembly timeout occurs    */
788 #else
789 #define PASAHO_LINFO_READ_TFINDEX(x)        PASAHO_LINFO_READ_TFINDEX_GEN1(x)         /**< Extract the IP Reassembly Traffic Flow Index */
790 #define PASAHO_LINFO_READ_FRANCNT(x)        PASAHO_LINFO_READ_FRANCNT_GEN1(x)         /**< Extract the IP Reassembly Fragment count */
792 #define PASAHO_LINFO_SET_TFINDEX(x, v)      PASAHO_LINFO_SET_TFINDEX_GEN1(x, v)       /**< Set the IP Reassembly Traffic Flow Index */
793 #define PASAHO_LINFO_SET_FRANCNT(x, v)      PASAHO_LINFO_SET_FRANCNT_GEN1(x, v)       /**< Set the IP Reassembly Fragment count */
795 #define PASAHO_LINFO_IS_IPSEC(x)            PASAHO_LINFO_IS_IPSEC_GEN1(x)             /**< Indicate whether it is an IPSEC packet */
796 #define PASAHO_LINFO_CLR_IPSEC(x)           PASAHO_LINFO_CLR_IPSEC_GEN1(x)            /**< Clear IPSEC indication bits */
797 #define PASAHO_LINFO_CLR_IPSEC_ESP(x)       PASAHO_LINFO_CLR_IPSEC_ESP_GEN1(x)        /**< Clear IPSEC ESP indication bit */
798 #define PASAHO_LINFO_CLR_IPSEC_AH(x)        PASAHO_LINFO_CLR_IPSEC_AH_GEN1(x)         /**< Claer IPSEC AH indication bit */
799 #define PASAHO_LINFO_CLR_FLAG_FRAG(x)       PASAHO_LINFO_CLR_FLAG_FRAG_GEN1(x)        /**< Clear the fragmentation found flag */
802 #define PASAHO_LINFO_SET_START_OFFSET(x, v) PASAHO_LINFO_SET_START_OFFSET_GEN1(x, v)  /**< Update the next parse start offset */
803 #define PASAHO_LINFO_SET_END_OFFSET(x, v)   PASAHO_LINFO_SET_END_OFFSET_GEN1(x, v)    /**< Update the end of packet parse offset */
805 #define PASAHO_LINFO_SET_NULL_PKT_IND(x, v) PASAHO_LINFO_SET_NULL_PKT_IND_GEN1(x, v)  /**< Set the null packet flag which indicates that the packet should be dropped. 
806                                                                                            This flag should be set for the null packet to be delivered to PASS when
807                                                                                            the reassembly timeout occurs    */
809 #endif                                                                                           
810 /*@}*/ /* PASAHO_long_info_ipReassm_macros */
811 /** @}*/ /* @name PASAHO Long Info IpReassm Macros */
813 /**
814  *  @def  PA_INV_TF_INDEX
815  *        PASS-asssited IP reassembly traffic flow index to indicate that no traffic flow is available 
816  */
817 #define PA_INV_TF_INDEX     0xFF    
819 /**
820  *  @ingroup pasaho_if_structures
821  *  @brief  pasahoShortInfo_t defines the packet parsing information in the short format
822  *
823  *  @details pasahoShortInfo_t defines the packet parsing information in terms of
824  *           payload offset and payload length as described below
825  *           SRTP:      offset to the RTP header; RTP payload length including ICV
826  *           IPSEC AH:  offset to the Outer IP; IP payload length
827  *           IPSEC ESP: offset to the ESP header; ESP papload length including ICV
828  */
830 typedef struct pasahoShortInfo_s {
831     uint32_t  word0;   /**< Control block word 0 */
832     uint32_t  word1;   /**< Optional supplement data (It may be padding for alignment only) */
833 } pasahoShortInfo_t;
835 /** 
836  *  @defgroup PASAHO_short_info_command_macros  PASAHO Short Info Command Macros
837  *  @ingroup pasaho_if_macros
838  *  @{
839  *  @name PASAHO Short Info Command Macros
840  *  Macros used by the PASAHO Short Info Command
841  *  
842  */
843 /*@{*/
844 #define PASAHO_SINFO_READ_CMDID(x)          PASAHO_READ_BITFIELD((x)->word0,29,3)                           /**< Extract the command ID defined at @ref pasahoCommands */
845 #define PASAHO_SINFO_RESD_PAYLOAD_OFFSET(x) PASAHO_READ_BITFIELD((x)->word0,16,8)                           /**< Extract the offset to the packet payload */
846 #define PASAHO_SINFO_READ_PAYLOAD_LENGTH(x) PASAHO_READ_BITFIELD((x)->word0,0,16)                           /**< Extract the byte length of the payload */
848 #define PASAHO_SINFO_SET_PAYLOAD_OFFSET(x, v)  PASAHO_SET_BITFIELD((x)->word0, (v), 16, 8)                  /**< Set the offset to the payload */
849 #define PASAHO_SINFO_SET_PAYLOAD_LENGTH(x, v)  PASAHO_SET_BITFIELD((x)->word0, (v), 0,  16)                 /**< Set the payload length */
850 #define PASAHO_SINFO_FORMAT_CMD(offset, len)   (((offset) << 16) | (len) | (PASAHO_SA_SHORT_INFO << 29))    /**< Format the entire short info command */
852 /*@}*/ /* PASAHO_short_info_command_macros */
853 /** @}*/ /* @name PASAHO Short Info Command Macros */
855 /* Header bitmask bits */
856 /**
857  *  @defgroup pasahoHeaderBitmapGen1  PA/SA/HO Header Bitmap Bit Definitions For First Generation PASS
858  *  @ingroup pasaho_if_constants
859  *  @{
860  *
861  *  @name PA/SA/HO Header Bitmap Bit Definitions For First Generation PASS
862  *  Bitmap definition of the protocol header bitmask at the long info of First Generation PASS. 
863  */ 
864 /*@{*/
865 #define PASAHO_HDR_BITMASK_MAC_GEN1     (1 << 0)     /**< MAC present (PASS Gen1)*/
866 #define PASAHO_HDR_BITMASK_VLAN_GEN1    (1 << 1)     /**< VLAN present (PASS Gen1)*/
867 #define PASAHO_HDR_BITMASK_MPLS_GEN1    (1 << 2)     /**< MPLS present (PASS Gen1)*/
868 #define PASAHO_HDR_BITMASK_IP_GEN1      (1 << 3)     /**< IP present (PASS Gen1)*/
869 #define PASAHO_HDR_BITMASK_ESP_GEN1     (1 << 4)     /**< IPSEC/ESP present (PASS Gen1)*/
870 #define PASAHO_HDR_BITMASK_AH_GEN1      (1 << 5)     /**< IPSEC/AH present (PASS Gen1)*/
871 #define PASAHO_HDR_BITMASK_UDP_GEN1     (1 << 6)     /**< UDP present (PASS Gen1)*/
872 #define PASAHO_HDR_BITMASK_UDPLITE_GEN1 (1 << 7)     /**< UDPLITE present (PASS Gen1)*/
873 #define PASAHO_HDR_BITMASK_TCP_GEN1     (1 << 8)     /**< TCP present (PASS Gen1)*/
874 #define PASAHO_HDR_BITMASK_GTPU_GEN1    (1 << 9)     /**< GTPU present (PASS Gen1)*/
875 #define PASAHO_HDR_BITMASK_CUSTOM_GEN1  (1 << 10)    /**< Custom header present (PASS Gen1)*/
877 #define PASAHO_HDR_BITMASK2_SCTP_GEN1          (1 << 0)     /**< SCTP present (PASS Gen1)*/
878 #define PASAHO_HDR_BITMASK2_IPSEC_NAT_T_GEN1   (1 << 1)     /**< IPSEC NAT-T present (PASS Gen1)*/
879 #define PASAHO_HDR_BITMASK2_PPPoE_GEN1         (1 << 2)     /**< PPPoE present (PASS Gen1)*/
880 #define PASAHO_HDR_BITMASK2_802_3_GEN1         (1 << 3)     /**< 802.3 present (PASS Gen1)*/
882 /*@}*/
883 /** @} */
885 /* Header bitmask bits */
886 /**
887  *  @defgroup pasahoHeaderBitmapGen2  PA/SA/HO Header Bitmap Bit Definitions For Second Generation PASS
888  *  @ingroup pasaho_if_constants
889  *  @{
890  *
891  *  @name PA/SA/HO Header Bitmap Bit Definitions For Second Generation PASS
892  *  Bitmap definition of the protocol header bitmask at the long info  For Second Generation PASS. 
893  */ 
894 /*@{*/
895 #define PASAHO_HDR_BITMASK_MAC_GEN2     (1 << 0)     /**< MAC present (PASS Gen2)*/
896 #define PASAHO_HDR_BITMASK_VLAN_GEN2    (1 << 1)     /**< VLAN present (PASS Gen2)*/
897 #define PASAHO_HDR_BITMASK_MPLS_GEN2    (1 << 2)     /**< MPLS present (PASS Gen2)*/
898 #define PASAHO_HDR_BITMASK_802_3_GEN2   (1 << 3)     /**< 802.3 present (PASS Gen2)*/
899 #define PASAHO_HDR_BITMASK_PPPoE_GEN2   (1 << 4)     /**< PPPoE present (PASS Gen2)*/
900 #define PASAHO_HDR_BITMASK_IPv4_GEN2    (1 << 5)     /**< IPv4 present (PASS Gen2)*/
901 #define PASAHO_HDR_BITMASK_IPv6_GEN2    (1 << 6)     /**< IPv6 present (PASS Gen2)*/
902 #define PASAHO_HDR_BITMASK_IP_OPTS_GEN2 (1 << 7)     /**< IPv4 options or IPv6 extension headers present (PASS Gen2)*/
903 #define PASAHO_HDR_BITMASK_ESP_GEN2     (1 << 8)     /**< IPSEC/ESP present (PASS Gen2)*/
904 #define PASAHO_HDR_BITMASK_AH_GEN2      (1 << 9)     /**< IPSEC/AH present (PASS Gen2)*/
905 #define PASAHO_HDR_BITMASK_SCTP_GEN2    (1 << 10)    /**< SCTP present (PASS Gen2)*/
906 #define PASAHO_HDR_BITMASK_UDP_GEN2     (1 << 11)    /**< UDP present (PASS Gen2)*/
907 #define PASAHO_HDR_BITMASK_UDPLITE_GEN2 (1 << 11)    /**< UDPLITE present (PASS Gen2)*/
908 #define PASAHO_HDR_BITMASK_TCP_GEN2     (1 << 12)    /**< TCP present (PASS Gen2)*/
909 #define PASAHO_HDR_BITMASK_GTPU_GEN2    (1 << 13)     /**< GTPU present (PASS Gen2)*/
910 #define PASAHO_HDR_BITMASK_CUSTOM_GEN2  (1 << 14)    /**< Custom header present (PASS Gen2)*/
911 #define PASAHO_HDR_BITMASK_IPSEC_NAT_T_GEN2   (1 << 15)     /**< IPSEC NAT-T present (PASS Gen2)*/
913 /*@}*/
914 /** @} */
916 /* Header bitmask bits */
917 /**
918  *  @defgroup pasahoHeaderBitmap  PA/SA/HO Header Bitmap Bit Definitions
919  *  @ingroup pasaho_if_constants
920  *  @{
921  *
922  *  @name PA/SA/HO Header Bitmap Bit Definitions
923  *  Bitmap definition of the protocol header bitmask at the long info. 
924  */ 
925 /*@{*/
926 #ifdef NSS_GEN2
927 #define PASAHO_HDR_BITMASK_MAC         PASAHO_HDR_BITMASK_MAC_GEN2          /**< MAC present */
928 #define PASAHO_HDR_BITMASK_VLAN        PASAHO_HDR_BITMASK_VLAN_GEN2         /**< VLAN present */
929 #define PASAHO_HDR_BITMASK_MPLS        PASAHO_HDR_BITMASK_MPLS_GEN2         /**< MPLS present */
930 #define PASAHO_HDR_BITMASK_802_3       PASAHO_HDR_BITMASK_802_3_GEN2        /**< 802.3 present */
931 #define PASAHO_HDR_BITMASK_PPPoE       PASAHO_HDR_BITMASK_PPPoE_GEN2        /**< PPPoE present */
932 #define PASAHO_HDR_BITMASK_IPv4        PASAHO_HDR_BITMASK_IPv4_GEN2         /**< IPv4 present */
933 #define PASAHO_HDR_BITMASK_IPv6        PASAHO_HDR_BITMASK_IPv6_GEN2         /**< IPv6 present */
934 #define PASAHO_HDR_BITMASK_IP_OPTS     PASAHO_HDR_BITMASK_IP_OPTS_GEN2      /**< IPv4 options or IPv6 extension headers present */
935 #define PASAHO_HDR_BITMASK_ESP         PASAHO_HDR_BITMASK_ESP_GEN2          /**< IPSEC/ESP present */
936 #define PASAHO_HDR_BITMASK_AH          PASAHO_HDR_BITMASK_AH_GEN2           /**< IPSEC/AH present */
937 #define PASAHO_HDR_BITMASK_SCTP        PASAHO_HDR_BITMASK_SCTP_GEN2         /**< SCTP present */
938 #define PASAHO_HDR_BITMASK_UDP         PASAHO_HDR_BITMASK_UDP_GEN2          /**< UDP present */
939 #define PASAHO_HDR_BITMASK_UDPLITE     PASAHO_HDR_BITMASK_UDPLITE_GEN2      /**< UDPLITE present */
940 #define PASAHO_HDR_BITMASK_TCP         PASAHO_HDR_BITMASK_TCP_GEN2          /**< TCP present */
941 #define PASAHO_HDR_BITMASK_GTPU        PASAHO_HDR_BITMASK_GTPU_GEN2         /**< GTPU present */
942 #define PASAHO_HDR_BITMASK_CUSTOM      PASAHO_HDR_BITMASK_CUSTOM_GEN2       /**< Custom header present */
943 #define PASAHO_HDR_BITMASK_IPSEC_NAT_T PASAHO_HDR_BITMASK_IPSEC_NAT_T_GEN2  /**< IPSEC NAT-T present */
944 #else
945 #define PASAHO_HDR_BITMASK_MAC         PASAHO_HDR_BITMASK_MAC_GEN1          /**< MAC present */
946 #define PASAHO_HDR_BITMASK_VLAN        PASAHO_HDR_BITMASK_VLAN_GEN1         /**< VLAN present */
947 #define PASAHO_HDR_BITMASK_MPLS        PASAHO_HDR_BITMASK_MPLS_GEN1         /**< MPLS present */
948 #define PASAHO_HDR_BITMASK_IP          PASAHO_HDR_BITMASK_IP_GEN1           /**< IP present */
949 #define PASAHO_HDR_BITMASK_ESP         PASAHO_HDR_BITMASK_ESP_GEN1          /**< IPSEC/ESP present */
950 #define PASAHO_HDR_BITMASK_AH          PASAHO_HDR_BITMASK_AH_GEN1           /**< IPSEC/AH present */
951 #define PASAHO_HDR_BITMASK_UDP         PASAHO_HDR_BITMASK_UDP_GEN1          /**< UDP present */
952 #define PASAHO_HDR_BITMASK_UDPLITE     PASAHO_HDR_BITMASK_UDPLITE_GEN1      /**< UDPLITE present */
953 #define PASAHO_HDR_BITMASK_TCP         PASAHO_HDR_BITMASK_TCP_GEN1          /**< TCP present */
954 #define PASAHO_HDR_BITMASK_GTPU        PASAHO_HDR_BITMASK_GTPU_GEN1         /**< GTPU present */
955 #define PASAHO_HDR_BITMASK_CUSTOM      PASAHO_HDR_BITMASK_CUSTOM_GEN1       /**< Custom header present */
957 #define PASAHO_HDR_BITMASK2_SCTP        PASAHO_HDR_BITMASK2_SCTP_GEN1       /**< SCTP present */
958 #define PASAHO_HDR_BITMASK2_IPSEC_NAT_T PASAHO_HDR_BITMASK2_IPSEC_NAT_T_GEN1/**< IPSEC NAT-T present */
959 #define PASAHO_HDR_BITMASK2_PPPoE       PASAHO_HDR_BITMASK2_PPPoE_GEN1      /**< PPPoE present */
960 #define PASAHO_HDR_BITMASK2_802_3       PASAHO_HDR_BITMASK2_802_3_GEN1      /**< 802.3 present */
961 #endif
963 /*@}*/
964 /** @} */
969 /* Next Route command */
970 /**
971  *  @defgroup pasahoNrDestGen1  PA/SA/HO Destination Types at NextRoute Command of First Generation PASS
972  *  @ingroup pasaho_if_constants
973  *  @{
974  *
975  *  @name PA/SA/HO Destination Types at NextRoute Command of First Generation PASS
976  *  Bitmap definition of the destination type at the nextRoute command of First Generation PASS. 
977  */ 
978 /*@{*/
979 #define PASAHO_NR_DEST_PKTDMA_GEN1      6            /**< NextRoute Destination: PKTDMA (PASS Gen1)*/
980 #define PASAHO_NR_DEST_ETH_GEN1         7            /**< NextRoute Destination: Ethernet Port (PASS Gen1)*/
981 #define PASAHO_NR_DEST_SRIO_GEN1        0            /**< NextRoute Destination: SRIO (PASS Gen1)*/
983 /*@}*/
984 /** @} */
986 /**
987  *  @defgroup pasahoNrDestGen2  PA/SA/HO Destination Types at NextRoute Command of Second Generation PASS
988  *  @ingroup pasaho_if_constants
989  *  @{
990  *
991  *  @name PA/SA/HO Destination Types at NextRoute Command of Second Generation PASS
992  *  Bitmap definition of the destination type at the nextRoute command of Second Generation PASS. 
993  */ 
994 /*@{*/
995 #define PASAHO_NR_DEST_PKTDMA_GEN2      0            /**< NextRoute Destination: PKTDMA (PASS Gen2)*/
996 #define PASAHO_NR_DEST_ETH_GEN2         2            /**< NextRoute Destination: Ethernet Port (PASS Gen2)*/
997 #define PASAHO_NR_DEST_SRIO_GEN2        7            /**< NextRoute Destination: SRIO (PASS Gen2)*/
999 /*@}*/
1000 /** @} */
1002 /**
1003  *  @defgroup pasahoNrDest  PA/SA/HO Destination Types at NextRoute Command
1004  *  @ingroup pasaho_if_constants
1005  *  @{
1006  *
1007  *  @name PA/SA/HO Destination Types at NextRoute Command
1008  *  Bitmap definition of the destination type at the nextRoute command
1009  */ 
1010 #ifdef NSS_GEN2
1011 #define PASAHO_NR_DEST_PKTDMA      PASAHO_NR_DEST_PKTDMA_GEN2   /**< NextRoute Destination: PKTDMA */
1012 #define PASAHO_NR_DEST_ETH         PASAHO_NR_DEST_ETH_GEN2      /**< NextRoute Destination: Ethernet Port */
1013 #define PASAHO_NR_DEST_SRIO        PASAHO_NR_DEST_SRIO_GEN2     /**< NextRoute Destination: SRIO */
1014 #else
1015 #define PASAHO_NR_DEST_PKTDMA      PASAHO_NR_DEST_PKTDMA_GEN1   /**< NextRoute Destination: PKTDMA */
1016 #define PASAHO_NR_DEST_ETH         PASAHO_NR_DEST_ETH_GEN1      /**< NextRoute Destination: Ethernet Port */
1017 #define PASAHO_NR_DEST_SRIO        PASAHO_NR_DEST_SRIO_GEN1     /**< NextRoute Destination: SRIO */
1018 #endif
1020 /*@}*/
1021 /** @} */
1023 /**
1024  *  @ingroup pasaho_if_structures
1025  *  @brief  pasahoNextRoute_t defines the next route command. The command structure is defined as 32 bit
1026  *          values to work with the hardware regardless of the device endianness.
1027  *
1028  *  @details 
1029  */
1031 typedef struct pasahoNextRoute_s  {
1032     uint32_t  word0;          /**< Contains the next route command information. @ref PASAHO_next_route_command_macros */
1033     uint32_t  swInfo0;        /**< Information placed into returned descriptor. Used if next destination is the host */
1034     uint32_t  swInfo1;        /**< Information placed into returned descriptor. Used if next destination is the host */
1035     uint32_t  word1;          /**< Contains the optional information such as pktType for SRIO. @ref PASAHO_next_route_command_macros */
1036 } pasahoNextRoute_t;
1038 /** 
1039  *  @defgroup PASAHO_next_route_command_macros  PASAHO Next Route Command Macros
1040  *  @ingroup pasaho_if_macros
1041  *  @{
1042  *  @name PASAHO Next Route Command Macros
1043  *  Macros used by the PASAHO Next Route Command
1044  *  
1045  */
1046 /*@{*/
1048 #define PASAHO_SET_N(x,v)       PASAHO_SET_BITFIELD((x)->word0, (v), 28, 1)    /**< Sets the N bit which indicates the next command should be executed prior to the route command */
1049 #define PASAHO_SET_E(x,v)       PASAHO_SET_BITFIELD((x)->word0, (v), 27, 1)    /**< Sets the E bit which indicates the extened parameters (packet type and/or control flags) are present for SRIO */
1050 #define PASAHO_SET_DEST(x,v)    PASAHO_SET_BITFIELD((x)->word0, (v), 24, 3)    /**< Sets the destination of the route defined at @ref pktDest */
1051 #define PASAHO_SET_FLOW(x,v)    PASAHO_SET_BITFIELD((x)->word0, (v), 16, 8)    /**< Specifies the flow to use for packets sent to the host */
1052 #define PASAHO_SET_QUEUE(x,v)   PASAHO_SET_BITFIELD((x)->word0, (v), 0,  16)   /**< Specifies the queue to use for packets send to the host */
1053 #define PASAHO_SET_PKTTYPE(x,v) PASAHO_SET_BITFIELD((x)->word1, (v), 24, 8)    /**< Specifies the packet type to use for packets send to the SRIO */
1054 #define PASAHO_SET_TX_PADDING(x,v) PASAHO_SET_BITFIELD((x)->word1, (v), 0, 1)  /**< Sets the tx padding bit which indicates PASS should check padding condition and provide L2 zero padding if required */
1055 #define PASAHO_SET_TX_STATS(x,v) PASAHO_SET_BITFIELD((x)->word1, (v), 1, 1)    /**< Sets the tx stats bit which indicates PASS should increment the user statistics chain pointed by the user statistics index */
1056 #define PASAHO_SET_RPT_TX_TIMESTAMP(x,v) PASAHO_SET_BITFIELD((x)->word1, (v), 2, 1)  /**< Sets the report tx timestamp bit which indicates swInfo0 is required to configure CPTS Tx timestamp report */
1057 #define PASAHO_SET_USR_STATS_INDEX(x,v) PASAHO_SET_BITFIELD((x)->word1, (v), 8, 16) /**< Specifies index of the first user-defined statistics to be updated */
1059 /*@}*/ /* PASAHO_next_route_command_macros */
1060 /** @}*/ /* @name PASAHO Next Route Command Macros */
1063 /* Compute checksum command */
1064 /**
1065  *  @ingroup pasaho_if_structures
1066  *  @brief  pasahoComChkCrc_t defines the checksum and CRC generation command. The command structure is defined as
1067  *          32 bit values to wrok with the hardware regardless of the device endianness.
1068  *
1069  *  @details 
1070  */
1072 typedef struct pasahoComChkCrc_s  {
1073     uint32_t  word0;        /**<  @ref PASAHO_chksum_command_macros */
1074     uint32_t  word1;        /**<  @ref PASAHO_chksum_command_macros */
1075     uint32_t  word2;        /**<  @ref PASAHO_chksum_command_macros */
1077 } pasahoComChkCrc_t;
1079 /** 
1080  *  @defgroup PASAHO_chksum_command_macros  PASAHO Checksum/CRC Command Macros
1081  *  @ingroup pasaho_if_macros
1082  *  @{
1083  *  @name PASAHO Checksum/CRC Command Macros
1084  *  Macros used by the ASAHO Checksum/CRC Command 
1085  */
1086 /*@{*/
1088 #define PASAHO_CHKCRC_SET_NEG0(x,v)        PASAHO_SET_BITFIELD((x)->word0, (v), 23, 1)           /**< Sets the negative 0 flag - if set a checksum computed as 0 will be sent as 0xffff */
1089 #define PASAHO_CHKCRC_SET_CTRL(x,v)        PASAHO_SET_BITFIELD((x)->word0, (v), 16, 4)           /**< Sets the optional flags of the CRC/Checksum command */
1090 #define PASAHO_CHKCRC_SET_CRCSIZE(x,v)     PASAHO_SET_BITFIELD((x)->word0, (v), 8,  8)           /**< Sets the size of the crc in bytes (PASS Gen2 only) */
1091 #define PASAHO_CHKCRC_SET_START(x,v)       PASAHO_SET_BITFIELD((x)->word0, (v), 0,  8)           /**< Sets the start offset of the checksum/crc */
1092 #define PASAHO_CHKCRC_SET_LEN(x,v)         PASAHO_SET_BITFIELD((x)->word1, (v), 16, 16)          /**< Sets the length of the checksum/crc */
1093 #define PASAHO_CHKCRC_SET_RESULT_OFF(x,v)  PASAHO_SET_BITFIELD((x)->word1, (v), 0,  16)          /**< Sets the offset to where to paste the checksum/crc into the packet */
1094 #define PASAHO_CHKCRC_SET_INITVAL(x,v)     PASAHO_SET_BITFIELD((x)->word2, (v), 16, 16)          /**< Sets the initial value of the 16-bit checksum */
1095 #define PASAHO_CHKCRC_SET_INITVAL32(x,v)   (x)->word2 = (v)                                      /**< Sets the initial value of the 32-bit crc (PASS Gen2 only)*/
1097 /*@}*/ /* @name PASAHO Checksum/CRC Command Macros */
1098 /** @}*/ /* PASAHO_chksum_command_macros */
1101 /* Blind patch command */
1102 /**
1103  *  @ingroup pasaho_if_structures
1104  *  @brief  pasahoComBlindPatch_t defines the blind patch command. The command structure is defined as
1105  *          32 bit values to work with the hardware regardless of the device endianness.
1106  *
1107  *  @details 
1108  */
1110 #define PASAHO_BPATCH_MAX_PATCH_WORDS   4
1111 typedef struct pasahoComBlindPatch_s  {
1112     uint32_t   word0;                                   /**<  @ref PASAHO_blind_patch_command_macros */
1113     uint32_t   patch[PASAHO_BPATCH_MAX_PATCH_WORDS];    /**<  @ref PASAHO_blind_patch_command_macros */
1114     
1115 } pasahoComBlindPatch_t;
1117 /** 
1118  *  @defgroup PASAHO_blind_patch_command_macros  PASAHO Blind Patch Command Macros
1119  *  @ingroup pasaho_if_macros
1120  *  @{
1121  *  @name PASAHO Blind Patch Command Macros
1122  *  Macros used by the PASAHO Blind Patch Command
1123  */
1125 #define PASAHO_BPATCH_SET_PATCH_NBYTES(x,v)    \
1126                           PASAHO_SET_BITFIELD((x)->word0, v, 24,  5)
1127 /**< Sets the number of bytes to patch */
1128                           
1129 #define PASAHO_BPATCH_SET_PATCH_CMDSIZE(x,v)   \
1130                           PASAHO_SET_BITFIELD((x)->word0, v, 20, 4)
1131 /**< Sets the size of the command in 32 bit word units */
1132                           
1133 #define PASAHO_BPATCH_SET_OVERWRITE(x,v)       \
1134                           PASAHO_SET_BITFIELD((x)->word0, v, 19, 1)
1135 /**< Sets the overwrite flag. If set the patch will overwrite existing packet data, 
1136      otherwise data may be inserted */  
1137      
1138 #define PASAHO_BPATCH_SET_DELETE(x,v)         \
1139                           PASAHO_SET_BITFIELD((x)->word0, v, 18, 1)
1140 /**< Sets the delete flag. If set, no data will be inserted */                          
1141                              
1142                           
1143 #define PASAHO_BPATCH_SET_OFFSET(x,v)         \
1144                           PASAHO_SET_BITFIELD((x)->word0, v, 0,  16)
1145 /**< Sets the offset to the start of the patch */                          
1146                           
1147 #define PASAHO_BPATCH_SET_PATCH_BYTE(x, byteNum, byte)  \
1148                                 PASAHO_SET_BITFIELD((x)->patch[(byteNum) >> 2], byte, ((3 - (byteNum & 0x3)) << 3), 8)
1149 /**< Sets the data to patch */                                                   
1150                                 
1151 /*@}*/ /* @name PASAHO Blind Patch Command Macros */
1152 /** @}*/ /* PASAHO_blind_patch_command_macros */        
1154 /* Report Timestamp command */
1155 /**
1156  *  @ingroup pasaho_if_structures
1157  *  @brief  pasahoReportTimestamp_t defines the report timestamp command. The command structure is defined as 32 bit
1158  *          values to work with the hardware regardless of the device endianness.
1159  *
1160  *  @details 
1161  */
1163 typedef struct pasahoReportTimestamp_s  {
1164     uint32_t  word0;          /**< Contains the report timestamp command information. @ref PASAHO_report_timestamp_command_macros */
1165     uint32_t  swInfo0;        /**< Information placed into returned descriptor of the reporting packet.  */
1166 } pasahoReportTimestamp_t;
1168 /** 
1169  *  @defgroup PASAHO_report_timestamp_command_macros PASAHO Report Timestamp Command Macros
1170  *  @ingroup pasaho_if_macros
1171  *  @{
1172  *  @name PASAHO Report Timestamp Command Macros
1173  *  Macros used by the PASAHO Report Timestamp Command
1174  *  
1175  */
1176 /*@{*/
1177 #define PASAHO_SET_REPORT_FLOW(x,v)    PASAHO_SET_BITFIELD((x)->word0, (v), 16, 8)    /**< Specifies the flow to use for report packets sent to the host */
1178 #define PASAHO_SET_REPORT_QUEUE(x,v)   PASAHO_SET_BITFIELD((x)->word0, (v), 0,  16)   /**< Specifies the queue to use for report packets send to the host */
1180 /*@}*/ /* @name PASAHO Report Timestamp Command Macros */
1181 /** @}*/ /* PASAHO_report_timestamp_command_macros */        
1183 /* IP Fragmentation command */
1184 /**
1185  *  @ingroup pasaho_if_structures
1186  *  @brief  pasahoIpFrag_t defines the IP Fragmentation command. The command structure is defined as 32 bit
1187  *          values to work with the hardware regardless of the device endianness.
1188  *
1189  *  @details 
1190  */
1192 typedef struct pasahoIpFrag_s  {
1193     uint32_t  word0;          /**< Contains the ip fragmentation command information. @ref PASAHO_ip_frag_command_macros */
1194 } pasahoIpFrag_t;
1196 /** 
1197  *  @defgroup PASAHO_ip_frag_command_macros  PASAHO IP Fragmentation Command Macros
1198  *  @ingroup pasaho_if_macros
1199  *  @{
1200  *  @name PASAHO IP Fragmentation Command Macros
1201  *  Macros used by the PASAHO IP Fragmentation Command
1202  *  
1203  */
1204 /*@{*/
1206 #define PASAHO_SET_SUB_CODE_IP_FRAG(x) PASAHO_SET_BITFIELD((x)->word0, PASAHO_SUB_CMD_IP_FRAG, 24, 5)    /**< Set sub-command code to indicate IP Fragmentation command */
1207 #define PASAHO_SET_SUB_CODE(x,v)  PASAHO_SET_BITFIELD((x)->word0, (v), 24, 5)  /**< Specifies the sub-command code */
1208 #define PASAHO_SET_IP_OFFSET(x,v) PASAHO_SET_BITFIELD((x)->word0, (v), 16, 8)  /**< Specifies the offset to the IP header to be fragmented */
1209 #define PASAHO_SET_MTU_SIZE(x,v)  PASAHO_SET_BITFIELD((x)->word0, (v), 0,  16) /**< Specifies the MTU size */
1211 /*@}*/ /* @name PASAHO IP Fragmentation Command Macros */
1212 /** @}*/ /* PASAHO_ip_frag_command_macros */
1215 /* Patch Message Length command */
1216 /**
1217  *  @ingroup pasaho_if_structures
1218  *  @brief  pasahoPatchMsgLen_t defines the message length patching command. The command structure is defined as 32 bit
1219  *          values to work with the hardware regardless of the device endianness.
1220  *
1221  *  @details 
1222  */
1224 typedef struct pasahoPatchMsgLen_s  {
1225     uint32_t  word0;          /**< Contains the message length patching command information. @ref PASAHO_patch_msg_len_command_macros */
1226 } pasahoPatchMsgLen_t;
1228 /** 
1229  *  @defgroup PASAHO_patch_msg_len_command_macros  PASAHO Message Length Patching Command Macros
1230  *  @ingroup pasaho_if_macros
1231  *  @{
1232  *  @name PASAHO Message Length Patching Command Macros
1233  *  Macros used by the PASAHO Message Length Patching Command
1234  *  
1235  */
1236 /*@{*/
1238 #define PASAHO_SET_SUB_CODE_PATCH_MSG_LEN(x) PASAHO_SET_BITFIELD((x)->word0, PASAHO_SUB_CMD_PATCH_MSG_LEN, 24, 5)    /**< Set sub-command code to indicate Message Length Patching command */
1239 #define PASAHO_SET_MSGLEN_OFFSET(x,v) PASAHO_SET_BITFIELD((x)->word0, (v), 16, 8)  /**< Specifies the offset to the message length field to be patched */
1240 #define PASAHO_SET_MSGLEN_SIZE(x,v) PASAHO_SET_BITFIELD((x)->word0, (v), 15,  1)   /**< Specifies the size of the length field (0: 16-bit; 1: 32-bit) */
1241 #define PASAHO_SET_MSGLEN(x,v)  PASAHO_SET_BITFIELD((x)->word0, (v), 0,  15)       /**< Specifies the message length excluding the IP header and payload length */
1243 /*@}*/ /* @name PASAHO Message Length Patching Command Macros */
1244 /** @}*/ /* PASAHO_patch_msg_len_command_macros */
1246 /* Compute checksum command */
1247 /**
1248  *  @ingroup pasaho_if_structures
1249  *  @brief  pasahoEfOp_t defines the egress flow operation command which is used to instruct PASS to 
1250  *          perform optional flow cache lookup and egress packet modification according to the associated
1251  *          egress flow records. The command structure is defined as 32 bit values to wrok with the hardware 
1252  *          regardless of the device endianness.
1253  *
1254  *  @details 
1255  */
1257 typedef struct pasahoEfOp_s  {
1258     uint32_t  word0;        /**<  @ref PASAHO_ef_op_command_macros */
1259     uint32_t  word1;        /**<  @ref PASAHO_ef_op_command_macros */
1260     uint32_t  word2;        /**<  @ref PASAHO_ef_op_command_macros */
1261     uint32_t  word3;        /**<  @ref PASAHO_ef_op_command_macros */
1262     uint32_t  word4;        /**<  @ref PASAHO_ef_op_command_macros */
1263     uint32_t  word5;        /**<  @ref PASAHO_ef_op_command_macros */
1265 } pasahoComEfOp_t;
1267 /**
1268  *  @defgroup pasahoEfOpCtrlBitmap  PA/SA/HO Egress Flow Opertaion Control Bitmap Bit Definitions
1269  *  @ingroup pasaho_if_constants
1270  *  @{
1271  *
1272  *  @name PA/SA/HO Egress Flow Opertaion Control Bitmap Bit Definitions
1273  *  Bitmap definition of the control bitmap at the Egress Flow operation info. 
1274  */ 
1275 /*@{*/
1277 #define PASAHO_HDR_EF_OP_CTRL_FC           (1 << 15)    /**< Enable Flow Cache lookup */
1278 #define PASAHO_HDR_EF_OP_CTRL_LVL4_REC     (1 << 7)     /**< Level 4 record prespent */
1279 #define PASAHO_HDR_EF_OP_CTRL_LVL3_REC     (1 << 6)     /**< Level 3 record prespent */
1280 #define PASAHO_HDR_EF_OP_CTRL_LVL2_REC     (1 << 5)     /**< Level 2 record prespent */
1281 #define PASAHO_HDR_EF_OP_CTRL_LVL1_REC     (1 << 4)     /**< Level 1 record prespent */
1283 /*@}*/
1284 /** @} */
1287 /** 
1288  *  @defgroup PASAHO_ef_op_command_macros  PASAHO Egress Flow Operation Command Macros
1289  *  @ingroup pasaho_if_macros
1290  *  @{
1291  *  @name PASAHO Egress Flow Operation Command Macros
1292  *  Macros used by the PASAHO Egress Flow Operation Command 
1293  */
1294 /*@{*/
1295 #define PASAHO_EF_OP_SET_CTRL(x,v)          PASAHO_SET_BITFIELD((x)->word0,(v), 8, 16)           /**< Sets the control flags of the Flow Cache operation command */
1296 #define PASAHO_EF_OP_SET_CTRL_FC(x,v)       PASAHO_SET_BITFIELD((x)->word0,(v), 23, 1)           /**< Enable/Disable Flow Cache lookup */
1297 #define PASAHO_EF_OP_SET_CTRL_LVL4(x,v)     PASAHO_SET_BITFIELD((x)->word0,(v), 15, 1)           /**< Enable/Disable Level 4 Egress Flow record */
1298 #define PASAHO_EF_OP_SET_CTRL_LVL3(x,v)     PASAHO_SET_BITFIELD((x)->word0,(v), 14, 1)           /**< Enable/Disable Level 3 Egress Flow record */
1299 #define PASAHO_EF_OP_SET_CTRL_LVL2(x,v)     PASAHO_SET_BITFIELD((x)->word0,(v), 13, 1)           /**< Enable/Disable Level 2 Egress Flow record */
1300 #define PASAHO_EF_OP_SET_CTRL_LVL1(x,v)     PASAHO_SET_BITFIELD((x)->word0,(v), 12, 1)           /**< Enable/Disable Level 1 Egress Flow record */
1302 #define PASAHO_EF_OP_SET_L2_OFFSET(x, v)    PASAHO_SET_BITFIELD((x)->word1,(v),8,8)              /**< Set the l2 offset */
1303 #define PASAHO_EF_OP_SET_L3_OFFSET2(x, v)   PASAHO_SET_BITFIELD((x)->word1,(v),0,8)              /**< Set the l3 offset for inner or fisrt IP */
1304 #define PASAHO_EF_OP_SET_L3_OFFSET(x, v)    PASAHO_SET_BITFIELD((x)->word2,(v),24,8)             /**< Set the l3 offset for outer or fisrt IP */
1305 #define PASAHO_EF_OP_SET_IPSEC_OFFSET(x, v) PASAHO_SET_BITFIELD((x)->word2,(v),0, 8)             /**< Set the IPSEC offset if the IPSEC header exists in the packet */
1306 #define PASAHO_EF_OP_SET_END_OFFSET(x, v)   PASAHO_SET_BITFIELD((x)->word1,(v),16,16)            /**< Set the end offset as end of L4 (UDP/UDPLite/TCP) payload */
1308 #define PASAHO_EF_OP_SET_LVL1_REC(x, v)     PASAHO_SET_BITFIELD((x)->word3,(v),24, 8)            /**< Set the index of Egress Flow level 1 record */
1309 #define PASAHO_EF_OP_SET_LVL2_REC(x, v)     PASAHO_SET_BITFIELD((x)->word3,(v),16, 8)            /**< Set the index of Egress Flow level 2 record */
1310 #define PASAHO_EF_OP_SET_LVL3_REC(x, v)     PASAHO_SET_BITFIELD((x)->word3,(v), 8, 8)            /**< Set the index of Egress Flow level 3 record */
1311 #define PASAHO_EF_OP_SET_LVL4_REC(x, v)     PASAHO_SET_BITFIELD((x)->word3,(v), 0, 8)            /**< Set the index of Egress Flow level 4 record */
1313 /*@}*/
1314 /** @} */
1317 /* Insert Message time command */
1318 /**
1319  *  @ingroup pasaho_if_structures
1320  *  @brief  pasahoInsMsgTime_t defines the message time insert command. The command structure is defined as 32 bit
1321  *          values to work with the hardware regardless of the device endianness.
1322  *
1323  *  @details 
1324  */
1326 typedef struct pasahoInsMsgTime_s  {
1327     uint32_t  word0;          /**< Contains the message time patching command information. @ref PASAHO_insert_msg_time_command_macros */
1328 } pasahoInsMsgTime_t;
1330 /** 
1331  *  @defgroup PASAHO_insert_msg_time_command_macros  PASAHO Message Time Insert Command Macros
1332  *  @ingroup pasaho_if_macros
1333  *  @{
1334  *  @name PASAHO Message Time Insert Command Macros
1335  *  Macros used by the PASAHO Message Time Insert Command
1336  *  
1337  */
1338 /*@{*/
1340 #define PASAHO_SET_SUB_CODE_INS_MSG_TIME(x) PASAHO_SET_BITFIELD((x)->word0, PASAHO_SUB_CMD_INS_TIME, 24, 5)    /**< Set sub-command code to indicate Message Time Insert command */
1341 #define PASAHO_SET_INS_OFFSET_MSG_TIME(x,offset)   PASAHO_SET_BITFIELD((x)->word0, offset, 0, 16)             /**< Set the offset from start of packet to insert the 8 byte time */
1343 /*@}*/ /* @name PASAHO Message Time Insert Command Macros */
1344 /** @}*/ /* PASAHO_insert_msg_time_command_macros */
1346 /* Insert Message Count command */
1347 /**
1348  *  @ingroup pasaho_if_structures
1349  *  @brief  pasahoInsMsgCount_t defines the message count insert command. The command structure is defined as 32 bit
1350  *          values to work with the hardware regardless of the device endianness.
1351  *
1352  *  @details 
1353  */
1355 typedef struct pasahoInsMsgCount_s  {
1356     uint32_t  word0;          /**< Contains the message count patching command information. @ref PASAHO_insert_msg_count_command_macros */
1357     uint32_t  word1;          /**< Contains the message count patching command information. @ref PASAHO_insert_msg_count_command_macros */
1358 } pasahoInsMsgCount_t;
1360 /** 
1361  *  @defgroup PASAHO_insert_msg_count_command_macros  PASAHO Message Count Insert Command Macros
1362  *  @ingroup pasaho_if_macros
1363  *  @{
1364  *  @name PASAHO Message Count Insert Command Macros
1365  *  Macros used by the PASAHO Message Count Insert Command
1366  *  
1367  */
1368 /*@{*/
1370 #define PASAHO_SET_SUB_CODE_INS_MSG_COUNT(x)        PASAHO_SET_BITFIELD((x)->word0, PASAHO_SUB_CMD_INS_COUNT, 24, 5)    /**< Set sub-command code to indicate Message Count Insert command */
1371 #define PASAHO_SET_INS_OFFSET_MSG_COUNT(x,offset)   PASAHO_SET_BITFIELD((x)->word0, offset, 0, 16)                      /**< Set the offset from start of packet to insert the 4 byte count */
1372 #define PASAHO_SET_COUNTER_INDEX_FOR_MSG_COUNT(x,offset)   PASAHO_SET_BITFIELD((x)->word1, offset, 16, 16)              /**< Set the counter index to read from, to insert the 4 byte count */
1374 /*@}*/ /* @name PASAHO Message Count Insert Command Macros */
1375 /** @}*/ /* PASAHO_insert_msg_count_command_macros */
1378 #ifdef __cplusplus
1380 #endif
1382 #endif  /* _PASAHO_H */