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

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

?? zl5011xpacketrx.c

?? Zalink50114----TDMoIP芯片驅動源碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
   {
      templateInUse = &(zl5011xPacketRxTemplatesIPv6[par->protocolType]);
   }

   /* allow the application to specify a protocol number to use */
   lanRxSetProtocolMatch->matchNum = par->protocolMatchNumber;

   lanRxSetProtocolMatch->output.discardUdpCheckFails = par->discardUdpCheckFails;
   lanRxSetProtocolMatch->output.protocolIpv4         = par->ipVer4;
   lanRxSetProtocolMatch->output.protocolVlan         = par->enableVlan;
   lanRxSetProtocolMatch->output.timestampShift       = templateInUse->timestampShift;

   if (par->forceOneByteSeq == ZL5011X_TRUE)
   {
      lanRxSetProtocolMatch->output.protocolTwoByteSeq = ZL5011X_FALSE;
   }
   else
   {
      lanRxSetProtocolMatch->output.protocolTwoByteSeq = templateInUse->protocolSeqLength16Bits;
   }

   /* Set up the location of the PW byte, allowing for the optional VLAN header and
      L2TPv3 cookie */
   lanRxSetProtocolMatch->output.extractPwByte = (Uint8T)(templateInUse->extractPwByte + vlanOffset + cookieOffset);

   for (n = 0; n < ZL5011X_PKC_PROTOCOL_NUM_MATCH_FIELDS; n++)
   {
      protocolMatchIndex = n;
      headerMatchIndex = n;

      if (n >= (ZL5011X_MAC_SIZE + ZL5011X_MAC_SIZE))
      {
         headerMatchIndex += snapOffset;
      }

      /* If the ethernet header contains SNAP, then this field is removed by the device,
         so need to skip over those bytes from the incoming header */
      lanRxSetProtocolMatch->match.protocolMatchBytes[protocolMatchIndex] = par->header[headerMatchIndex];
   }

   for (n = 0; n < (ZL5011X_PKC_PROTOCOL_NUM_MATCH_FIELDS - vlanOffset - cookieOffset); n++)
   {
      protocolMaskIndex = n;
      templateMaskIndex = n;

      if (n >= (ZL5011X_MAC_SIZE + ZL5011X_MAC_SIZE))
      {
         protocolMaskIndex += vlanOffset;
      }

      if (protocolMaskIndex >= (l2tpHeaderPos + ZL5011X_PKT_L2TPV3_HDR_LEN - snapOffset))
      {
         protocolMaskIndex += cookieOffset;
      }

      if (protocolMaskIndex >= ZL5011X_PKC_PROTOCOL_NUM_MATCH_FIELDS)
      {
         break;
      }

      /* The bytes indexed in the template are indexed without knowledge of the
         presence of VLAN or SNAP. Since SNAP will have been removed by the time
         this stuff is applied, we only need to worry about VLAN. If VLAN is
         present, then when the byte index gets to the VLAN position, the mask
         has to be shifted by the size of VLAN. */
      lanRxSetProtocolMatch->match.protocolMaskBytes[protocolMaskIndex] = templateInUse->protocolMaskBytes[templateMaskIndex];

      if (udpHeader == ZL5011X_TRUE)
      {
         /* using UDP header so apply the required masks for the port addresses */
         if (templateMaskIndex == (udpPos + ZL5011X_PKT_UDP_SRC_PORT_POS + 0))
         {
            lanRxSetProtocolMatch->match.protocolMaskBytes[protocolMaskIndex] = (Uint8T)(~(par->srcUdpPortMask) >> 8);
         }

         if (templateMaskIndex == (udpPos + ZL5011X_PKT_UDP_SRC_PORT_POS + 1))
         {
            lanRxSetProtocolMatch->match.protocolMaskBytes[protocolMaskIndex] = (Uint8T)(~(par->srcUdpPortMask) >> 0);
         }

         if (templateMaskIndex == (udpPos + ZL5011X_PKT_UDP_DEST_PORT_POS + 0))
         {
            lanRxSetProtocolMatch->match.protocolMaskBytes[protocolMaskIndex] = (Uint8T)(~(par->destUdpPortMask) >> 8);
         }

         if (templateMaskIndex == (udpPos + ZL5011X_PKT_UDP_DEST_PORT_POS + 1))
         {
            lanRxSetProtocolMatch->match.protocolMaskBytes[protocolMaskIndex] = (Uint8T)(~(par->destUdpPortMask) >> 0);
         }
      }
   }

   if (par->matchDestMacAddress == ZL5011X_TRUE)
   {
      for (n = 0; n < ZL5011X_MAC_SIZE; n++)
      {
         lanRxSetProtocolMatch->match.protocolMaskBytes[n] = ZL5011X_MASK_IN;
      }
   }

   if ((par->matchDestIpv4Address == ZL5011X_TRUE) && (ipv4Header == ZL5011X_TRUE))
   {
      /* using IPv4 header and need to add dest src address to the protocol match */
      Uint32T ipPos;

      ipPos = ZL5011X_PKT_ETHERNET_HDR_LEN + vlanOffset + ZL5011X_PKT_IPV4_DEST_POS;

      for (n = 0; n < (ZL5011X_PKT_IPV4_ADDR_LEN / 2); n++)
      {
         lanRxSetProtocolMatch->match.protocolMaskBytes[ipPos + n] = ZL5011X_MASK_IN;
      }
   }

   /* if VLAN is enabled, then the ethertype check in the template will be checking the ethertype
      part of the VLAN header, so need to add in a check for the ethertype in the ethernet header */
   if (par->enableVlan == ZL5011X_TRUE)
   {
      lanRxSetProtocolMatch->match.protocolMaskBytes[ZL5011X_MAC_SIZE + ZL5011X_MAC_SIZE] = ZL5011X_MASK_IN;
      lanRxSetProtocolMatch->match.protocolMaskBytes[ZL5011X_MAC_SIZE + ZL5011X_MAC_SIZE + 1] = ZL5011X_MASK_IN;
   }

   /* work out if the sequence number needs to be different from that in the template */
   seqOffset = 0;

   if (par->rtpForceSeqNumber == ZL5011X_TRUE)
   {
      /* The template is setup for using the first sequence number in the protocol stack by default.
         But in this case choosing to use the RTP field so work out the offset */
      if ((par->protocolType == ZL5011X_MPLS_PW_RTP) || (par->protocolType == ZL5011X_MPLS_RTCP_CTRL) ||
         (par->protocolType == ZL5011X_CUSTOM8_PW_RTP))
      {
         seqOffset = (ZL5011X_PKT_PW_HDR_LEN - ZL5011X_PKT_PW_SEQ_POS) + ZL5011X_PKT_RTP_SEQ_POS;
      }
   }
   else
   {
      /* The template is setup for using the first sequence number in the protocol stack by default.
         But in this case choosing to use the PW field so work out the offset */
      if ((par->protocolType == ZL5011X_IP_UDP_RTP_PW) || (par->protocolType == ZL5011X_IP_L2TPV3_RTP_PW) ||
         (par->protocolType == ZL5011X_IP_UDP_RTCP_CTRL) || (par->protocolType == ZL5011X_IP_L2TPV3_RTCP_CTRL) ||
         (par->protocolType == ZL5011X_CUSTOM8_RTP_PW) ||
         (par->protocolType == ZL5011X_IP_UDP_RTP_PW_ALT))
      {
         seqOffset = (ZL5011X_PKT_RTP_HDR_LEN - ZL5011X_PKT_RTP_SEQ_POS) + ZL5011X_PKT_PW_SEQ_POS;
      }
   }

   for (n = 0; n < ZL5011X_PKC_PROTOCOL_MAX_SEQ_BYTES; n++)
   {
      /* adjust the position, since it comes after the VLAN and L2TP cookie (if present) */
      lanRxSetProtocolMatch->output.extractSequenceBytes[n] = (Uint8T)(templateInUse->extractSequenceBytes[n] +
            vlanOffset + cookieOffset + seqOffset);
   }

   for (n = 0; n < ZL5011X_PKC_PROTOCOL_MAX_TIMESTAMP_BYTES; n++)
   {
      if (par->disableTimestamp == ZL5011X_FALSE)
      {
         /* adjust the position, since it comes after the VLAN and L2TP cookie (if present) */
         lanRxSetProtocolMatch->output.extractTimestampBytes[n] = (Uint8T)(templateInUse->extractTimestampBytes[n] +
               vlanOffset + cookieOffset);
      }
      else
      {
         /* don't want to extract the timestamp, so just set the position to the
            first byte in the packet */
         lanRxSetProtocolMatch->output.extractTimestampBytes[n] = 0;
      }
   }

   for (n = 0; n < ZL5011X_PKC_PROTOCOL_MAX_LENGTH_BYTES; n++)
   {
      /* adjust the position, since it comes after the VLAN and before L2TP cookie (if present) */
      lanRxSetProtocolMatch->output.extractLengthBytes[n] = (Uint8T)(templateInUse->extractLengthBytes[n] +
            vlanOffset);
   }

   for (n = 0; n < ZL5011X_PKC_CLASSIFY_NUM_MATCH_FIELDS; n++)
   {
      /* work out if any VLAN or L2TP cookie offset is applicable to this entry in the
         template. If so, then adjust as appropriate */
      if (templateInUse->extractClassifyBytes[n] >= (ZL5011X_MAC_SIZE + ZL5011X_MAC_SIZE))
      {
         tempOffset = vlanOffset;
      }
      else
      {
         tempOffset = 0;
      }

      if (templateInUse->extractClassifyBytes[n] >= (l2tpHeaderPos + ZL5011X_PKT_L2TPV3_HDR_LEN - snapOffset - vlanOffset))
      {
         /* if L2TP is not enabled then the offset will be zero, so doesn't matter if it gets added */
         tempOffset += cookieOffset;
      }

      lanRxSetProtocolMatch->output.extractClassifyBytes[n] = (Uint8T)(templateInUse->extractClassifyBytes[n] + tempOffset);
   }

   for (n = 0; n < ZL5011X_PKC_CLASSIFY_NUM_CHECK_FIELDS; n++)
   {
      /* work out if any VLAN or L2TP cookie offset is applicable to this entry in the
         template. If so, then adjust as appropriate */
      if (templateInUse->extractCheckBytes[n] >= (ZL5011X_MAC_SIZE + ZL5011X_MAC_SIZE))
      {
         tempOffset = vlanOffset;
      }
      else
      {
         tempOffset = 0;
      }

      if (templateInUse->extractCheckBytes[n] >= (l2tpHeaderPos + ZL5011X_PKT_L2TPV3_HDR_LEN - snapOffset - vlanOffset))
      {
         tempOffset += cookieOffset;
      }

      lanRxSetProtocolMatch->output.extractCheckBytes[n] = (Uint8T)(templateInUse->extractCheckBytes[n] + tempOffset);
      lanRxSetProtocolMatch->output.checkMask[n] = templateInUse->checkMask[n];

      if ((templateInUse->extractCheckBytes[n] == templateInUse->extractPwByte) &&
         (templateInUse->extractPwByte != 0))
      {
         Uint32T pwMask;

         /* PW status byte field, so set the mask independently of the template */
         if (par->statusByteMask == (Uint32T)ZL5011X_INVALID)
         {
            /* L, R and top M bit are ignored for packet acceptance */
            pwMask = ZL5011X_PACKET_DEFAULT_STATUS_MASK;
         }
         else
         {
            pwMask = ~par->statusByteMask & 0xff;
         }

         lanRxSetProtocolMatch->output.checkMask[n] = pwMask;
      }

      /* if this is a length field, then mask out the check if length is NOT to be used */
      if ((templateInUse->extractCheckBytes[n] != 0) &&
         (par->lengthUsage != ZL5011X_PACKET_LENGTH_CHECK) &&
         ((templateInUse->extractCheckBytes[n] == templateInUse->extractLengthBytes[0]) ||
         (templateInUse->extractCheckBytes[n] == templateInUse->extractLengthBytes[1])))

      {
         lanRxSetProtocolMatch->output.checkMask[n] = ZL5011X_MASK_OUT;
      }
   }

   /* If VLAN is enabled then the there are some extra matches for the VLAN ID
      that can applied (either for classification or checking) */
   if (par->enableVlan == ZL5011X_TRUE)
   {
      /* If the VLAN ID is to be checked, then setup the fields */
      if (templateInUse->vlanCheckPos[0] < ZL5011X_PKC_CLASSIFY_NUM_CHECK_FIELDS)
      {
         lanRxSetProtocolMatch->output.extractCheckBytes[templateInUse->vlanCheckPos[0]] =
               ZL5011X_MAC_SIZE + ZL5011X_MAC_SIZE + ZL5011X_PKT_ETHERTYPE_LEN;
         lanRxSetProtocolMatch->output.checkMask[templateInUse->vlanCheckPos[0]] =
               (Uint8T)(ZL5011X_MASK_IN_VLAN_ID >> 8);
      }

      if (templateInUse->vlanCheckPos[1] < ZL5011X_PKC_CLASSIFY_NUM_CHECK_FIELDS)
      {
         lanRxSetProtocolMatch->output.extractCheckBytes[templateInUse->vlanCheckPos[1]] =
               ZL5011X_MAC_SIZE + ZL5011X_MAC_SIZE + ZL5011X_PKT_ETHERTYPE_LEN + 1;
         lanRxSetProtocolMatch->output.checkMask[templateInUse->vlanCheckPos[1]] =
               (Uint8T)ZL5011X_MASK_IN_VLAN_ID;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
另类成人小视频在线| 欧美蜜桃一区二区三区| 成人激情免费网站| 91免费观看视频在线| 欧美日韩另类一区| 精品第一国产综合精品aⅴ| 欧美激情综合五月色丁香| 国产精品高潮久久久久无| 亚洲一区在线电影| 国产麻豆精品95视频| 色综合久久天天| 日韩视频免费观看高清在线视频| 欧美高清在线一区二区| 亚洲国产精品久久久久秋霞影院| 国产尤物一区二区| 欧洲中文字幕精品| 国产日韩精品久久久| 亚洲一区二区精品视频| 国产麻豆精品在线| 欧美视频在线播放| 国产精品青草久久| 免费人成网站在线观看欧美高清| 成人av在线网| 777亚洲妇女| 亚洲视频一区二区在线| 精品一区在线看| 欧洲国产伦久久久久久久| 久久一日本道色综合| 亚洲va韩国va欧美va| 国产成a人无v码亚洲福利| 51精品视频一区二区三区| 一色桃子久久精品亚洲| 美女一区二区在线观看| 91视频观看视频| 国产校园另类小说区| 日韩电影在线观看电影| 99国产精品久久久久久久久久| 欧美videossexotv100| 一区二区三区美女视频| 成人免费高清视频在线观看| 日韩欧美激情在线| 亚洲综合丝袜美腿| 99re亚洲国产精品| 久久影视一区二区| 久久精品国产秦先生| 欧美日韩一区三区四区| 亚洲视频一区二区在线| 国产91清纯白嫩初高中在线观看| 欧美一卡2卡三卡4卡5免费| 亚洲一区国产视频| 色美美综合视频| 国产精品成人一区二区三区夜夜夜 | 亚洲区小说区图片区qvod| 国产成人午夜高潮毛片| 欧美大尺度电影在线| 青青草国产成人99久久| 欧美精品色综合| 亚洲va国产天堂va久久en| 在线免费观看成人短视频| 亚洲六月丁香色婷婷综合久久| 成人一级黄色片| 国产精品美女久久久久高潮| 成人一区二区视频| 国产精品青草综合久久久久99| 国产福利一区二区| 国产视频一区二区三区在线观看 | 精品卡一卡二卡三卡四在线| 图片区小说区国产精品视频| 欧洲生活片亚洲生活在线观看| 亚洲欧美成aⅴ人在线观看| 成人av第一页| 成人免费在线播放视频| 色狠狠综合天天综合综合| 亚洲精品国产无天堂网2021| 色哟哟精品一区| 亚洲猫色日本管| 91福利社在线观看| 婷婷国产v国产偷v亚洲高清| 欧美日韩日本视频| 日韩不卡一区二区| 欧美一区二区三区白人| 美女一区二区三区| 国产午夜精品福利| 99久久精品国产网站| 樱桃视频在线观看一区| 欧美三级乱人伦电影| 日本美女一区二区三区视频| 亚洲精品一区二区三区精华液 | 久久蜜桃av一区精品变态类天堂| 国产麻豆精品久久一二三| 国产精品女同一区二区三区| av在线这里只有精品| 亚洲精品一二三区| 欧美精品久久99| 久99久精品视频免费观看| 久久久不卡影院| 成人av手机在线观看| 依依成人综合视频| 日韩一卡二卡三卡国产欧美| 国产一区二区三区电影在线观看| 国产精品视频九色porn| 色综合久久久久久久久久久| 日精品一区二区| 久久丝袜美腿综合| 99国产欧美久久久精品| 日韩精品色哟哟| 久久久久久久综合色一本| 91香蕉视频污| 美女视频网站久久| 国产精品网友自拍| 欧美日韩中文一区| 韩国在线一区二区| 亚洲视频一二三| 日韩视频免费观看高清完整版 | 国产精品久久久久久久午夜片| 色国产综合视频| 狠狠色狠狠色综合系列| ...中文天堂在线一区| 欧美日韩大陆在线| 国产高清不卡二三区| 亚洲无线码一区二区三区| 精品福利av导航| 色婷婷亚洲一区二区三区| 欧美a级一区二区| 最新不卡av在线| 欧美一区二区成人| 91蜜桃婷婷狠狠久久综合9色| 免费在线一区观看| 国产精品第五页| 欧美电影精品一区二区| 91丨九色porny丨蝌蚪| 九九久久精品视频 | 91精品综合久久久久久| 成人毛片在线观看| 久久99精品久久久久婷婷| 亚洲男人电影天堂| 国产三级精品三级| 91精品中文字幕一区二区三区| 91在线观看免费视频| 精品一区二区三区在线播放视频 | 欧美日韩久久久| av网站一区二区三区| 精品一区二区三区视频在线观看| 一区二区三区在线观看国产| 国产午夜一区二区三区| 91精品国产品国语在线不卡| 91年精品国产| 国产不卡视频在线观看| 久久精品理论片| 午夜av一区二区| 亚洲人成精品久久久久| 国产视频视频一区| 精品粉嫩超白一线天av| 91精品国产色综合久久不卡蜜臀 | 亚洲国产va精品久久久不卡综合| 国产精品久久毛片| 久久久久久97三级| 日韩欧美成人午夜| 欧美一级在线免费| 91精品国产一区二区三区香蕉| 91成人在线精品| 色欧美片视频在线观看在线视频| 国产91富婆露脸刺激对白| 狠狠v欧美v日韩v亚洲ⅴ| 奇米一区二区三区| 日韩成人一区二区三区在线观看| 一区二区三区在线影院| 亚洲欧洲国产日韩| 国产精品久久影院| 国产日韩精品一区| 国产精品日韩成人| 国产精品每日更新| 国产精品传媒视频| 中文字幕在线观看不卡| 国产精品美女久久久久久久久久久 | 一区二区欧美精品| 亚洲男人的天堂在线aⅴ视频| 国产精品久久午夜| 综合精品久久久| 中文字幕色av一区二区三区| 综合分类小说区另类春色亚洲小说欧美 | 亚洲国产精品久久人人爱| 亚洲综合色噜噜狠狠| 亚洲福利国产精品| 五月天久久比比资源色| 五月综合激情婷婷六月色窝| 亚洲成国产人片在线观看| 水野朝阳av一区二区三区| 婷婷夜色潮精品综合在线| 日韩一区欧美二区| 免费高清视频精品| 精品亚洲成a人| 国产精品一区免费视频| 国产suv精品一区二区三区| 99久久免费视频.com| 色综合久久99| 91精品国产一区二区三区香蕉| 26uuu亚洲婷婷狠狠天堂| 国产无遮挡一区二区三区毛片日本| 国产精品人成在线观看免费|