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

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

?? udp.c

?? MCS-51的一個Free小型操作系統(tǒng),在KeilC中下編譯工作
?? C
?? 第 1 頁 / 共 2 頁
字號:
    pbuf_chain(q, p);    /* { first pbuf q points to header pbuf } */    LWIP_DEBUGF(UDP_DEBUG, ("udp_send: added header pbuf %p before given pbuf %p\n", (void *)q, (void *)p));  /* adding a header within p succeeded */  } else {    /* first pbuf q equals given pbuf */    q = p;    LWIP_DEBUGF(UDP_DEBUG, ("udp_send: added header in given pbuf %p\n", (void *)p));  }  /* { q now represents the packet to be sent } */  udphdr = q->payload;  udphdr->src = htons(pcb->local_port);  udphdr->dest = htons(pcb->remote_port);  /* in UDP, 0 checksum means 'no checksum' */  udphdr->chksum = 0x0000;   /* PCB local address is IP_ANY_ADDR? */  if (ip_addr_isany(&pcb->local_ip)) {    /* use outgoing network interface IP address as source address */    src_ip = &(netif->ip_addr);  } else {    /* use UDP PCB local IP address as source address */    src_ip = &(pcb->local_ip);  }  LWIP_DEBUGF(UDP_DEBUG, ("udp_send: sending datagram of length %"U16_F"\n", q->tot_len));  /* UDP Lite protocol? */  if (pcb->flags & UDP_FLAGS_UDPLITE) {    LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP LITE packet length %"U16_F"\n", q->tot_len));    /* set UDP message length in UDP header */    udphdr->len = htons(pcb->chksum_len);    /* calculate checksum */#if CHECKSUM_GEN_UDP    udphdr->chksum = inet_chksum_pseudo(q, src_ip, &(pcb->remote_ip),          IP_PROTO_UDP, pcb->chksum_len);    /* chksum zero must become 0xffff, as zero means 'no checksum' */    if (udphdr->chksum == 0x0000) udphdr->chksum = 0xffff;#else    udphdr->chksum = 0x0000;#endif    /* output to IP */    LWIP_DEBUGF(UDP_DEBUG, ("udp_send: ip_output_if (,,,,IP_PROTO_UDPLITE,)\n"));    err = ip_output_if (q, src_ip, &pcb->remote_ip, pcb->ttl, pcb->tos, IP_PROTO_UDPLITE, netif);      /* UDP */  } else {    LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP packet length %"U16_F"\n", q->tot_len));    udphdr->len = htons(q->tot_len);    /* calculate checksum */#if CHECKSUM_GEN_UDP    if ((pcb->flags & UDP_FLAGS_NOCHKSUM) == 0) {      udphdr->chksum = inet_chksum_pseudo(q, src_ip, &pcb->remote_ip, IP_PROTO_UDP, q->tot_len);      /* chksum zero must become 0xffff, as zero means 'no checksum' */      if (udphdr->chksum == 0x0000) udphdr->chksum = 0xffff;    }#else    udphdr->chksum = 0x0000;#endif    LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP checksum 0x%04"X16_F"\n", udphdr->chksum));    LWIP_DEBUGF(UDP_DEBUG, ("udp_send: ip_output_if (,,,,IP_PROTO_UDP,)\n"));    /* output to IP */    err = ip_output_if(q, src_ip, &pcb->remote_ip, pcb->ttl, pcb->tos, IP_PROTO_UDP, netif);      }  /* TODO: must this be increased even if error occured? */  snmp_inc_udpoutdatagrams();  /* did we chain a seperate header pbuf earlier? */  if (q != p) {    /* free the header pbuf */    pbuf_free(q); q = NULL;    /* { p is still referenced by the caller, and will live on } */  }  UDP_STATS_INC(udp.xmit);  return err;}/** * Bind an UDP PCB. * * @param pcb UDP PCB to be bound with a local address ipaddr and port. * @param ipaddr local IP address to bind with. Use IP_ADDR_ANY to * bind to all local interfaces. * @param port local UDP port to bind with. * * @return lwIP error code. * - ERR_OK. Successful. No error occured. * - ERR_USE. The specified ipaddr and port are already bound to by * another UDP PCB. * * @see udp_disconnect() */err_tudp_bind(struct udp_pcb *pcb, struct ip_addr *ipaddr, u16_t port){  struct udp_pcb *ipcb;  u8_t rebind;  LWIP_DEBUGF(UDP_DEBUG | DBG_TRACE | 3, ("udp_bind(ipaddr = "));  ip_addr_debug_print(UDP_DEBUG, ipaddr);  LWIP_DEBUGF(UDP_DEBUG | DBG_TRACE | 3, (", port = %"U16_F")\n", port));  rebind = 0;  /* Check for double bind and rebind of the same pcb */  for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {    /* is this UDP PCB already on active list? */    if (pcb == ipcb) {      /* pcb may occur at most once in active list */      LWIP_ASSERT("rebind == 0", rebind == 0);      /* pcb already in list, just rebind */      rebind = 1;    }/* this code does not allow upper layer to share a UDP port for   listening to broadcast or multicast traffic (See SO_REUSE_ADDR and   SO_REUSE_PORT under *BSD). TODO: See where it fits instead, OR   combine with implementation of UDP PCB flags. Leon Woestenberg. */#ifdef LWIP_UDP_TODO    /* port matches that of PCB in list? */    else if ((ipcb->local_port == port) &&       /* IP address matches, or one is IP_ADDR_ANY? */       (ip_addr_isany(&(ipcb->local_ip)) ||       ip_addr_isany(ipaddr) ||       ip_addr_cmp(&(ipcb->local_ip), ipaddr))) {      /* other PCB already binds to this local IP and port */      LWIP_DEBUGF(UDP_DEBUG, ("udp_bind: local port %"U16_F" already bound by another pcb\n", port));      return ERR_USE;    }#endif  }  ip_addr_set(&pcb->local_ip, ipaddr);  /* no port specified? */  if (port == 0) {#ifndef UDP_LOCAL_PORT_RANGE_START#define UDP_LOCAL_PORT_RANGE_START 4096#define UDP_LOCAL_PORT_RANGE_END   0x7fff#endif    port = UDP_LOCAL_PORT_RANGE_START;    ipcb = udp_pcbs;    while ((ipcb != NULL) && (port != UDP_LOCAL_PORT_RANGE_END)) {      if (ipcb->local_port == port) {        port++;        ipcb = udp_pcbs;      } else        ipcb = ipcb->next;    }    if (ipcb != NULL) {      /* no more ports available in local range */      LWIP_DEBUGF(UDP_DEBUG, ("udp_bind: out of free UDP ports\n"));      return ERR_USE;    }  }  pcb->local_port = port;  /* pcb not active yet? */  if (rebind == 0) {    /* place the PCB on the active list if not already there */    pcb->next = udp_pcbs;    udp_pcbs = pcb;  }  LWIP_DEBUGF(UDP_DEBUG | DBG_TRACE | DBG_STATE, ("udp_bind: bound to %"U16_F".%"U16_F".%"U16_F".%"U16_F", port %"U16_F"\n",   (u16_t)(ntohl(pcb->local_ip.addr) >> 24 & 0xff),   (u16_t)(ntohl(pcb->local_ip.addr) >> 16 & 0xff),   (u16_t)(ntohl(pcb->local_ip.addr) >> 8 & 0xff),   (u16_t)(ntohl(pcb->local_ip.addr) & 0xff), pcb->local_port));  return ERR_OK;}/** * Connect an UDP PCB. * * This will associate the UDP PCB with the remote address. * * @param pcb UDP PCB to be connected with remote address ipaddr and port. * @param ipaddr remote IP address to connect with. * @param port remote UDP port to connect with. * * @return lwIP error code * * @see udp_disconnect() */err_tudp_connect(struct udp_pcb *pcb, struct ip_addr *ipaddr, u16_t port){  struct udp_pcb *ipcb;  if (pcb->local_port == 0) {    err_t err = udp_bind(pcb, &pcb->local_ip, pcb->local_port);    if (err != ERR_OK)      return err;  }  ip_addr_set(&pcb->remote_ip, ipaddr);  pcb->remote_port = port;  pcb->flags |= UDP_FLAGS_CONNECTED;/** TODO: this functionality belongs in upper layers */#ifdef LWIP_UDP_TODO  /* Nail down local IP for netconn_addr()/getsockname() */  if (ip_addr_isany(&pcb->local_ip) && !ip_addr_isany(&pcb->remote_ip)) {    struct netif *netif;    if ((netif = ip_route(&(pcb->remote_ip))) == NULL) {      LWIP_DEBUGF(UDP_DEBUG, ("udp_connect: No route to 0x%lx\n", pcb->remote_ip.addr));        UDP_STATS_INC(udp.rterr);      return ERR_RTE;    }    /** TODO: this will bind the udp pcb locally, to the interface which        is used to route output packets to the remote address. However, we        might want to accept incoming packets on any interface! */    pcb->local_ip = netif->ip_addr;  } else if (ip_addr_isany(&pcb->remote_ip)) {    pcb->local_ip.addr = 0;  }#endif  LWIP_DEBUGF(UDP_DEBUG | DBG_TRACE | DBG_STATE, ("udp_connect: connected to %"U16_F".%"U16_F".%"U16_F".%"U16_F",port %"U16_F"\n",   (u16_t)(ntohl(pcb->remote_ip.addr) >> 24 & 0xff),   (u16_t)(ntohl(pcb->remote_ip.addr) >> 16 & 0xff),   (u16_t)(ntohl(pcb->remote_ip.addr) >> 8 & 0xff),   (u16_t)(ntohl(pcb->remote_ip.addr) & 0xff), pcb->remote_port));  /* Insert UDP PCB into the list of active UDP PCBs. */  for(ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {    if (pcb == ipcb) {      /* already on the list, just return */      return ERR_OK;    }  }  /* PCB not yet on the list, add PCB now */  pcb->next = udp_pcbs;  udp_pcbs = pcb;  return ERR_OK;}voidudp_disconnect(struct udp_pcb *pcb){  /* reset remote address association */  ip_addr_set(&pcb->remote_ip, IP_ADDR_ANY);  pcb->remote_port = 0;  /* mark PCB as unconnected */  pcb->flags &= ~UDP_FLAGS_CONNECTED;}voidudp_recv(struct udp_pcb *pcb,   void (* recv)(void *arg, struct udp_pcb *upcb, struct pbuf *p,           struct ip_addr *addr, u16_t port),   void *recv_arg){  /* remember recv() callback and user data */  pcb->recv = recv;  pcb->recv_arg = recv_arg;}/** * Remove an UDP PCB. * * @param pcb UDP PCB to be removed. The PCB is removed from the list of * UDP PCB's and the data structure is freed from memory. * * @see udp_new() */voidudp_remove(struct udp_pcb *pcb){  struct udp_pcb *pcb2;  /* pcb to be removed is first in list? */  if (udp_pcbs == pcb) {    /* make list start at 2nd pcb */    udp_pcbs = udp_pcbs->next;  /* pcb not 1st in list */  } else for(pcb2 = udp_pcbs; pcb2 != NULL; pcb2 = pcb2->next) {    /* find pcb in udp_pcbs list */    if (pcb2->next != NULL && pcb2->next == pcb) {      /* remove pcb from list */      pcb2->next = pcb->next;    }  }  memp_free(MEMP_UDP_PCB, pcb);}/** * Create a UDP PCB. * * @return The UDP PCB which was created. NULL if the PCB data structure * could not be allocated. * * @see udp_remove() */struct udp_pcb *udp_new(void) {  struct udp_pcb *pcb;  pcb = memp_malloc(MEMP_UDP_PCB);  /* could allocate UDP PCB? */  if (pcb != NULL) {    /* initialize PCB to all zeroes */    memset(pcb, 0, sizeof(struct udp_pcb));    pcb->ttl = UDP_TTL;  }      return pcb;}#if UDP_DEBUGvoidudp_debug_print(struct udp_hdr *udphdr){  LWIP_DEBUGF(UDP_DEBUG, ("UDP header:\n"));  LWIP_DEBUGF(UDP_DEBUG, ("+-------------------------------+\n"));  LWIP_DEBUGF(UDP_DEBUG, ("|     %5"U16_F"     |     %5"U16_F"     | (src port, dest port)\n",         ntohs(udphdr->src), ntohs(udphdr->dest)));  LWIP_DEBUGF(UDP_DEBUG, ("+-------------------------------+\n"));  LWIP_DEBUGF(UDP_DEBUG, ("|     %5"U16_F"     |     0x%04"X16_F"    | (len, chksum)\n",         ntohs(udphdr->len), ntohs(udphdr->chksum)));  LWIP_DEBUGF(UDP_DEBUG, ("+-------------------------------+\n"));}#endif /* UDP_DEBUG */#endif /* LWIP_UDP */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品亚洲精品国产欧美| 久久久久久久久久久久电影| 日韩一区二区在线免费观看| 久久精品亚洲一区二区三区浴池| 一区二区三区四区视频精品免费| 日本大胆欧美人术艺术动态| 成人黄色电影在线 | 伊人婷婷欧美激情| 蜜臀av在线播放一区二区三区| 成+人+亚洲+综合天堂| 欧美一级日韩不卡播放免费| 综合久久久久久| 国产九九视频一区二区三区| 欧美一区二区视频在线观看2022| 中文字幕欧美一区| 国产传媒日韩欧美成人| 日韩欧美中文字幕精品| 亚洲一区在线看| 97精品视频在线观看自产线路二| 精品国产亚洲在线| 三级一区在线视频先锋| 日本道在线观看一区二区| 国产精品第四页| 丰满岳乱妇一区二区三区| 久久久久久久久一| 精品一区二区久久| 日韩午夜电影在线观看| 日韩精品一级中文字幕精品视频免费观看 | 国产一区二区三区四| 欧美日韩性生活| 亚洲激情第一区| 色综合网站在线| 亚洲综合另类小说| 91一区二区在线观看| 亚洲欧洲性图库| 99re这里都是精品| 国产精品国产三级国产aⅴ中文 | 欧美不卡一区二区| 麻豆免费看一区二区三区| 欧美一区二区国产| 精品在线播放免费| 国产丝袜美腿一区二区三区| 国产精品一二三四| 国产精品人人做人人爽人人添| 国产精品一区二区免费不卡| 久久久午夜电影| 成人av动漫在线| 中文字幕亚洲一区二区av在线| 成人av小说网| 亚洲女人的天堂| 欧美天天综合网| 亚洲va韩国va欧美va| 日韩一区二区在线观看| 精品亚洲免费视频| 国产精品超碰97尤物18| 色综合久久中文字幕| 亚洲午夜激情av| 欧美成人一区二区三区片免费| 国产综合久久久久影院| 日本一区二区三区国色天香| 91香蕉视频污在线| 亚洲成人av资源| 精品国产乱码久久久久久夜甘婷婷| 国产一区二区三区av电影| 国产精品久久久久久久久晋中 | 国产成人8x视频一区二区| 中文字幕免费不卡| 欧美日韩在线直播| 国产麻豆日韩欧美久久| 亚洲激情av在线| 久久久久久久国产精品影院| 成人高清伦理免费影院在线观看| 亚洲精品网站在线观看| 精品国产乱码久久久久久图片| 播五月开心婷婷综合| 亚洲福利国产精品| 欧美经典三级视频一区二区三区| 在线亚洲高清视频| 国产福利不卡视频| 午夜电影久久久| 国产精品午夜在线| 欧美一级片在线观看| gogogo免费视频观看亚洲一| 免费高清成人在线| 亚洲精品一二三四区| 精品免费99久久| 欧美无砖专区一中文字| 国产成人精品一区二区三区四区 | 欧美一区二区三区色| 97se亚洲国产综合自在线不卡| 日韩电影在线观看电影| 自拍偷拍国产精品| 日本一区二区成人在线| 26uuu国产一区二区三区| 一本在线高清不卡dvd| 国产凹凸在线观看一区二区| 日韩精品一卡二卡三卡四卡无卡| 亚洲女同女同女同女同女同69| 精品国产sm最大网站| 欧美区在线观看| 91极品美女在线| 成人免费观看男女羞羞视频| 亚洲电影视频在线| 亚洲综合久久久| 亚洲精品国产精华液| 欧美激情一区二区三区全黄| 欧美不卡一二三| 欧美成人国产一区二区| 日韩三级高清在线| 91精品欧美福利在线观看| 欧美日本高清视频在线观看| 91香蕉视频mp4| av激情成人网| 99re这里只有精品首页| 99久久免费视频.com| 不卡的av在线播放| 91免费小视频| 色视频成人在线观看免| 91精品福利视频| 在线精品视频小说1| 一本久久综合亚洲鲁鲁五月天| 色婷婷av一区| 欧美人与禽zozo性伦| 日韩午夜电影av| 久久精品水蜜桃av综合天堂| 久久精品人人爽人人爽| 国产精品久久久久影院色老大| 日日夜夜精品视频免费| 午夜伦理一区二区| 日韩国产一二三区| 精品一区二区三区不卡| 国产精品18久久久久久久久久久久| 国产一区二区不卡老阿姨| 国产成人精品影视| 一本大道久久a久久综合婷婷| 色婷婷久久久综合中文字幕| 欧美日韩激情在线| 精品久久久久一区| 中文字幕一区二区三| 亚洲国产欧美日韩另类综合| 日韩黄色免费网站| 国产精品99久久久久久久vr| 99久久精品国产观看| 欧美三级韩国三级日本三斤 | 亚洲www啪成人一区二区麻豆| 婷婷中文字幕综合| 韩国三级在线一区| 日本高清无吗v一区| 在线播放国产精品二区一二区四区| 日韩免费福利电影在线观看| 亚洲欧美综合色| 亚洲丶国产丶欧美一区二区三区| 黑人巨大精品欧美一区| 色综合天天综合网国产成人综合天 | 亚洲一区二区三区四区在线观看| 日日摸夜夜添夜夜添精品视频| 国内精品久久久久影院色| 色综合天天综合色综合av| 日韩免费高清视频| 一区二区三区资源| 国产盗摄视频一区二区三区| 在线精品视频小说1| 久久久久国色av免费看影院| 亚洲一二三四在线| 丁香激情综合国产| 91精品欧美一区二区三区综合在| 国产精品私人影院| 蜜桃av一区二区在线观看| 一本大道av一区二区在线播放| 日韩一区二区视频| 亚洲精品久久久蜜桃| 国产传媒久久文化传媒| 欧美卡1卡2卡| 一区二区三区免费网站| av在线播放不卡| 久久奇米777| 麻豆91小视频| 欧美福利视频一区| 一区二区久久久久久| 成人app网站| 国产偷国产偷亚洲高清人白洁 | 亚洲激情欧美激情| av中文字幕在线不卡| 久久精品欧美一区二区三区不卡| 免费观看成人av| 欧美日韩国产成人在线91| 亚洲色图.com| av不卡一区二区三区| 中文欧美字幕免费| 国产精品一区二区在线观看网站| 欧美一级理论片| 日本在线观看不卡视频| 欧美色中文字幕| 亚洲精品国产一区二区三区四区在线| 国产精品911| 国产性天天综合网| 国产成人无遮挡在线视频| 国产欧美日韩精品在线| 国产成人免费在线观看不卡| 久久久亚洲精品石原莉奈|