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

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

?? zl5011xpackettx.c

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

 Function:
   zl5011xAddCDHeader

 Description:
   Modify the structure information passed in to setup header for
   Context Descriptor

 Inputs:
   layer2and3Header  Pointer to zl5011xLanTxSetLayer2and3HeaderS structure to
                     check CD position
   layer4and5Header  Pointer to zl5011xLanTxSetLayer4and5HeaderS structure to
                     check CD position
   par               Pointer to the zl5011xPacketTxSetHeaderS structure.

 Outputs:
   None

 Returns:
   zlStatusE

 Remarks:
   None

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

zlStatusE zl5011xAddCDHeader(zl5011xLanTxSetLayer2and3HeaderS *layer2and3Header,
      zl5011xLanTxSetLayer4and5HeaderS *layer4and5Header, zl5011xPacketTxSetHeaderS *par,
      Uint8T *cdPos)
{
   zlStatusE status = ZL5011X_OK;
   zl5011xBooleanE noHighHeader = ZL5011X_FALSE;

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

   if (par->protocolType == ZL5011X_IP_UDP_CD)
   {
      /* if CD is being used on top of UDP, then it must immediately
         follow the UDP header */
      par->contextDescriptorOffset = layer4and5Header->header.txHighLength +
            layer2and3Header->header.txLowLength;
   }
   else
   {
      if (par->contextDescriptorOffset == (Uint32T)ZL5011X_INVALID)
      {
         par->contextDescriptorOffset = par->headerLength - ZL5011X_PKT_CD_HDR_LEN;
      }
   }

   if ((par->headerLength < (par->contextDescriptorOffset + ZL5011X_PKT_CD_HDR_LEN)) ||
         ((Uint8T)par->contextDescriptorOffset < (layer4and5Header->header.txHighLength + layer2and3Header->header.txLowLength)))
   {
      status = ZL5011X_PARAMETER_INVALID;
   }
   else
   {
      if (par->contextDescriptorTeardown == ZL5011X_TRUE)
      {
         /* setting the silence control to 0, will allow only one packet to be transmitted
            by the RTP block. After this packet, the RTP will discard all further packets */
         layer4and5Header->header.highSilenceCtrl = 0;
      }

      /* if there is no high header at the moment, then remember since that allows
         more tweaking of the low and high header lengths */
      if (layer4and5Header->header.txHighLength == 0)
      {
         noHighHeader = ZL5011X_TRUE;

         /* put the CD field at the start of the header in the RTP block */
         layer2and3Header->header.txLowLength = (Uint8T)par->contextDescriptorOffset;
         layer4and5Header->header.txHighLength = (Uint8T)(par->headerLength - par->contextDescriptorOffset);
      }
      else
      {
         /* leave the RTP header as it is, but change the length to
            account for the CD + padding */
         layer4and5Header->header.txHighLength = (Uint8T)(par->headerLength - layer2and3Header->header.txLowLength);
      }
   }

   if (status == ZL5011X_OK)
   {
      if (noHighHeader == ZL5011X_TRUE)
      {
         /* can only include an even number of bytes in the RTP block */
         if ((layer4and5Header->header.txHighLength % 2) == 1)
         {
            layer2and3Header->header.txLowLength--;
            layer4and5Header->header.txHighLength++;
         }
      }

      /* return the position of the CD header in the RTP header */
      *cdPos = (Uint8T)(par->contextDescriptorOffset - layer2and3Header->header.txLowLength);
   }

   return(status);
}

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

 Function:
   zl5011xUpdateIPChecksum

 Description:
   In IPv4 mode, the checksum needs to be presented to the device, based on the
   length and the identification fields being zero for the partial checksum.
   This function re-calculates the checksum based on these fields being zero.

 Inputs:
    layer2and3Header  Pointer to the zl5011xLanTxSetLayer2and3HeaderS structure.
    par               Pointer to the zl5011xPacketTxSetHeaderS structure.

 Outputs:
    None

 Returns:
    zlStatusE

 Remarks:
   The PTX uses the length field from a seperate register in the control
   header. The value in the header itself is as set by the calling function
   - and as used for calculating the checksum. So, change this field to
   zero and re-calculate the checksum.

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

