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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? cardif_linux.c

?? 可以用作很多客戶端的XSUPPLICANT的源代碼。比如用在802.1x或者無線AP上
?? C
?? 第 1 頁 / 共 3 頁
字號:
/** * A client-side 802.1x implementation  * * This code is released under both the GPL version 2 and BSD licenses. * Either license may be used.  The respective licenses are found below. * * Copyright (C) 2002 Bryan D. Payne & Nick L. Petroni Jr. * All Rights Reserved * * --- GPL Version 2 License --- * This program 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. * * 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. * * --- BSD License --- * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * *  - Redistributions of source code must retain the above copyright notice, *    this list of conditions and the following disclaimer. *  - Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. *  - All advertising materials mentioning features or use of this software *    must display the following acknowledgement: *       This product includes software developed by the University of *       Maryland at College Park and its contributors. *  - Neither the name of the University nor the names of its contributors *    may be used to endorse or promote products derived from this software *    without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *//******************************************************************* * The driver function for a Linux application layer EAPOL  * implementation * File: cardif_linux.c * * Authors: Chris.Hessing@utah.edu * * $Id: cardif_linux.c,v 1.24 2004/04/18 03:28:26 chessing Exp $ * $Date: 2004/04/18 03:28:26 $ * $Log: cardif_linux.c,v $ * Revision 1.24  2004/04/18 03:28:26  chessing * * Fixed a little bit of verbage in cardif_linux.c that could be confusing. * * Revision 1.23  2004/04/01 06:12:55  npetroni * fixed off-by-one error * * Revision 1.22  2004/03/29 21:36:38  chessing * * Fixed a problem that would cause XSupplicant to segfault if there was no default network profile defined, an interface was down, and XSupplicant was terminated.  (All at the same time.) * * Revision 1.21  2004/03/27 01:40:45  chessing * * Lots of small updates to free memory that wasn't getting freed, add some additional debug output, and fix a couple of memory leaks. * * Revision 1.20  2004/03/26 21:34:52  chessing * Fixed problem with interface being down on startup causing xsupplicant to not read the proper configuration information when the interface is brought up.  Added/fixed code to rebuild userdata piece of structure when the essid changes.  Added code to avoid setting a key on an interface if the interface doesn't already have encryption enabled.  Added a little bit of debugging code to help find a solution to an IPC socket problem. * * Revision 1.19  2004/03/25 06:06:57  chessing * * Some debug code cleanups.  Fixed a bug with non-existant, or down interfaces defined in the allow_interfaces would loop forever.  Added calls to reset wireless keys to all 0s when we end up in disconnected, or held state. * * Revision 1.18  2004/03/24 18:35:47  chessing * * Added a modified version of a patch from David Relson to fix a problem with some of the debug info in config_grammer.y.  Added some additional checks to eapol_key_type1 that will keep us from segfaulting under some *REALLY* strange conditions.  Changed the set key code in cardif_linux to double check that we aren't a wireless interface before returning an error.  This resolved a problem when XSupplicant was started when an interface was done.  Upon bringing up the interface, XSupplicant would sometimes think it wasn't wireless, and not bother trying to set keys. * * Revision 1.17  2004/03/23 23:34:20  galimorerpg * Removed another un-needed Makefile and added the cardif_get_int patch from Pavel Roskin * * Revision 1.16  2004/03/22 00:41:00  chessing * * Added logfile option to the global config options in the config file.  The logfile is where output will go when we are running in daemon mode.  If no logfile is defined, output will go to the console that started xsupplicant.   Added forking to the code, so that when started, the process can daemonize, and run in the background.  If there is a desire to force running in the foreground (such as for debugging), the -f option was added. * * Revision 1.15  2004/03/06 03:53:54  chessing * * We now send logoffs when the process is terminated.  Added a new option to the config file "wireless_control" which will allow a user to disable non-EAPoL key changes.  Added an update to destination BSSID checking that will reset the wireless key to all 0s when the BSSID changes.  (This is what "wireless_control" disables when it is set to no.)  Roaming should now work, but because we are resetting keys to 128 bit, there may be issues with APs that use 64 bit keys.  I will test this weekend. * * Revision 1.14  2004/02/06 06:13:31  chessing * * Cleaned up some unneeded stuff in the configure.in file as per e-mail from Rakesh Patel.  Added all 12 patches from Jouni Malinen (Including wpa_supplicant patch, until we can add true wpa support in xsupplicant.) * * Revision 1.13  2004/01/20 03:44:32  chessing * * A couple of small updates.  TTLS now uses the correct phase 2 type as defined by the config file.  Setting dest_mac now works, and has the desired results.  One small fix to EAP-SIM. * * Revision 1.12  2004/01/17 21:16:15  chessing * * Various segfault fixes.  PEAP now works correctly again.  Some new error checking in the tls handlers.  Fixes for the way we determine if we have changed ESSIDs.  We now quit when we don't have a config, or when the config is bad. Added code to check and see if a frame is in the queue, and don't sleep if there is.  "Fixed" ID issue by inheriting the ID from the parent where needed.  However, assigning an ID inside of a handler will override the parent ID.  This could cause problems with some EAP types.  We should add a "username" field to PEAP to allow configuration of the inner EAP identity. * * Revision 1.11  2004/01/15 23:45:11  chessing * * Fixed a segfault when looking for wireless interfaces when all we had was a wired interface.  Fixed external command execution so that junk doesn't end up in the processed string anymore.  Changed the state machine to call txRspAuth even if there isn't a frame to process.  This will enable EAP methods to request information from a GUI interface (such as passwords, or supply challenge information that might be needed to generate passwords).  EAP methods now must decide what to do when they are handed NULL for the pointer to the in frame.  If they don't need any more data, they should quietly exit. * * Revision 1.10  2004/01/15 01:12:45  chessing * * Fixed a keying problem (keying material wasn't being generated correctly).  Added support for global counter variables from the config file. (Such as auth_period)  Added support for executing command defined in the config file based on different events.  (Things such as what to do on reauth.)  Added the ability to roam to a different SSID.  We now check to make sure our BSSID hasn't changed, and we follow it, if it has.  Fixed a sefault when the program was terminated in certain states.  Added attempt at better garbage collection on program termination. Various small code cleanups. * * Revision 1.9  2004/01/14 22:07:25  chessing * * Fixes that were needed in order to allow us to authenticate correctly.  We should now be able to authenticate using only information provided by the config file! * * Revision 1.8  2004/01/06 23:35:07  chessing * * Fixed a couple known bugs in SIM.  Config file support should now be in place!!! But, because of the changes, PEAP is probably broken.  We will need to reconsider how the phase 2 piece of PEAP works. * * Revision 1.7  2003/12/28 07:13:21  chessing * * Fixed a problem where we would segfault on an EAP type we didn't understand.  Added EAP-OTP.  EAP-OTP has been tested using the opie package, and Radiator 3.8.  EAP-OTP currently prompts for a passphrase, which it shouldn't do, so it should be considered *VERY* much in test mode until we finish the GUI. * * Revision 1.6  2003/12/19 06:29:57  chessing * * New code to determine if an interface is wireless or not.  Lots of IPC updates. * * Revision 1.5  2003/12/04 04:36:25  chessing * * Added support for multiple interfaces (-D now works), also added DEBUG_EXCESSIVE to help clean up some of the debug output (-d 6). * * Revision 1.4  2003/11/29 03:50:03  chessing * * Added NAK code, EAP Type checking, split out daemon config from user config, added Display of EAP-Notification text, revamped phase 2 selection method for TTLS. * * Revision 1.3  2003/11/24 04:56:04  chessing * * EAP-SIM draft 11 now works.  Statemachine updated to work based on the up/down state of an interface, rather than just assuming it is up. * * Revision 1.2  2003/11/24 02:14:08  chessing * * Added EAP-SIM (draft 11 still needs work), various small changes to eap calls, new hex dump code including ASCII dump (used mostly for dumping frames) * * Revision 1.1.1.1  2003/11/19 04:13:28  chessing * New source tree * * * *******************************************************************/#include <sys/types.h>#include <sys/socket.h>#include <fcntl.h>#include <linux/if.h>#include <linux/if_packet.h>#include <linux/if_ether.h>#include <string.h>#include <sys/ioctl.h>#include <netinet/in.h>#include <linux/wireless.h>#include <stdio.h>#include <errno.h>#include <unistd.h>#include <net/if_arp.h>#include "cardif/cardif.h"#include "config.h"#include "profile.h"#include "xsup_debug.h"#include "xsup_err.h"#ifndef ETH_P_EAPOL#define ETH_P_EAPOL 0x888e#endif/*********************************************** * * Do whatever is needed to get the interface in to a state that we can send * and recieve frames on the network.  Any information that we need to later * use should be stored in the interface_data structure. * ***********************************************/int cardif_init(struct interface_data *thisint){  struct ifreq ifr;  int sockopts, sockerr, retval;  //  char newdest[6];  debug_printf(DEBUG_INT, "Initializing socket for interface %s..\n",	       thisint->intName);  // Establish a socket handle.  thisint->sockInt = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_EAPOL));  if (thisint->sockInt < 0)    {      debug_printf(DEBUG_NORMAL, 		   "Couldn't initialize raw socket for interface %s!\n",		   thisint->intName);      return XENOSOCK;    }          // Tell the ifreq struct which interface we want to use.  strncpy((char *)&ifr.ifr_name, thisint->intName, sizeof(ifr.ifr_name));  retval = ioctl(thisint->sockInt, SIOCGIFINDEX, &ifr);  if (retval < 0)    {      debug_printf(DEBUG_NORMAL, "Error getting interface index value for interface %s\n",		   thisint->intName);      return XESOCKOP;    }  // Build our link layer socket struct, so we can bind it to a specific  // interface.  thisint->sll.sll_family = PF_PACKET;  thisint->sll.sll_ifindex = ifr.ifr_ifindex;  thisint->sll.sll_protocol = htons(ETH_P_EAPOL);  // Bind to the interface.  retval = bind(thisint->sockInt, (const struct sockaddr *)&thisint->sll, 		sizeof(struct sockaddr_ll));  if (retval < 0)    {      debug_printf(DEBUG_NORMAL, "Error binding raw socket to interface %s!\n",		   thisint->intName);      return XESOCKOP;    }  // Get our MAC address.  (Needed for sending frames out correctly.)  retval = ioctl(thisint->sockInt, SIOCGIFHWADDR, &ifr);  if (retval < 0)    {      debug_printf(DEBUG_NORMAL, "Error getting hardware (MAC) address for interface %s!\n",		   thisint->intName);      return XENOTINT;    }  // Store a copy of our source MAC for later use.  memcpy((char *)&thisint->source_mac[0], (char *)&ifr.ifr_hwaddr.sa_data[0], 6);  // Set our socket to non-blocking.  sockopts = fcntl(thisint->sockInt, F_GETFL, 0);  if (sockopts < 0)    {      debug_printf(DEBUG_NORMAL, "Error getting socket options for interface %s!\n",		   thisint->intName);      return XENOTINT;    }  sockerr = fcntl(thisint->sockInt, F_SETFL, sockopts | O_NONBLOCK);  if (sockerr < 0)    {      debug_printf(DEBUG_NORMAL, "Error setting socket options for interface %s!\n",		   thisint->intName);      return XENOTINT;    }  return XENONE;}/************************************************************** *  * Check if encryption is available.  If it is, we will return * TRUE, if it isn't, we will return FALSE.  On error, we return * -1. * **************************************************************/int cardif_enc_enabled(struct interface_data *thisint){  int rc = 0;  int skfd;  struct iwreq wrq;  bzero((struct iwreq *)&wrq, sizeof(struct iwreq));  skfd = socket(AF_INET, SOCK_DGRAM, 0);  if (skfd < 0)    return -1;  strncpy(wrq.ifr_name, thisint->intName, IFNAMSIZ);  if ((rc = ioctl(skfd, SIOCGIWENCODE, &wrq)) < 0)    {      // We got an error while trying to get encryption information      // from the card.      rc = -1;    } else {      // We got some data, so see if we have encryption or not.      if ((wrq.u.data.flags & IW_ENCODE_DISABLED) == IW_ENCODE_DISABLED)	{	  // Encryption is disabled.	  rc = FALSE;	} else {	  // Encryption is enabled.	  rc = TRUE;	}    }   close(skfd);  return rc;}/************************************************************** * * If we have detected, or forced this interface to reset keys, then

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲r级在线视频| 国产精品传媒入口麻豆| 奇米精品一区二区三区四区| 欧美一级理论性理论a| 免费成人美女在线观看.| 精品国产麻豆免费人成网站| 懂色av一区二区三区免费观看| 国产精品视频在线看| 91美女蜜桃在线| 偷窥国产亚洲免费视频 | 日本韩国精品在线| 亚洲综合色婷婷| 日韩视频一区二区三区在线播放 | 亚洲图片欧美综合| 4438x亚洲最大成人网| 韩国欧美一区二区| 国产日韩欧美激情| 91久久一区二区| 理论片日本一区| 中文字幕佐山爱一区二区免费| 欧美日韩在线不卡| 国产成人综合在线播放| 夜夜嗨av一区二区三区| 精品一区二区三区视频在线观看 | 久久久高清一区二区三区| 国产成人三级在线观看| 亚洲激情综合网| 精品久久免费看| 色综合色狠狠天天综合色| 男女男精品视频网| 中文字幕在线播放不卡一区| 欧美日韩亚州综合| av激情成人网| 极品尤物av久久免费看| 一区二区在线看| 国产喷白浆一区二区三区| 欧美日韩精品电影| 99久久久免费精品国产一区二区| 久久丁香综合五月国产三级网站 | 日韩丝袜情趣美女图片| 色综合久久久久久久久| 国产美女精品在线| 三级影片在线观看欧美日韩一区二区| 国产精品日韩成人| 欧美精品一区二区三区很污很色的| 一道本成人在线| 国产成人99久久亚洲综合精品| 午夜视频在线观看一区二区三区| 国产精品传媒入口麻豆| 国产网红主播福利一区二区| 欧美精品久久天天躁| 99综合电影在线视频| 国产一区二区三区久久久| 亚洲成a人v欧美综合天堂| 亚洲免费在线观看| 国产精品国产三级国产普通话99| 亚洲丝袜另类动漫二区| 精品免费国产一区二区三区四区| 欧美日韩视频在线一区二区| 91久久人澡人人添人人爽欧美 | 另类中文字幕网| 日韩av一区二区三区| 亚洲一区二区三区四区在线观看| 亚洲日本一区二区| 亚洲欧美在线视频观看| 国产精品久久午夜| 国产日韩高清在线| 国产欧美日韩在线| 亚洲国产成人在线| 国产精品伦理在线| 国产精品青草久久| 国产精品白丝在线| 国产精品久久久久9999吃药| 亚洲欧美综合色| 一区二区三区在线视频免费观看| 亚洲美女偷拍久久| 夜夜爽夜夜爽精品视频| 亚洲国产日韩在线一区模特| 亚洲成人综合网站| 日韩国产精品91| 精品一区二区国语对白| 国产高清不卡一区| 成人av在线观| 在线亚洲精品福利网址导航| 欧美影视一区二区三区| 欧美蜜桃一区二区三区| 欧美一区二区视频观看视频| 精品国产亚洲在线| 中文欧美字幕免费| 亚洲欧美在线aaa| 亚洲一区二区免费视频| 日本欧美加勒比视频| 国内精品第一页| 成人动漫在线一区| 色就色 综合激情| 91精品麻豆日日躁夜夜躁| 精品国产区一区| 亚洲欧洲av在线| 天天色图综合网| 国产在线视频一区二区三区| 成人午夜短视频| 欧洲亚洲国产日韩| 精品久久久网站| 亚洲人成精品久久久久久| 亚洲超丰满肉感bbw| 精品亚洲成av人在线观看| 成人av片在线观看| 欧美人伦禁忌dvd放荡欲情| 久久午夜老司机| 一区二区在线观看视频在线观看| 青椒成人免费视频| 不卡一二三区首页| 91精品国产麻豆国产自产在线 | 精品一区精品二区高清| 波多野结衣亚洲| 91精品啪在线观看国产60岁| 国产农村妇女毛片精品久久麻豆| 亚洲国产精品自拍| 高清视频一区二区| 制服.丝袜.亚洲.另类.中文 | 国产夜色精品一区二区av| 亚洲美女偷拍久久| 国产伦精品一区二区三区在线观看 | 日韩一级大片在线| 最新国产の精品合集bt伙计| 男人的天堂久久精品| 91精品办公室少妇高潮对白| xfplay精品久久| 亚洲国产日韩精品| 99精品视频在线观看| 欧美精品一区二区精品网| 一级特黄大欧美久久久| 国产成人h网站| 欧美一区二区精美| 亚洲综合色网站| 99re这里只有精品视频首页| 久久精品欧美日韩精品| 免费高清视频精品| 欧美日韩精品欧美日韩精品一| 国产精品美女一区二区三区| 极品少妇xxxx精品少妇偷拍| 欧美日韩国产在线观看| 亚洲人成网站精品片在线观看| 国产在线精品不卡| 欧美成人性福生活免费看| 午夜精品一区二区三区三上悠亚| 91在线无精精品入口| 国产精品欧美经典| 国产资源在线一区| 欧美videofree性高清杂交| 日日噜噜夜夜狠狠视频欧美人 | 日韩精品专区在线影院观看| 亚洲高清视频的网址| 色天使久久综合网天天| 18欧美乱大交hd1984| 不卡的电视剧免费网站有什么| 久久精品一区二区| 国产在线一区观看| 久久青草欧美一区二区三区| 久久69国产一区二区蜜臀| 精品日韩99亚洲| 久久爱www久久做| 精品国产伦一区二区三区免费| 久久成人麻豆午夜电影| 精品日产卡一卡二卡麻豆| 国内精品国产成人国产三级粉色| 精品国一区二区三区| 国产毛片精品视频| 国产精品亲子伦对白| 不卡高清视频专区| 亚洲激情av在线| 欧美日韩中文字幕精品| 婷婷中文字幕综合| 欧美一级一级性生活免费录像| 日韩精品成人一区二区三区| 欧美一级日韩不卡播放免费| 久久电影国产免费久久电影| 久久久久免费观看| 国产激情一区二区三区四区| 中文字幕中文乱码欧美一区二区 | 免费不卡在线观看| 欧美精品一区二区不卡| 成人精品鲁一区一区二区| 日韩毛片一二三区| 欧美日韩亚洲另类| 激情小说亚洲一区| 国产精品白丝在线| 欧美欧美欧美欧美| 国产在线精品一区二区三区不卡 | 成人黄色a**站在线观看| 免费在线观看日韩欧美| 国产校园另类小说区| 91美女片黄在线| 日本在线不卡视频一二三区| 久久综合视频网| 99久久99久久精品免费看蜜桃| 水野朝阳av一区二区三区| 久久这里只有精品视频网| 色中色一区二区| 麻豆久久一区二区|