FreeBSD/sys/netinet/toecore.c
/*
 * Returns 0 or EWOULDBLOCK on success (any other value is an error).  0 means
 * lladdr and vtag are valid on return, EWOULDBLOCK means the TOE driver's
 * tod_l2_update will be called later, when the entry is resolved or times out.
 */
Returns 0 or EWOULDBLOCK on success (any other value is an error).  0 means
lladdr and vtag are valid on return, EWOULDBLOCK means the TOE driver's
tod_l2_update will be called later, when the entry is resolved or times out.
Returns 0 or EWOULDBLOCK on success ( any other value is an error ) . 0 means lladdr and vtag are valid on return EWOULDBLOCK means the TOE driver ' s tod_l2_update will be called later when the entry is resolved or times out .
int
toe_l2_resolve(struct toedev *tod, struct ifnet *ifp, struct sockaddr *sa,
    uint8_t *lladdr, uint16_t *vtag)
{
	int rc;
	switch (sa->sa_family) {
#ifdef INET
	case AF_INET:
		rc = arpresolve(ifp, 0, NULL, sa, lladdr, NULL, NULL);
		break;
#endif
#ifdef INET6
	case AF_INET6:
		rc = nd6_resolve(ifp, 0, NULL, sa, lladdr, NULL, NULL);
		break;
#endif
	default:
		return (EPROTONOSUPPORT);
	}
	if (rc == 0) {
#ifdef VLAN_TAG
		if (VLAN_TAG(ifp, vtag) != 0)
#endif
			*vtag = 0xfff;
	}
	return (rc);
}
int toe_l2_resolve ( struct toedev * tod , struct ifnet * ifp , struct sockaddr * sa , uint8_t * lladdr , uint16_t * vtag ) { int rc ; switch ( sa -> sa_family ) { #ifdef INET case AF_INET : rc = arpresolve ( ifp , 0 , NULL , sa , lladdr , NULL , NULL ) ; break ; #endif #ifdef INET6 case AF_INET6 : rc = nd6_resolve ( ifp , 0 , NULL , sa , lladdr , NULL , NULL ) ; break ; #endif default : return ( EPROTONOSUPPORT ) ; } if ( rc == 0 ) { #ifdef VLAN_TAG if ( VLAN_TAG ( ifp , vtag ) != 0 ) #endif * vtag = 0xfff ; } return ( rc ) ; }
Returns 0 or EWOULDBLOCK on success (any other value is an error).
Returns 0 or EWOULDBLOCK on success ( any other value is an error ) .