FreeBSD/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c
/*
 * Initiate a SDP connection to nam.
 */
Initiate a SDP connection to nam.
Initiate a SDP connection to nam .
static int
sdp_start_connect(struct sdp_sock *ssk, struct sockaddr *nam, struct thread *td)
{
	struct sockaddr_in src;
	struct socket *so;
	int error;
	so = ssk->socket;
	SDP_WLOCK_ASSERT(ssk);
	if (ssk->lport == 0) {
		error = sdp_pcbbind(ssk, (struct sockaddr *)0, td->td_ucred);
		if (error)
			return error;
	}
	src.sin_family = AF_INET;
	src.sin_len = sizeof(src);
	bzero(&src.sin_zero, sizeof(src.sin_zero));
	src.sin_port = ssk->lport;
	src.sin_addr.s_addr = ssk->laddr;
	soisconnecting(so);
	SDP_WUNLOCK(ssk);
	error = -rdma_resolve_addr(ssk->id, (struct sockaddr *)&src, nam,
	    SDP_RESOLVE_TIMEOUT);
	SDP_WLOCK(ssk);
	if (error == 0)
		ssk->state = TCPS_SYN_SENT;
	return 0;
}
static int sdp_start_connect ( struct sdp_sock * ssk , struct sockaddr * nam , struct thread * td ) { struct sockaddr_in src ; struct socket * so ; int error ; so = ssk -> socket ; SDP_WLOCK_ASSERT ( ssk ) ; if ( ssk -> lport == 0 ) { error = sdp_pcbbind ( ssk , ( struct sockaddr * ) 0 , td -> td_ucred ) ; if ( error ) return error ; } src . sin_family = AF_INET ; src . sin_len = sizeof ( src ) ; bzero ( & src . sin_zero , sizeof ( src . sin_zero ) ) ; src . sin_port = ssk -> lport ; src . sin_addr . s_addr = ssk -> laddr ; soisconnecting ( so ) ; SDP_WUNLOCK ( ssk ) ; error = - rdma_resolve_addr ( ssk -> id , ( struct sockaddr * ) & src , nam , SDP_RESOLVE_TIMEOUT ) ; SDP_WLOCK ( ssk ) ; if ( error == 0 ) ssk -> state = TCPS_SYN_SENT ; return 0 ; }
Initiate a SDP connection to nam.
Initiate a SDP connection to nam .