zlStatusE zl5011xUpdateIPChecksum(zl5011xLanTxSetLayer2and3HeaderS *layer2and3Header,
      zl5011xLanTxSetLayer4and5HeaderS *layer4and5Header,
      zl5011xPacketTxSetHeaderS * par)
{
   zlStatusE status = ZL5011X_OK;
   Uint16T chkChange, tempPos, newLength = 0;

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

   chkChange = 0;

   if (par->fixIpv4Header == ZL5011X_TRUE)
   {
      /* check that the payload length is non-zero, to be sure that a value
         has been set */
      if (par->payloadLength == 0)
      {
         status = ZL5011X_PARAMETER_INVALID;
      }
      else
      {
         newLength = layer2and3Header->header.layer3LengthValue +
               layer4and5Header->header.txHighLength + par->payloadLength;
      }
   }
   else
   {
      newLength = 0;
   }

   if (status == ZL5011X_OK)
   {
      /* change the length field to 0 */
      status = zl5011xPacketChangeField(layer2and3Header->header.txLowData,
            layer2and3Header->header.layer3LengthPos,
            newLength, 0xffff, &chkChange);
   }

   if (status == ZL5011X_OK)
   {
      if (par->fixIpv4Header != ZL5011X_TRUE)
      {
         /* change the identification field to 0 */
         tempPos = layer2and3Header->header.layer3LengthPos + (ZL5011X_PKT_IPV4_IDENT_POS - ZL5011X_PKT_IPV4_LEN_POS);
         layer2and3Header->header.txLowData[tempPos] = 0;
         layer2and3Header->header.txLowData[tempPos + 1] = 0;
      }

      /* change the checksum field to 0 */
      tempPos = layer2and3Header->header.layer3ChecksumPos;
      layer2and3Header->header.txLowData[tempPos] = 0;
      layer2and3Header->header.txLowData[tempPos + 1] = 0;

      /* calculate the checksum */
      status = zl5011xPacketCalculateChecksum(layer2and3Header->header.txLowData + tempPos - ZL5011X_PKT_IPV4_CHKSUM_POS,
            ZL5011X_PKT_IPV4_HDR_LEN, &chkChange);


      if (par->fixIpv4Header == ZL5011X_TRUE)
      {
         /* disable the IPv4 dynamic fields if the header is to be fixed */
         layer2and3Header->header.layer3LengthEnable = ZL5011X_FALSE;
         layer2and3Header->header.layer3ChecksumEnable = ZL5011X_FALSE;

         /* insert the checksum into the header, inverting as required for the partial checksum */
         layer2and3Header->header.txLowData[tempPos] = (chkChange >> 8) & 0xff;
         layer2and3Header->header.txLowData[tempPos + 1] = (chkChange >> 0) & 0xff;
      }
      else
      {
         /* insert the checksum into the header, inverting as required for the partial checksum */
         layer2and3Header->header.txLowData[tempPos] = (~chkChange >> 8) & 0xff;
         layer2and3Header->header.txLowData[tempPos + 1] = (~chkChange >> 0) & 0xff;
      }
   }

   return(status);
}

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

 Function:
   zl5011xUpdateUDPChecksum

 Description:
   The UDP checksum needs to be presented to the device, based on the
   length and any subsequent header fields being zero for the partial checksum.
   This function, amends the checksum based on these fields being zero.

 Inputs:
   layer4and5Header  Pointer to the zl5011xLanTxSetLayer4and5HeaderS structure.
   layer2and3Header  Pointer to the zl5011xLanTxSetLayer2and3HeaderS structure.
   par               Pointer to the zl5011xPacketTxSetHeaderS structure.

 Outputs:
    None

 Returns:
    zlStatusE

 Remarks:
   None

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

