-/* $OpenBSD: if.c,v 1.29 2000/03/21 23:31:26 mickey Exp $ */
+/* $OpenBSD: if.c,v 1.30 2000/03/22 11:28:42 itojun Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
return (NULL);
}
-
-/*
- * Map interface name in a sockaddr_dl to
- * interface structure pointer.
- */
-struct ifnet *
-if_withname(sa)
- struct sockaddr *sa;
-{
- char ifname[IFNAMSIZ+1];
- struct sockaddr_dl *sdl = (struct sockaddr_dl *)sa;
-
- if ( (sa->sa_family != AF_LINK) || (sdl->sdl_nlen == 0) ||
- (sdl->sdl_nlen > IFNAMSIZ) )
- return NULL;
-
- /*
- * ifunit wants a null-terminated name. It may not be null-terminated
- * in the sockaddr. We don't want to change the caller's sockaddr,
- * and there might not be room to put the trailing null anyway, so we
- * make a local copy that we know we can null terminate safely.
- */
-
- bcopy(sdl->sdl_data, ifname, sdl->sdl_nlen);
- ifname[sdl->sdl_nlen] = '\0';
- return ifunit(ifname);
-}
-
-
/*
* Interface ioctls.
*/
-/* $OpenBSD: if.h,v 1.16 2000/03/21 23:31:26 mickey Exp $ */
+/* $OpenBSD: if.h,v 1.17 2000/03/22 11:28:42 itojun Exp $ */
/* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */
/*
int ifioctl __P((struct socket *, u_long, caddr_t, struct proc *));
int ifpromisc __P((struct ifnet *, int));
struct ifnet *ifunit __P((char *));
-struct ifnet *if_withname __P((struct sockaddr *));
struct ifaddr *ifa_ifwithaddr __P((struct sockaddr *));
struct ifaddr *ifa_ifwithaf __P((int));