-/***************************************************
- * File: netcp_cfg.h
- * Purpose: netcp config API
- **************************************************************
- * FILE: netcp_cfg.h
- *
- * DESCRIPTION: netapi NETCP configuration API header file
- * for user space transport library
- *
- * REVISION HISTORY: rev 0.0.1
+/******************************************************************************
+ * FILE PURPOSE: netapi NETCP configuration API header file
+ ******************************************************************************
+ * FILE NAME: netcp_cfg.h
+ *
+ * DESCRIPTION:netapi NETCP configuration API header file for user space transport library
+ *
+ * REVISION HISTORY:
*
* Copyright (c) Texas Instruments Incorporated 2010-2011
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
* are met:
*
- * Redistributions of source code must retain the above copyright
+ * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+/* ============================================================= */
+
+/**
+ * @file netcp_cfg.h
+ * @brief Netapi NETCP configuration API header file for user space transport library
+ */
+
- ***************************************************/
#ifndef __NETCP_CFG__H
#define __NETCP_CFG__H
#include "ti/runtime/pktlib/pktlib.h"
//NETCP FLOW
+/**
+ * @ingroup netapi_structures
+ * @brief CPPI flow ID for default case, use NETCP_DEFAULT_FLOW
+ */
typedef struct NETCP_CFG_FLOW_Tag
{
- int flowid;
+ int flowid; /**< flow id*/
} NETCP_CFG_FLOW_T;
+
+
+
+/**
+ * @ingroup netapi_constants
+ * @brief This defines the handle to NETCP configuration flow.
+ */
typedef void * NETCP_CFG_FLOW_HANDLE_T;
+/**
+ * @ingroup netapi_constants
+ * @brief This defines the NETCP default FLOW to be NULL.
+ */
+#define NETCP_DEFAULT_FLOW (NETCP_CFG_FLOW_HANDLE_T*) NULL
+
-//NETCP ROUTE
+/**
+ * @ingroup nwal_api_constants
+ * @brief Handle to the default NETCP route.
+ * @details Application to use this handle to identify default NETCP route.
+ */
+typedef void * NETCP_CFG_ROUTE_HANDLE_T;
+
+/**
+ * @brief This defines the NETCP default ROUTE to be NULL.
+ */
+#define NETCP_DEFAULT_ROUTE (NETCP_CFG_ROUTE_HANDLE_T*) NULL
+
+
+/**
+ * @ingroup netapi_structures
+ * @brief NETCP application defined route information.
+ *
+ */
typedef struct NETCP_CFG_ROUTE_Tag
{
- NETCP_CFG_FLOW_HANDLE_T p_flow;
- PKTIO_HANDLE_T * p_dest_q;
- int nextAction;
+ NETCP_CFG_FLOW_T * p_flow; /**< NULL or NETCP_DEFAULT_FLOW for default flow, @ref NETCP_CFG_FLOW_T */
+ PKTIO_HANDLE_T * p_dest_q;/**<NULL for default destination queue */
} NETCP_CFG_ROUTE_T;
-typedef void * NETCP_CFG_ROUTE_HANDLE_T;
-/*--------------flow management--------*/
-NETCP_CFG_FLOW_HANDLE_T netcp_cfgAddFlow(NETAPI_T ,
+/**
+ * @ingroup netapi_constants
+ * @brief This defines the NETCP action to discard packet.
+ */
+#define NETCP_CFG_ACTION_DISCARD 0
+/**
+ * @ingroup netapi_constants
+ * @brief This defines the NETCP action to pass packet ono the next classifier
+ */
+#define NETCP_CFG_ACTION_CONTINUE 1
+/**
+ * @ingroup netapi_constants
+ * @brief This defines the NETCP action to pass packet to User space application
+ */
+#define NETCP_CFG_ACTION_TO_SW 2
+
+
+/**
+ * @ingroup nwal_api_constants
+ * @brief Handle to the default NETCP route.
+ * @details Application to use this handle to identify default NETCP route.
+ */
+typedef void * NETCP_CFG_VLAN_T;
+
+/**
+ * @ingroup nwal_api_constants
+ * @brief AppID for MAC interface
+ */
+typedef uint32_t NETCP_CFG_MACIF_T;
+
+/**
+ * @ingroup nwal_api_constants
+ * @brief AppID for IP interface
+ */
+typedef uint32_t NETCP_CFG_IP_T;
+
+
+
+/**
+ * @ingroup nwal_api_constants
+ * @brief This define is used to identify the application id associated with a created SA
+ */
+typedef uint32_t NETCP_CFG_SA_T;
+
+
+/**
+ * @ingroup nwal_api_constants
+ * @brief AppId used to identify NETCP IPSEC policy
+ */
+typedef uint32_t NETCP_CFG_IPSEC_POLICY_T;
+
+
+/**
+ * @ingroup nwal_api_constants
+ * @brief This define is to be used in AddIp, AddClassifier to indicate any MAC address.
+ */
+#define NETCP_CFG_NO_INTERFACE 0xff
+
+
+
+/**
+ * @note APPIDs are present in RX packet meta data and tell "how far the packet got
+ * through the classification rules of NETCP
+ * APPID is 32 bits:
+ * bits 31-24 = MATCH STAGE (NETAPI_NECP_MATCH_xxx below)
+ * bits 23-8 = identifier (depends on match stage)
+ * bits 7-0 = logical mac interface
+*/
+
+/**
+ * @ingroup netapi_constants
+ * @brief This define is used to indicate that apacket matched a MAC entry. Entry # (logical interface) is in byte 0 of APPID.
+ * Packet did not match any other rule
+ */
+#define NETAPI_NETCP_MATCH_GENERIC_MAC 0x10000000 //lower byte==interface
+
+/**
+ * @ingroup netapi_constants
+ * @brief This define is used to indicate that a packet matched a MAC entry. Entry # (logical interface) is in byte 0 of APPID
+ * packet matched a generic IP rule attached to that interface. The IP rule # for the interface
+ * is given in Bytes 3,2 of the APPID. Packet did not match any other rule
+ */
+#define NETAPI_NETCP_MATCH_GENERIC_IP 0x20000000 //lower byte==interface
+
+
+/**
+ * @ingroup netapi_constants
+ * @brief This define is used to indicate that a packet matched a MAC entry. Entry # (logical interface) is in byte 0 of APPID
+ * packet matched a generic IP rule attached to that interface OR a general IP rule added as part of
+ * the classifier or it matched a combination of ISPEC SA rule and a policy check. Finally,
+ * Packet matched a L4 port rule that was added as part of a classifer. Bytes 3-2
+ * give the ID of the classifier . Packet did not match any other rule
+ */
+#define NETAPI_NETCP_MATCH_CLASS 0x80000000 //FULL MATCH or' in classifier (16 bits), lower byte==interface
+
+/**
+ * @ingroup netapi_constants
+ * @brief This define is used to indicate that a packet matched a MAC entry. Entry # (logical interface) is in byte 0 of APPID
+ * packet matched a general IP rule added as part of a classifier. But it not match a
+ * L4 port or any other rule. We cannout say what classifer partially matched so Bytes 3-2 are
+ * not applicable
+ */
+#define NETAPI_NETCP_MATCH_CLASS_L3 0x40000000 //MATCHED L3 but not L4. lower byte==interface
+
+/**
+ * @ingroup netapi_constants
+ * @brief This define is used to indicate that a packet matched a MAC entry. Entry # (logical interface) is in byte 0 of APPID
+ * packet matched an IPSEC SA rule (matched proto, dest ip and SPI). The SA id is in
+ * bytes 3-2 of APPID. Packet did not match any other rule (so may have failed a policy check)
+ */
+#define NETAPI_NETCP_MATCH_IPSEC 0x01000000 //lower byte==interface, Or' in SA id (16 bits)
+
+/**
+ * @ingroup netapi_constants
+ * @brief This define is used to indicate that a packet matched a MAC entry. Entry # (logical interface) is in byte 0 of APPID
+ * packet matched an IPSEC SA rule (matched proto, dest ip and SPI). Packet matched
+ * a POLICY RULE - this is a check of the inner IP. The IPSEC RX Policy ID is in
+ * bytes 3-2 of APPID. Packet did not match any other rule
+ */
+#define NETAPI_NETCP_MATCH_IPSEC_POLICY 0x02000000 //lower byte==interface, Or' in SA id (16 bits)
+
+
+
+
+
+/**
+ * @ingroup netapi_cfg_functions
+ * @brief netcp_cfgAddFlow API to add a flow
+ *
+ * @details This api is used to add a flow
+ * @param[in] h NETAPI instance handle, @ref NETAPI_T
+ * @param[in] n number of Pktlib_HeapHandle
+ * @param[in] handles[] handles to Pktlib_HeapHandle
+ * @param[in] sizes[] must be<= heap corresponding heap size-recv_offset-any desired tail room
+ * @param[in] recv_offset bytes to save in front of packet
+ * @param[out] err pointer to error return
+ * @retval NETCP flow handle, @ref NETCP_CFG_FLOW_HANDLE_T
+ * @pre @ref netapi_init
+ */
+NETCP_CFG_FLOW_HANDLE_T netcp_cfgAddFlow(NETAPI_T h,
int n,
Pktlib_HeapHandle handles[],
+ int sizes[],
+ int recv_offset,
int * err );
-void netcp_cfgDelFlow(NETAPI_T , NETCP_CFG_FLOW_HANDLE_T , int * err);
-/*------------Routes------------------*/
-NETCP_CFG_ROUTE_HANDLE_T netcp_cfgAddRoute(NETAPI_T ,int nh,
- Pktlib_HeapHandle heaps[],
- int *err );
-void netcp_cfgDelRoute(NETAPI_T , NETCP_CFG_ROUTE_HANDLE_T, int *err );
-/*-----------Actions----------*/
-#define NETCP_CFG_ACTION_DISCARD 0
-#define NETCP_CFG_ACTION_CONTINUE 1 //pass packet on to next classifier
-#define NETCP_CFG_ACTION_TO_SW 2
+/**
+ * @ingroup netapi_cfg_functions
+ * @brief netcp_cfgDelFlow API to delete a flow
+ *
+ * @details This api is used to delete a flow
+ * @param[in] h NETAPI instance handle, @ref NETAPI_T
+ * @param[in] p handle to NETCP flow
+ * @param[out] err pointer to error return
+ * @retval none
+ * @pre @ref netapi_init, netcp_cfgAddFlow
+ */
+void netcp_cfgDelFlow(NETAPI_T h ,
+ NETCP_CFG_FLOW_HANDLE_T p ,
+ int * err);
-/******************************************************************/
-/***********************APP ids for rx meta data********************/
-/******************************************************************/
-// NWAL "AP ids" for PA Rules that are added
-#define NETAPI_NETCP_MATCH_GENERIC_MAC 0x10000000 //lower byte==interface
-#define NETAPI_NETCP_MATCH_GENERIC_IP 0x20000000 //lower byte==interface
-#define NETAPI_NETCP_MATCH_CLASS 0x80000000 //or' in classifier #, lower byte==interface
+/**
+ * @ingroup netapi_cfg_functions
+ * @brief netcp_cfgDelMac API to delete MAC interface
+ *
+ * @details This api is used to delete a MAC interface
+ * @param[in] h NETAPI instance handle, @ref NETAPI_T
+ * @param[in] iface_no interface number (0,1,..)
+ * @param[out] err pointer to error return
+ * @retval returned AppID for attached rule. This is returned in RX meta data for packets matching this rule and no other, @ref NETCP_CFG_IP_T
+ * @pre @ref netapi_init , @ref netcp_cfgAddMac
+ */
+void netcp_cfgDelMac(NETAPI_T h,int iface_no, int *err);
-/*---------MAC APPID------------------*/
-typedef uint32_t NETCP_CFG_MACIF_T;
-/*------------L2----------------------*/
-typedef void * NETCP_CFG_VLAN_T;
+/**
+ * @ingroup netapi_cfg_functions
+ * @brief API attaches an IP adderess and qualifier to a MAC interface
+ *
+ * @details This api is used to add an IP address to a MAC interface along
+ * with optional IP qualifier. A route, @ref NETCP_CFG_ROUTE_HANDLE_T,or NULL for default
+ * may be specified to indicate where to send packets matching the MAC interface MAC address, the
+ * supplied IP address and any qualifier. This API adds a rule to the NETCP level 1 lookup tables
+ * Packets arriving that match this rule are identified in meta data with Appid= NETAPI_NETCP_MATCH_GENERIC_IP
+ * Note: An IP address must be attached to enable NETCP receive Checksum offload feature
+ * @param[in] h NETAPI instance handle, @ref NETAPI_T
+ * @param[in] iface_no interface number (0,1,..)
+ * @param[in] ipType type of IP address (V4 for V6), @ref nwal_IpType
+ * @param[in] ip_addr ip_address, @ref nwalIpAddr_t
+ * @param[in] ip_qualifiers ip_qualifiers (all 0 for no qualifiers). This can be used to apply special handling for
+ * diffserv category for example. @ref nwalIpOpt_t
+ * @param[in] route [future] handle of a created route or NULL to use internal default route, @ref NETCP_CFG_ROUTE_HANDLE_T
+ * @param[out] err pointer to error return
+ * @retval returned AppID for attached rule. This is returned in RX meta data for packets matching this rule and no other, @ref NETCP_CFG_IP_T
+ * @pre @ref netapi_init , @ref netcp_cfgAddMac
+ */
+NETCP_CFG_IP_T netcp_cfgAddIp(
+ NETAPI_T h,
+ int iface_no,
+ nwal_IpType ipType,
+ nwalIpAddr_t * ip_addr,
+ nwalIpOpt_t * ip_qualifiers,
+ NETCP_CFG_ROUTE_HANDLE_T route,
+ int * err
+ );
-/*---------------IP APPID-------------------*/
-typedef uint32_t NETCP_CFG_IP_T;
+#define netcp_addIp netcp_cfgAddIp //oops
-/* del mac i/f */
-void netcp_cfgDelMac(NETAPI_T h,int iface_no, int *err);
+/**
+ * @ingroup netapi_cfg_functions
+ * @brief netcp_cfgDelIp API to delete IP interface
+ *
+ * @details This api is used to delete an IP interface
+ * @param[in] h NETAPI instance handle, @ref NETAPI_T
+ * @param[in] iface_no interface number (0,1,..)
+ * @param[in] ipType type of IP address (V4 for V6), @ref nwal_IpType
+ * @param[in] ip_addr ip_address, @ref nwalIpAddr_t
+ * @param[in] ip_qualifiers ip_qualifiers (all 0 for no qualifiers). This can be used to apply special handling for
+ * diffserv category for example. @ref nwalIpOpt_t
+ * @param[in] ip_rule_id @ref NETCP_CFG_IP_T
+ * @param[out] err pointer to error return
+ * @retval returned AppID for attached rule. This is returned in RX meta data for packets matching this rule and no other, @ref NETCP_CFG_IP_T
+ * @pre @ref netapi_init , @ref netcp_cfgAddIp
+ */
void netcp_cfgDelIp(NETAPI_T h, int iface_no, nwal_IpType ipType,
nwalIpAddr_t * ip_addr,
- nwalIpOpt_t * ip_qualifiers, int *err);
-
-
-/*****************************************************************
- * Create a MAC interface
- ****************************************************************/
-/*
-* @brief API Creates a MAC interface
- *
+ nwalIpOpt_t * ip_qualifiers,
+ NETCP_CFG_IP_T ip_rule_id,
+ int *err);
+
+
+
+/**
+ * @ingroup netapi_cfg_functions
+ * @brief netcp_cfgCreateMacInterface API to create a MAC interface
+ *
* @details This api is used to create a MAC interface.
* Once it is created, the MAC interface can be used to receive packets. The API
* adds a rule to the NETCP 1st level lookup tables to route all packets with destination
* MAC matching supplied argument and not matching any other lookup entry (see @ref netcp_cfgAddIp) to
* the supplied route, @ref NETCP_CFG_ROUTE_T, (or default route).
* Packets arriving that match this rule are identified in meta data with Appid= NETAPI_NETCP_MATCH_GENERIC_MAC
- * Note: The internal SOC switch must be "taught" that this mac
+ * Note: The internal SOC switch must be "taught" that this mac
* address is present by transmitting a packet with destination mac = this interface mac address.
- * @param[in] @ref NETAPI_T: NETAPI instance
- * @param[in] char *: pointer to 6 byte MAC address for interface
- * @param[in] int : interface number (0,1,..)
- * @param[in] int : switch port (0 don't care, 1 switch port 1, 1 switch port 2) [only 0 supported]
- * @param[in] @ref NETCP_CFG_ROUTE_HANDLE_T : [future] handle of a created route or NULL to use internal default route
- * @oaram[in] @ref NETCP_CFG_VLAN_T : [future[ vlan configuration . Set to NULL
- * @param[in] int : [future] interface state (0=down, 1= up)
- * @param[out] int * err: pointer to error return
- * @retval @ref NETCP_CFG_MACIF_T : returned AppID for interface (this is returned in meta data for
- * received packets matching this rule an no others)
+ * @param[in] h NETAPI instance handle, @ref NETAPI_T
+ * @param[in] p_mac pointer to 6 byte MAC address for interface
+ * @param[in] iface_no interface number (0,1,..)
+ * @param[in] switch_port (0 don't care, 1 switch port 1, 1 switch port 2) [only 0 supported]
+ * @param[in] route [future] handle of a created route or NULL to use internal default route, @ref NETCP_CFG_ROUTE_HANDLE_T
+ * @param[in] vlan [future[ vlan configuration . Set to NULL, @ref NETCP_CFG_VLAN_T
+ * @param[in] state [future] interface state (0=down, 1= up)
+ * @param[out] err pointer to error return
+ * @retval returns AppID for interface (this is returned in meta data for received packets matching this rule an no others) @ref @ref NETCP_CFG_MACIF_T
* @pre @ref netapi_init
*/
NETCP_CFG_MACIF_T netcp_cfgCreateMacInterface(
- NETAPI_T h, //
- uint8_t *p_mac, //mac address associated with interface
- int iface_no, //0,1, ..
- int switch_port,//0=don't care, 1=switch port 1, 2=switch port 2 , ..
- NETCP_CFG_ROUTE_HANDLE_T route, //NULL to use default
- NETCP_CFG_VLAN_T vlan, //future
- int state, //0=down, 1=up //FUTURE
+ NETAPI_T h,
+ uint8_t *p_mac,
+ int iface_no,
+ int switch_port,
+ NETCP_CFG_ROUTE_HANDLE_T route,
+ NETCP_CFG_VLAN_T vlan,
+ int state,
int * err
);
-/*****************************************************************
- * Add IP address/qualifier to MAC interface
- ****************************************************************/
-/*
-* @brief API attaches an IP adderess and qualifier to a MAC interface
- *
- * @details This api is used to add an IP address to a MAC interface along
- * with optional IP qualifier. A route, @ref NETCP_CFG_ROUTE_HANDLE_T,or NULL for default
- * may be specified to indicate where to send packets matching the MAC interface MAC address, the
- * supplied IP address and any qualifier. This API adds a rule to the NETCP level 1 lookup tables
- * Packets arriving that match this rule are identified in meta data with Appid= NETAPI_NETCP_MATCH_GENERIC_IP
- * Note: An IP address must be attached to enable NETCP Recevie Checksum offload feature
- * @param[in] @ref NETAPI_T: NETAPI instance
- * @param[in] int : interface number (0,1,..)
- * @param[in] @ref nwal_IpType : type of IP address (V4 for V6)
- * @oaram[in] @ref nwalIpAddr_t : ip_address
- * @param[in] @ref nwalIpOpt_t : ip_qualifiers (all 0 for no qualifiers). This can be used to apply special handling for
- * diffserv category for example
- * @param[in] @ref NETCP_CFG_ROUTE_HANDLE_T : [future] handle of a created route or NULL to use internal default route
- * @param[out] int * err: pointer to error return
- * @retval @ref NETCP_CFG_IP_T : returned AppID for attached rule. This is returned in RX meta data for
- * packets matching this rule and no other.
- * @pre @ref netapi_init , @ref netcp_cfgAddMac
+
+/**
+ * @brief This defines handle to installed classifier returned by API. Pkts matching this classifier will have meta data with this tag.
+ * Also used to delete classifier
*/
-NETCP_CFG_IP_T netcp_AddIp(
- NETAPI_T h,
- int iface_no,
- nwal_IpType ipType,
- nwalIpAddr_t * ip_addr,
- nwalIpOpt_t * ip_qualifiers,
- NETCP_CFG_ROUTE_HANDLE_T route, //NULL for default
- int * err
- );
+typedef uint32_t NETCP_CFG_CLASS_T;
+
+
+
+//classifier L4 type (L2,L3 implied by iface, ip)
+typedef struct NETCP_CFG_CLASS_L4_Tag
+{
+ //which mac interface pkt is from,
+ int iface;
+ NETCP_CFG_IP_T ip;
+
+ //L4 (port)
+ nwal_appProtoType_t proto; //L4 proto (-1 for don't care)
+ nwalAppProto_t appProto; //ports or equivalent
+
+} NETCP_CFG_CLASS_L4_T;
+
+//classifier L4 + policy (L2, L3 (outer), tunnel, L3 (inner) implied by policy
+typedef struct NETCP_CFG_CLASS_L4_IPSEC_Tag
+{
+ //which mac interface pkt is from,
+ int iface;
+ NETCP_CFG_IPSEC_POLICY_T ip_policy;
+
+ //L4 (port)
+ nwal_appProtoType_t proto; //L4 proto (-1 for don't care)
+ nwalAppProto_t appProto; //ports or equivalent
+
+} NETCP_CFG_CLASS_L4_IPSEC_T;
-/*------------------classification [FUTURE]-------------------*/
-typedef void *NETCP_CFG_CLASS_T;
-//add classifier
+//classifier L3_L4 type (L2 implied by iface)
+typedef struct NETCP_CFG_CLASS_L3_L4_Tag
+{
+ //which mac interface pkt is from,
+ int iface;
+
+ //L3 - iP address: IP type, destination addr, qualifiers
+ nwal_IpType ipType;
+ nwalIpAddr_t * ip_addr;
+ nwalIpOpt_t * ip_qualifiers;
+ NETCP_CFG_ROUTE_HANDLE_T p_fail_route; //what to do if L3 matches but L4 fails AND L3 is a
+ // new rule.(if exisitng rule, then existing fail
+ //route will be used.
+
+ //L4 (port)
+ nwal_appProtoType_t proto; //L4 proto (-1 for don't care)
+ nwalAppProto_t appProto; //ports or equivalent
+
+} NETCP_CFG_CLASS_L3_L4_T;
+
+//classifier
typedef struct NETCP_CFG_CLASSIFIER_Tag
{
- //tbd a classisfier
+ int classType;
+#define NETCP_CFG_CLASS_TYPE_L4 0
+#define NETCP_CFG_CLASS_TYPE_L3_L4 1
+ union
+ {
+ NETCP_CFG_CLASS_L3_L4_T c_l3_l4;
+ NETCP_CFG_CLASS_L4_T c_l4;
+ NETCP_CFG_CLASS_L4_IPSEC_T c_l4_ipsec;
+ } u;
} NETCP_CFG_CLASSIFIER_T;
-NETCP_CFG_CLASS_T netcp_cfgAddClass(NETAPI_T h,
- NETCP_CFG_CLASSIFIER_T *p_class,
- NETCP_CFG_ROUTE_HANDLE_T p_route,
- int action, int * err);
-//del classifier
+
+
+/**
+ * @ingroup netapi_cfg_functions
+ * @brief netcp_cfgAddClass API can be used to route a packet flow to a specific PKTIO channel
+ *
+ * @details This api can be used to route a packet flow to a particular PktIO channel, use a specific
+ * pktLib heap, and/or have NetCP attach a tag (classifier id) to the incoming packet.
+ * @param[in] h NETAPI instance handle, @ref NETAPI_T
+ * @param[in] p_class
+ * @param[in] p_route
+ * @param[out] err pointer to error return
+ * @retval returned AppID for attached rule. This is returned in RX meta data for packets matching this rule and no other, @ref NETCP_CFG_IP_T
+ * @pre @ref netapi_init
+ */NETCP_CFG_CLASS_T netcp_cfgAddClass(NETAPI_T h,
+ NETCP_CFG_CLASSIFIER_T *p_class,
+ NETCP_CFG_ROUTE_HANDLE_T p_route,
+ int action, int * err);
+
+
+
+/**
+ * @ingroup netapi_cfg_functions
+ * @brief netcp_cfgDelClass API can be used to delete a preconfigured classifier
+ *
+ * @details This API can be used to delete a preconfigured classifier
+ * @param[in] h NETAPI instance handle, @ref NETAPI_T
+ * @param[in] classId
+ * @param[out] err pointer to error return
+ * @retval none
+ * @pre @ref netapi_init, @ref netcp_cfgAddClass
+ */
void netcp_cfgDelClass(NETAPI_T h,
- NETCP_CFG_CLASS_T p_class,
+ NETCP_CFG_CLASS_T classId,
int *err);
-/***************************************************************************
-********************************STATS**************************************
-**************************************************************************/
-
-/*
- * @brief This is the callback function that is used to return statistics from NETCP
- *
+/**
+ * @ingroup netapi_cb_functions
+ * @brief NETCP_CFG_STATS_CB Callback function that is used to return statistics from NETCP
+ *
* @details The application provides a callback function that NETAPI uses to report statistics.
-* The request for stats is generated from the @ref netcp_cfgReqStats API.
- * Note: to receive ths stats callback, the @ref netapi_netcpPoll funcition must be called
- * @param[in] @ref NETAPI_T: NETAPI instance
- * @param[in] @ref paSysStats_t * : the PA (NETCP packet accelerator subsystem) statistics block
+ * The request for stats is generated from the @ref netcp_cfgReqStats API.
+ * Note: to receive ths stats callback, the @ref netapi_netcpPoll funcition must be called
+ * @param[in] h NETAPI instance handle, @ref NETAPI_T
+ * @param[out] pPaStats the PA (NETCP packet accelerator subsystem) statistics block
* @retval none
* @pre @ref netapi_init , @ref netapi_cfgReqStats, @ref netapi_netcpPoll
*/
-//stats CB
typedef void (*NETCP_CFG_STATS_CB)( NETAPI_T h, paSysStats_t* pPaStats);
-//stats request
-/*
- * @brief API request statistics from NETCP
- *
- * @details This api is used to request a statistics from NETCP. This will generate a stats request
- * command to NETCP. Sometime later, the statistics result will arrive and will be passed to
- * the caller via the asynchronus callback @ref NETCP_CFG_STATS_CB that is registered in this call.
- * Note: to receive the stats callback, the @ref netapi_netcpPoll funcition must be called
- * @param[in] @ref NETAPI_T: NETAPI instance
- * @param[in] @ref NETCP_CFG_STATS_CB : the function to call with the resulting statistics block
- * @param[in] int : clear the stats in NETCP after the report (0=no, 1=yes)
+
+
+/**
+ * @ingroup netapi_cfg_functions
+ * @brief netcp_cfgReqStats API to request statistics from NETCP
+ *
+* @details This api is used to request a statistics from NETCP. This will generate a stats request
+ * command to NETCP. Sometime later, the statistics result will arrive and will be passed to
+ * the caller via the asynchronus callback @ref NETCP_CFG_STATS_CB that is registered in this call.
+ * Note: to receive the stats callback, the @ref netapi_netcpPoll funcition must be called
+ * @param[in] h NETAPI instance handle, @ref NETAPI_T
+ * @param[in] c the callback function to invoke with the resulting statistics block, @ref NETCP_CFG_STATS_CB
+ * @param[in] doClear clear the stats in NETCP after the report (0=no, 1=yes)
* @param[out] int * err: pointer to error return
* @retval none
* @pre @ref netapi_init