亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? irnet_irda.c

?? 優龍2410linux2.6.8內核源代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/* * This are the main operations on IrNET sockets, basically to create * and destroy IrNET sockets. These are called from the PPP part... *//*------------------------------------------------------------------*//* * Create a IrNET instance : just initialise some parameters... */intirda_irnet_create(irnet_socket *	self){  DENTER(IRDA_SOCK_TRACE, "(self=0x%p)\n", self);  self->magic = IRNET_MAGIC;	/* Paranoia */  self->ttp_open = 0;		/* Prevent higher layer from accessing IrTTP */  self->ttp_connect = 0;	/* Not connecting yet */  self->rname[0] = '\0';	/* May be set via control channel */  self->rdaddr = DEV_ADDR_ANY;	/* May be set via control channel */  self->rsaddr = DEV_ADDR_ANY;	/* May be set via control channel */  self->daddr = DEV_ADDR_ANY;	/* Until we get connected */  self->saddr = DEV_ADDR_ANY;	/* Until we get connected */  self->max_sdu_size_rx = TTP_SAR_UNBOUND;  /* Register as a client with IrLMP */  self->ckey = irlmp_register_client(0, NULL, NULL, NULL);#ifdef DISCOVERY_NOMASK  self->mask = 0xffff;		/* For W2k compatibility */#else /* DISCOVERY_NOMASK */  self->mask = irlmp_service_to_hint(S_LAN);#endif /* DISCOVERY_NOMASK */  self->tx_flow = FLOW_START;	/* Flow control from IrTTP */  DEXIT(IRDA_SOCK_TRACE, "\n");  return(0);}/*------------------------------------------------------------------*//* * Connect to the other side : *	o convert device name to an address *	o find the socket number (dlsap) *	o Establish the connection * * Note : We no longer mimic af_irda. The IAS query for finding the TSAP * is done asynchronously, like the TTP connection. This allow us to * call this function from any context (not only process). * The downside is that following what's happening in there is tricky * because it involve various functions all over the place... */intirda_irnet_connect(irnet_socket *	self){  int		err;  DENTER(IRDA_SOCK_TRACE, "(self=0x%p)\n", self);  /* Check if we are already trying to connect.   * Because irda_irnet_connect() can be called directly by pppd plus   * packet retries in ppp_generic and connect may take time, plus we may   * race with irnet_connect_indication(), we need to be careful there... */  if(test_and_set_bit(0, &self->ttp_connect))    DRETURN(-EBUSY, IRDA_SOCK_INFO, "Already connecting...\n");  if((self->iriap != NULL) || (self->tsap != NULL))    DERROR(IRDA_SOCK_ERROR, "Socket not cleaned up...\n");  /* Insert ourselves in the hashbin so that the IrNET server can find us.   * Notes : 4th arg is string of 32 char max and must be null terminated   *	     When 4th arg is used (string), 3rd arg isn't (int)   *	     Can't re-insert (MUST remove first) so check for that... */  if((irnet_server.running) && (self->q.q_next == NULL))    {      spin_lock_bh(&irnet_server.spinlock);      hashbin_insert(irnet_server.list, (irda_queue_t *) self, 0, self->rname);      spin_unlock_bh(&irnet_server.spinlock);      DEBUG(IRDA_SOCK_INFO, "Inserted ``%s'' in hashbin...\n", self->rname);    }  /* If we don't have anything (no address, no name) */  if((self->rdaddr == DEV_ADDR_ANY) && (self->rname[0] == '\0'))    {      /* Try to find a suitable address */      if((err = irnet_discover_daddr_and_lsap_sel(self)) != 0)	DRETURN(err, IRDA_SOCK_INFO, "auto-connect failed!\n");      /* In most cases, the call above is non-blocking */    }  else    {      /* If we have only the name (no address), try to get an address */      if(self->rdaddr == DEV_ADDR_ANY)	{	  if((err = irnet_dname_to_daddr(self)) != 0)	    DRETURN(err, IRDA_SOCK_INFO, "name connect failed!\n");	}      else	/* Use the requested destination address */	self->daddr = self->rdaddr;      /* Query remote LM-IAS to find LSAP selector */      irnet_find_lsap_sel(self);      /* The above call is non blocking */    }  /* At this point, we are waiting for the IrDA stack to call us back,   * or we have already failed.   * We will finish the connection procedure in irnet_connect_tsap().   */  DEXIT(IRDA_SOCK_TRACE, "\n");  return(0);}/*------------------------------------------------------------------*//* * Function irda_irnet_destroy(self) * *    Destroy irnet instance * * Note : this need to be called from a process context. */voidirda_irnet_destroy(irnet_socket *	self){  DENTER(IRDA_SOCK_TRACE, "(self=0x%p)\n", self);  if(self == NULL)    return;  /* Remove ourselves from hashbin (if we are queued in hashbin)   * Note : `irnet_server.running' protect us from calls in hashbin_delete() */  if((irnet_server.running) && (self->q.q_next != NULL))    {      struct irnet_socket *	entry;      DEBUG(IRDA_SOCK_INFO, "Removing from hash..\n");      spin_lock_bh(&irnet_server.spinlock);      entry = hashbin_remove_this(irnet_server.list, (irda_queue_t *) self);      self->q.q_next = NULL;      spin_unlock_bh(&irnet_server.spinlock);      DASSERT(entry == self, , IRDA_SOCK_ERROR, "Can't remove from hash.\n");    }  /* If we were connected, post a message */  if(test_bit(0, &self->ttp_open))    {      /* Note : as the disconnect comes from ppp_generic, the unit number       * doesn't exist anymore when we post the event, so we need to pass       * NULL as the first arg... */      irnet_post_event(NULL, IRNET_DISCONNECT_TO,		       self->saddr, self->daddr, self->rname, 0);    }  /* Prevent various IrDA callbacks from messing up things   * Need to be first */  clear_bit(0, &self->ttp_connect);  /* Prevent higher layer from accessing IrTTP */  clear_bit(0, &self->ttp_open);  /* Unregister with IrLMP */  irlmp_unregister_client(self->ckey);  /* Unregister with LM-IAS */  if(self->iriap)    {       iriap_close(self->iriap);      self->iriap = NULL;    }  /* Cleanup eventual discoveries from connection attempt */  if(self->discoveries != NULL)    {      /* Cleanup our copy of the discovery log */      kfree(self->discoveries);      self->discoveries = NULL;    }  /* Close our IrTTP connection */  if(self->tsap)    {      DEBUG(IRDA_SOCK_INFO, "Closing our TTP connection.\n");      irttp_disconnect_request(self->tsap, NULL, P_NORMAL);      irttp_close_tsap(self->tsap);      self->tsap = NULL;    }  self->stsap_sel = 0;  DEXIT(IRDA_SOCK_TRACE, "\n");  return;}/************************** SERVER SOCKET **************************//* * The IrNET service is composed of one server socket and a variable * number of regular IrNET sockets. The server socket is supposed to * handle incoming connections and redirect them to one IrNET sockets. * It's a superset of the regular IrNET socket, but has a very distinct * behaviour... *//*------------------------------------------------------------------*//* * Function irnet_daddr_to_dname (self) * *    Convert an IrDA address to a IrDA nickname * * It basically look into the discovery log until there is a match. */static inline intirnet_daddr_to_dname(irnet_socket *	self){  struct irda_device_info *discoveries;	/* Copy of the discovery log */  int	number;			/* Number of nodes in the log */  int	i;  DENTER(IRDA_SERV_TRACE, "(self=0x%p)\n", self);  /* Ask lmp for the current discovery log */  discoveries = irlmp_get_discoveries(&number, 0xffff,				      DISCOVERY_DEFAULT_SLOTS);  /* Check if the we got some results */  if (discoveries == NULL)    DRETURN(-ENETUNREACH, IRDA_SERV_INFO, "Cachelog empty...\n");  /* Now, check all discovered devices (if any) */  for(i = 0; i < number; i++)    {      /* Does the name match ? */      if(discoveries[i].daddr == self->daddr)	{	  /* Yes !!! Get it.. */	  strlcpy(self->rname, discoveries[i].info, sizeof(self->rname));	  self->rname[NICKNAME_MAX_LEN + 1] = '\0';	  DEBUG(IRDA_SERV_INFO, "Device 0x%08x is in fact ``%s''.\n",		self->daddr, self->rname);	  kfree(discoveries);	  DEXIT(IRDA_SERV_TRACE, "\n");	  return 0;	}    }  /* No luck ! */  DEXIT(IRDA_SERV_INFO, ": cannot discover device 0x%08x !!!\n", self->daddr);  kfree(discoveries);  return(-EADDRNOTAVAIL);}/*------------------------------------------------------------------*//* * Function irda_find_socket (self) * *    Find the correct IrNET socket * * Look into the list of IrNET sockets and finds one with the right * properties... */static inline irnet_socket *irnet_find_socket(irnet_socket *	self){  irnet_socket *	new = (irnet_socket *) NULL;  int			err;  DENTER(IRDA_SERV_TRACE, "(self=0x%p)\n", self);  /* Get the addresses of the requester */  self->daddr = irttp_get_daddr(self->tsap);  self->saddr = irttp_get_saddr(self->tsap);  /* Try to get the IrDA nickname of the requester */  err = irnet_daddr_to_dname(self);  /* Protect access to the instance list */  spin_lock_bh(&irnet_server.spinlock);  /* So now, try to get an socket having specifically   * requested that nickname */  if(err == 0)    {      new = (irnet_socket *) hashbin_find(irnet_server.list,					  0, self->rname);      if(new)	DEBUG(IRDA_SERV_INFO, "Socket 0x%p matches rname ``%s''.\n",	      new, new->rname);    }  /* If no name matches, try to find an socket by the destination address */  /* It can be either the requested destination address (set via the   * control channel), or the current destination address if the   * socket is in the middle of a connection request */  if(new == (irnet_socket *) NULL)    {      new = (irnet_socket *) hashbin_get_first(irnet_server.list);      while(new !=(irnet_socket *) NULL)	{	  /* Does it have the same address ? */	  if((new->rdaddr == self->daddr) || (new->daddr == self->daddr))	    {	      /* Yes !!! Get it.. */	      DEBUG(IRDA_SERV_INFO, "Socket 0x%p matches daddr %#08x.\n",		    new, self->daddr);	      break;	    }	  new = (irnet_socket *) hashbin_get_next(irnet_server.list);	}    }  /* If we don't have any socket, get the first unconnected socket */  if(new == (irnet_socket *) NULL)    {      new = (irnet_socket *) hashbin_get_first(irnet_server.list);      while(new !=(irnet_socket *) NULL)	{	  /* Is it available ? */	  if(!(test_bit(0, &new->ttp_open)) && (new->rdaddr == DEV_ADDR_ANY) &&	     (new->rname[0] == '\0') && (new->ppp_open))	    {	      /* Yes !!! Get it.. */	      DEBUG(IRDA_SERV_INFO, "Socket 0x%p is free.\n",		    new);	      break;	    }	  new = (irnet_socket *) hashbin_get_next(irnet_server.list);	}    }  /* Spin lock end */  spin_unlock_bh(&irnet_server.spinlock);  DEXIT(IRDA_SERV_TRACE, " - new = 0x%p\n", new);  return new;}/*------------------------------------------------------------------*//* * Function irda_connect_socket (self) * *    Connect an incoming connection to the socket * */static inline intirnet_connect_socket(irnet_socket *	server,		     irnet_socket *	new,		     struct qos_info *	qos,		     __u32		max_sdu_size,		     __u8		max_header_size){  DENTER(IRDA_SERV_TRACE, "(server=0x%p, new=0x%p)\n",	 server, new);  /* Now attach up the new socket */  new->tsap = irttp_dup(server->tsap, new);  DABORT(new->tsap == NULL, -1, IRDA_SERV_ERROR, "dup failed!\n");  /* Set up all the relevant parameters on the new socket */  new->stsap_sel = new->tsap->stsap_sel;  new->dtsap_sel = new->tsap->dtsap_sel;  new->saddr = irttp_get_saddr(new->tsap);  new->daddr = irttp_get_daddr(new->tsap);  new->max_header_size = max_header_size;  new->max_sdu_size_tx = max_sdu_size;  new->max_data_size   = max_sdu_size;#ifdef STREAM_COMPAT  /* If we want to receive "stream sockets" */  if(max_sdu_size == 0)    new->max_data_size = irttp_get_max_seg_size(new->tsap);#endif /* STREAM_COMPAT */  /* Clean up the original one to keep it in listen state */  irttp_listen(server->tsap);  /* Send a connection response on the new socket */  irttp_connect_response(new->tsap, new->max_sdu_size_rx, NULL);  /* Allow PPP to send its junk over the new socket... */  set_bit(0, &new->ttp_open);  /* Not connecting anymore, and clean up last possible remains   * of connection attempts on the socket */  clear_bit(0, &new->ttp_connect);  if(new->iriap)    {      iriap_close(new->iriap);      new->iriap = NULL;    }  if(new->discoveries != NULL)    {      kfree(new->discoveries);      new->discoveries = NULL;    }#ifdef CONNECT_INDIC_KICK  /* As currently we don't block packets in ppp_irnet_send() while passive,   * this is not really needed...   * Also, not doing it give IrDA a chance to finish the setup properly   * before being swamped with packets... */  ppp_output_wakeup(&new->chan);#endif /* CONNECT_INDIC_KICK */  /* Notify the control channel */  irnet_post_event(new, IRNET_CONNECT_FROM,		   new->saddr, new->daddr, server->rname, 0);  DEXIT(IRDA_SERV_TRACE, "\n");  return 0;}/*------------------------------------------------------------------*//* * Function irda_disconnect_server (self) * *    Cleanup the server socket when the incoming connection abort * */static inline voidirnet_disconnect_server(irnet_socket *	self,			struct sk_buff *skb){  DENTER(IRDA_SERV_TRACE, "(self=0x%p)\n", self);  /* Put the received packet in the black hole */  kfree_skb(skb);#ifdef FAIL_SEND_DISCONNECT  /* Tell the other party we don't want to be connected */  /* Hum... Is it the right thing to do ? And do we need to send   * a connect response before ? It looks ok without this... */  irttp_disconnect_request(self->tsap, NULL, P_NORMAL);#endif /* FAIL_SEND_DISCONNECT */  /* Notify the control channel (see irnet_find_socket()) */  irnet_post_event(NULL, IRNET_REQUEST_FROM,		   self->saddr, self->daddr, self->rname, 0);  /* Clean up the server to keep it in listen state */  irttp_listen(self->tsap);  DEXIT(IRDA_SERV_TRACE, "\n");  return;}/*------------------------------------------------------------------*//* * Function irda_setup_server (self) * *    Create a IrTTP server and set it up... * * Register the IrLAN hint bit, create a IrTTP instance for us, * set all the IrTTP callbacks and create an IrIAS entry... */static inline intirnet_setup_server(void){  __u16		hints;  DENTER(IRDA_SERV_TRACE, "()\n");  /* Initialise the regular socket part of the server */  irda_irnet_create(&irnet_server.s);  /* Open a local TSAP (an IrTTP instance) for the server */  irnet_open_tsap(&irnet_server.s);  /* PPP part setup */  irnet_server.s.ppp_open = 0;  irnet_server.s.chan.private = NULL;  irnet_server.s.file = NULL;  /* Get the hint bit corresponding to IrLAN */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩av在线免费观看不卡| 亚洲黄一区二区三区| 欧美精品aⅴ在线视频| 欧美一二三四区在线| 日韩午夜精品电影| 精品国产伦一区二区三区观看方式 | **欧美大码日韩| 欧美激情中文不卡| 欧美高清在线精品一区| 欧美经典一区二区三区| 国产精品美女久久久久av爽李琼| 久久精子c满五个校花| 国产免费久久精品| 亚洲自拍另类综合| 捆绑紧缚一区二区三区视频 | 欧美系列亚洲系列| 欧美亚洲国产一区二区三区| 91精品视频网| 久久综合色婷婷| 国产日韩欧美高清在线| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 日本一区二区三区dvd视频在线| 91精品啪在线观看国产60岁| 久久久精品影视| 一区二区三区在线免费视频| 肉丝袜脚交视频一区二区| 久久电影网站中文字幕| 99久久er热在这里只有精品15| 97久久超碰国产精品| 欧美视频三区在线播放| 精品免费视频一区二区| 国产精品成人免费| 亚洲1区2区3区4区| 国产99精品在线观看| 91官网在线观看| 日韩免费高清视频| 国产精品区一区二区三区| 午夜成人免费视频| 成人综合婷婷国产精品久久蜜臀 | 久久福利视频一区二区| 99久久婷婷国产精品综合| 91精品国产一区二区三区蜜臀 | 一区二区三区日韩| 极品销魂美女一区二区三区| 美女视频一区在线观看| 天天免费综合色| 国产精品久久久久久久久动漫| 国产老肥熟一区二区三区| 久久亚洲精品小早川怜子| 国产精品资源在线| 91福利精品第一导航| 亚洲综合在线电影| 午夜久久电影网| 成人一区二区三区视频| 日韩一区二区三区av| 亚洲乱码国产乱码精品精可以看| 国产在线一区二区| 91精品国产欧美一区二区成人| 国产精品久久久久永久免费观看 | 亚洲精品视频自拍| 国产麻豆一精品一av一免费 | 91精品国产91热久久久做人人| 色综合久久综合网97色综合| 久久综合精品国产一区二区三区 | 午夜一区二区三区视频| 成人午夜在线播放| 国产三级精品在线| 九九视频精品免费| 91精品视频网| 免费xxxx性欧美18vr| 欧美老人xxxx18| 亚洲aⅴ怡春院| 777午夜精品免费视频| 久久久精品免费免费| 中文字幕一区二区5566日韩| 国产精品乱人伦中文| 成人毛片视频在线观看| 成人avav影音| 亚洲欧美视频一区| 粉嫩蜜臀av国产精品网站| 午夜精品爽啪视频| 亚洲女人****多毛耸耸8| 亚洲人成影院在线观看| 中文字幕亚洲综合久久菠萝蜜| 国产无人区一区二区三区| 亚洲天堂福利av| 国产一区久久久| 欧美另类久久久品| 国产精品毛片高清在线完整版| 亚洲午夜在线观看视频在线| 国产一区二区福利视频| 精品无人码麻豆乱码1区2区 | 亚洲手机成人高清视频| 国产人伦精品一区二区| 一区二区三区色| 欧美精品一区视频| 一区二区三区精密机械公司| 丝瓜av网站精品一区二区| 精品无人区卡一卡二卡三乱码免费卡| 蜜桃av一区二区三区| 国产精品影视网| 日韩在线播放一区二区| 久久亚洲私人国产精品va媚药| 午夜婷婷国产麻豆精品| 95精品视频在线| 欧美人xxxx| 丝袜美腿亚洲综合| 欧美日韩在线播| 欧美精品一级二级三级| 欧美乱妇23p| 欧美美女一区二区在线观看| 久久91精品国产91久久小草| 成人午夜免费电影| 亚洲一区二区在线观看视频| 日本最新不卡在线| 正在播放亚洲一区| 丝袜亚洲另类欧美| 555夜色666亚洲国产免| 天天操天天干天天综合网| 午夜影院在线观看欧美| 欧洲一区在线电影| 亚洲精品免费播放| 91久久精品一区二区三区| 亚洲免费观看高清完整版在线 | 国产专区欧美精品| 久久精品在线免费观看| 成人福利视频网站| 亚洲乱码精品一二三四区日韩在线| 国产精品资源站在线| 欧美裸体一区二区三区| 蜜臀av一区二区三区| 日韩三级免费观看| 男女视频一区二区| 91精品欧美福利在线观看| 久久国产精品无码网站| 国产日韩精品一区| 91福利在线观看| 亚洲欧美区自拍先锋| 欧美一区二区啪啪| 欧美性videosxxxxx| 91亚洲精品久久久蜜桃| 成人在线视频一区二区| 精品在线观看免费| 青草国产精品久久久久久| 亚洲一区国产视频| 樱桃视频在线观看一区| 国产精品网站在线观看| 久久精品男人天堂av| 日韩精品自拍偷拍| 日韩视频中午一区| 91精品国产综合久久福利软件| 欧美日韩视频在线第一区 | 亚洲成人www| 亚洲综合激情网| 一区二区三区影院| 一区二区免费看| 亚洲欧美视频在线观看视频| 亚洲人快播电影网| 亚洲丝袜制服诱惑| 亚洲影视在线观看| 日本特黄久久久高潮| 免费久久精品视频| 国产一区二区伦理片| 国产剧情一区二区| av激情成人网| 91久久精品午夜一区二区| 久久综合久久鬼色中文字| 日韩欧美电影一区| 国产亚洲精品久| 亚洲六月丁香色婷婷综合久久| 亚洲男人电影天堂| 亚洲国产精品久久一线不卡| 亚洲成精国产精品女| 老司机精品视频一区二区三区| 国内精品视频666| 成人激情文学综合网| 欧美三区免费完整视频在线观看| 欧美视频一区二区三区在线观看| 欧美成人a∨高清免费观看| 国产蜜臀av在线一区二区三区| 亚洲特黄一级片| 日本v片在线高清不卡在线观看| 韩日精品视频一区| 97久久精品人人爽人人爽蜜臀 | 婷婷开心激情综合| 国模少妇一区二区三区| 91天堂素人约啪| 91精品国产欧美一区二区18| 中文字幕va一区二区三区| 亚洲电影视频在线| 国产精品一区二区男女羞羞无遮挡| av在线一区二区三区| 91精品国产免费| 亚洲激情中文1区| 精品一区二区三区日韩| 日本韩国欧美三级| 久久久久97国产精华液好用吗| 亚洲高清不卡在线| 成人亚洲精品久久久久软件| 91精品欧美综合在线观看最新|