struct rif_cache_s *entry; 
struct rif_cache *entry; 
void tr_source_route(struct sk_buff *skb,struct trh_hdr *trh,struct net_device *dev) {	int slack;	unsigned int hash;	struct rif_cache_s *entry;	unsigned char *olddata;	static const unsigned char mcast_func_addr[] 		= {0xC0,0x00,0x00,0x04,0x00,0x00};		spin_lock_bh(&rif_lock);	/*	 *	Broadcasts are single route as stated in RFC 1042 	 */	if( (!memcmp(&(trh->daddr[0]),&(dev->broadcast[0]),TR_ALEN)) ||	    (!memcmp(&(trh->daddr[0]),&(mcast_func_addr[0]), TR_ALEN))  )	{		trh->rcf=htons((((sizeof(trh->rcf)) << 8) & TR_RCF_LEN_MASK)  			       | TR_RCF_FRAME2K | TR_RCF_LIMITED_BROADCAST);		trh->saddr[0]|=TR_RII;	}	else 	{		hash = rif_hash(trh->daddr);		/*		 *	Walk the hash table and look for an entry		 */		for(entry=rif_table[hash];entry && memcmp(&(entry->addr[0]),&(trh->daddr[0]),TR_ALEN);entry=entry->next);		/*		 *	If we found an entry we can route the frame.		 */		if(entry) 		{#if TR_SR_DEBUGprintk("source routing for %02X:%02X:%02X:%02X:%02X:%02X\n",trh->daddr[0],		  trh->daddr[1],trh->daddr[2],trh->daddr[3],trh->daddr[4],trh->daddr[5]);#endif			if(!entry->local_ring && (ntohs(entry->rcf) & TR_RCF_LEN_MASK) >> 8)			{				trh->rcf=entry->rcf;				memcpy(&trh->rseg[0],&entry->rseg[0],8*sizeof(unsigned short));				trh->rcf^=htons(TR_RCF_DIR_BIT);					trh->rcf&=htons(0x1fff);	/* Issam Chehab <ichehab@madge1.demon.co.uk> */				trh->saddr[0]|=TR_RII;#if TR_SR_DEBUG				printk("entry found with rcf %04x\n", entry->rcf);			}			else			{				printk("entry found but without rcf length, local=%02x\n", entry->local_ring);#endif			}			entry->last_used=jiffies;		}		else 		{			/*			 *	Without the information we simply have to shout			 *	on the wire. The replies should rapidly clean this			 *	situation up.			 */			trh->rcf=htons((((sizeof(trh->rcf)) << 8) & TR_RCF_LEN_MASK)  				       | TR_RCF_FRAME2K | TR_RCF_LIMITED_BROADCAST);			trh->saddr[0]|=TR_RII;#if TR_SR_DEBUG			printk("no entry in rif table found - broadcasting frame\n");#endif		}	}	/* Compress the RIF here so we don't have to do it in the driver(s) */	if (!(trh->saddr[0] & 0x80))		slack = 18;	else 		slack = 18 - ((ntohs(trh->rcf) & TR_RCF_LEN_MASK)>>8);	olddata = skb->data;	spin_unlock_bh(&rif_lock);	skb_pull(skb, slack);	memmove(skb->data, olddata, sizeof(struct trh_hdr) - slack);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/c8b35d2a29ec3c93e3b9c1e70d649a77a214b1c1/tr.c/clean/net/802/tr.c