亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? zl5011xpacketrx.c

?? Zalink50114----TDMoIP芯片驅動源碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
/******************************************************************************
*
*  File name:              zl5011xPacketRx.c
*
*  Version:                90
*
*  Author:                 JFE
*
*  Date created:           19/06/2002
*
*  Copyright 2002, 2003, 2004, 2005, Zarlink Semiconductor Limited.
*  All rights reserved.
*
*  Module Description:
*
*  This file contains packet Rx construction routines.
*
*  Revision History:
*
*  Rev:  Date:       Author:  Comments:
*  1     19/06/2002  JFE      Initial revision
*  2     04/09/2002  JFE      Made functions to control classifier and
*                             pre-classifier separate.
*                             Added the protocol stack template stuff.
*  3     06/09/2002  JFE      Fixed a #define use.
*  4     06/09/2002  JFE      Fixed a little bug with classify check bytes.
*                             Added support for VLAN
*                             Changed name of protocolType structure member
*  5     06/09/2002  JFE      Fixed bug with programming the classifier rules
*  6     06/09/2002  JFE      Added support for SNAP
*                             par->header is now a pointer which needs to be
*                             checked before it can be used.
*  7     06/09/2002  JFE      Changed name of template structure array so that
*                             a different pointer can be obtained for IPv4
*                             protocols to the pointer for IPv6.
*                             Fixed a problem with vlan support when a check
*                             or classify is required on VLAN tag.
*  8     11/09/2002  JFE      Added condition that ZL5011X_PW can only be used
*                             when VLAN enabled.
*  9     12/09/2002  JFE      Sorted out some length / modifier issues
*                             Added capability to deal with CD protocol stacks
*                             Fixed returns to free dynamic memory allocated
*  10    13/09/2002  JFE      Modified to deal with option of L2TP cookie
*  11    16/09/2002  JFE      Change zl5011xPacketRxSetHeader to be able to
*                             setup checking on length field.
*  12    16/09/2002  JFE      Changed zl5011xGetHeaderLength to take care of
*                             new control protocol stacks.
*                             Fixed a problem with VLAN.
*  13    17/09/2002  JFE      Fixed a problem with checking on IP length field.
*  14    17/09/2002  JFE      Fixed more issues with classification on VLAN.
*  15    18/09/2002  JFE      Fixed VLAN classification key and mask extraction.
*  16    18/09/2002  JFE      VLAN Post Verification issue. Also fixed uninit variable.
*  17    18/09/2002  JFE      Fixed another VLAN pv issue.
*  18    19/09/2002  JFE      Fixed some information for PKC task message setup.
*  19    20/09/2002  JFE      Changed #include to zl5011xApi.h
*  20    23/09/2002  JFE      Added function zl5011xPacketRxSetControlHeader()
*  21    23/09/2002  JFE      Mainly cosmetic changes
*                             Changed endian of check bytes for IP length in line
*                             with PKC endian.
*  22    25/09/2002  JFE      Added capability to deal with calling function
*                             trying to set up the same protocol type.
*  23    27/09/2002  JFE      Changed the way we deal with double-setting up
*                             same protocol stack. Now not using device structure.
*  24    02/10/2002  JFE      When calling function doesn't setup the context
*                             descriptor parameters, program the PKC to assume
*                             the CD field exists as the last two bytes in the header.
*                             Changed ZL5011X_TRACE macros to include function name first.
*  25    02/10/2002  JFE      Fixed problem with determining CD field position.
*  26    03/10/2002  DJA      ZL5011X_TRACE messages fixed up
*  27    03/10/2002  JFE      Added setup of PW Status ram (in PKC) for all new
*                             contexts involving PW.
*  28    03/10/2002  JFE      Fixed confusion between context no & matchNum
*  29    08/10/2002  JFE      Peer review actions.
*  30    10/10/2002  JFE      Made changes to accommodate revelation that IPv6 pre-
*                             classification with VLAN is hard.
*  31    10/10/2002  JFE      Enlarged on code to determine whether or not a protocol
*                             stack has been setup to include support for CD
*                             protocol stacks with various CD offsets.
*  32    14/10/2002  SAC      Fixed single '=' in conditional expression.
*  33    21/10/2002  JFE      Modified handling of L2TPv3 optional cookie.
*  34    31/10/2002  MRC      Added variants + minor fixes
*  35    31/10/2002  JFE      Fixed type in L2TPv3 optional cookie handling.
*  36    31/10/2002  JFE      Fixed problems with decision making for reuse of shared
*                             stub with CD protocol stacks involving SNAP.
*  37    04/11/2002  JFE      Added the protocolTwoByteSeq handling.
*                             Fixed incorrect usage of L2TP Header Length macro.
*                             Took SNAP out of the equation for L2TPv3 header pos.
*  38    06/11/2002  JFE      Made changes to allow for correct calculation of PW byte
*                             position in presence of VLAN.
*  39    06/11/2002  JFE      Fixed header length calculation for L2TPV3 / RTCP Ctrl
*  40    12/11/2002  JFE      Fixed a bit of a bug in pw position calculation.
*  41    15/11/2002  JFE      Added function to deal with the removal of protocol match
*                             entries.
*  42    18/11/2002  JFE      Fixed a bug with packetRxDeleteHeader
*  43    05/03/2003  MRC      Fairly big tweak
*  44    06/03/2003  MRC      Tidied up references to a cookie and IP->L2TPV3_CTRL
*  45    06/03/2003  MRC      Added OS exclusion and VLAN fix
*  46    10/03/2003  MRC      Length check enable now checks that the length
*                             position != 0 before changing masks etc.
*  47    24/03/2003  MRC      Add parameter to force one byte seq numbers
*  48    25/03/2003  MRC      Updated comment for parameter discardUdpCheckFails
*  49    19/05/2003  APL      L2TPv3 changes
*  50    22/05/2003  MRC      Reverted L2TPv3 changes
*  51    04/06/2003  JFE      Fixed problem with ZL5011X_CD making multiple pre-classify
*                             templates when only difference is IP Ver.
*  52    05/06/2003  JFE      Improved co-existence of SNAP and VLAN by changing the order
*                             (SNAP comes before VLAN).
*  53    06/06/2003  JFE      Changed call to calloc to use macro
*  54    10/06/2003  JFE      Performed pre-audit actions
*  55    11/06/2003  JFE      Added more useful information returned in structure when
*                             attempt to add pre-classifier match fails.
*  56    18/06/2003  ARW      Returning the value of  realContextDescriptorOffset when
*                             reusing a protcol involving CD
*  57    25/06/2003  MRC      Fixed a couple of problems with CD classification
*  58    25/06/2003  MRC      Fill in the CD header type automatically
*  59    18/07/2003  JFE      Fixed ZL5011X_CD freeing up issue
*  60    29/07/2003  APL      Added support for devices with no TDM interface
*  61    30/07/2003  APL      Audit action - rename of PacketToTdmMapping
*  62    13/08/2003  JFE      Added checking for concurrency of conflicting stacks
*  63    15/04/2004  MRC      Added option to disable timestamp extraction to
*                             packet Rx function
*  64    07/06/2004  MRC      Updated for MPLS->PW->RTP protocol
*  65    29/07/2004  MRC      Fixed some compiler warnings
*  66    04/08/2004  MRC      Updated MPLS protocols
*  67    25/08/2004  MRC      Protocol updates
*  68    27/08/2004  MRC      Corrected PW mask setting
*  69    13/09/2004  APL      Added option to remove headers or not.
*                             Ensure a valid payload length is specified if required.
*                             Corrected logic for host control packet matching.
*  70    27/09/2004  MRC      Uses the status byte mask for classification rather
*                             than value from the template
*  71    30/09/2004  MRC      Corrected classification mask for VLAN
*  72    17/11/2004  APL      Corrected logic to check for a valid payload length
*  73    19/11/2004  MRC      Added enum to allow more control over operations
*                             on the length for Packet Rx
*  74    26/11/2004  MRC      Added extra packet protocols
*  75    16/12/2004  MRC      Fixed header length calc for new protocols
*  76    21/01/2005  MRC      Added option for PacketRx to match ethernet MAC
*                             address (matchDestMacAddress) and a function
*                             for use on device reset zl5011xPacketRxFreeDevice
*  77    25/01/2005  APL      Removed check for device running in
*                             zl5011xPacketRxFreeDevice
*  78    28/01/2005  MRC      Added options to PacketRx to match IPv4 addresses
*  79    04/02/2005  MRC      Added option to apply masks to UDP ports and
*                             disable post classification checks
*  80    10/02/2005  MRC      Fixed some typos and allow protocol match number
*                             to be specified in call to zl5011xPacketRxSetProtocol
*  81    14/02/2005  APL      zl5011xPacketRxFreeDevice returns a meaningful error code
*                             if no packet matches have yet been defined.
*  82    18/02/2005  APL      Updated some comments
*  83    28/02/2005  APL      Added ZL5011X_ETHERNET type
*  84    17/03/2005  APL      Updated comment for zl5011xGetHeaderLength
*  85    18/03/2005  APL      Further update to comment for zl5011xGetHeaderLength
*  86    29/03/2005  APL      zl5011xPacketRxDeleteHeader now deletes header properly
*  87    19/04/2005  MRC      Added another packet length option
*  88    17/05/2005  MRC      Added custom 8 byte protocol header support
*  89    19/05/2005  MRC      Added PW byte support for custom headers
*  90    21/07/2005  MRC      Added IP->UDP->RTP and IP->UDP->RTP->PW->ALT protcols
*                             and support for UDP ports during protocol matching
*
******************************************************************************/

