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

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

?? pppframe.c

?? wince3.0的源碼
?? C
字號:
/*++

Copyright (c) 1993-2000 Microsoft Corporation.  All rights reserved.

Module Name:

    pppframe.c

Abstract:

Environment:

--*/

#include "windows.h"
#include "tapi.h"
#include "ndis.h"
#include "ndiswan.h"
#include "ndistapi.h"
#include "asyncmac.h"
#include "frame.h"

VOID
AssemblePPPFrame(
	IN		PASYNCMAC_OPEN_LINE pOpenLine,
	IN	OUT	PNDIS_WAN_PACKET	WanPacket)
//
//	Perform Async encapsulation of the PPP frame data which transforms it:
//
//             +---------------------+
//             | PPP frame data      |
//             +---------------------+
//            /                       \
//           /                         \
//       +--+---------------------------+-----------+--+
//       |7E| Escaped PPP frame data    |Escaped CRC|7E|
//       +--+---------------------------+-----------+--+
//
//	The transformation is done within the WanPacket buffer.
//	Recall that in the function MpInit we set the HeaderPadding in the WAN_INFO structure
//	to a sufficient size to allow for the addition of the leading flag and the expansion
//  of the PPP frame data.  Also, the TailPadding was set to allow for the addition of
//  the escaped CRC and trailing flag.
//
{
	PUCHAR		pOldFrame;
	PUCHAR		pNewFrame;
	USHORT		crcData;
	int			dataSize;
	ULONG		bmACCM;
	UCHAR		c;

	ASSERT(WanPacket->StartBuffer   <= WanPacket->EndBuffer);
	ASSERT(WanPacket->StartBuffer   <= WanPacket->CurrentBuffer);
	ASSERT(WanPacket->CurrentBuffer + WanPacket->CurrentLength <= WanPacket->EndBuffer);

	//
	// Initialize locals
	//

    pOldFrame = WanPacket->CurrentBuffer;

    pNewFrame = WanPacket->StartBuffer;

	//
	// for quicker access, get a copy of data length field
	//
	dataSize = WanPacket->CurrentLength;

	bmACCM = pOpenLine->WanLinkInfo.SendACCM;


//
//
// Now we run through the entire frame and pad it FORWARDS...
//
// <------------- new frame -----------> (could be twice as large)
// +-----------------------------------+
// |                                 |x|
// +-----------------------------------+
//									  ^
// <---- old frame -->	   	    	  |
// +-----------------+				  |
// |			   |x|                |
// +-----------------+				  |
//					|				  |
//                  \-----------------/
//
// so that we don't overrun ourselves
//
//-----------------------------------------------------------------------
//
//         +----------+----------+----------+----------+------------
//         |   Flag   | Address  | Control  | Protocol | Information
//         | 01111110 | 11111111 | 00000011 | 16 bits  |      *
//         +----------+----------+----------+----------+------------
//                 ---+----------+----------+-----------------
//                    |   FCS    |   Flag   | Inter-frame Fill
//                    | 16 bits  | 01111110 | or next Address
//                 ---+----------+----------+-----------------
//
//
// Frame Check Sequence (FCS) Field
//
//   The Frame Check Sequence field is normally 16 bits (two octets).  The
//   use of other FCS lengths may be defined at a later time, or by prior
//   agreement.
//
//   The FCS field is calculated over all bits of the Address, Control,
//   Protocol and Information fields not including any start and stop bits
//   (asynchronous) and any bits (synchronous) or octets (asynchronous)
//   inserted for transparency.  This does not include the Flag Sequences
//   or the FCS field itself.  The FCS is transmitted with the coefficient
//   of the highest term first.
//
//      Note: When octets are received which are flagged in the Async-
//      Control-Character-Map, they are discarded before calculating the
//      FCS.  See the description in Appendix A.
//
//
//	RFC 1331                Point-to-Point Protocol                 May 1992
//  Transparency
//
//      On asynchronous links, a character stuffing procedure is used.
//      The Control Escape octet is defined as binary 01111101
//      (hexadecimal 0x7d) where the bit positions are numbered 87654321
//      (not 76543210, BEWARE).
//
//      After FCS computation, the transmitter examines the entire frame
//      between the two Flag Sequences.  Each Flag Sequence, Control
//      Escape octet and octet with value less than hexadecimal 0x20 which
//      is flagged in the Remote Async-Control-Character-Map is replaced
//      by a two octet sequence consisting of the Control Escape octet and
//      the original octet with bit 6 complemented (i.e., exclusive-or'd
//      with hexadecimal 0x20).
//
//      Prior to FCS computation, the receiver examines the entire frame
//      between the two Flag Sequences.  Each octet with value less than
//      hexadecimal 0x20 is checked.  If it is flagged in the Local
//      Async-Control-Character-Map, it is simply removed (it may have
//      been inserted by intervening data communications equipment).  For
//      each Control Escape octet, that octet is also removed, but bit 6
//      of the following octet is complemented.  A Control Escape octet
//      immediately preceding the closing Flag Sequence indicates an
//      invalid frame.
//
//         Note: The inclusion of all octets less than hexadecimal 0x20
//         allows all ASCII control characters [10] excluding DEL (Delete)
//         to be transparently communicated through almost all known data
//         communications equipment.
//
//
//      The transmitter may also send octets with value in the range 0x40
//      through 0xff (except 0x5e) in Control Escape format.  Since these
//      octet values are not negotiable, this does not solve the problem
//      of receivers which cannot handle all non-control characters.
//      Also, since the technique does not affect the 8th bit, this does
//      not solve problems for communications links that can send only 7-
//      bit characters.
//
//      A few examples may make this more clear.  Packet data is
//      transmitted on the link as follows:
//
//         0x7e is encoded as 0x7d, 0x5e.
//         0x7d is encoded as 0x7d, 0x5d.
//
//         0x01 is encoded as 0x7d, 0x21.
//
//      Some modems with software flow control may intercept outgoing DC1
//      and DC3 ignoring the 8th (parity) bit.  This data would be
//      transmitted on the link as follows:
//
//         0x11 is encoded as 0x7d, 0x31.
//         0x13 is encoded as 0x7d, 0x33.
//         0x91 is encoded as 0x7d, 0xb1.
//         0x93 is encoded as 0x7d, 0xb3.
//


	//
	// Calculate 16 bit CRC on original (unescaped) data
	//
	crcData = CalcCRCPPP(pOldFrame,	dataSize) ^ 0xFFFF;

	*pNewFrame++ = PPP_FLAG_BYTE; // 0x7e - mark beginning of frame

	//
	// Copy oldFrame to newFrame, escaping all ACCM, ESC, and FLAG chars
	//
	while (dataSize-- > -2)
	{
		if (dataSize >= 0)			// get current byte in frame
			c = *pOldFrame++;
		else if (dataSize == -1)	// First (LSB) CRC byte	
			c = (UCHAR)crcData;
		else // (dataSize == -2)	// Second (MSB) CRC byte	
			c = (UCHAR)(crcData >> 8);

		//
		// Check if we have to escape out this byte or not
		//
		if (c == PPP_ESC_BYTE
		||  c == PPP_FLAG_BYTE
		||	(bmACCM && (c < 32) && (bmACCM & (1 << c)) ) )
		{
			*pNewFrame++ = PPP_ESC_BYTE;
			c = c ^ 0x20;
		}

		*pNewFrame++ = c;
	}

	//
	// Mark end of frame
	//
	*pNewFrame++ = PPP_FLAG_BYTE;


	//
	// Calc how many bytes we expanded to including CRC and flags
	//
	WanPacket->CurrentLength = (ULONG)(pNewFrame - WanPacket->StartBuffer);

	//
	// Put in the adjusted length -- actual num of bytes to send
	//

	WanPacket->CurrentBuffer = WanPacket->StartBuffer;

	DEBUGMSG(ZONE_SEND, (TEXT("-AssemblePPPFrame: Frame: start=%x end=%x length=%x\n"), WanPacket->CurrentBuffer, pNewFrame, WanPacket->CurrentLength));

	ASSERT(WanPacket->CurrentBuffer + WanPacket->CurrentLength <= WanPacket->EndBuffer);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美精品一区aⅴ影院| 麻豆91精品视频| 五月婷婷久久丁香| 国产成人av一区二区三区在线| 欧美在线观看视频在线| 精品三级在线观看| 日韩精品一卡二卡三卡四卡无卡| 成人深夜视频在线观看| 欧美大片拔萝卜| 午夜电影一区二区| 在线观看视频91| 亚洲欧美日韩成人高清在线一区| 国产精品888| 久久久亚洲国产美女国产盗摄| 日本午夜一本久久久综合| 99国内精品久久| 亚洲国产岛国毛片在线| 亚洲v中文字幕| 成人高清伦理免费影院在线观看| 久久综合色8888| 国产在线视频不卡二| 日韩欧美一二区| 裸体健美xxxx欧美裸体表演| 91精品国产一区二区三区香蕉| 午夜在线电影亚洲一区| 欧美午夜寂寞影院| 亚洲香肠在线观看| 在线视频综合导航| 亚洲制服欧美中文字幕中文字幕| 色一区在线观看| 亚洲最新视频在线观看| 欧美中文字幕不卡| 亚洲成av人片一区二区| 欧美一区二区三区白人| 九九精品视频在线看| 精品国产一区二区三区四区四| 免费不卡在线观看| xnxx国产精品| 成人午夜av在线| 国产精品二三区| 欧美色精品天天在线观看视频| 天天av天天翘天天综合网色鬼国产| 欧美丝袜丝交足nylons| 午夜视频一区二区| 精品入口麻豆88视频| 国产成人免费在线| 亚洲六月丁香色婷婷综合久久| 欧美亚洲丝袜传媒另类| 免费在线看成人av| 久久久久久久电影| 日本道免费精品一区二区三区| 午夜欧美大尺度福利影院在线看| 精品国产91乱码一区二区三区| 国产精品一区专区| 亚洲天天做日日做天天谢日日欢 | 亚洲电影视频在线| 7777精品伊人久久久大香线蕉的| 麻豆精品在线播放| 中文字幕乱码一区二区免费| 精品视频一区三区九区| 精油按摩中文字幕久久| 亚洲欧洲日本在线| 91精品国产aⅴ一区二区| 国产成人午夜精品影院观看视频 | 久久精品视频一区| 一本久道中文字幕精品亚洲嫩| 五月天丁香久久| 欧美韩国日本一区| 91 com成人网| 国产69精品久久777的优势| 亚洲成人自拍一区| 日本一区二区三区dvd视频在线| 欧美性生活大片视频| 国内精品在线播放| 婷婷国产在线综合| 亚洲图片激情小说| 一区二区三区精品| wwwwww.欧美系列| 欧美亚洲免费在线一区| 成人免费福利片| 蜜臀av国产精品久久久久 | 欧美日韩在线不卡| 成人黄色免费短视频| 日韩av中文字幕一区二区| 中文字幕综合网| 久久久www成人免费毛片麻豆| 欧美日本在线视频| 色偷偷久久一区二区三区| 国产成人综合在线播放| 日韩成人一级片| 午夜天堂影视香蕉久久| 亚洲精品网站在线观看| 国产精品久久三| 久久一区二区三区四区| 日韩一区和二区| 欧美日韩国产综合久久| 91久久国产最好的精华液| av色综合久久天堂av综合| 国产精品一线二线三线| 激情六月婷婷综合| 毛片不卡一区二区| 日韩激情视频在线观看| 亚洲大型综合色站| 亚洲福利一二三区| 亚洲成人在线免费| 午夜av区久久| 亚洲福利一二三区| 天堂av在线一区| 视频一区二区中文字幕| 亚洲mv在线观看| 日韩精品成人一区二区三区| 首页国产丝袜综合| 日韩成人免费在线| 免费成人在线影院| 久久精品免费看| 极品瑜伽女神91| 国产尤物一区二区在线| 国产一区二区中文字幕| 丁香桃色午夜亚洲一区二区三区| 国产乱对白刺激视频不卡| 风间由美一区二区三区在线观看| 国产91精品久久久久久久网曝门| 成人午夜在线免费| 一本大道久久a久久综合| 欧美午夜精品一区二区蜜桃| 欧美精品视频www在线观看| 欧美一区午夜视频在线观看 | 久久99久久久久久久久久久| 久久精品国产99| 高潮精品一区videoshd| 色香色香欲天天天影视综合网| 在线视频欧美区| 欧美一区二区视频在线观看2022| 久久综合色婷婷| 自拍偷拍亚洲欧美日韩| 丝袜诱惑制服诱惑色一区在线观看 | 欧美福利一区二区| 日韩欧美国产系列| 国产精品短视频| 丝袜美腿亚洲色图| 国产成人亚洲精品青草天美| 日本国产一区二区| 色先锋aa成人| 欧美一级在线免费| 国产精品毛片a∨一区二区三区| 亚洲日本青草视频在线怡红院| 亚洲一本大道在线| 国产高清亚洲一区| 欧洲一区二区三区免费视频| 欧美不卡在线视频| 欧美国产精品久久| 日韩成人一区二区三区在线观看| 国产成人免费xxxxxxxx| 欧美精品日韩一区| 国产精品久久免费看| 日本在线播放一区二区三区| 粉嫩一区二区三区在线看| 欧美日韩国产另类一区| 中文字幕 久热精品 视频在线 | 欧美老肥妇做.爰bbww| 久久久久久免费| 亚洲一级二级三级在线免费观看| 国产精品自拍在线| 欧美一区二区成人6969| 亚洲精品日韩一| 国产精品一区二区无线| 欧美日本高清视频在线观看| 国产精品第13页| 国产一区二区三区蝌蚪| 69av一区二区三区| 亚洲综合区在线| 成人久久18免费网站麻豆| 欧美tickle裸体挠脚心vk| 亚洲成av人影院在线观看网| 99国产精品久| 中文字幕第一区第二区| 久久99精品久久久久久国产越南 | 日本美女一区二区三区| 色婷婷综合在线| 亚洲国产激情av| 国产精品18久久久久久久网站| 欧美一区二区三区四区高清| 亚洲一区二区不卡免费| 97se亚洲国产综合自在线不卡| 精品国产乱码久久久久久久久| 亚洲五码中文字幕| 欧美亚一区二区| 一区二区三区在线看| 色综合久久久久综合体| 亚洲三级理论片| 99精品热视频| 亚洲伦在线观看| 欧美亚洲动漫另类| 亚洲成人一二三| 7777精品久久久大香线蕉| 日韩—二三区免费观看av| 91精品蜜臀在线一区尤物| 男女男精品网站| 久久影院午夜片一区| 国产成人一区在线|