kernels/linux-2.4.0/net/irda/irnet/irnet_irda.c
/*------------------------------------------------------------------*/
/*
 * Function irnet_dname_to_daddr (self)
 *
 *    Convert an IrDA nickname to a valid IrDA address
 *
 * It basically look into the discovery log until there is a match.
 */
Function irnet_dname_to_daddr (self)
Convert an IrDA nickname to a valid IrDA address

It basically look into the discovery log until there is a match.
Function irnet_dname_to_daddr ( self ) Convert an IrDA nickname to a valid IrDA address It basically look into the discovery log until there is a match .
static inline int
irnet_dname_to_daddr(irnet_socket *	self)
{
  struct irda_device_info *discoveries;	
  int	number;			
  int	i;
  DENTER(IRDA_SR_TRACE, "(self=0x%X)\n", (unsigned int) self);
  discoveries = irlmp_get_discoveries(&number, 0xffff);
  if(discoveries == NULL)
    DRETURN(-ENETUNREACH, IRDA_SR_INFO, "Cachelog empty...\n");
  for(i = 0; i < number; i++)
    {
      if(!strncmp(discoveries[i].info, self->rname, NICKNAME_MAX_LEN))
	{
	  self->daddr = discoveries[i].daddr;
	  DEBUG(IRDA_SR_INFO, "discovered device ``%s'' at address 0x%08x.\n",
		self->rname, self->daddr);
	  kfree(discoveries);
	  DEXIT(IRDA_SR_TRACE, "\n");
	  return 0;
	}
    }
  DEBUG(IRDA_SR_INFO, "cannot discover device ``%s'' !!!\n", self->rname);
  kfree(discoveries);
  return(-EADDRNOTAVAIL);
}
static inline int irnet_dname_to_daddr ( irnet_socket * self ) { struct irda_device_info * discoveries ; int number ; int i ; DENTER ( IRDA_SR_TRACE , " \n " , ( unsigned int ) self ) ; discoveries = irlmp_get_discoveries ( & number , 0xffff ) ; if ( discoveries == NULL ) DRETURN ( - ENETUNREACH , IRDA_SR_INFO , " \n " ) ; for ( i = 0 ; i < number ; i ++ ) { if ( ! strncmp ( discoveries [ i ] . info , self -> rname , NICKNAME_MAX_LEN ) ) { self -> daddr = discoveries [ i ] . daddr ; DEBUG ( IRDA_SR_INFO , " \n " , self -> rname , self -> daddr ) ; kfree ( discoveries ) ; DEXIT ( IRDA_SR_TRACE , " \n " ) ; return 0 ; } } DEBUG ( IRDA_SR_INFO , " \n " , self -> rname ) ; kfree ( discoveries ) ; return ( - EADDRNOTAVAIL ) ; }
Function irnet_dname_to_daddr (self)
    Convert an IrDA nickname to a valid IrDA address
Function irnet_dname_to_daddr ( self ) Convert an IrDA nickname to a valid IrDA address
/* Copy of the discovery log */ /* Number of nodes in the log */ /* Ask lmp for the current discovery log */ /* Check if the we got some results */ /* 
   * Now, check all discovered devices (if any), and connect
   * client only about the services that the client is
   * interested in...
   */ /* Does the name match ? */ /* Yes !!! Get it.. */ /* No luck ! */