linux_ioctl.c (182141) | linux_ioctl.c (183550) |
---|---|
1/*- 2 * Copyright (c) 1994-1995 S�ren Schmidt 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29#include "opt_compat.h" 30 31#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1994-1995 S�ren Schmidt 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29#include "opt_compat.h" 30 31#include <sys/cdefs.h> |
32__FBSDID("$FreeBSD: head/sys/compat/linux/linux_ioctl.c 182141 2008-08-25 04:55:29Z julian $"); | 32__FBSDID("$FreeBSD: head/sys/compat/linux/linux_ioctl.c 183550 2008-10-02 15:37:58Z zec $"); |
33 34#include <sys/param.h> 35#include <sys/systm.h> 36#include <sys/sysproto.h> 37#include <sys/cdio.h> 38#include <sys/dvdio.h> 39#include <sys/conf.h> 40#include <sys/disk.h> --- 2005 unchanged lines hidden (view full) --- 2046 2047/* 2048 * Interface function used by linprocfs (at the time of writing). It's not 2049 * used by the Linuxulator itself. 2050 */ 2051int 2052linux_ifname(struct ifnet *ifp, char *buffer, size_t buflen) 2053{ | 33 34#include <sys/param.h> 35#include <sys/systm.h> 36#include <sys/sysproto.h> 37#include <sys/cdio.h> 38#include <sys/dvdio.h> 39#include <sys/conf.h> 40#include <sys/disk.h> --- 2005 unchanged lines hidden (view full) --- 2046 2047/* 2048 * Interface function used by linprocfs (at the time of writing). It's not 2049 * used by the Linuxulator itself. 2050 */ 2051int 2052linux_ifname(struct ifnet *ifp, char *buffer, size_t buflen) 2053{ |
2054 INIT_VNET_NET(ifp->if_vnet); |
|
2054 struct ifnet *ifscan; 2055 int ethno; 2056 2057 /* Short-circuit non ethernet interfaces */ 2058 if (!IFP_IS_ETH(ifp)) 2059 return (strlcpy(buffer, ifp->if_xname, buflen)); 2060 2061 /* Determine the (relative) unit number for ethernet interfaces */ --- 17 unchanged lines hidden (view full) --- 2079 * and return the associated ifnet structure 2080 * bsdname and lxname need to be least IFNAMSIZ bytes long, but 2081 * can point to the same buffer. 2082 */ 2083 2084static struct ifnet * 2085ifname_linux_to_bsd(const char *lxname, char *bsdname) 2086{ | 2055 struct ifnet *ifscan; 2056 int ethno; 2057 2058 /* Short-circuit non ethernet interfaces */ 2059 if (!IFP_IS_ETH(ifp)) 2060 return (strlcpy(buffer, ifp->if_xname, buflen)); 2061 2062 /* Determine the (relative) unit number for ethernet interfaces */ --- 17 unchanged lines hidden (view full) --- 2080 * and return the associated ifnet structure 2081 * bsdname and lxname need to be least IFNAMSIZ bytes long, but 2082 * can point to the same buffer. 2083 */ 2084 2085static struct ifnet * 2086ifname_linux_to_bsd(const char *lxname, char *bsdname) 2087{ |
2088 INIT_VNET_NET(TD_TO_VNET(curthread)); |
|
2087 struct ifnet *ifp; 2088 int len, unit; 2089 char *ep; 2090 int is_eth, index; 2091 2092 for (len = 0; len < LINUX_IFNAMSIZ; ++len) 2093 if (!isalpha(lxname[len])) 2094 break; --- 24 unchanged lines hidden (view full) --- 2119 2120/* 2121 * Implement the SIOCGIFCONF ioctl 2122 */ 2123 2124static int 2125linux_ifconf(struct thread *td, struct ifconf *uifc) 2126{ | 2089 struct ifnet *ifp; 2090 int len, unit; 2091 char *ep; 2092 int is_eth, index; 2093 2094 for (len = 0; len < LINUX_IFNAMSIZ; ++len) 2095 if (!isalpha(lxname[len])) 2096 break; --- 24 unchanged lines hidden (view full) --- 2121 2122/* 2123 * Implement the SIOCGIFCONF ioctl 2124 */ 2125 2126static int 2127linux_ifconf(struct thread *td, struct ifconf *uifc) 2128{ |
2129 INIT_VNET_NET(TD_TO_VNET(td)); |
|
2127#ifdef COMPAT_LINUX32 2128 struct l_ifconf ifc; 2129#else 2130 struct ifconf ifc; 2131#endif 2132 struct l_ifreq ifr; 2133 struct ifnet *ifp; 2134 struct ifaddr *ifa; --- 584 unchanged lines hidden --- | 2130#ifdef COMPAT_LINUX32 2131 struct l_ifconf ifc; 2132#else 2133 struct ifconf ifc; 2134#endif 2135 struct l_ifreq ifr; 2136 struct ifnet *ifp; 2137 struct ifaddr *ifa; --- 584 unchanged lines hidden --- |