1/* 2 * Copyright (c) 1995, Mike Mitchell 3 * Copyright (c) 1984, 1985, 1986, 1987, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 19 unchanged lines hidden (view full) --- 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * 34 * @(#)ipx.c 35 * |
36 * $Id: ipx.c,v 1.8 1997/03/24 11:33:31 bde Exp $ |
37 */ 38 39#include <sys/param.h> 40#include <sys/queue.h> 41#include <sys/systm.h> 42#include <sys/mbuf.h> 43#include <sys/sockio.h> |
44#include <sys/proc.h> |
45#include <sys/protosw.h> 46#include <sys/errno.h> 47#include <sys/socket.h> 48#include <sys/socketvar.h> 49 50#include <net/if.h> 51#include <net/route.h> 52 --- 5 unchanged lines hidden (view full) --- 58struct ipx_ifaddr *ipx_ifaddr; 59int ipx_interfaces; 60 61/* 62 * Generic internet control operations (ioctl's). 63 */ 64/* ARGSUSED */ 65int |
66ipx_control(so, cmd, data, ifp, p) |
67 struct socket *so; 68 int cmd; 69 caddr_t data; 70 register struct ifnet *ifp; |
71 struct proc *p; |
72{ 73 register struct ifreq *ifr = (struct ifreq *)data; 74 register struct ipx_aliasreq *ifra = (struct ipx_aliasreq *)data; 75 register struct ipx_ifaddr *ia; 76 struct ifaddr *ifa; 77 struct ipx_ifaddr *oia; 78 int dstIsNew, hostIsNew; 79 int error = 0; --- 27 unchanged lines hidden (view full) --- 107 if (ia == (struct ipx_ifaddr *)0) 108 return (EADDRNOTAVAIL); 109 if ((ifp->if_flags & IFF_POINTOPOINT) == 0) 110 return (EINVAL); 111 *(struct sockaddr_ipx *)&ifr->ifr_dstaddr = ia->ia_dstaddr; 112 return (0); 113 } 114 |
115 if (p && (error = suser(p->p_ucred, &p->p_acflag)) != 0) 116 return (error); |
117 118 switch (cmd) { 119 case SIOCAIFADDR: 120 case SIOCDIFADDR: 121 if (ifra->ifra_addr.sipx_family == AF_IPX) 122 for (oia = ia; ia; ia = ia->ia_next) { 123 if (ia->ia_ifp == ifp && 124 ipx_neteq(ia->ia_addr.sipx_addr, --- 238 unchanged lines hidden --- |