Rtos API example

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers lwip_ethernet.h Source File

lwip_ethernet.h

Go to the documentation of this file.
00001 /**
00002  * @file
00003  * Ethernet input function - handles INCOMING ethernet level traffic
00004  * To be used in most low-level netif implementations
00005  */
00006 
00007 /*
00008  * Copyright (c) 2001-2003 Swedish Institute of Computer Science.
00009  * Copyright (c) 2003-2004 Leon Woestenberg <leon.woestenberg@axon.tv>
00010  * Copyright (c) 2003-2004 Axon Digital Design B.V., The Netherlands.
00011  * All rights reserved.
00012  *
00013  * Redistribution and use in source and binary forms, with or without modification,
00014  * are permitted provided that the following conditions are met:
00015  *
00016  * 1. Redistributions of source code must retain the above copyright notice,
00017  *    this list of conditions and the following disclaimer.
00018  * 2. Redistributions in binary form must reproduce the above copyright notice,
00019  *    this list of conditions and the following disclaimer in the documentation
00020  *    and/or other materials provided with the distribution.
00021  * 3. The name of the author may not be used to endorse or promote products
00022  *    derived from this software without specific prior written permission.
00023  *
00024  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
00025  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00026  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
00027  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00028  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
00029  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00030  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00031  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
00032  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
00033  * OF SUCH DAMAGE.
00034  *
00035  * This file is part of the lwIP TCP/IP stack.
00036  *
00037  * Author: Adam Dunkels <adam@sics.se>
00038  *
00039  */
00040 
00041 #ifndef LWIP_HDR_NETIF_ETHERNET_H
00042 #define LWIP_HDR_NETIF_ETHERNET_H
00043 
00044 #include "lwip/opt.h"
00045 
00046 #include "lwip/pbuf.h"
00047 #include "lwip/netif.h"
00048 #include "lwip/prot/lwip_ethernet.h"
00049 
00050 #ifdef __cplusplus
00051 extern "C" {
00052 #endif
00053 
00054 #if LWIP_ARP || LWIP_ETHERNET
00055 
00056 /** Define this to 1 and define LWIP_ARP_FILTER_NETIF_FN(pbuf, netif, type)
00057  * to a filter function that returns the correct netif when using multiple
00058  * netifs on one hardware interface where the netif's low-level receive
00059  * routine cannot decide for the correct netif (e.g. when mapping multiple
00060  * IP addresses to one hardware interface).
00061  */
00062 #ifndef LWIP_ARP_FILTER_NETIF
00063 #define LWIP_ARP_FILTER_NETIF 0
00064 #endif
00065 
00066 err_t ethernet_input(struct pbuf *p, struct netif *netif);
00067 err_t ethernet_output(struct netif* netif, struct pbuf* p, const struct eth_addr* src, const struct eth_addr* dst, u16_t eth_type);
00068 
00069 extern const struct eth_addr ethbroadcast, ethzero;
00070 
00071 #endif /* LWIP_ARP || LWIP_ETHERNET */
00072 
00073 #ifdef __cplusplus
00074 }
00075 #endif
00076 
00077 #endif /* LWIP_HDR_NETIF_ETHERNET_H */