x25_write_internal(make, X25_CALL_ACCEPTED);  makex25->state = X25_STATE_3; 
/* Normally all calls are accepted immediatly */ if(makex25->accptapprv & X25_DENY_ACCPT_APPRV) { x25_write_internal(make, X25_CALL_ACCEPTED); makex25->state = X25_STATE_3; } 
int x25_rx_call_request(struct sk_buff *skb, struct x25_neigh *nb,			unsigned int lci){	struct sock *sk;	struct sock *make;	struct x25_sock *makex25;	struct x25_address source_addr, dest_addr;	struct x25_facilities facilities;	int len, rc;	/*	 *	Remove the LCI and frame type.	 */	skb_pull(skb, X25_STD_MIN_LEN);	/*	 *	Extract the X.25 addresses and convert them to ASCII strings,	 *	and remove them.	 */	skb_pull(skb, x25_addr_ntoa(skb->data, &source_addr, &dest_addr));	/*	 *	Get the length of the facilities, skip past them for the moment	 *	get the call user data because this is needed to determine	 *	the correct listener	 */	len = skb->data[0] + 1;	skb_pull(skb,len);	/*	 *	Find a listener for the particular address/cud pair.	 */	sk = x25_find_listener(&source_addr,skb);	skb_push(skb,len);	/*	 *	We can't accept the Call Request.	 */	if (sk == NULL || sk_acceptq_is_full(sk))		goto out_clear_request;	/*	 *	Try to reach a compromise on the requested facilities.	 */	if ((len = x25_negotiate_facilities(skb, sk, &facilities)) == -1)		goto out_sock_put;	/*	 * current neighbour/link might impose additional limits	 * on certain facilties	 */	x25_limit_facilities(&facilities, nb);	/*	 *	Try to create a new socket.	 */	make = x25_make_new(sk);	if (!make)		goto out_sock_put;	/*	 *	Remove the facilities	 */	skb_pull(skb, len);	skb->sk     = make;	make->sk_state = TCP_ESTABLISHED;	makex25 = x25_sk(make);	makex25->lci           = lci;	makex25->dest_addr     = dest_addr;	makex25->source_addr   = source_addr;	makex25->neighbour     = nb;	makex25->facilities    = facilities;	makex25->vc_facil_mask = x25_sk(sk)->vc_facil_mask;	/* ensure no reverse facil on accept */	makex25->vc_facil_mask &= ~X25_MASK_REVERSE;	makex25->cudmatchlength = x25_sk(sk)->cudmatchlength;	x25_write_internal(make, X25_CALL_ACCEPTED);	makex25->state = X25_STATE_3;	/*	 *	Incoming Call User Data.	 */	if (skb->len >= 0) {		memcpy(makex25->calluserdata.cuddata, skb->data, skb->len);		makex25->calluserdata.cudlength = skb->len;	}	sk->sk_ack_backlog++;	x25_insert_socket(make);	skb_queue_head(&sk->sk_receive_queue, skb);	x25_start_heartbeat(make);	if (!sock_flag(sk, SOCK_DEAD))		sk->sk_data_ready(sk, skb->len);	rc = 1;	sock_put(sk);out:	return rc;out_sock_put:	sock_put(sk);out_clear_request:	rc = 0;	x25_transmit_clear_request(nb, lci, 0x01);	goto out;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/ebc3f64b864fc16a594c2e63bf55a55c7d42084b/af_x25.c/clean/net/x25/af_x25.c