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

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

?? raw.c

?? 基于AT91SAM7x256的硬件平臺的WEB服務器源碼(A&shy DS版本, ucOS_II+LWIP+自己編寫的DNS查詢工具)
?? C
字號:
/** * @file *  * Implementation of raw protocol PCBs for low-level handling of * different types of protocols besides (or overriding) those * already available in lwIP. * *//* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, *    this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, *    this list of conditions and the following disclaimer in the documentation *    and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products *    derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. * * Author: Adam Dunkels <adam@sics.se> * */#include <string.h>#include "lwip/opt.h"#include "lwip/def.h"#include "lwip/memp.h"#include "lwip/inet.h"#include "lwip/ip_addr.h"#include "lwip/netif.h"#include "lwip/raw.h"#include "lwip/stats.h"#include "arch/perf.h"#include "lwip/snmp.h"#if LWIP_RAW/** The list of RAW PCBs */static struct raw_pcb *raw_pcbs = NULL;voidraw_init(void){  raw_pcbs = NULL;}/** * Determine if in incoming IP packet is covered by a RAW PCB * and if so, pass it to a user-provided receive callback function. * * Given an incoming IP datagram (as a chain of pbufs) this function * finds a corresponding RAW PCB and calls the corresponding receive * callback function. * * @param pbuf pbuf to be demultiplexed to a RAW PCB. * @param netif network interface on which the datagram was received. * @Return - 1 if the packet has been eaten by a RAW PCB receive *           callback function. The caller MAY NOT not reference the *           packet any longer, and MAY NOT call pbuf_free(). * @return - 0 if packet is not eaten (pbuf is still referenced by the *           caller). * */u8_traw_input(struct pbuf *p, struct netif *inp){  struct raw_pcb *pcb;  struct ip_hdr *iphdr;  s16_t proto;  u8_t eaten = 0;  iphdr = p->payload;  proto = IPH_PROTO(iphdr);  pcb = raw_pcbs;  /* loop through all raw pcbs until the packet is eaten by one */  /* this allows multiple pcbs to match against the packet by design */  while ((eaten == 0) && (pcb != NULL)) {    if (pcb->protocol == proto) {      /* receive callback function available? */      if (pcb->recv != NULL) {        /* the receive callback function did not eat the packet? */        if (pcb->recv(pcb->recv_arg, pcb, p, &(iphdr->src)) != 0)        {          /* receive function ate the packet */          p = NULL;          eaten = 1;        }      }      /* no receive callback function was set for this raw PCB */      /* drop the packet */    }    pcb = pcb->next;  }  return eaten;}/** * Bind a RAW PCB. * * @param pcb RAW PCB to be bound with a local address ipaddr. * @param ipaddr local IP address to bind with. Use IP_ADDR_ANY to * bind to all local interfaces. * * @return lwIP error code. * - ERR_OK. Successful. No error occured. * - ERR_USE. The specified IP address is already bound to by * another RAW PCB. * * @see raw_disconnect() */err_traw_bind(struct raw_pcb *pcb, struct ip_addr *ipaddr){  ip_addr_set(&pcb->local_ip, ipaddr);  return ERR_OK;}/** * Connect an RAW PCB. This function is required by upper layers * of lwip. Using the raw api you could use raw_sendto() instead * * This will associate the RAW PCB with the remote address. * * @param pcb RAW PCB to be connected with remote address ipaddr and port. * @param ipaddr remote IP address to connect with. * * @return lwIP error code * * @see raw_disconnect() and raw_sendto() */err_traw_connect(struct raw_pcb *pcb, struct ip_addr *ipaddr){  ip_addr_set(&pcb->remote_ip, ipaddr);  return ERR_OK;}/** * Set the callback function for received packets that match the * raw PCB's protocol and binding.  *  * The callback function MUST either * - eat the packet by calling pbuf_free() and returning non-zero. The *   packet will not be passed to other raw PCBs or other protocol layers. * - not free the packet, and return zero. The packet will be matched *   against further PCBs and/or forwarded to another protocol layers. *  * @return non-zero if the packet was free()d, zero if the packet remains * available for others. */voidraw_recv(struct raw_pcb *pcb,         u8_t (* recv)(void *arg, struct raw_pcb *upcb, struct pbuf *p,                      struct ip_addr *addr),         void *recv_arg){  /* remember recv() callback and user data */  pcb->recv = recv;  pcb->recv_arg = recv_arg;}/** * Send the raw IP packet to the given address. Note that actually you cannot * modify the IP headers (this is inconsistent with the receive callback where * you actually get the IP headers), you can only specify the IP payload here. * It requires some more changes in lwIP. (there will be a raw_send() function * then.) * * @param pcb the raw pcb which to send * @param p the IP payload to send * @param ipaddr the destination address of the IP packet * */err_traw_sendto(struct raw_pcb *pcb, struct pbuf *p, struct ip_addr *ipaddr){  err_t err;  struct netif *netif;  struct ip_addr *src_ip;  struct pbuf *q; /* q will be sent down the stack */    LWIP_DEBUGF(RAW_DEBUG | DBG_TRACE | 3, ("raw_sendto\n"));    /* not enough space to add an IP header to first pbuf in given p chain? */  if (pbuf_header(p, IP_HLEN)) {    /* allocate header in new pbuf */    q = pbuf_alloc(PBUF_IP, 0, PBUF_RAM);    /* new header pbuf could not be allocated? */    if (q == NULL) {      LWIP_DEBUGF(RAW_DEBUG | DBG_TRACE | 2, ("raw_sendto: could not allocate header\n"));      return ERR_MEM;    }    /* chain header q in front of given pbuf p */    pbuf_chain(q, p);    /* { first pbuf q points to header pbuf } */    LWIP_DEBUGF(RAW_DEBUG, ("raw_sendto: added header pbuf %p before given pbuf %p\n", (void *)q, (void *)p));  }  else {    /* first pbuf q equals given pbuf */    q = p;    pbuf_header(q, -IP_HLEN);  }    if ((netif = ip_route(ipaddr)) == NULL) {    LWIP_DEBUGF(RAW_DEBUG | 1, ("raw_sendto: No route to 0x%"X32_F"\n", ipaddr->addr));#if RAW_STATS    /*    ++lwip_stats.raw.rterr;*/#endif /* RAW_STATS */    /* free any temporary header pbuf allocated by pbuf_header() */    if (q != p) {      pbuf_free(q);    }    return ERR_RTE;  }  if (ip_addr_isany(&pcb->local_ip)) {    /* use outgoing network interface IP address as source address */    src_ip = &(netif->ip_addr);  } else {    /* use RAW PCB local IP address as source address */    src_ip = &(pcb->local_ip);  }  err = ip_output_if (q, src_ip, ipaddr, pcb->ttl, pcb->tos, pcb->protocol, netif);  /* did we chain a header earlier? */  if (q != p) {    /* free the header */    pbuf_free(q);  }  return err;}/** * Send the raw IP packet to the address given by raw_connect() * * @param pcb the raw pcb which to send * @param p the IP payload to send * @param ipaddr the destination address of the IP packet * */err_traw_send(struct raw_pcb *pcb, struct pbuf *p){  return raw_sendto(pcb, p, &pcb->remote_ip);}/** * Remove an RAW PCB. * * @param pcb RAW PCB to be removed. The PCB is removed from the list of * RAW PCB's and the data structure is freed from memory. * * @see raw_new() */voidraw_remove(struct raw_pcb *pcb){  struct raw_pcb *pcb2;  /* pcb to be removed is first in list? */  if (raw_pcbs == pcb) {    /* make list start at 2nd pcb */    raw_pcbs = raw_pcbs->next;    /* pcb not 1st in list */  } else for(pcb2 = raw_pcbs; pcb2 != NULL; pcb2 = pcb2->next) {    /* find pcb in raw_pcbs list */    if (pcb2->next != NULL && pcb2->next == pcb) {      /* remove pcb from list */      pcb2->next = pcb->next;    }  }  memp_free(MEMP_RAW_PCB, pcb);}/** * Create a RAW PCB. * * @return The RAW PCB which was created. NULL if the PCB data structure * could not be allocated. * * @param proto the protocol number of the IPs payload (e.g. IP_PROTO_ICMP) * * @see raw_remove() */struct raw_pcb *raw_new(u16_t proto) {  struct raw_pcb *pcb;  LWIP_DEBUGF(RAW_DEBUG | DBG_TRACE | 3, ("raw_new\n"));  pcb = memp_malloc(MEMP_RAW_PCB);  /* could allocate RAW PCB? */  if (pcb != NULL) {    /* initialize PCB to all zeroes */    memset(pcb, 0, sizeof(struct raw_pcb));    pcb->protocol = proto;    pcb->ttl = RAW_TTL;    pcb->next = raw_pcbs;    raw_pcbs = pcb;  }  return pcb;}#endif /* LWIP_RAW */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人亚洲一区二区一| 午夜精品久久久久久| 欧美影院一区二区| 极品少妇xxxx精品少妇偷拍| 日韩毛片精品高清免费| 精品国产电影一区二区| 色综合久久六月婷婷中文字幕| 蜜桃久久av一区| 亚洲最新视频在线播放| 国产情人综合久久777777| 欧美精三区欧美精三区| 色久优优欧美色久优优| 国产.欧美.日韩| 麻豆91在线播放免费| 亚洲成av人片在线观看| 《视频一区视频二区| 2021中文字幕一区亚洲| 在线播放91灌醉迷j高跟美女| 91免费小视频| 成人黄色av电影| 狠狠色丁香九九婷婷综合五月| 亚洲自拍欧美精品| 日韩毛片视频在线看| 国产精品亲子乱子伦xxxx裸| 精品不卡在线视频| 日韩三级视频在线观看| 欧美精品久久久久久久多人混战| 色综合久久九月婷婷色综合| 99久久精品一区二区| 粉嫩久久99精品久久久久久夜 | 午夜精品影院在线观看| 亚洲素人一区二区| 国产精品不卡在线| 亚洲国产高清在线| 日本一区二区三区国色天香 | 欧美日本韩国一区二区三区视频 | 国产精品综合二区| 激情伊人五月天久久综合| 美洲天堂一区二卡三卡四卡视频| 亚洲mv在线观看| 无码av免费一区二区三区试看| 亚洲主播在线观看| 一二三区精品视频| 亚洲一区电影777| 亚洲国产一区二区三区青草影视| 一卡二卡三卡日韩欧美| 亚洲制服丝袜一区| 亚洲国产成人高清精品| 亚洲大片免费看| 日本大胆欧美人术艺术动态| 免费在线欧美视频| 久草这里只有精品视频| 国产二区国产一区在线观看| 大美女一区二区三区| 成人成人成人在线视频| 在线观看免费视频综合| 欧美日韩激情一区二区| 欧美一级二级三级蜜桃| 日韩精品一区二区三区在线播放| 精品久久人人做人人爽| 久久精品水蜜桃av综合天堂| 国产精品二三区| 亚洲永久免费av| 人妖欧美一区二区| 国产一区二区三区免费在线观看| 懂色av一区二区三区免费看| 91首页免费视频| 欧美日韩在线电影| 精品久久五月天| 亚洲欧洲无码一区二区三区| 亚洲国产欧美在线人成| 久久av中文字幕片| 99久久精品国产一区| 欧美三级韩国三级日本一级| 欧美刺激脚交jootjob| 国产精品拍天天在线| 亚洲成人自拍偷拍| 国产伦精品一区二区三区在线观看 | 日韩免费一区二区| 国产免费观看久久| 天天综合色天天| 国产成人免费视| 欧美亚洲愉拍一区二区| 久久综合久久久久88| 亚洲图片欧美激情| 精品一区二区三区在线观看国产| 成人性生交大片免费看中文网站| 欧美午夜理伦三级在线观看| 欧美精品一区二区三区四区| 亚洲精选一二三| 国产精品亚洲视频| 欧美图片一区二区三区| 中文字幕欧美区| 日本中文字幕不卡| 91在线视频18| 久久久亚洲精品石原莉奈| 亚洲自拍偷拍综合| 成人午夜精品一区二区三区| 制服丝袜中文字幕一区| 17c精品麻豆一区二区免费| 激情深爱一区二区| 色欧美乱欧美15图片| 国产三区在线成人av| 日韩中文字幕91| 色综合视频在线观看| 国产日韩欧美亚洲| 美女国产一区二区| 欧美日韩精品一区二区在线播放| 亚洲国产精品成人综合| 麻豆精品一区二区| 欧美日韩和欧美的一区二区| 国产精品成人在线观看| 国产最新精品精品你懂的| 91.com在线观看| 一区二区三区精品视频在线| 国产成人精品aa毛片| 欧美xxxxx牲另类人与| 无码av免费一区二区三区试看| 色欧美88888久久久久久影院| 国产精品美女www爽爽爽| 国产美女一区二区| wwwwww.欧美系列| 久国产精品韩国三级视频| 91精品国产综合久久精品| 亚洲一区二区在线免费观看视频 | 欧美少妇bbb| 亚洲综合区在线| 色婷婷精品大在线视频| 中文字幕一区二区三区在线观看| 国产精品一区二区久久精品爱涩 | 视频一区中文字幕| 欧美午夜精品电影| 亚洲综合久久av| 91蝌蚪porny九色| 亚洲色图清纯唯美| 色妹子一区二区| 亚洲激情男女视频| 欧美亚洲禁片免费| 婷婷综合五月天| 欧美一区二区在线看| 免费看日韩a级影片| 日韩精品影音先锋| 韩日欧美一区二区三区| 精品精品国产高清a毛片牛牛| 国内精品国产成人| 久久精品亚洲精品国产欧美kt∨| 经典三级在线一区| 久久精品欧美一区二区三区不卡| 国产福利一区二区三区视频在线 | 欧美做爰猛烈大尺度电影无法无天| 椎名由奈av一区二区三区| 99久久精品国产毛片| 亚洲一区二区三区美女| 91精品国产入口在线| 麻豆国产精品一区二区三区 | 日本aⅴ精品一区二区三区| 欧美v国产在线一区二区三区| 黄一区二区三区| 中文天堂在线一区| 色呦呦国产精品| 日日夜夜免费精品| 精品播放一区二区| 91免费观看视频| 日韩高清欧美激情| 久久综合国产精品| 91在线播放网址| 午夜精品福利一区二区三区蜜桃| 日韩午夜激情视频| 国产69精品久久久久毛片| 亚洲在线视频网站| 精品久久久久久久久久久院品网| 国产91精品精华液一区二区三区| 一区二区三区精品视频| 精品处破学生在线二十三| 一本到不卡免费一区二区| 日日夜夜免费精品| 中文字幕av免费专区久久| 欧美色视频在线| 国产一区二区在线电影| 一区二区三区影院| 欧美精品一区二区三区蜜桃视频| www.成人在线| 美女视频免费一区| 综合激情成人伊人| 精品国产免费人成在线观看| 91丨porny丨在线| 精品一区二区三区免费毛片爱| 国产精品三级av在线播放| 欧美喷潮久久久xxxxx| 国产精品91xxx| 天天色图综合网| 亚洲天堂福利av| 精品久久五月天| 欧美三级欧美一级| 成人免费va视频| 麻豆国产精品一区二区三区| 亚洲影院在线观看| 国产欧美视频一区二区三区| 3atv一区二区三区| 一本一道波多野结衣一区二区|