/**************************************************************************************** * * * Copyright (C) 2007 Ikanos Communications Inc. All rights reserved * * * * The information and source code contained herein is the exclusive property * * of Ikanos Communications and may not be disclosed, examined or reproduced in whole * * or in part without the explicit written authorization from Ikanos Communications. * * * ****************************************************************************************/ /**************************************************************************************** * * * File name : ap_ops.h * * Author : Ikanos Communications [ jpattar@ikanos.com ] * * Version : * * Date : 16th Nov 2010 * * Description : This file contains the operation table related structures. * * * * OPERATION TABLE: * * --------------------------------------------------------- * * | TYPE | LENGTH | Data | * * --------------------------------------------------------- * * | MESH_GRETAP_ENCAP| 38 | Eth_hdr+IP+GRETAP | * * --------------------------------------------------------- * * | | | | * * --------------------------------------------------------- * * * ****************************************************************************************/ /*_____________________________________Header Gaurd_____________________________________*/ #ifndef _APOPS_H_ #define _APOPS_H_ #ifdef CONFIG_L2TP_AP_SUPPORT #include #endif /*_______________________________________Includes_______________________________________*/ /*________________________________________MACROS________________________________________*/ #define OPTBL_BASE_ADDR LMEM_OPERATIONTABLE_ADDR #define OPTBL_MAX_ENTRIES 10 #ifdef CONFIG_L2TP_AP_SUPPORT #define OPTBL_MAX_OPERATIONS 3 #else #define OPTBL_MAX_OPERATIONS 2 #endif // Following macros define the ops table index #define OPTBL_MESH_NETWORK_OPN 0 #define OPTBL_IPV6_IPV4_TUNNELING_TRANSLATION_OPN 1 #ifdef CONFIG_L2TP_AP_SUPPORT #define OPTBL_L2TP_TUNNEL_OPN 2 #endif //Following macros holds different types of apOps_t.type field. #define OPTBL_NONE 0 #define OPTBL_MESH_GRETAP_ENCAP 11 #define OPTBL_MESH_GRETAP_DECAP 12 #define OPTBL_MESH_GRETAP_FORWARD 13 #define OPTBL_MESH_GRETAP_BRIDGING 14 #define OPTBL_IPV6_TO_IPV4_TUNNEL 21 #define OPTBL_IPV6_TO_IPV4_TRANSLATION 22 #define OPTBL_IPV4_TO_IPV6_TUNNEL 23 #define OPTBL_IPV4_TO_IPV6_TRANSLATION 24 #ifdef CONFIG_L2TP_AP_SUPPORT #define OPTBL_L2TP_IPV4_ONLY_TUNNEL 25 //#define OPTBL_L2TP_IPV4_ONLY_DECAP 26 #endif #define MESH_OPS_INDEX_INSIDE_FLOW_ID 16 #define MESH_OPS_INDEX_PEGRESS_0 16 #define MESH_OPS_INDEX_PEGRESS_1 20 #define MESH_OPS_INDEX_PEGRESS_2 24 #define MESH_OPS_INDEX_PEGRESS_3 28 /*______________________________________STRUCTURES______________________________________*/ typedef struct ipv4TunnelAddr_s { unsigned int srcIP; unsigned int dstIP; } ipv4TunnelAddr_t; #ifndef AP_IPV6_IP_ADDR_LEN #define AP_IPV6_IP_ADDR_LEN 16 #endif typedef struct ipv6TunnelAddr_s { unsigned char srcIP[AP_IPV6_IP_ADDR_LEN]; unsigned char dstIP[AP_IPV6_IP_ADDR_LEN]; } ipv6TunnelAddr_t; #ifdef CONFIG_L2TP_AP_SUPPORT typedef struct l2tpTunnelAddr_s { ipv4TunnelAddr_t ipv4TunnelAddr; udpTunnelAddr_t udpTunnelAddr; l2tpTunnelParams_t l2tpTunnelParams; pppTunnelAddr_t pppTunnelAddr; }l2tpTunnelAddr_t; #endif /* * apOps_s: This structure is the main structure of ap operation table. */ typedef struct apOps_s { unsigned char type; //Type of operation unsigned char length; //Length of operation structure (meshTap/meshVlanTap) unsigned short refcount; // maintains the reference count union opHdr_s { ipv4TunnelAddr_t ipv4TunnelAddr; ipv6TunnelAddr_t ipv6TunnelAddr; #ifdef CONFIG_L2TP_AP_SUPPORT l2tpTunnelAddr_t l2tpTunnelAddr; /*size = */ #endif unsigned char buf[44]; }opHdr_t; }apOps_t; /*_____________________________________Header Gaurd_____________________________________*/ #endif