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

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

?? zl5011xpkcpreclassify.c

?? Zalink50114----TDMoIP芯片驅動源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:

   if (status == ZL5011X_OK)
   {
      status = zl5011xWriteAssembledBitFields(zl5011xParams, tempWord,
            index, tempPos, address);
   }

   return status;
}

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

 Function:
    zl5011xPkcProtocolSetMaskField

 Description:
   Sets the masck bytes in the pre classifier. These are used to control which
   of the bits in the match bytes are compared.

 Inputs:
   zl5011xParams   Pointer to the structure for this device instance
   maskNum        the number of the entry to set
   maskIndex      array of bytes to be used for masking

 Outputs:
   None

 Returns:
   zlStatusE

 Remarks:
   None

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

zlStatusE zl5011xPkcProtocolSetMaskField(zl5011xParamsS *zl5011xParams,
      Uint32T maskNum, Uint8T *maskIndex)
{
   Uint32T tempWord[(ZL5011X_PKC_PROTOCOL_MASK_SIZE / 4) + 1];
   Uint8T tempPos = 0;
   Uint8T index = 0;
   Uint32T address;
   Uint32T loop;
   zlStatusE status = ZL5011X_OK;

   ZL5011X_TRACE(ZL5011X_PKC_FN_ID,
         "zl5011xPkcProtocolSetMaskField: match %3d",
         maskNum, 0, 0, 0, 0, 0);

   address = ZL5011X_PKC_PROTOCOL_MASK +
         ((maskNum*2) * ZL5011X_PKC_PROTOCOL_MASK_SIZE);

   /* assemble the classify match entries into 32 bit words and
      then write them to the device */
   for (loop = 0; loop < ZL5011X_PKC_PROTOCOL_NUM_MATCH_FIELDS; loop++)
   {
      if (status != ZL5011X_OK)
         break;

      status = zl5011xAssembleBitFields(tempWord, &index, &tempPos,
            maskIndex[loop], ZL5011X_PKC_PROTOCOL_SIZE_MASK_FIELD);
   }

   if (status == ZL5011X_OK)
   {
      status = zl5011xWriteAssembledBitFields(zl5011xParams, tempWord,
            index, tempPos, address);
   }

   return status;
}


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

 Function:
   zl5011xPkcProtocolConflictCheck

 Description:
   Checks for a protocol matching conflict.

 Inputs:
   zl5011xParams   Pointer to the structure for this device instance
   matchNum       the number of the entry to disable
   newMatch          structure containing the pre classifier match settings

 outputs:
   None

 Returns:
   zlStatusE

 Remarks:
   None

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

