|
|
| version 1.2, 2003/06/17 04:29:52 | version 1.3, 2004/03/11 09:38:59 |
|---|---|
| Line 35 | Line 35 |
| * static char sccsid[] = "@(#)if.c 5.1 (Berkeley) 6/4/85"; (routed/if.c) | * static char sccsid[] = "@(#)if.c 5.1 (Berkeley) 6/4/85"; (routed/if.c) |
| * | * |
| * $FreeBSD: src/usr.sbin/IPXrouted/if.c,v 1.5 1999/08/28 01:15:02 peter Exp $ | * $FreeBSD: src/usr.sbin/IPXrouted/if.c,v 1.5 1999/08/28 01:15:02 peter Exp $ |
| * $DragonFly: src/usr.sbin/IPXrouted/if.c,v 1.1 2003/06/16 07:16:13 dillon Exp $ | * $DragonFly$ |
| * | * |
| * @(#)if.c 8.1 (Berkeley) 6/5/93 | * @(#)if.c 8.1 (Berkeley) 6/5/93 |
| */ | */ |
| Line 51 extern struct interface *ifnet; | Line 51 extern struct interface *ifnet; |
| * Find the interface with address addr. | * Find the interface with address addr. |
| */ | */ |
| struct interface * | struct interface * |
| if_ifwithaddr(addr) | if_ifwithaddr(struct sockaddr *addr) |
| struct sockaddr *addr; | |
| { | { |
| register struct interface *ifp; | struct interface *ifp; |
| #define same(a1, a2) \ | #define same(a1, a2) \ |
| (bcmp((caddr_t)((a1)->sa_data), (caddr_t)((a2)->sa_data), 10) == 0) | (bcmp((caddr_t)((a1)->sa_data), (caddr_t)((a2)->sa_data), 10) == 0) |
| Line 76 if_ifwithaddr(addr) | Line 75 if_ifwithaddr(addr) |
| * Find the point-to-point interface with destination address addr. | * Find the point-to-point interface with destination address addr. |
| */ | */ |
| struct interface * | struct interface * |
| if_ifwithdstaddr(addr) | if_ifwithdstaddr(struct sockaddr *addr) |
| struct sockaddr *addr; | |
| { | { |
| register struct interface *ifp; | struct interface *ifp; |
| for (ifp = ifnet; ifp; ifp = ifp->int_next) { | for (ifp = ifnet; ifp; ifp = ifp->int_next) { |
| if ((ifp->int_flags & IFF_POINTOPOINT) == 0) | if ((ifp->int_flags & IFF_POINTOPOINT) == 0) |
| Line 95 if_ifwithdstaddr(addr) | Line 93 if_ifwithdstaddr(addr) |
| * of the specified address. | * of the specified address. |
| */ | */ |
| struct interface * | struct interface * |
| if_ifwithnet(addr) | if_ifwithnet(struct sockaddr *addr) |
| register struct sockaddr *addr; | |
| { | { |
| register struct interface *ifp; | struct interface *ifp; |
| register int af = addr->sa_family; | int af = addr->sa_family; |
| register int (*netmatch)(); | int (*netmatch)(); |
| if (af >= AF_MAX) | if (af >= AF_MAX) |
| return (0); | return (0); |
| Line 122 if_ifwithnet(addr) | Line 119 if_ifwithnet(addr) |
| * interface a packet came in on -- for tracing. | * interface a packet came in on -- for tracing. |
| */ | */ |
| struct interface * | struct interface * |
| if_iflookup(addr) | if_iflookup(struct sockaddr *addr) |
| struct sockaddr *addr; | |
| { | { |
| register struct interface *ifp, *maybe; | struct interface *ifp, *maybe; |
| register int af = addr->sa_family; | int af = addr->sa_family; |
| register int (*netmatch)(); | int (*netmatch)(); |
| if (af >= AF_MAX) | if (af >= AF_MAX) |
| return (0); | return (0); |