zlStatusE zl5011xUpdateUDPChecksum(zl5011xLanTxSetLayer4and5HeaderS *layer4and5Header,
      zl5011xLanTxSetLayer2and3HeaderS *layer2and3Header, zl5011xPacketTxSetHeaderS *par)
{
   zlStatusE status = ZL5011X_OK;
   Uint16T chkChange, temp, ipStart;
   Uint8T tempHeader[ZL5011X_PTX_LOW_HEADER_MAX_LEN + ZL5011X_RTP_HIGH_HEADER_MAX_LEN + 16];
   Uint16T newLength = layer4and5Header->header.txHighLength + par->payloadLength - 2;

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

   /* if the UDP checksum is required then need to take care of the dynamic fields */
   if (par->enableUDPChecksum == ZL5011X_TRUE)
   {
      if (layer4and5Header->header.layer4LengthEnable == ZL5011X_FALSE)
      {
         /* have a checksum but no length - this means that the UDP header has been shuffled!!
            need to set the correct value for UDP in the header since the dynamic field is
            not enabled. Also need to offset the checksum calculation, since the length the
            device will use is too low */

         layer4and5Header->header.txHighData[layer4and5Header->header.layer4LengthPos] = (Uint8T)(newLength >> 8);
         layer4and5Header->header.txHighData[layer4and5Header->header.layer4LengthPos + 1] = (Uint8T)newLength;
      }

      temp = layer4and5Header->header.txHighLength;

      memcpy(tempHeader, layer4and5Header->header.txHighData, temp);

      /* if the length is an odd number of bytes, then round up to the next 16 bit word */
      if ((temp & 1) != 0)
      {
         tempHeader[temp++] = 0;
      }

      if (layer4and5Header->header.layer4LengthEnable == ZL5011X_FALSE)
      {
         /* the last 2 bytes from the PTX have been shifted into the PE block.
            Need to remove them or they will affect the checksum calculation -
            overwrite them with the length, which is needed for the pseudo header */
         tempHeader[0] = (Uint8T)(newLength >> 8);
         tempHeader[1] = (Uint8T)newLength;
      }
      else
      {
         /* zero out the length field for the calculation */
         tempHeader[layer4and5Header->header.layer4LengthPos] = 0;
         tempHeader[layer4and5Header->header.layer4LengthPos + 1] = 0;
      }

      /* zero out the checksum field for the calculation */
      tempHeader[layer4and5Header->header.layer4ChecksumPos] = 0;
      tempHeader[layer4and5Header->header.layer4ChecksumPos + 1] = 0;

      /* zero out the sequence number field for the calculation */
      if (layer4and5Header->header.layer5SequenceNumEnable == ZL5011X_TRUE)
      {
         tempHeader[layer4and5Header->header.layer5SequenceNumPos] = 0;

         if (layer4and5Header->header.layer5SequenceNum16bit == ZL5011X_TRUE)
         {
            tempHeader[layer4and5Header->header.layer5SequenceNumPos + 1] = 0;
         }
      }

      /* zero out the timestamp field for the calculation */
      if (layer4and5Header->header.layer5TimestampEnable == ZL5011X_TRUE)
      {
         tempHeader[layer4and5Header->header.layer5TimestampPos] = 0;
         tempHeader[layer4and5Header->header.layer5TimestampPos + 1] = 0;

         if (layer4and5Header->header.layer5Timestamp32bit == ZL5011X_TRUE)
         {
            tempHeader[layer4and5Header->header.layer5TimestampPos + 2] = 0;
            tempHeader[layer4and5Header->header.layer5TimestampPos + 3] = 0;
         }
      }

      /* tack the pseudo header fields onto the end of the array */
      if (par->ipVer4 == ZL5011X_TRUE)
      {
         ipStart = layer2and3Header->header.layer3LengthPos - ZL5011X_PKT_IPV4_L

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品人人爽人人爽| 91视频在线观看免费| 欧美激情一区二区三区在线| 欧洲人成人精品| 91丨九色丨尤物| 99视频超级精品| 丁香激情综合五月| 精品综合免费视频观看| 亚洲精品国产无套在线观| 国产亚洲欧美一级| 2022国产精品视频| 精品国精品国产尤物美女| 91精品国产综合久久国产大片| 欧美中文字幕亚洲一区二区va在线 | 天天做天天摸天天爽国产一区 | 欧美系列亚洲系列| 精品在线播放免费| 久久精品国产一区二区三区免费看| 亚洲免费看黄网站| 亚洲激情自拍视频| 亚洲最新在线观看| 午夜精品福利一区二区蜜股av| 亚洲午夜激情网站| 天天av天天翘天天综合网| 亚洲成人www| 天天亚洲美女在线视频| 午夜精品久久久久久久| 天堂久久一区二区三区| 亚洲私人影院在线观看| 中文字幕一区二区三区在线播放| 国产精品网友自拍| 亚洲丝袜制服诱惑| 亚洲综合免费观看高清完整版在线 | 国产精品久久综合| 亚洲欧洲日韩在线| 亚洲久本草在线中文字幕| 一区二区三区四区在线播放| 午夜精品视频在线观看| 美女视频免费一区| 成人av网站在线观看| 在线一区二区视频| 日韩欧美激情在线| 欧美日本韩国一区二区三区视频| 91精品国产综合久久精品麻豆| 日韩精品一区二区三区四区视频 | 亚洲国产精品黑人久久久| 亚洲天堂2014| 美女久久久精品| 不卡的电视剧免费网站有什么| 色综合夜色一区| 日韩欧美亚洲另类制服综合在线| 久久久国产精品不卡| 一区二区视频在线| 麻豆精品视频在线观看| 成人黄页在线观看| 欧美揉bbbbb揉bbbbb| 日韩精品综合一本久道在线视频| 国产欧美日本一区二区三区| 亚洲国产aⅴ成人精品无吗| 国产伦理精品不卡| 91福利区一区二区三区| 精品蜜桃在线看| 一二三区精品视频| 国产福利精品导航| 欧美一级xxx| 中文字幕一区二区三区不卡在线| 一区二区三区成人| 丰满岳乱妇一区二区三区 | 一区二区三区在线观看动漫| 激情六月婷婷综合| 欧美日韩国产小视频在线观看| 久久久久久日产精品| 日本女人一区二区三区| 91九色最新地址| 久久亚洲春色中文字幕久久久| 亚洲欧洲一区二区在线播放| 亚洲五码中文字幕| 色妹子一区二区| 中文字幕亚洲不卡| 国产精品系列在线观看| 日韩欧美一卡二卡| 免费在线一区观看| 欧美精品在线一区二区| 亚洲影院理伦片| 91免费观看在线| 亚洲精品在线免费播放| 亚洲免费观看高清完整版在线 | 成人性生交大合| 久久久五月婷婷| 久久精品国产免费看久久精品| 欧美三级电影在线看| 亚洲一区二区三区激情| 色婷婷综合中文久久一本| 国产精品久久久久久久久动漫| 风间由美一区二区av101 | 无码av免费一区二区三区试看| 国产精品456露脸| 久久九九国产精品| 丁香六月久久综合狠狠色| 欧美精品第1页| 久久成人麻豆午夜电影| 欧美精品一区二区在线观看| 久久国内精品视频| 久久九九久精品国产免费直播| 粉嫩aⅴ一区二区三区四区| 中国av一区二区三区| 91老师国产黑色丝袜在线| 亚洲欧美一区二区三区极速播放 | 极品少妇一区二区三区精品视频| 欧美电影精品一区二区| 国内不卡的二区三区中文字幕| 久久精品一区二区三区四区| bt欧美亚洲午夜电影天堂| 久久夜色精品一区| 91视频免费播放| 亚洲成在线观看| 制服视频三区第一页精品| 国产原创一区二区三区| 国产欧美一区二区精品忘忧草| av电影在线观看一区| 亚洲成a人v欧美综合天堂下载| 91精品国产色综合久久不卡电影 | 日韩国产欧美三级| 久久精品一区八戒影视| 91在线你懂得| 美女在线视频一区| 亚洲色图欧美偷拍| 日韩你懂的在线播放| av高清久久久| 蜜臂av日日欢夜夜爽一区| 亚洲欧洲av在线| 日韩欧美激情四射| 国产自产2019最新不卡| 亚洲精品视频在线看| 日韩三级视频在线观看| av一本久道久久综合久久鬼色| 日韩 欧美一区二区三区| 国产欧美日韩另类视频免费观看| 色综合 综合色| 国产一区二区三区综合| 午夜久久久影院| 亚洲视频免费在线观看| 久久综合五月天婷婷伊人| 日韩欧美一级二级三级| 91精品国产综合久久久久| 欧美高清性hdvideosex| 欧美影院一区二区三区| 一本一道久久a久久精品| 99国产精品国产精品久久| 丰满亚洲少妇av| 成人激情小说乱人伦| 成人一区二区三区在线观看| 国产99精品在线观看| 国产不卡在线一区| 成人午夜视频福利| 欧美日韩精品是欧美日韩精品| 99精品久久99久久久久| eeuss影院一区二区三区| 99精品视频在线播放观看| 一本在线高清不卡dvd| 在线观看国产精品网站| 欧美中文字幕一区二区三区亚洲| 欧美日韩日本视频| 日韩一二三四区| 337p粉嫩大胆噜噜噜噜噜91av| 精品成人在线观看| 国产精品白丝在线| 亚洲黄色性网站| 免费观看在线综合色| 国产精品888| 97精品久久久久中文字幕 | 久久久久久久久久久久电影| 久久久美女艺术照精彩视频福利播放| 欧美国产一区在线| 亚洲精品国产高清久久伦理二区| 午夜久久电影网| 国产精品18久久久久久久久久久久| 国产99久久久国产精品| 欧美影视一区在线| 久久综合成人精品亚洲另类欧美| 国产精品国模大尺度视频| 亚洲一二三四在线观看| 久久精品国产亚洲一区二区三区| 国产经典欧美精品| 欧美性猛交一区二区三区精品| 日韩免费看的电影| 中文字幕一区二区三区乱码在线| 天堂在线一区二区| 成人av在线电影| 欧美一区二区三区啪啪| 国产精品三级电影| 乱一区二区av| 色综合久久天天| 26uuu精品一区二区三区四区在线| 亚洲欧洲制服丝袜| 国产成人免费视频一区| 欧美日韩电影在线| 国产精品夫妻自拍| 国产在线精品不卡| 7799精品视频|