zlStatusE zl5011xPkcProtocolConflictCheck(zl5011xParamsS *zl5011xParams,
      Uint32T *matchNum, zl5011xPacketProtocolMatchS *newMatch, zl5011xBooleanE extraCheck )
{
   zlStatusE status = ZL5011X_OK;
   zl5011xPacketProtocolMatchS *firstMatch;
   zl5011xPacketProtocolMatchS *secndMatch;
   Uint32T mNum,num,ndx;
   zl5011xBooleanE sameCommonMatch;
   zl5011xBooleanE overridingMask;
   zl5011xBooleanE identicalMatch;
   Uint8T tmp;

   ZL5011X_TRACE(ZL5011X_PKC_FN_ID, "zl5011xPkcProtocolConflictCheck: match %3ld",
               *matchNum, 0, 0, 0, 0, 0);
   if ( *matchNum >= ZL5011X_PKC_NUM_PROTOCOL_ENTRIES )
   {
      /* With the matchNum as invalid we assume the calling function does not know
       * which entry will be used. It should turn out to be the next free one
       * Does not matter if there are no free entries, as this will be dealt with elsewhere. */
      mNum = 0;
      while ( (mNum < ZL5011X_PKC_NUM_PROTOCOL_ENTRIES)
           && (zl5011xParams->packetIf.packetRx.pkcProtocol[mNum].protocolReserved) )
      {
         mNum++;
      }
   }
   else
   {
      mNum = *matchNum;
   }
   for( num = 0; (num < ZL5011X_PKC_NUM_PROTOCOL_ENTRIES) && (status == ZL5011X_OK); num++)
   {
      if ( (num != mNum)
        && (zl5011xParams->packetIf.packetRx.pkcProtocol[num].protocolReserved) )
      {
         if ( num < mNum )
         {
            firstMatch = &zl5011xParams->packetIf.packetRx.pkcProtocol[num].protocolMatch;
            secndMatch = newMatch;
         }
         else
         {
            firstMatch = newMatch;
            secndMatch = &zl5011xParams->packetIf.packetRx.pkcProtocol[num].protocolMatch;
         }
         sameCommonMatch = ZL5011X_TRUE;
         overridingMask = ZL5011X_TRUE;
         identicalMatch = extraCheck; /* only interested if the calling function says so */

         /* make comparison between new match and the current match rule given by 'num' */
         for( ndx = 0; (ndx < ZL5011X_PKC_PROTOCOL_NUM_MATCH_FIELDS) && sameCommonMatch; ndx++)
         {
            /* assign to tmp, the mask for the common matching bits
             * (note: invert as 0xff means don't care) */
            tmp = ~(firstMatch->protocolMaskBytes[ndx] | secndMatch->protocolMaskBytes[ndx]);
            /* see if the match values are the same using the mask above */
            if ( (tmp & firstMatch->protocolMatchBytes[ndx]) != (tmp & secndMatch->protocolMatchBytes[ndx]) )
            {
               sameCommonMatch = ZL5011X_FALSE;
            }
            else
            {
               if ( overridingMask &&
                    (~firstMatch->protocolMaskBytes[ndx] & secndMatch->protocolMaskBytes[ndx]) )
               {
                  overridingMask = ZL5011X_FALSE;
               }
               if ( identicalMatch &&
                    (firstMatch->protocolMaskBytes[ndx] != secndMatch->protocolMaskBytes[ndx]) )
               {
                  identicalMatch = ZL5011X_FALSE;
               }
            }
         }
         /* analyse the comparison */
         if ( sameCommonMatch )
         {
            if ( identicalMatch )
            {
               /* let calling function know about existing rule */
               status = ZL5011X_PROTOCOL_MATCH_IN_USE;
               *matchNum = num;
            }
            else if ( overridingMask )
            {
               ZL5011X_TRACE(ZL5011X_PKC_FN_ID, "Conflict: a protocol match would be hidden",0,0,0,0,0,0);
               /* the proposed and the existing rules are conflicting, because the first rule will
                * always over-ride the second */
               status = ZL5011X_PKT_INCOMPATIBLE_HEADER_ERROR;
            }
            else if ( extraCheck )
            {
               ZL5011X_TRACE(ZL5011X_PKC_FN_ID, "Conflict: protocol match not exclusive: common with %3d",num,0,0,0,0,0);
               /* not identical and not always over-riding, but the two rules do overlap
                * i.e. some (or all) packets could match either rule
                * Return error as the calling function cares about this */
                status = ZL5011X_NO_AVAIL_PROTOCOL_MATCH;
               *matchNum = num;
            }
         }
      }
   }
   return status;
}

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

 Function:
    zl5011xPkcProtocolSetMatch

 Description:
   This function is used to setup a pre classifier match.

 Inputs:
   zl5011xParams   Pointer to the structure for this device instance
   matchNum       the number of the entry to disable
   match          structure containing the pre classifier match settings
   output         structure containing the pre classifier output settings.

 Outputs:
   None

 Returns:
   zlStatusE

 Remarks:
   None

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

