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

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

?? raw.c

?? 前段時間把lwip和ucos移植在44b0平臺上,用的是hfrk44b0開發板.已經調試通過,并且在板子上運行正常.
?? C
字號:
/** * @file * Raw Access module * *//* * 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> * *//* raw.c * * The code for the Raw Access to the IP * */#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"#include "string.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 * and process it if possible * * Given an incoming IP datagram (as a chain of pbufs) this function * finds a corresponding RAW PCB and * * @param pbuf pbuf to be demultiplexed to a RAW PCB. * @param netif network interface on which the datagram was received. * @return 0 if packet is not eated (pbuf needs to be freed then) *         or 1 if the packet has been eaten (pbuf needs not to be freed *         then) * */intraw_input(struct pbuf *p, struct netif *inp){  struct raw_pcb *pcb;  struct ip_hdr *iphdr;  int proto;  int rc = 0;  iphdr = p->payload;  proto = IPH_PROTO(iphdr);  for(pcb = raw_pcbs; pcb != NULL; pcb = pcb->next) {    if (pcb->protocol == proto) {      if (pcb->recv) {        if (!pcb->recv(pcb->recv_arg, pcb, p, &(iphdr->src)))          return 0;      }      pbuf_free(p);      rc = 1;      break;    }  }  return rc;}/** * 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 ipaddr 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_send_to() 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_send_to() */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 if a RAW packet with the pcb's protocol * is received. If the callback function returns a value unequal 0 * the raw packet is "eaten" and not forwarded to any other raw pcb * including lwip itself */voidraw_recv(struct raw_pcb *pcb,         int (* 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 inconsitent with the receive callback where * you actually get the IP headers), you can only specifiy 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 whole IP packet * */err_traw_send_to(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_send_to\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_send_to: 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_send_to: 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_send_to: No route to 0x%lx\n", ipaddr->addr));#if RAW_STATS    /*    ++lwip_stats.raw.rterr;*/#endif /* RAW_STATS */    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 whole IP packet * */err_traw_send(struct raw_pcb *pcb, struct pbuf *p){  return raw_send_to(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一区二区三区免费野_久草精品视频
色婷婷av一区二区三区软件 | 亚洲国产aⅴ成人精品无吗| 久国产精品韩国三级视频| 精品视频在线视频| 亚洲国产视频一区| 色婷婷av一区二区三区软件 | 中文字幕在线播放不卡一区| 精品一区二区三区视频在线观看| 欧美xxxx老人做受| 另类中文字幕网| 国产欧美日韩视频一区二区 | 日日嗨av一区二区三区四区| 6080国产精品一区二区| 国产在线精品一区二区夜色| 国产精品三级av| 欧美一区二区三区不卡| av一区二区三区黑人| 日本不卡视频一二三区| 国产精品日日摸夜夜摸av| 欧美婷婷六月丁香综合色| 国精产品一区一区三区mba桃花| 久久精品欧美一区二区三区麻豆| 99热99精品| 国产在线麻豆精品观看| 美女一区二区三区| 亚洲精品国产第一综合99久久 | 亚洲一区二区三区小说| 欧美精品视频www在线观看| 国产风韵犹存在线视精品| 亚洲综合视频在线| 中文一区二区在线观看| 91精品福利在线一区二区三区 | 午夜精品福利一区二区三区av| 在线观看网站黄不卡| 国产精品综合二区| 国产在线精品国自产拍免费| 奇米四色…亚洲| 国产精品系列在线观看| 国产成人午夜精品影院观看视频| 裸体在线国模精品偷拍| 美女视频免费一区| 久久不见久久见免费视频1| 夜夜精品视频一区二区| 国产精品入口麻豆原神| 日本一区二区三区在线观看| 日韩精品中文字幕一区 | 日韩欧美亚洲一区二区| 欧美性大战xxxxx久久久| 97精品久久久午夜一区二区三区 | 亚洲激情一二三区| 一区二区三区小说| 中文字幕乱码日本亚洲一区二区| 久久先锋资源网| 国产欧美日韩一区二区三区在线观看| 精品国产一区二区三区久久久蜜月| 91精品国产手机| 26uuu国产电影一区二区| 欧美一区二区三区视频免费 | 色婷婷狠狠综合| 欧美日韩一区二区三区高清| 91精品视频网| 国产精品麻豆欧美日韩ww| 国产精品国产精品国产专区不蜜 | 国产91精品欧美| 成人av动漫网站| 欧美色图免费看| 久久五月婷婷丁香社区| 亚洲视频在线一区观看| 国产精品久久久久影院| 免费观看91视频大全| 从欧美一区二区三区| 精品视频一区二区不卡| 中文字幕第一区二区| 亚洲成人精品在线观看| 国产成人在线视频网址| 欧美久久一二区| 亚洲美女区一区| 99久久精品国产精品久久| 久久成人久久爱| 久久精品免费观看| 欧美日韩在线电影| 亚洲欧美综合色| 精品一区二区三区免费| 在线不卡中文字幕播放| 亚洲视频免费在线观看| 日本视频免费一区| 欧美午夜电影一区| 一区二区三区四区不卡视频| 久久国产夜色精品鲁鲁99| 欧美日韩国产综合久久| 亚洲女女做受ⅹxx高潮| 91亚洲精品一区二区乱码| 国产精品入口麻豆原神| av一区二区三区四区| 中文字幕国产一区二区| 91麻豆国产在线观看| 久久精品免费在线观看| 久久爱另类一区二区小说| 精品国产乱码久久| 国产不卡免费视频| 欧美激情一区二区三区蜜桃视频| 亚洲自拍偷拍麻豆| 日韩视频在线永久播放| 国产91在线观看丝袜| 5月丁香婷婷综合| 国产一区二区三区黄视频 | 成人久久18免费网站麻豆| 中文字幕不卡在线| 777午夜精品免费视频| 日韩电影免费在线看| 中文字幕精品三区| 91麻豆精品国产91久久久久| 国产欧美一区在线| 欧美一区二区视频在线观看2020| 久久国产精品72免费观看| 亚洲激情第一区| 51精品秘密在线观看| 色综合网色综合| 国产一区二区免费看| 日韩精品乱码免费| 欧美国产乱子伦| 久久伊99综合婷婷久久伊| 欧美色老头old∨ideo| 91福利视频网站| 99国产精品久久久久| 精品在线亚洲视频| 久久99国产精品麻豆| 日本一区中文字幕| 亚洲第四色夜色| 亚洲高清不卡在线观看| 亚洲一区二区在线观看视频 | 久久99精品国产麻豆婷婷洗澡| 一区二区三区中文字幕精品精品| 国产喂奶挤奶一区二区三区| 久久九九久精品国产免费直播| 91精品国产综合久久精品麻豆 | 亚洲欧洲精品一区二区三区不卡| 2欧美一区二区三区在线观看视频| 在线一区二区视频| 91久久精品日日躁夜夜躁欧美| 高清不卡一区二区在线| 91麻豆高清视频| 日韩欧美综合一区| 欧日韩精品视频| 欧美精品1区2区3区| 精品欧美一区二区三区精品久久 | 国产精品亚洲综合一区在线观看| 久久国产尿小便嘘嘘| 成人高清视频在线观看| 在线欧美日韩国产| 久久色.com| 中文字幕中文字幕一区二区| 天天综合色天天| 成人一区在线观看| 51精品久久久久久久蜜臀| 91精品国产综合久久久久久漫画| 国产精品久久毛片av大全日韩| 一区二区三区在线免费视频| 激情都市一区二区| 精品免费99久久| 青青草国产精品亚洲专区无| 欧美日韩午夜精品| 亚洲成人av免费| 日韩三级免费观看| 国内久久精品视频| 欧美极品xxx| 91九色02白丝porn| 首页亚洲欧美制服丝腿| 日韩免费看网站| 成人国产在线观看| 亚洲福利电影网| 久久综合九色综合97婷婷| 成人激情电影免费在线观看| 中文字幕欧美三区| 欧美高清hd18日本| 国产成人精品在线看| 一区二区激情视频| 日韩欧美综合一区| 91在线精品秘密一区二区| 天堂va蜜桃一区二区三区漫画版| 91麻豆精品国产91久久久资源速度 | 欧美日韩国产欧美日美国产精品| 亚洲国产精品久久不卡毛片| 日韩美女在线视频| 91美女视频网站| 国产精选一区二区三区| 亚洲韩国精品一区| 国产精品二三区| www国产精品av| 91精品久久久久久蜜臀| 99re这里只有精品首页| 免费av网站大全久久| 亚洲免费毛片网站| 国产色综合一区| 精品sm捆绑视频| 欧美一区二区在线免费观看| 色综合一个色综合| 色哟哟一区二区在线观看 | 成人黄色小视频在线观看| 久久99精品久久久久|