Exemple #1
0
static int
ddp_attach(struct socket *so, int proto, struct thread *td)
{
	int error = 0;
	
	KASSERT(sotoddpcb(so) == NULL, ("ddp_attach: ddp != NULL"));

	/*
	 * Allocate socket buffer space first so that it's present
	 * before first use.
	 */
	error = soreserve(so, ddp_sendspace, ddp_recvspace);
	if (error)
		return (error);

	DDP_LIST_XLOCK();
	error = at_pcballoc(so);
	DDP_LIST_XUNLOCK();
	return (error);
}
Exemple #2
0
static int
ddp_attach(struct socket *so, int proto, struct proc *p)
{
	struct ddpcb	*ddp;
	int		error = 0;
	int		s;
	

	ddp = sotoddpcb( so );
	if ( ddp != NULL ) {
	    return( EINVAL);
	}

	s = splnet();
	error = at_pcballoc( so );
	splx(s);
	if (error) {
	    return (error);
	}
	return (soreserve( so, ddp_sendspace, ddp_recvspace ));
}
Exemple #3
0
int	ddp_pru_attach(struct socket *so, int proto,
		   struct proc *p)
{
	int s, error = 0;
	at_ddp_t *ddp = NULL;
	struct atpcb *pcb = (struct atpcb *)((so)->so_pcb);

        error = soreserve(so, ddp_sendspace, ddp_recvspace);
	if (error != 0)
		return error;

	s = splnet();
	error = at_pcballoc(so, &ddp_head);
	splx(s);
	if (error)
		return error;
	pcb = (struct atpcb *)((so)->so_pcb);
	pcb->pid = current_proc()->p_pid;
	pcb->ddptype = (u_char) proto;    /* set in socreate() */
	pcb->proto = ATPROTO_DDP;

	return error;
}