/*****************   INCLUDE FILES                ****************************/

#include "zl5011xApi.h"
#include "zl5011xMisc.h"
#include "zl5011xLan.h"
#include "zl5011xPacket.h"
#include "zl5011xPkcMap.h"
#include "zl5011xPacketRxTemplates.h"

/*****************   STATIC FUNCTION DECLARATIONS   ***************************/

#ifdef _DEBUG
   #define static
#endif

/* Declare an array of devices to keep track of protocol stacks in use on a per-
   device basis. This information is not stored in the device structure because
   protocol stacks being supported are considered to be implementation-specific
   and it is not desirable to tie the API to specific protocol stacks. The only
   concept of protocol stacks should exist in the packet helper functions, hence
   the relevant structures are decleared as global in this file. */
static zl5011xProtocolTableS Zl5011xProtocolTable[ZL5011X_MAX_NUMBER_DEVICES];
static zl5011xBooleanE Zl5011xProtocolTableInitialised = ZL5011X_FALSE;
static OS_MUTEX_ID Zl5011xProtocolTableExclusion = OS_SEM_INVALID;

static zlStatusE zl5011xPacketInitialiseTable(zl5011xPacketRxSetHeaderS * par);
static zlStatusE zl5011xPacketGetTable(zl5011xBooleanE waitForever);
static zlStatusE zl5011xPacketReleaseTable(void);
static zlStatusE zl5011xPacketRxSetProtocolFunc(zl5011xParamsS * zl5011xParams,
      zl5011xPacketRxSetHeaderS *par);
