int sctp_ulpq_tail_event(struct sctp_ulpq *ulpq, struct sctp_ulpevent *event){	struct sock *sk = ulpq->asoc->base.sk;	struct sk_buff_head *queue;	int clear_pd = 0;	/* If the socket is just going to throw this away, do not	 * even try to deliver it.	 */	if (sock_flag(sk, SOCK_DEAD) || (sk->sk_shutdown & RCV_SHUTDOWN))		goto out_free;	/* Check if the user wishes to receive this event.  */	if (!sctp_ulpevent_is_enabled(event, &sctp_sk(sk)->subscribe))		goto out_free;	/* If we are in partial delivery mode, post to the lobby until	 * partial delivery is cleared, unless, of course _this_ is	 * the association the cause of the partial delivery.	 */	if (!sctp_sk(sk)->pd_mode) {		queue = &sk->sk_receive_queue;	} else if (ulpq->pd_mode) {		if (event->msg_flags & MSG_NOTIFICATION)		       	queue = &sctp_sk(sk)->pd_lobby;		else {			clear_pd = event->msg_flags & MSG_EOR;			queue = &sk->sk_receive_queue;		}	} else		queue = &sctp_sk(sk)->pd_lobby;	/* If we are harvesting multiple skbs they will be	 * collected on a list.	 */	if (sctp_event2skb(event)->list)		sctp_skb_list_tail(sctp_event2skb(event)->list, queue);	else		__skb_queue_tail(queue, sctp_event2skb(event));	/* Did we just complete partial delivery and need to get	 * rolling again?  Move pending data to the receive	 * queue.	 */	if (clear_pd)		sctp_ulpq_clear_pd(ulpq);	if (queue == &sk->sk_receive_queue)		sk->sk_data_ready(sk, 0);	return 1;out_free:	if (sctp_event2skb(event)->list)		sctp_queue_purge_ulpevents(sctp_event2skb(event)->list);	else		sctp_ulpevent_free(event);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/8728b834b226ffcf2c94a58530090e292af2a7bf/ulpqueue.c/clean/net/sctp/ulpqueue.c