zlStatusE zl5011xPkcProtocolSetMatch(zl5011xParamsS *zl5011xParams,
      Uint32T matchNum, zl5011xPacketProtocolMatchS *match,
      zl5011xPacketProtocolOutputS *output)
{
   Uint32T tempWord[(ZL5011X_PKC_PROTOCOL_OUTPUT_RAM_SIZE / 4) + 1];
   Uint8T tempPos = 0;
   Uint8T index = 0;
   Uint32T address;
   Uint32T loop;
   Uint32T bits;
   zlStatusE status = ZL5011X_OK;

   ZL5011X_TRACE(ZL5011X_PKC_FN_ID,
         "zl5011xPkcProtocolSetMatch: match %3d",
         matchNum, 0, 0, 0, 0, 0);

   /* check that the parameters are okay */
   if ((matchNum >= ZL5011X_PKC_NUM_PROTOCOL_ENTRIES) ||
         (match == NULL) ||
         (output == NULL))
   {
      status = ZL5011X_PARAMETER_INVALID;
   }

   /* check that the output parameters are okay */
   if (status == ZL5011X_OK)
   {
      status = ZL5011X_CHECK_BOOLEAN(output->discardUdpCheckFails);
   }

   if (status == ZL5011X_OK)
   {
      status = ZL5011X_CHECK_BOOLEAN(output->protocolIpv4);
   }

   if (status == ZL5011X_OK)
   {
      status = ZL5011X_CHECK_BOOLEAN(output->protocolVlan);
   }

   if (status == ZL5011X_OK)
   {
      status = ZL5011X_CHECK_BOOLEAN(output->protocolTwoByteSeq);
   }

   if ((status == ZL5011X_OK) &&
         ((output->timestampShift & ~ZL5011X_PKC_PROTOCOL_TIMESTAMP_SHIFT_MASK) != 0))
   {
      status = ZL5011X_PARAMETER_INVALID;
   }

   if (status == ZL5011X_OK)
   {
      loop = matchNum; /* use loop as a temporary variable */
      status = zl5011xPkcProtocolConflictCheck( zl5011xParams, &loop, match, ZL5011X_FALSE );
   }

   /* setup the match, mask and check fields for the recognition
      stage of the classifier */
   if (status == ZL5011X_OK)
   {
      status = zl5011xPkcProtocolSetMatchField(zl5011xParams, matchNum,
            match->protocolMatchBytes);
   }

   if (status == ZL5011X_OK)
   {
      status = zl5011xPkcProtocolSetMaskField(zl5011xParams,
            matchNum, match->protocolMaskBytes);
   }

   /* set up the output Ram  */
   address = ZL5011X_PKC_PROTOCOL_OUTPUT_RAM +
         ((matchNum*2) * ZL5011X_PKC_PROTOCOL_OUTPUT_RAM_SIZE);

   /* initialise the temporary buffer to 0 */
   (void)memset(tempWord, 0, sizeof(tempWord));

   /* write the classifier byte index'es to the output RAM */
   for (loop = 0; loop < ZL5011X_PKC_CLASSIFY_NUM_MATCH_FIELDS; loop++)
   {
      if (status != ZL5011X_OK)
         break;

      status = zl5011xAssembleBitFields(tempWord, &index, &tempPos,
            output->extractClassifyBytes[loop],
            ZL5011X_PKC_PROTOCOL_SIZE_CLASSIFY_FIELD);
   }

   /* write the check byte index'es to the output RAM */
   for (loop = 0; loop < ZL5011X_PKC_CLASSIFY_NUM_CHECK_FIELDS; loop++)
   {
      if (status != ZL5011X_OK)
         break;

      status = zl5011xAssembleBitFields(tempWord, &index, &tempPos,
            output->extractCheckBytes[loop],
            ZL5011X_PKC_PROTOCOL_SIZE_CHECK_FIELD);
   }

   /* write the PW status byte to the output RAM */
   if (status == ZL5011X_OK)
   {
      status = zl5011xAssembleBitFields(tempWord, &index, &tempPos,
            output->extractPwByte,
            ZL5011X_PKC_PROTOCOL_SIZE_PW_FIELD);
   }

   /* write the sequence number bytes to the output RAM */
   for (loop = 0; loop < ZL5011X_PKC_PROTOCOL_MAX_SEQ_BYTES; loop++)
   {
      if (status != ZL5011X_OK)
         break;

      status = zl5011xAssembleBitFields(tempWord, &index, &tempPos,
            output->extractSequenceBytes[loop],
            ZL5011X_PKC_PROTOCOL_SIZE_SEQ_FIELD);
   }

   /* write the timestamp bytes to the output RAM */
   for (loop = 0; loop < ZL5011X_PKC_PROTOCOL_MAX_TIMESTAMP_BYTES; loop++)
   {
      if (status != ZL5011X_OK)
         break;

      status = zl5011xAssembleBitFields(tempWord, &index, &tempPos,
            output->extractTimestampBytes[loop],
            ZL5011X_PKC_PROTOCOL_SIZE_TIMESTAMP_FIELD);
   }

   /* write the length bytes to the output RAM */
   for (loop = 0; loop < ZL5011X_PKC_PROTOCOL_MAX_LENGTH_BYTES; loop++)
   {
      if (status != ZL5011X_OK)
         break;

      status = zl5011xAssembleBitFields(tempWord, &index, &tempPos,
            output->extractLengthBytes[loop],
            ZL5011X_PKC_PROTOCOL_SIZE_LENGTH_FIELD);
   }

   /* write the action on UDP checksum failure bit to the output RAM */
   if (status == ZL5011X_OK)
   {
      if (output->discardUdpCheckFails == ZL5011X_TRUE)
      {
         bits = 0x1;
      }
      else
      {
         bits = 0x0;
      }

      status = zl5011xAssembleBitFields(tempWord, &index, &tempPos,
            bits,
            ZL5011X_PKC_PROTOCOL_SIZE_UDP_CHECK_FIELD);
   }

   /* write the IP protocol bit */
   if (status == ZL5011X_OK)
   {
      if (output->protocolIpv4 == ZL5011X_TRUE)
      {
         bits = 0x0;
      }
      else
      {
         bits = 0x1;
      }

      status = zl5011xAssembleBitFields(tempWord, &index, &tempPos,
            bits,
            ZL5011X_PKC_PROTOCOL_SIZE_IP_FIELD);
   }

   /* write the VLAN  bit */
   if (status == ZL5011X_OK)
   {
      if (output->protocolVlan == ZL5011X_TRUE)
      {
         bits = 0x1;
      }
      else
      {
         bits = 0x0;
      }

      status = zl5011xAssembleBitFields(tempWord, &index, &tempPos,
            bits,
            ZL5011X_PKC_PROTOCOL_SIZE_VLAN_FIELD);
   }

   /* write the check mask bytes to the output RAM */
   for (loop = 0; loop < ZL5011X_PKC_CLASSIFY_NUM_CHECK_FIELDS; loop++)
   {
      if (status != ZL5011X_OK)
         break;

      status = zl5011xAssembleBitFields(tempWord, &index, &tempPos,
            output->checkMask[loop],
            ZL5011X_PKC_PROTOCOL_SIZE_CHECK_MASK_FIELD);
   }

   /* write the sequence length control bit to the output RAM */
   if (status == ZL5011X_OK)
   {
      if (output->protocolTwoByteSeq == ZL5011X_TRUE)
      {
         bits = 0x1;
      }
      else
      {
         bits = 0x0;
      }

      status = zl5011xAssembleBitFields(tempWord, &index, &tempPos,
            bits,
            ZL5011X_PKC_PROTOCOL_SIZE_SEQ_SIZE_FIELD);
   }

   /* write the timestamp shift bits to the output RAM */
   if (status == ZL5011X_OK)
   {

      status = zl5011xAssembleBitFields(tempWord, &index, &tempPos,
            output->timestampShift,
            ZL5011X_PKC_PROTOCOL_SIZE_TIMESTAMP_SHIFT_FIELD);
   }

   if (status == ZL5011X_OK)
   {
      status = zl5011xWriteAssembledBitFields(zl5011xParams, tempWord,
            index, tempPos, address);
   }

   /* need to store all of these settings into the device structure */
   if (status == ZL5011X_OK)
   {
      memcpy(&zl5011xParams->packetIf.packetRx.pkcProtocol[matchNum].protocolMatch,
            match, sizeof(zl5011xPacketProtocolMatchS));
      memcpy(&zl5011xParams->packetIf.packetRx.pkcProtocol[matchNum].protocolOutput,
            output, sizeof(zl5011xPacketProtocolOutputS));
   }

   return status;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩丝袜情趣美女图片| 欧美激情中文字幕| 亚洲国产裸拍裸体视频在线观看乱了 | 欧美肥妇毛茸茸| 亚洲成人av资源| 6080午夜不卡| 激情久久五月天| 亚洲精品在线三区| 成人亚洲精品久久久久软件| 国产精品美女久久久久高潮| 亚洲国产精品激情在线观看| 国产精品系列在线播放| 中文字幕+乱码+中文字幕一区| 成人高清伦理免费影院在线观看| 国产精品久久久久久一区二区三区| 91在线码无精品| 亚洲成人动漫在线免费观看| 这里只有精品99re| 国产福利一区在线| 中文字幕一区日韩精品欧美| 色婷婷香蕉在线一区二区| 亚洲成人av福利| www国产成人| 91亚洲精品乱码久久久久久蜜桃| 一片黄亚洲嫩模| 精品国产乱码久久久久久久久| 国产一区二区导航在线播放| 国产精品第一页第二页第三页| 欧美日韩精品一区二区三区| 国内精品久久久久影院薰衣草| 亚洲区小说区图片区qvod| 91精品国产91热久久久做人人 | 欧美在线视频日韩| 麻豆国产欧美一区二区三区| 精品国产免费一区二区三区香蕉| 99久久精品国产一区二区三区| 亚洲成人777| 欧美国产精品一区二区三区| 欧美午夜精品久久久久久孕妇 | 久久精品理论片| 亚洲视频你懂的| 精品国产乱码久久久久久夜甘婷婷 | 久久久久88色偷偷免费| 日本韩国欧美在线| 国产裸体歌舞团一区二区| 亚洲成av人片在线观看| 中国色在线观看另类| 欧美一区二区三区在线电影| av电影一区二区| 久久精品国产色蜜蜜麻豆| 一区二区免费看| 国产精品狼人久久影院观看方式| 欧美一区二区三区影视| 欧美视频一区二区三区四区 | 国内精品伊人久久久久av影院| 一区二区三区国产| 中文字幕不卡三区| 久久精品亚洲精品国产欧美| 日韩区在线观看| 欧美欧美欧美欧美首页| 在线日韩av片| 99re成人在线| 99re成人精品视频| 波多野结衣中文字幕一区二区三区| 偷偷要91色婷婷| 亚洲国产综合人成综合网站| 亚洲美女免费在线| 18欧美乱大交hd1984| 亚洲国产精品传媒在线观看| 久久免费视频色| 日韩欧美久久一区| 欧美成人精品二区三区99精品| 国产精品网站在线观看| 国产欧美一区二区三区在线老狼| 26uuu久久天堂性欧美| 精品久久国产字幕高潮| 日韩精品一区二| 日韩欧美亚洲另类制服综合在线| 欧美一区二区三区精品| 日韩视频在线观看一区二区| 91精品欧美一区二区三区综合在 | 欧美日韩一区国产| 欧美午夜精品理论片a级按摩| 在线观看免费视频综合| 欧美亚洲国产一区二区三区| 欧美日韩精品一区二区三区蜜桃| 8x8x8国产精品| 在线播放91灌醉迷j高跟美女| 欧美日韩激情在线| 日韩亚洲欧美在线| 精品乱码亚洲一区二区不卡| 久久女同性恋中文字幕| 国产精品成人在线观看| 一区二区三区资源| 日韩精品一区第一页| 久久国产精品色婷婷| 风间由美一区二区av101| 暴力调教一区二区三区| 在线影院国内精品| 日韩视频免费观看高清完整版| 精品国产一区二区三区久久影院| 欧美激情一区二区三区全黄| ●精品国产综合乱码久久久久| 亚洲综合成人在线| 蜜桃av噜噜一区二区三区小说| 黄页视频在线91| av动漫一区二区| 在线播放日韩导航| 国产精品久久久久久久岛一牛影视 | 久久国产三级精品| av电影在线观看一区| 欧美一卡2卡三卡4卡5免费| 久久久久久一二三区| 亚洲色图制服诱惑| 欧美卡1卡2卡| 精品国产91久久久久久久妲己| 国产精品美女久久久久久久久久久| 一区二区三区在线不卡| 精品一区二区三区在线视频| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 正在播放亚洲一区| 国产精品久久精品日日| 亚洲高清免费在线| 国产电影精品久久禁18| 一本色道综合亚洲| 久久久久青草大香线综合精品| 一级女性全黄久久生活片免费| 麻豆91精品视频| 色婷婷久久久久swag精品 | 中文子幕无线码一区tr| 日本不卡一二三区黄网| 97国产精品videossex| 日韩午夜电影av| 亚洲一区在线视频| 国产精品一区二区黑丝| 欧美性猛交一区二区三区精品| 日本一区免费视频| 捆绑紧缚一区二区三区视频| 日本道色综合久久| 日本一区二区视频在线观看| 青青草成人在线观看| 欧美亚男人的天堂| 国产精品毛片高清在线完整版 | 亚洲第一激情av| 99久久精品国产一区二区三区| 久久久精品影视| 欧美aⅴ一区二区三区视频| 欧美在线999| 亚洲丝袜精品丝袜在线| 国产91在线观看| 欧美tk—视频vk| 石原莉奈在线亚洲三区| 在线观看日韩av先锋影音电影院| 国产精品久久久久久福利一牛影视| 国产乱人伦偷精品视频免下载| 欧美一级专区免费大片| 蜜臀国产一区二区三区在线播放| 欧美偷拍一区二区| 一区二区三区四区不卡视频| 99精品一区二区| 国产精品久久精品日日| 懂色av一区二区三区蜜臀| 精品噜噜噜噜久久久久久久久试看| 蜜臀av一区二区在线观看| 欧美一区二区视频网站| 免费日韩伦理电影| 日韩亚洲欧美综合| 精品制服美女丁香| 亚洲精品一区二区三区99| 国模套图日韩精品一区二区 | 国产精品对白交换视频| 成人国产电影网| 亚洲色图在线看| 91免费国产在线观看| 一区二区三区丝袜| 欧美日韩国产不卡| 欧美日韩的一区二区| 午夜精品爽啪视频| 777久久久精品| 日本不卡的三区四区五区| 日韩精品中文字幕在线不卡尤物| 麻豆专区一区二区三区四区五区| 日韩欧美国产一区二区在线播放 | 在线免费不卡视频| 亚洲成av人片在线观看| 日韩三级中文字幕| 国产黄色91视频| 亚洲色大成网站www久久九九| 色吊一区二区三区| 亚洲综合自拍偷拍| 日韩一区二区在线看片| 极品销魂美女一区二区三区| 国产亚洲欧美一级| 91蝌蚪porny九色| 亚洲r级在线视频| 欧美一级高清片| 成人深夜福利app| 亚洲国产综合色| 久久久久久**毛片大全| 91免费观看国产|