[457] | 1 | /**
|
---|
| 2 | * @file
|
---|
| 3 | * lwIP netif implementing an IEEE 802.1D MAC Bridge
|
---|
| 4 | */
|
---|
| 5 |
|
---|
| 6 | /*
|
---|
| 7 | * Copyright (c) 2017 Simon Goldschmidt.
|
---|
| 8 | * All rights reserved.
|
---|
| 9 | *
|
---|
| 10 | * Redistribution and use in source and binary forms, with or without modification,
|
---|
| 11 | * are permitted provided that the following conditions are met:
|
---|
| 12 | *
|
---|
| 13 | * 1. Redistributions of source code must retain the above copyright notice,
|
---|
| 14 | * this list of conditions and the following disclaimer.
|
---|
| 15 | * 2. Redistributions in binary form must reproduce the above copyright notice,
|
---|
| 16 | * this list of conditions and the following disclaimer in the documentation
|
---|
| 17 | * and/or other materials provided with the distribution.
|
---|
| 18 | * 3. The name of the author may not be used to endorse or promote products
|
---|
| 19 | * derived from this software without specific prior written permission.
|
---|
| 20 | *
|
---|
| 21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
---|
| 22 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
---|
| 23 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
---|
| 24 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
---|
| 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
---|
| 26 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
---|
| 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
---|
| 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
---|
| 29 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
---|
| 30 | * OF SUCH DAMAGE.
|
---|
| 31 | *
|
---|
| 32 | * This file is part of the lwIP TCP/IP stack.
|
---|
| 33 | *
|
---|
| 34 | * Author: Simon Goldschmidt <goldsimon@gmx.de>
|
---|
| 35 | *
|
---|
| 36 | */
|
---|
| 37 |
|
---|
| 38 | #ifndef LWIP_HDR_NETIF_BRIDGEIF_OPTS_H
|
---|
| 39 | #define LWIP_HDR_NETIF_BRIDGEIF_OPTS_H
|
---|
| 40 |
|
---|
| 41 | #include "lwip/opt.h"
|
---|
| 42 |
|
---|
| 43 | /**
|
---|
| 44 | * @defgroup bridgeif_opts Options
|
---|
| 45 | * @ingroup bridgeif
|
---|
| 46 | * @{
|
---|
| 47 | */
|
---|
| 48 |
|
---|
| 49 | /** BRIDGEIF_PORT_NETIFS_OUTPUT_DIRECT==1: set port netif's 'input' function
|
---|
| 50 | * to call directly into bridgeif code and on top of that, directly call into
|
---|
| 51 | * the selected forwarding port's 'linkoutput' function.
|
---|
| 52 | * This means that the bridgeif input/output path is protected from concurrent access
|
---|
| 53 | * but as well, *all* bridge port netif's drivers must correctly handle concurrent access!
|
---|
| 54 | * == 0: get into tcpip_thread for every input packet (no multithreading)
|
---|
| 55 | * ATTENTION: as ==0 relies on tcpip.h, the default depends on NO_SYS setting
|
---|
| 56 | */
|
---|
| 57 | #ifndef BRIDGEIF_PORT_NETIFS_OUTPUT_DIRECT
|
---|
| 58 | #define BRIDGEIF_PORT_NETIFS_OUTPUT_DIRECT NO_SYS
|
---|
| 59 | #endif
|
---|
| 60 |
|
---|
| 61 | /** BRIDGEIF_MAX_PORTS: this is used to create a typedef used for forwarding
|
---|
| 62 | * bit-fields: the number of bits required is this + 1 (for the internal/cpu port)
|
---|
| 63 | * (63 is the maximum, resulting in an u64_t for the bit mask)
|
---|
| 64 | * ATTENTION: this controls the maximum number of the implementation only!
|
---|
| 65 | * The max. number of ports per bridge must still be passed via netif_add parameter!
|
---|
| 66 | */
|
---|
| 67 | #ifndef BRIDGEIF_MAX_PORTS
|
---|
| 68 | #define BRIDGEIF_MAX_PORTS 7
|
---|
| 69 | #endif
|
---|
| 70 |
|
---|
| 71 | /** BRIDGEIF_DEBUG: Enable generic debugging in bridgeif.c. */
|
---|
| 72 | #ifndef BRIDGEIF_DEBUG
|
---|
| 73 | #define BRIDGEIF_DEBUG LWIP_DBG_OFF
|
---|
| 74 | #endif
|
---|
| 75 |
|
---|
| 76 | /** BRIDGEIF_DEBUG: Enable FDB debugging in bridgeif.c. */
|
---|
| 77 | #ifndef BRIDGEIF_FDB_DEBUG
|
---|
| 78 | #define BRIDGEIF_FDB_DEBUG LWIP_DBG_OFF
|
---|
| 79 | #endif
|
---|
| 80 |
|
---|
| 81 | /** BRIDGEIF_DEBUG: Enable forwarding debugging in bridgeif.c. */
|
---|
| 82 | #ifndef BRIDGEIF_FW_DEBUG
|
---|
| 83 | #define BRIDGEIF_FW_DEBUG LWIP_DBG_OFF
|
---|
| 84 | #endif
|
---|
| 85 |
|
---|
| 86 | /**
|
---|
| 87 | * @}
|
---|
| 88 | */
|
---|
| 89 |
|
---|
| 90 | #endif /* LWIP_HDR_NETIF_BRIDGEIF_OPTS_H */
|
---|