1/* 2 * Wired Ethernet driver interface 3 * Copyright (c) 2005-2009, Jouni Malinen <j@w1.fi> 4 * Copyright (c) 2004, Gunter Burchardt <tira@isx.de> 5 * 6 * This software may be distributed under the terms of the BSD license. 7 * See README for more details. 8 */ 9 10#include "includes.h" |
11 12#include "common.h" 13#include "eloop.h" 14#include "driver.h" 15 |
16#include <sys/ioctl.h> |
17#undef IFNAMSIZ |
18#include <net/if.h> 19#ifdef __linux__ 20#include <netpacket/packet.h> 21#include <net/if_arp.h> |
22#endif /* __linux__ */ 23#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) 24#include <net/if_dl.h> 25#include <net/if_media.h> 26#endif /* defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) */ 27#ifdef __sun__ 28#include <sys/sockio.h> 29#endif /* __sun__ */ 30 |
31#ifdef _MSC_VER 32#pragma pack(push, 1) 33#endif /* _MSC_VER */ 34 35struct ieee8023_hdr { 36 u8 dest[6]; 37 u8 src[6]; 38 u16 ethertype; --- 427 unchanged lines hidden (view full) --- 466 strerror(errno)); 467 close(s); 468 return -1; 469 } 470 close(s); 471 return 0; 472} 473 |
474 |
475#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) 476static int wpa_driver_wired_get_ifstatus(const char *ifname, int *status) 477{ 478 struct ifmediareq ifmr; 479 int s; 480 481 s = socket(PF_INET, SOCK_DGRAM, 0); 482 if (s < 0) { --- 71 unchanged lines hidden (view full) --- 554 close(s); 555 return 0; 556} 557 558 559static void * wpa_driver_wired_init(void *ctx, const char *ifname) 560{ 561 struct wpa_driver_wired_data *drv; |
562 int flags; |
563 564 drv = os_zalloc(sizeof(*drv)); 565 if (drv == NULL) 566 return NULL; 567 os_strlcpy(drv->ifname, ifname, sizeof(drv->ifname)); 568 drv->ctx = ctx; 569 570#ifdef __linux__ --- 111 unchanged lines hidden --- |