資源簡介
TP-LINK TL-WN725N V2 Linux 驅(qū)動安裝
代碼片段和文件信息
/******************************************************************************
?*
?*?Copyright(c)?2007?-?2011?Realtek?Corporation.?All?rights?reserved.
?*????????????????????????????????????????
?*?This?program?is?free?software;?you?can?redistribute?it?and/or?modify?it
?*?under?the?terms?of?version?2?of?the?GNU?General?Public?License?as
?*?published?by?the?Free?Software?Foundation.
?*
?*?This?program?is?distributed?in?the?hope?that?it?will?be?useful?but?WITHOUT
?*?ANY?WARRANTY;?without?even?the?implied?warranty?of?MERCHANTABILITY?or
?*?FITNESS?FOR?A?PARTICULAR?PURPOSE.?See?the?GNU?General?Public?License?for
?*?more?details.
?*
?*?You?should?have?received?a?copy?of?the?GNU?General?Public?License?along?with
?*?this?program;?if?not?write?to?the?Free?Software?Foundation?Inc.
?*?51?Franklin?Street?Fifth?Floor?Boston?MA?02110?USA
?*
?*
?******************************************************************************/
#define?_RTW_BR_EXT_C_
#ifdef?__KERNEL__
#include?
#include?
#include?
#include?
#include?
#include?
#endif
#if?1 //?rtw_wifi_driver
#include?
#include?
#include?“rtw_br_ext.h“
#else //?rtw_wifi_driver
#include?“./8192cd_cfg.h“
#ifndef?__KERNEL__
#include?“./sys-support.h“
#endif
#include?“./8192cd.h“
#include?“./8192cd_headers.h“
#include?“./8192cd_br_ext.h“
#include?“./8192cd_debug.h“
#endif //?rtw_wifi_driver
#ifdef?CL_IPV6_PASS
#ifdef?__KERNEL__
#include?
#include?
#include?
#include?
#endif
#endif
#ifdef?CONFIG_BR_EXT
//#define?BR_EXT_DEBUG
#define?NAT25_IPV4 01
#define?NAT25_IPV6 02
#define?NAT25_IPX 03
#define?NAT25_APPLE 04
#define?NAT25_PPPOE 05
#define?RTL_RELAY_TAG_LEN?(ETH_ALEN)
#define?TAG_HDR_LEN 4
#define?MAGIC_CODE 0x8186
#define?MAGIC_CODE_LEN 2
#define?WAIT_TIME_PPPOE 5 //?waiting?time?for?pppoe?server?in?sec
/*-----------------------------------------------------------------
??How?database?records?network?address:
???????????0????1????2????3????4????5????6????7????8????9???10
????????|----|----|----|----|----|----|----|----|----|----|----|
??IPv4??|type|?????????????????????????????|??????IP?addr??????|
??IPX???|type|??????Net?addr?????|??????????Node?addr??????????|
??IPX???|type|??????Net?addr?????|Sckt?addr|
??Apple?|type|?Network?|node|
??PPPoE?|type|???SID???|???????????AC?MAC????????????|
-----------------------------------------------------------------*/
//Find?a?tag?in?pppoe?frame?and?return?the?pointer
static?__inline__?unsigned?char?*__nat25_find_pppoe_tag(struct?pppoe_hdr?*ph?unsigned?short?type)
{
unsigned?char?*cur_ptr?*start_ptr;
unsigned?short?tagLen?tagType;
start_ptr?=?cur_ptr?=?(unsigned?char?*)ph->tag;
while((cur_ptr?-?start_ptr)?length))?{
//?prevent?un-alignment?access
tagType?=?(unsigned?short)((cur_ptr[0]?<8)?+?cur_ptr[1]);
tagLen??=?(unsigned?short)((cur_ptr[2]?<8)?+?cur_ptr[3]
評論
共有 條評論