static zlStatusE zl5011xPacketRxSetHeaderFunc(zl5011xParamsS * zl5011xParams,
      zl5011xPacketRxSetHeaderS *par);
static zlStatusE zl5011xPacketRxSetControlHeaderFunc(zl5011xParamsS * zl5011xParams,
      zl5011xPacketRxSetHeaderS *par);

/*****************   EXTERNAL FUNCTION DEFINITIONS   *************************/

/******************************************************************************

 Function:
    zl5011xPacketRxSetHeaderStructInit

 Description:
   Initialises structure used by functions :
      zl5011xPacketRxSetHeader
      zl5011xPacketRxSetProtocol
      zl5011xPacketRxSetControlHeader
      zl5011xPacketRxDeleteHeader

 Inputs:
   zl5011xParams   Pointer to the structure for this device instance
   par            Pointer to the structure for configuration items.
                  See main functions

 Returns:
   zlStatusE

 Remarks:
    If osExclusionEnable is set to ZL5011X_TRUE then a semaphore is created.

******************************************************************************/

zlStatusE zl5011xPacketRxSetHeaderStructInit(zl5011xParamsS *zl5011xParams,
      zl5011xPacketRxSetHeaderS * par)
{
   zlStatusE status = ZL5011X_OK;

   ZL5011X_TRACE(ZL5011X_PACKET_FN_ID,"zl5011xPacketRxSetHeaderStructInit:",0, 0, 0, 0, 0, 0);

   /* do some parameter checking */
   status = ZL5011X_CHECK_POINTERS(zl5011xParams, par);

   if (status == ZL5011X_OK)
   {
      par->context = (Uint32T)ZL5011X_INVALID_CONTEXT;
      par->protocolType = ZL5011X_INVALID_PROTOCOL;
      par->cpuQueue = ZL5011X_QUEUE_0;
      par->header = NULL;
      par->headerLength = 0;
      par->protocolMatchNumber = (Uint32T)ZL5011X_INVALID;
      par->classifyMatchNumber = (Uint32T)ZL5011X_INVALID;
      par->enableVlan = ZL5011X_FALSE;
      par->enableSnap = ZL5011X_FALSE;
      par->ipVer4 = ZL5011X_TRUE;
      par->discardUdpCheckFails = ZL5011X_TRUE;
      par->enableL2TPCookie = ZL5011X_FALSE;
      par->contextDescriptorOffset = (Uint32T)ZL5011X_INVALID;
      par->contextDescriptorNumber = ZL5011X_PKT_UNINIT;

      par->forceOneByteSeq = ZL5011X_TRUE;

      /* control whether the protocol classification phase should check the
         dest MAC and / or IPv4 fields */
      par->matchDestMacAddress = ZL5011X_FALSE;
      par->matchDestIpv4Address = ZL5011X_FALSE;

      /* control whether the classification stage should use the IPv4 src address */
      par->matchSrcIpv4Address = ZL5011X_TRUE;

      /* default to matching the UDP ports during classification */
      par->srcUdpPortMask = 0x0000;
      par->destUdpPortMask = 0x0000;

      /* enable classification checks by default */
      par->enableClassificationChecks = ZL5011X_TRUE;

      /* set to ZL5011X_TRUE to force the sequence number to be extracted from

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美影片第一页| 欧美色精品天天在线观看视频| 777欧美精品| 日韩成人av影视| 欧美肥妇bbw| 国产综合成人久久大片91| 久久久久久久综合日本| 成人午夜在线免费| 亚洲精品日韩综合观看成人91| 91在线观看下载| 亚洲午夜激情av| 日韩一级片网站| 成人综合婷婷国产精品久久蜜臀 | 成人综合在线视频| ...av二区三区久久精品| 欧美视频一区二区三区在线观看| 午夜婷婷国产麻豆精品| 精品乱码亚洲一区二区不卡| 国产麻豆91精品| 自拍偷拍亚洲综合| 日韩欧美色电影| 91丨九色丨蝌蚪富婆spa| 婷婷综合在线观看| 国产喂奶挤奶一区二区三区| 久久久久成人黄色影片| av一二三不卡影片| 欧美96一区二区免费视频| 国产精品美女久久久久久久| 欧美图区在线视频| 国产一区二区91| 亚洲成人免费av| 国产人伦精品一区二区| 欧美色电影在线| 成人激情免费电影网址| 亚洲成a天堂v人片| 国产精品国产自产拍高清av| 51精品久久久久久久蜜臀| 岛国精品一区二区| 另类小说图片综合网| 夜夜夜精品看看| 国产农村妇女毛片精品久久麻豆| 欧美精品第1页| av在线一区二区三区| 激情小说亚洲一区| 亚洲国产综合人成综合网站| 国产精品三级视频| 欧美xxxxxxxx| 国产日韩精品一区二区三区| 色婷婷av一区二区三区gif| 国产真实乱对白精彩久久| 亚洲尤物在线视频观看| 国产精品久久久一区麻豆最新章节| 欧美在线免费视屏| 成人黄色免费短视频| 精品一区二区三区在线播放视频| 亚洲成人免费看| 亚洲精品欧美综合四区| 欧美国产国产综合| 久久免费美女视频| www激情久久| 欧美成人bangbros| 欧美精品tushy高清| 91麻豆免费观看| av电影天堂一区二区在线| 国产成人精品亚洲777人妖| 激情图片小说一区| 精品一区二区三区的国产在线播放 | 国产一区亚洲一区| 卡一卡二国产精品 | 久久午夜老司机| 欧美成人一区二区三区| 欧美一级搡bbbb搡bbbb| 91精品国产综合久久久蜜臀粉嫩 | 日韩高清欧美激情| 午夜精品aaa| 日本亚洲三级在线| 麻豆精品精品国产自在97香蕉| 日韩综合在线视频| 奇米影视7777精品一区二区| 日本不卡一区二区三区高清视频| 视频精品一区二区| 免费观看久久久4p| 美女视频黄 久久| 国产在线播放一区三区四| 国产一区不卡在线| 国产成人8x视频一区二区| 成人在线综合网站| 91网站最新地址| 欧美天堂一区二区三区| 欧美年轻男男videosbes| 91麻豆精品国产91久久久使用方法 | 久久久亚洲午夜电影| 精品久久久久久综合日本欧美| 久久久久久久久久看片| 欧美激情一区二区三区在线| 中文字幕色av一区二区三区| 1024亚洲合集| 三级欧美在线一区| 国产一区二区三区国产| 一区二区三区免费| 久久精品在线观看| 中文字幕一区二区三区蜜月| 亚洲资源中文字幕| 久久丁香综合五月国产三级网站| 国内久久精品视频| 91在线国产观看| 这里是久久伊人| 欧美国产精品专区| 亚洲影视在线播放| 韩国av一区二区三区四区| av一区二区久久| 91精品啪在线观看国产60岁| 精品国产sm最大网站免费看| 亚洲国产精品国自产拍av| 亚洲大片一区二区三区| 久久精品国产精品亚洲综合| jlzzjlzz国产精品久久| 欧美精品在线观看播放| 亚洲国产高清在线| 日本免费新一区视频| 成人性生交大片免费看中文| 欧美另类z0zxhd电影| 国产精品午夜免费| 免费观看在线色综合| 91在线精品秘密一区二区| 日韩视频123| 一区2区3区在线看| 国产精品一卡二卡| 欧美久久免费观看| 日韩毛片在线免费观看| 久久99精品久久久久久国产越南 | 亚洲精品美国一| 久久99精品久久久久婷婷| 欧美在线观看一区| 国产精品久久毛片a| 精品中文av资源站在线观看| 91福利在线观看| 国产精品超碰97尤物18| 国产美女精品在线| 日韩一区二区在线看| 亚洲五码中文字幕| 99re热视频这里只精品| 久久精品一区四区| 久久婷婷色综合| 最近中文字幕一区二区三区| 国产精品自拍毛片| 日韩欧美一级在线播放| 日韩和欧美一区二区三区| 色综合咪咪久久| 国产精品国产三级国产aⅴ入口 | 91麻豆精品国产91久久久久久 | 91精品国产欧美一区二区18| 亚洲最新在线观看| 91亚洲精品久久久蜜桃| 中文在线一区二区| 国产精品一级黄| 欧美精品一区二区三区很污很色的 | 国产一区二区中文字幕| 欧美一区2区视频在线观看| 午夜日韩在线观看| 欧美日韩中文字幕一区二区| 亚洲另类在线视频| 色哟哟精品一区| 亚洲乱码一区二区三区在线观看| 99这里都是精品| 亚洲日本一区二区| 色88888久久久久久影院按摩| 亚洲情趣在线观看| 在线欧美日韩精品| 亚洲一区二区在线播放相泽| 欧美性生活一区| 亚洲成人一区在线| 91精品国产91久久久久久最新毛片 | 亚洲福利视频一区| 7777精品伊人久久久大香线蕉完整版| 亚洲一区二区在线播放相泽| 色八戒一区二区三区| 亚洲一区二区三区自拍| 欧美日韩国产一二三| 91捆绑美女网站| 1024国产精品| 欧美少妇一区二区| 蜜臀久久99精品久久久久久9| 日韩视频免费观看高清在线视频| 极品尤物av久久免费看| 国产日韩欧美综合在线| 91色porny在线视频| 亚洲最大色网站| 欧美一区二区三区视频| 韩国精品在线观看| 中文字幕亚洲在| 欧美群妇大交群的观看方式| 久久成人免费网站| 国产精品国产三级国产aⅴ原创| 色丁香久综合在线久综合在线观看| 偷拍日韩校园综合在线| 精品久久久网站| 日本精品视频一区二区三区| 天天av天天翘天天综合网色鬼国产| 26uuu精品一区二区三区四区在线|