case X25_CALL_ACCEPTED: len += 1 + X25_MAX_FAC_LEN + X25_MAX_CUD_LEN; 
case X25_CALL_ACCEPTED: /* fast sel with no restr on resp */ if(x25->facilities.reverse & 0x80) { len += 1 + X25_MAX_FAC_LEN + X25_MAX_CUD_LEN; } else { len += 1 + X25_MAX_FAC_LEN; } 
void x25_write_internal(struct sock *sk, int frametype){	struct x25_sock *x25 = x25_sk(sk);	struct sk_buff *skb;	unsigned char  *dptr;	unsigned char  facilities[X25_MAX_FAC_LEN];	unsigned char  addresses[1 + X25_ADDR_LEN];	unsigned char  lci1, lci2;	/*	 *	Default safe frame size.	 */	int len = X25_MAX_L2_LEN + X25_EXT_MIN_LEN;	/*	 *	Adjust frame size.	 */	switch (frametype) {		case X25_CALL_REQUEST:			len += 1 + X25_ADDR_LEN + X25_MAX_FAC_LEN +			       X25_MAX_CUD_LEN;			break;		case X25_CALL_ACCEPTED:			len += 1 + X25_MAX_FAC_LEN + X25_MAX_CUD_LEN;			break;		case X25_CLEAR_REQUEST:		case X25_RESET_REQUEST:			len += 2;			break;		case X25_RR:		case X25_RNR:		case X25_REJ:		case X25_CLEAR_CONFIRMATION:		case X25_INTERRUPT_CONFIRMATION:		case X25_RESET_CONFIRMATION:			break;		default:			printk(KERN_ERR "X.25: invalid frame type %02X\n",			       frametype);			return;	}	if ((skb = alloc_skb(len, GFP_ATOMIC)) == NULL)		return;	/*	 *	Space for Ethernet and 802.2 LLC headers.	 */	skb_reserve(skb, X25_MAX_L2_LEN);	/*	 *	Make space for the GFI and LCI, and fill them in.	 */	dptr = skb_put(skb, 2);	lci1 = (x25->lci >> 8) & 0x0F;	lci2 = (x25->lci >> 0) & 0xFF;	if (x25->neighbour->extended) {		*dptr++ = lci1 | X25_GFI_EXTSEQ;		*dptr++ = lci2;	} else {		*dptr++ = lci1 | X25_GFI_STDSEQ;		*dptr++ = lci2;	}	/*	 *	Now fill in the frame type specific information.	 */	switch (frametype) {		case X25_CALL_REQUEST:			dptr    = skb_put(skb, 1);			*dptr++ = X25_CALL_REQUEST;			len     = x25_addr_aton(addresses, &x25->dest_addr,						&x25->source_addr);			dptr    = skb_put(skb, len);			memcpy(dptr, addresses, len);			len     = x25_create_facilities(facilities,							&x25->facilities,					     x25->neighbour->global_facil_mask);			dptr    = skb_put(skb, len);			memcpy(dptr, facilities, len);			dptr = skb_put(skb, x25->calluserdata.cudlength);			memcpy(dptr, x25->calluserdata.cuddata,			       x25->calluserdata.cudlength);			x25->calluserdata.cudlength = 0;			break;		case X25_CALL_ACCEPTED:			dptr    = skb_put(skb, 2);			*dptr++ = X25_CALL_ACCEPTED;			*dptr++ = 0x00;		/* Address lengths */			len     = x25_create_facilities(facilities,							&x25->facilities,							x25->vc_facil_mask);			dptr    = skb_put(skb, len);			memcpy(dptr, facilities, len);			dptr = skb_put(skb, x25->calluserdata.cudlength);			memcpy(dptr, x25->calluserdata.cuddata,			       x25->calluserdata.cudlength);			x25->calluserdata.cudlength = 0;			break;		case X25_CLEAR_REQUEST:		case X25_RESET_REQUEST:			dptr    = skb_put(skb, 3);			*dptr++ = frametype;			*dptr++ = 0x00;		/* XXX */			*dptr++ = 0x00;		/* XXX */			break;		case X25_RR:		case X25_RNR:		case X25_REJ:			if (x25->neighbour->extended) {				dptr     = skb_put(skb, 2);				*dptr++  = frametype;				*dptr++  = (x25->vr << 1) & 0xFE;			} else {				dptr     = skb_put(skb, 1);				*dptr    = frametype;				*dptr++ |= (x25->vr << 5) & 0xE0;			}			break;		case X25_CLEAR_CONFIRMATION:		case X25_INTERRUPT_CONFIRMATION:		case X25_RESET_CONFIRMATION:			dptr  = skb_put(skb, 1);			*dptr = frametype;			break;	}	x25_transmit_link(skb, x25->neighbour);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/ebc3f64b864fc16a594c2e63bf55a55c7d42084b/x25_subr.c/clean/net/x25/x25_subr.c