arp.c (8857) | arp.c (13379) |
---|---|
1/* 2 * sys-bsd.c - System-dependent procedures for setting up 3 * PPP interfaces on bsd-4.4-ish systems (including 386BSD, NetBSD, etc.) 4 * 5 * Copyright (c) 1989 Carnegie Mellon University. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms are permitted 9 * provided that the above copyright notice and this paragraph are 10 * duplicated in all such forms and that any documentation, 11 * advertising materials, and other materials related to such 12 * distribution and use acknowledge that the software was developed 13 * by Carnegie Mellon University. The name of the 14 * University may not be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 19 * | 1/* 2 * sys-bsd.c - System-dependent procedures for setting up 3 * PPP interfaces on bsd-4.4-ish systems (including 386BSD, NetBSD, etc.) 4 * 5 * Copyright (c) 1989 Carnegie Mellon University. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms are permitted 9 * provided that the above copyright notice and this paragraph are 10 * duplicated in all such forms and that any documentation, 11 * advertising materials, and other materials related to such 12 * distribution and use acknowledge that the software was developed 13 * by Carnegie Mellon University. The name of the 14 * University may not be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 19 * |
20 * $Id: arp.c,v 1.1 1995/02/26 12:17:09 amurai Exp $ | 20 * $Id: arp.c,v 1.2 1995/05/30 03:50:23 rgrimes Exp $ |
21 * 22 */ 23 24/* 25 * TODO: 26 */ 27 28#include <sys/ioctl.h> 29#include <sys/types.h> | 21 * 22 */ 23 24/* 25 * TODO: 26 */ 27 28#include <sys/ioctl.h> 29#include <sys/types.h> |
30#include <sys/uio.h> |
|
30#include <sys/socket.h> 31#include <sys/time.h> 32#include <sys/errno.h> | 31#include <sys/socket.h> 32#include <sys/time.h> 33#include <sys/errno.h> |
34#include <unistd.h> 35#include <string.h> |
|
33 34#include <net/if.h> 35#include <net/route.h> 36#include <net/if_dl.h> 37#include <netinet/in.h> 38#include <stdio.h> 39#include <fcntl.h> 40#ifdef __bsdi__ --- 37 unchanged lines hidden (view full) --- 78static int arpmsg_valid; 79 80int 81sifproxyarp(unit, hisaddr) 82 int unit; 83 u_long hisaddr; 84{ 85 int routes; | 36 37#include <net/if.h> 38#include <net/route.h> 39#include <net/if_dl.h> 40#include <netinet/in.h> 41#include <stdio.h> 42#include <fcntl.h> 43#ifdef __bsdi__ --- 37 unchanged lines hidden (view full) --- 81static int arpmsg_valid; 82 83int 84sifproxyarp(unit, hisaddr) 85 int unit; 86 u_long hisaddr; 87{ 88 int routes; |
86 int l; | |
87 88 /* 89 * Get the hardware address of an interface on the same subnet 90 * as our local address. 91 */ 92 memset(&arpmsg, 0, sizeof(arpmsg)); 93 if (!get_ether_addr(unit, hisaddr, &arpmsg.hwa)) { 94 logprintf("Cannot determine ethernet address for proxy ARP\n"); --- 137 unchanged lines hidden (view full) --- 232 struct sockaddr_dl *hwaddr; 233{ 234 struct ifreq *ifr, *ifend, *ifp; 235 u_long ina, mask; 236 struct sockaddr_dl *dla; 237 struct ifreq ifreq; 238 struct ifconf ifc; 239 struct ifreq ifs[MAX_IFS]; | 89 90 /* 91 * Get the hardware address of an interface on the same subnet 92 * as our local address. 93 */ 94 memset(&arpmsg, 0, sizeof(arpmsg)); 95 if (!get_ether_addr(unit, hisaddr, &arpmsg.hwa)) { 96 logprintf("Cannot determine ethernet address for proxy ARP\n"); --- 137 unchanged lines hidden (view full) --- 234 struct sockaddr_dl *hwaddr; 235{ 236 struct ifreq *ifr, *ifend, *ifp; 237 u_long ina, mask; 238 struct sockaddr_dl *dla; 239 struct ifreq ifreq; 240 struct ifconf ifc; 241 struct ifreq ifs[MAX_IFS]; |
240 struct ifreq ifx; | |
241 242 ifc.ifc_len = sizeof(ifs); 243 ifc.ifc_req = ifs; 244 if (ioctl(s, SIOCGIFCONF, &ifc) < 0) { 245 fprintf(stderr, "ioctl(SIOCGIFCONF): \n"); 246 return 0; 247 } 248 --- 175 unchanged lines hidden --- | 242 243 ifc.ifc_len = sizeof(ifs); 244 ifc.ifc_req = ifs; 245 if (ioctl(s, SIOCGIFCONF, &ifc) < 0) { 246 fprintf(stderr, "ioctl(SIOCGIFCONF): \n"); 247 return 0; 248 } 249 --- 175 unchanged lines hidden --- |