⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vnet.h

📁 atmel芯片的Linux驱动程序。很多802.11协议的无限网卡都使用该芯片
💻 H
字号:
/***************************************************************************************	Copyright 2000-2001 ATMEL Corporation.		This file is part of atmel wireless lan drivers.    Atmel wireless lan drivers is free software; you can redistribute it and/or modify    it under the terms of the GNU General Public License as published by    the Free Software Foundation; either version 2 of the License, or    (at your option) any later version.    Atmel wireless lan drivers 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 Atmel wireless lan drivers; if not, write to the Free Software    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA**************************************************************************************/#include <sys/types.h>#include <sys/ioctl.h>#include <stdio.h>#include <errno.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <netdb.h>		/* gethostbyname, getnetbyname */#include <getopt.h>#include <linux/if_arp.h>	/* For ARPHRD_ETHER */#include <linux/socket.h>	/* For AF_INET & struct sockaddr */#include "vnetioctl.h"//#include "frame.h"#include <linux/wireless.h>#include <termios.h>#include <ncurses.h>WINDOW *exit_win;WINDOW *set_win;WINDOW *justa_win;WINDOW *conf_win;WINDOW *wep_win;#define ifr_name	ifr_ifrn.ifrn_name	/* interface name 	*/#define ifr_hwaddr	ifr_ifru.ifru_hwaddr	/* MAC address 		*/#define	ifr_addr	ifr_ifru.ifru_addr	/* address		*/#define MAX_SSID_LENGTH			32#define SHORT_WEP_KEY_SIZE		5#define LONG_WEP_KEY_SIZE		13#define WEP_DISABLED			0#define WEP_64BIT			1#define WEP_128BIT			2#define SITE_SURVEY_IDLE 0#define SITE_SURVEY_IN_PROGRESS 1#define SITE_SURVEY_COMPLETED 2typedef char CHAR;typedef unsigned char 	UCHAR;typedef unsigned short 	USHORT;typedef unsigned long 	ULONG;typedef unsigned int 	UINT;typedef unsigned char* 	PUCHAR;typedef unsigned short*	PUSHORT;typedef int	 	BOOLEAN;typedef void		VOID;typedef struct termios KB_SETTINGS;char ifname[10];typedef struct iw_statistics	iwstats;typedef struct iw_range		iwrange;typedef struct iw_freq		iwfreq;typedef struct iw_priv_args	iwprivargs;typedef struct sockaddr		sockaddr; #ifndef ATMEL_WLANtypedef struct __ENCRYPTION_INFO{	UCHAR						WepKeyToUse;	UCHAR						WepMode;	USHORT						AuthenticationType;	UCHAR						EncryptionLevel;					//0:Disabled,1:64bit,2:128 bit	UCHAR						WepKey1[LONG_WEP_KEY_SIZE];	UCHAR						WepKey2[LONG_WEP_KEY_SIZE];	UCHAR						WepKey3[LONG_WEP_KEY_SIZE];	UCHAR						WepKey4[LONG_WEP_KEY_SIZE];} ENCRYPTION_INFO, *PENCRYPTION_INFO;#else#define CIPHER_SUITE_NONE 0#define CIPHER_SUITE_WEP_64 1#define CIPHER_SUITE_TKIP 2#define CIPHER_SUITE_AES  3#define CIPHER_SUITE_CCX  4#define CIPHER_SUITE_WEP_128  5typedef struct __ENCRYPTION_INFO{	UCHAR	WepKeyToUse;	UCHAR	WepMode;	USHORT	AuthenticationType;	UCHAR	EncryptionLevel;		//0:Disabled, 1:64bit, 2:128 bit  UCHAR	GroupKeyIndex;  UCHAR	PairwiseKeyIndex;  UCHAR   PairwiseKeyLength;  UCHAR	GroupKeyLength;  UCHAR	PairwiseCipherSuite;  UCHAR	GroupCipherSuite;  UCHAR   BSSID[6];  UCHAR	KeyIndex;  UCHAR	KeyLength;  UCHAR	SetKey;  UCHAR	KeyMaterial[4][40];  UCHAR	KeyRSC[4][8];} ENCRYPTION_INFO, *PENCRYPTION_INFO;#endif	//ATMEL_WLAN#define MAX_IE_LENGTH		400typedef struct __VERSION_INFO{	UCHAR	DriverMajorVersion;	UCHAR	DriverMinorVersion;	UCHAR	DriverSubVersion;	USHORT	DriverBuild;	USHORT	FwMajorVersion;	USHORT	FwMinorVersion;	USHORT	FwSubVersion;	USHORT	FwBuild;}VERSION_INFO, *PVERSION_INFO;typedef struct __STATISTICS{	ULONG	TxDataPacketsOk;	ULONG	TxDataPacketsError;	ULONG	TxMgmtPacketsOk;	ULONG	TxMgmtPacketsError;	ULONG	RxDataPacketsOk;	ULONG	RxDataPacketsError;	ULONG	RxMgmtPacketsOk;	ULONG	RxMgmtPacketsError;	ULONG	RxLost;	ULONG	TxPacketsRejectedNotReady;	ULONG	TxPacketsRejectedResources;	ULONG	MatchingBeacons;	ULONG	RxWpaMicErrors;	ULONG	RxWpaCountermeasuresCount;	ULONG	RxWpaReplayErrors;	ULONG	WpaBlackListEntries;	ULONG	Reserved1;	ULONG	Reserved2;	ULONG	Reserved3;	ULONG	Reserved4;	}STATISTICS, *PSTATISTICS;typedef struct __DEVICE_CONFIGURATION{	UCHAR			OperatingMode;					//AD_HOC_MODE or INFRASTRUCTURE_MODE	UCHAR			Channel;							UCHAR			SSID[MAX_SSID_LENGTH];				UCHAR			SSIDlength;	UCHAR			TxRate;							//0-4	UCHAR			PowerMgmtMode;					// PM_MODE_ACTIVE or PM_MODE_POWER_SAVE	UCHAR			TxPowerLevel;							//0-4	UCHAR			InternationalRoaming;					// PM_MODE_ACTIVE or PM_MODE_POWER_SAVE	UCHAR			RadioIsOn;					// PM_MODE_ACTIVE or PM_MODE_POWER_SAVE	UCHAR			PreambleType;					// LONG_PREAMBLE or SHORT_PREAMBLE	USHORT			FragmentationThreshold;				USHORT			RtsCtsThreshold;	UCHAR			BSSID[6];	UCHAR			StationState;	UCHAR			Rssi;	UCHAR			LinkQuality;	UCHAR			RegDomain;        UCHAR                   ChannelVector[14];	ULONG			MgmtErrorCode;			}DEVICE_CONFIGURATION, *PDEVICE_CONFIGURATION;typedef struct __STR_LIST{	struct __STR_LIST	*next;	char				*string1;	char				*value;}STR_LIST, *PSTR_LIST;#define STR_LIST_SIZE sizeof(STR_LIST)/* defined also in /include/pcmcia/appint.h */#define MAX_BSS_ENTRIES		64	#define MAX_PAIRWISE_SUITES 4#define MAX_AUTH_MGMT_SUITES 4typedef struct __WPA_INFO{	USHORT	Version;	UCHAR	GroupSuite;	USHORT	PairwiseSuiteCnt;	UCHAR	PairwiseSuiteList[MAX_PAIRWISE_SUITES];	USHORT	AuthMgmtSuiteCnt;	UCHAR	AuthMgmtSuiteList[MAX_AUTH_MGMT_SUITES];	UCHAR	WpaCapabilities[2];}WPA_INFO, *PWPA_INFO;#define BSS_CAPAPILITY_WPA		1#define BSS_CAPAPILITY_CCX		2#define MAX_WPA_IE_LEN 64#define MAX_SUPPORTED_RATES_LENGTH					16typedef struct __BSS_INFO_EX{	UCHAR	Channel;	UCHAR	SSID[MAX_SSID_LENGTH];	UCHAR	SSIDsize;	UCHAR	BSSID[6];	CHAR	RSSI;	UCHAR	UsingWEP;	UCHAR	PreambleType;	USHORT  BeaconPeriod;	UCHAR	BSStype;	UCHAR	BeaconProbeInfo[MAX_IE_LENGTH];	USHORT	BeaconProbeLen;        UCHAR   WpaIE[MAX_WPA_IE_LEN * 2 + 30];        USHORT  WpaIELen;	ULONG	Capabilities;	UCHAR	FailedToConnect;	WPA_INFO WpaInfo;	WPA_INFO Wpa2Info;	UCHAR	SupportedRatesLength;	UCHAR	SupportedRates[MAX_SUPPORTED_RATES_LENGTH];}BSS_INFO_EX, *PBSS_INFO_EX;/********************************************/#include "stdinclude.h"#include "frame.h"#include "ncurses.h"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -