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

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

?? zl5011xpackettx.c

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

               case ZL5011X_IP_CD:
                  /* Layer 3: IP  */
                  if (status == ZL5011X_OK)
                  {
                     status = zl5011xAddIPHeader(layer2and3Header, par);
                  }

                  layer4and5Header->header.txHighLength = 0;
                  if (status == ZL5011X_OK)
                  {
                     status = zl5011xAddCDHeader(layer2and3Header, layer4and5Header, par, &cdPos);
                     cdEnable = ZL5011X_TRUE;
                  }
                  break;

               case ZL5011X_IP_UDP_CD:
                  /* Layer 3: IP  */
                  if (status == ZL5011X_OK)
                  {
                     status = zl5011xAddIPHeader(layer2and3Header, par);
                  }

                  /* add the UDP header fields */
                  if (status == ZL5011X_OK)
                  {
                     status = zl5011xAddUDPHeader(layer4and5Header, par);
                     udpEnable = ZL5011X_TRUE;
                  }

                  layer4and5Header->header.txHighLength = ZL5011X_PKT_UDP_HDR_LEN;

                  if (status == ZL5011X_OK)
                  {
                     status = zl5011xAddCDHeader(layer2and3Header, layer4and5Header, par, &cdPos);
                     cdEnable = ZL5011X_TRUE;
                  }
                  break;

               case ZL5011X_ETHERNET :
                  /* Only Ethernet header is required so nothing more to add */
                  break;

               case ZL5011X_CUSTOM8_PW:
                  /* Layer 3: 8 byte header - place in the PE block to allow context switching.
                     Setup the PW sequence number */
                  layer4and5Header->header.layer5SequenceNumEnable = ZL5011X_TRUE;
                  layer4and5Header->header.layer5SequenceNum16bit = ZL5011X_TRUE;
                  layer4and5Header->header.layer5SequenceNumPos = 8 + ZL5011X_PKT_PW_SEQ_POS;

                  layer4and5Header->header.txHighLength = 8 + ZL5011X_PKT_PW_HDR_LEN;

                  pwStatusPos = layer4and5Header->header.txHighLength - ZL5011X_PKT_PW_HDR_LEN;
                  break;

               case ZL5011X_CUSTOM8_PW_RTP:
                  /* Layer 3: 8 byte header - place in the PE block to allow context switching.
                     Setup the PW sequence number */
                  layer4and5Header->header.layer5SequenceNumEnable = ZL5011X_TRUE;
                  layer4and5Header->header.layer5SequenceNum16bit = ZL5011X_TRUE;
                  if (par->rtpForceSeqNumber == ZL5011X_TRUE)
                  {
                     layer4and5Header->header.layer5SequenceNumPos = 8 + ZL5011X_PKT_PW_HDR_LEN + ZL5011X_PKT_RTP_SEQ_POS;
                  }
                  else
                  {
                     layer4and5Header->header.layer5SequenceNumPos = 8 + ZL5011X_PKT_PW_SEQ_POS;
                  }

                  /* setup the timestamp field for the RTP header */
                  layer4and5Header->header.layer5TimestampEnable = ZL5011X_TRUE;
                  layer4and5Header->header.layer5TimestampIncrement = (Uint16T)par->rtpTimestampInc;
                  layer4and5Header->header.layer5TimestampFromWan = par->rtpTimestampFromWan;
                  layer4and5Header->header.layer5Timestamp32bit = ZL5011X_TRUE;
                  layer4and5Header->header.layer5TimestampPos = 8 + ZL5011X_PKT_PW_HDR_LEN + ZL5011X_PKT_RTP_TS_POS;

                  layer4and5Header->header.txHighLength = 8 + ZL5011X_PKT_PW_HDR_LEN + ZL5011X_PKT_RTP_HDR_LEN;

                  pwStatusPos = layer4and5Header->header.txHighLength - ZL5011X_PKT_RTP_HDR_LEN - ZL5011X_PKT_PW_HDR_LEN;
                  break;

               case ZL5011X_CUSTOM8_RTP_PW:
                  /* Layer 3: 8 byte header - place in the PE block to allow context switching.
                     Setup the PW sequence number */
                  layer4and5Header->header.layer5SequenceNumEnable = ZL5011X_TRUE;
                  layer4and5Header->header.layer5SequenceNum16bit = ZL5011X_TRUE;
                  if (par->rtpForceSeqNumber == ZL5011X_TRUE)
                  {
                     layer4and5Header->header.layer5SequenceNumPos = 8 + ZL5011X_PKT_RTP_SEQ_POS;
                  }
                  else
                  {
                     layer4and5Header->header.layer5SequenceNumPos = 8 + ZL5011X_PKT_RTP_HDR_LEN + ZL5011X_PKT_PW_SEQ_POS;
                  }

                  /* setup the timestamp field for the RTP header */
                  layer4and5Header->header.layer5TimestampEnable = ZL5011X_TRUE;
                  layer4and5Header->header.layer5TimestampIncrement = (Uint16T)par->rtpTimestampInc;
                  layer4and5Header->header.layer5TimestampFromWan = par->rtpTimestampFromWan;
                  layer4and5Header->header.layer5Timestamp32bit = ZL5011X_TRUE;
                  layer4and5Header->header.layer5TimestampPos = 8 + ZL5011X_PKT_RTP_TS_POS;

                  layer4and5Header->header.txHighLength = 8 + ZL5011X_PKT_PW_HDR_LEN + ZL5011X_PKT_RTP_HDR_LEN;

                  pwStatusPos = layer4and5Header->header.txHighLength - ZL5011X_PKT_PW_HDR_LEN;
                  break;

               default:
                  status = ZL5011X_PARAMETER_INVALID;
                  ZL5011X_TRACE(ZL5011X_PACKET_FN_ID,
                        "zl5011xPacketTxSetHeader: protocol type error %d",
                        par->protocolType, 0, 0, 0, 0, 0);
            }
         }

         if (status == ZL5011X_OK)
         {
            if ((pwStatusPos != (Uint8T)ZL5011X_INVALID) &&
               (par->protocolType != ZL5011X_IP_UDP_RTP_PW) &&
               (par->protocolType != ZL5011X_IP_UDP_RTP_PW_ALT) &&
               (par->protocolType != ZL5011X_IP_L2TPV3_RTP_PW) &&
               (par->protocolType != ZL5011X_MPLS_PW_RTP) &&
               (par->protocolType != ZL5011X_CUSTOM8_PW_RTP) &&
               (par->protocolType != ZL5011X_CUSTOM8_RTP_PW))
            {
               if ((par->protocolType == ZL5011X_IP_PW_TS) && (par->fixIpv4Header == ZL5011X_TRUE))
               {
                  /* using the IP->PW->TS header and the IP checksum is fixed. This header is
                     small enough to fit most of the IP into the PE block, so shift up bytes
                     from the PTX into the PE */
                  pwShuffle = ZL5011X_RTP_HIGH_HEADER_MAX_LEN - layer4and5Header->header.txHighLength;
               }
               else
               {
                  /* need to shuffle the PW byte so that it is not in the same 32 bit word
                     as the sequence number field */
                  pwShuffle = 2;
               }

               pwStatusPos += pwShuffle;

               layer4and5Header->header.txHighLength += pwShuffle;
               layer2and3Header->header.txLowLength -= pwShuffle;

               if (layer2and3Header->header.layer3LengthEnable == ZL5011X_TRUE)
               {
                  layer2and3Header->header.layer3LengthValue -= pwShuffle;
               }

               if (layer4and5Header->header.layer4ChecksumPresent == ZL5011X_TRUE)
               {
                  layer4and5Header->header.layer4ChecksumPos += pwShuffle;
               }

               if (layer4and5Header->header.layer4LengthEnable == ZL5011X_TRUE)
               {
                  /* have an issue - the UDP length is being calculated on the fly,
                     but have just shifted 2 bytes into the PE from the PTX.
                     Therefore the calculation will fail, so need to write the header
                     length into the packet. Check that a length has been specified. */
                  if (par->payloadLength == 0)
                  {
                     status = ZL5011X_PARAMETER_INVALID;
                  }
                  else
                  {
                     layer4and5Header->header.layer4LengthEnable = ZL5011X_FALSE;
                     layer4and5Header->header.layer4LengthPos += pwShuffle;
                  }
               }

               if (layer4and5Header->header.layer5SequenceNumEnable == ZL5011X_TRUE)
               {
                  layer4and5Header->header.layer5SequenceNumPos += pwShuffle;
               }

               if (layer4and5Header->header.layer5TimestampEnable == ZL5011X_TRUE)
               {
                  layer4and5Header->header.layer5TimestampPos += pwShuffle;
               }
            }
         }

         if (status == ZL5011X_OK)
         {
            /* check that neither of the headers is too long */
            if (layer2and3Header->header.txLowLength > ZL5011X_PTX_LOW_HEADER_MAX_LEN)
            {
               ZL5011X_TRACE(ZL5011X_PACKET_FN_ID,
                     "zl5011xPacketTxSetHeader: ERROR - layer 2 & 3 header %2d, max %2d",
                     layer2and3Header->header.txLowLength, ZL5011X_PTX_LOW_HEADER_MAX_LEN, 0, 0, 0, 0);

               status = ZL5011X_PKT_HEADER_SIZE_ERROR;
            }
            else
            {
               if (layer4and5Header->header.txHighLength > ZL5011X_RTP_HIGH_HEADER_MAX_LEN)
               {
                  ZL5011X_TRACE(ZL5011X_PACKET_FN_ID,
                        "zl5011xPacketTxSetHeader: ERROR - layer 4 & 5 header %2d, max %2d",
                        layer4and5Header->header.txHighLength, ZL5011X_RTP_HIGH_HEADER_MAX_LEN, 0, 0, 0, 0);

                  status = ZL5011X_PKT_HEADER_SIZE_ERROR;
               }
            }
         }

         if (status == ZL5011X_OK)
         {
            /* if the ethernet length is being used, then update it now */
            if (layer2and3Header->header.layer2LengthEnable == ZL5011X_TRUE)
            {
               layer2and3Header->header.layer2LengthValue = (Uint16T)(layer2and3Header->header.txLowLength -
                     ZL5011X_PKT_ETHERNET_HDR_LEN);
            }

            /* Check that there is enough data in the original buffer to populate the required headers */
            if ((layer2and3Header->header.txLowLength + layer4and5Header->header.txHighLength) > par->headerLength)
            {
               status = ZL5011X_PKT_HEADER_SIZE_ERROR;
            }
            else
            {
               status = zl5011xCopyHeaders(layer2and3Header, layer4and5Header, par);
            }
         }

         if (status == ZL5011X_OK)
         {
            /* if the layer 3 checksum is enabled (IPv4) and the length field is
               enabled then need to update the checksum to take care of the fact
               that the length field needs to be 0 for the partial checksum.
               This will also impact on the UDP checksum if it is enabled. */
            if ((layer2and3Header->header.layer3ChecksumEnable == ZL5011X_TRUE) &&
                  (layer2and3Header->header.layer3LengthEnable == ZL5011X_TRUE))
            {
               status = zl5011xUpdateIPChecksum(layer2and3Header, layer4and5Header, par);


               if (status == ZL5011X_OK)
               {
                  if ((par->protocolType == ZL5011X_IP_PW_TS) && (par->fixIpv4Header == ZL5011X_TRUE))
                  {
                     Uint32T loop;

                     /* the IP header has been updated so need to refresh this in the PE block,
                        since for IP->PW->TS the IP fields are no longer in the PTX */
                     for (loop = 0; loop < pwShuffle; loop++)
                     {
                        layer4and5Header->header.txHighData[loop] =
                              layer2and3Header->header.txLowData[layer2and3Header->header.txLowLength + loop];
                     }
                  }
               }
            }
         }

         if (cdEnable == ZL5011X_TRUE)
         {
            if (status == ZL5011X_OK)
            {
               /* fill in the CD field in the header */
               status = zl5011xPacketGetWanRxCDHeader(zl5011xParams,
                     par, &temp, cdPos);
            }

            if (status == ZL5011X_OK)
            {
               /* adjust the CD field in the header */
               status = zl5011xPacketChangeField(layer4and5Header->header.txHighData,
                     cdPos, temp, 0xffff, &checksumMod);
            }
         }

         if (status == ZL5011X_OK)
         {
            if (udpEnable == ZL5011X_TRUE)
            {
               /* a UDP header is present, so update the checksum based on the dynamic
                  field positions etc. */
               status = zl5011xUpdateUDPChecksum(layer4and5Header, layer2and3Header, par);
            }
         }
      }
   }

   /* check that the flow type is consistent with the protocol selected. The
      PE block must be included in the flow if the layer 4/5 header is required */
   if (status == ZL5011X_OK)
   {
      switch (zl5011xParams->wanIf.wanRxFlow[par->context])
      {
         case ZL5011X_FLOW_WAN_PE_PKT:
         case ZL5011X_FLOW_CPU_PE_PKT:
         case ZL5011X_FLOW_PKT_PE_PKT:
            /* PE block is included in flow so its header must be specified
               as it does not support addition of zero length headers */
            if (layer4and5Header->header.txHighLength == 0)
            {
               status = ZL5011X_INVALID_FLOW_TYPE;
            }
            break;

         case ZL5011X_FLOW_WAN_PKT:
         case ZL5011X_FLOW_CPU_PKT:
         case ZL5011X_FLOW_PKT_PKT:
            /* PE block is NOT included in flow so if header is specified this is an error */
            if (layer4and5Header->header.txHighLength != 0)
            {
               status = ZL5011X_INVALID_FLOW_TYPE;
            }
            break;

         default:
            /* Flow type does not end in _PKT so is not correct for packet transmit */
            status = ZL5011X_INVALID_FLOW_TYPE;
            break;
      }
   }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费看欧美女人艹b| 亚洲妇熟xx妇色黄| 精品美女在线播放| 欧美电视剧在线看免费| 欧美精品成人一区二区三区四区| 日本乱人伦一区| 欧美日韩久久久| 欧美一区二区在线不卡| 精品久久五月天| 国产婷婷一区二区| 综合久久久久久久| 亚洲一二三四在线观看| 日日骚欧美日韩| 精品写真视频在线观看| 福利一区在线观看| 91黄视频在线观看| 欧美日韩精品一区二区三区蜜桃| 欧美日韩免费一区二区三区视频| 精品视频一区三区九区| 欧美成人一区二区| 国产精品不卡视频| 天天av天天翘天天综合网色鬼国产 | 亚洲一区二区三区影院| 丝袜亚洲精品中文字幕一区| 国产在线播放一区三区四| 成人黄色小视频| 在线成人高清不卡| 国产视频不卡一区| 亚洲国产精品久久一线不卡| 久久91精品久久久久久秒播| av资源站一区| 欧美一区二区三区婷婷月色| 国产精品视频一区二区三区不卡| 一区二区高清免费观看影视大全 | 91精品国产综合久久精品麻豆| 欧美精品一区二区三区久久久| 亚洲三级免费电影| 精品一区二区在线看| 色婷婷激情综合| 久久精品一区二区三区不卡| 一区二区三区四区不卡在线| 国产一区二区三区av电影| 欧美视频你懂的| 国产精品二三区| 狠狠狠色丁香婷婷综合激情| 色综合久久精品| 国产欧美精品在线观看| 日韩中文字幕1| 欧美在线免费播放| 国产精品你懂的在线| 免费在线成人网| 欧美日韩精品一区二区三区| 18涩涩午夜精品.www| 国产一区中文字幕| 欧美电影一区二区| 亚洲一区av在线| 一本色道**综合亚洲精品蜜桃冫| 国产午夜精品一区二区三区四区| 青青草成人在线观看| 在线免费av一区| 亚洲免费av高清| 91视频免费看| 亚洲欧美另类综合偷拍| 成人av免费在线播放| 中文一区二区完整视频在线观看| 久久99精品久久久久久国产越南| 7777精品伊人久久久大香线蕉完整版| 亚洲色图视频网站| 色综合夜色一区| 一区在线中文字幕| 色综合久久久久网| 亚洲另类色综合网站| 日本韩国精品在线| 亚洲五码中文字幕| 91麻豆精品国产91久久久| 亚洲h在线观看| 欧美一区二区三区四区高清 | 国精产品一区一区三区mba视频 | 国产欧美综合在线| 国产v综合v亚洲欧| 国产精品久久综合| 91久久免费观看| 亚洲超碰97人人做人人爱| 欧美日韩专区在线| 日韩高清欧美激情| 久久众筹精品私拍模特| 国产精品99久久久久久似苏梦涵| 国产亚洲精品资源在线26u| 成人白浆超碰人人人人| 亚洲图片你懂的| 欧美精品在线一区二区| 日韩av一区二区三区四区| 精品理论电影在线| 成人综合婷婷国产精品久久蜜臀 | 91极品美女在线| 青青草国产成人av片免费| 国产亚洲短视频| 99久久99精品久久久久久| 一区二区三区在线观看网站| 欧美日韩亚洲综合一区二区三区| 日本不卡免费在线视频| 国产日韩欧美精品电影三级在线| 97久久久精品综合88久久| 五月天欧美精品| 久久综合九色综合97婷婷女人| 91在线精品一区二区| 日产国产欧美视频一区精品| 国产亚洲一区二区三区在线观看| 99国产精品久久久| 另类成人小视频在线| 亚洲欧美日韩一区| 精品久久久久久综合日本欧美| av一区二区三区在线| 麻豆成人久久精品二区三区小说| 欧美国产一区视频在线观看| 欧美蜜桃一区二区三区| 北条麻妃一区二区三区| 精油按摩中文字幕久久| 一区二区不卡在线视频 午夜欧美不卡在| 欧美一区二区女人| 91女人视频在线观看| 国产自产高清不卡| 日韩成人精品在线| 亚洲一区二区在线观看视频| 国产亚洲婷婷免费| 日韩一级片在线观看| 在线这里只有精品| 91在线免费视频观看| 国产一区亚洲一区| 蜜桃视频一区二区| 天堂成人免费av电影一区| 亚洲精品国产成人久久av盗摄 | 国产精品系列在线播放| 琪琪久久久久日韩精品| 亚洲一区二区三区三| 中文字幕一区二区三区蜜月| 精品久久久久久亚洲综合网| 678五月天丁香亚洲综合网| 色呦呦一区二区三区| 99久久免费视频.com| 国产99久久久国产精品| 国产乱一区二区| 国产精品资源网| 国产福利一区在线| 国产精品亚洲综合一区在线观看| 免费观看日韩av| 蜜臀av一区二区在线免费观看 | 在线视频国内一区二区| 99re热这里只有精品免费视频| 国产a精品视频| 成人免费视频免费观看| 波多野结衣亚洲一区| 94色蜜桃网一区二区三区| 91啪在线观看| 欧美日韩国产小视频在线观看| 欧美日韩激情一区| 欧美日本在线观看| 欧美zozo另类异族| 国产日本欧洲亚洲| 一区在线中文字幕| 怡红院av一区二区三区| 亚洲一区在线播放| 奇米综合一区二区三区精品视频| 六月丁香婷婷色狠狠久久| 国产美女在线观看一区| 成人中文字幕电影| 91免费在线看| 欧美高清精品3d| 国产亚洲人成网站| 亚洲人xxxx| 日韩va欧美va亚洲va久久| 国产乱码精品一区二区三区忘忧草 | 99久久精品免费看国产免费软件| 91视频免费观看| 日韩一级片网站| 国产精品网站导航| 亚洲综合偷拍欧美一区色| 日韩av一级片| av亚洲产国偷v产偷v自拍| 欧美午夜精品免费| 亚洲精品一区在线观看| 1024精品合集| 久久国产乱子精品免费女| 成人av在线一区二区| 欧美日韩亚洲综合一区| 久久综合色8888| 亚洲综合在线五月| 国产精品一区二区在线观看不卡| av一区二区三区黑人| 日韩一区二区视频在线观看| 国产精品欧美一区二区三区| 香蕉久久一区二区不卡无毒影院| 国产传媒一区在线| 在线不卡中文字幕播放| 自拍偷拍欧美激情| 国产美女主播视频一区| 欧美日韩夫妻久久| 日韩一区欧美一区| 国产精品一色哟哟哟| 欧美一区二区三级|