Files
esp-lwip/.github/workflows/ci-linux.yml
T
martin-ger 319d4d3c91 napt: Add basic support for NAT by martin-ger
* Cosmetic updates on NAPT functionality implemented by martin-ger
- moved NAPT specific code from ip4.c to ip4_napt.c
- formatting updates to keep the changes easier to review
- updated per C-90 style used for lwip upstream (fixed warning,
renaming, lwip types)
- esp_random() -> LWIP_RAND()
- drop the connection with routing err if failed to add new napt record
- prepared for lwip unit testing

* Add ip4 routing tests
- lwip native ip-forward tests
- napt feature test udp, tcp
- napt feature, test add/release of nat records
Testing configurations: lwip unit tests are executed in the following
three configurations:
- default
- IP_FORWARD=1
- IP_FORWARD=1 & IP_NAPT=1
Note that debugging option ESP_TEST_DEBUG was introduced to enable running only
IP-FORWARD/IP-NAPT tests with verbose output

* Fix checksum of UDP
- According to the UDP protocol, the checksum is optional.
so if the checksum is 0, this meaning the checksum is turn off, and no need to
correct checksum.

* Fix disbale IPv6 and enable NAPT will build error

Co-Authored-By: David Cermak <cermak@espressif.com> (4b4d6b28, 754b8d5d)
Co-Authored-By: leo chung <gewalalb@gmail.com> (bb63eed1)
Co-Authored-By: yuanjm <yuanjianmin@espressif.com> (74cf7f9f)
Ref IDF-4800
2022-03-24 10:20:47 +01:00

57 lines
1.8 KiB
YAML

name: CI
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
compiler: [gcc, clang]
env:
CC: ${{ matrix.compiler }}
LSAN_OPTIONS: verbosity=1:log_threads=1
WGET_PATH: http://download.savannah.nongnu.org/releases/lwip
CONTRIB: contrib-2.1.0
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install deps
run: |
sudo apt-get install check ninja-build doxygen
wget --no-verbose ${WGET_PATH}/${CONTRIB}.zip
unzip -oq ${CONTRIB}.zip
patch -s -p0 < test/${CONTRIB}.patch
- name: Build and Run unit tests with make
run: |
export LWIPDIR=../../../../src && cd ${CONTRIB}/ports/unix/check
make -j 4 check
make clean
export EXTRA_CFLAGS="-DIP_FORWARD=1" && export CC="cc $EXTRA_CFLAGS"
make -j 4 check
make clean
export EXTRA_CFLAGS="-DIP_FORWARD=1 -DIP_NAPT=1 -DLWIP_ARCH_CC_H -include cc_esp_platform.h" && export CC="cc $EXTRA_CFLAGS"
make -j 4 check
- name: Run cmake
run: mkdir build && cd build && cmake .. -G Ninja
- name: Build with cmake
run: cd build && cmake --build .
- name: Build docs with cmake
run: cd build && cmake --build . --target lwipdocs
- name: Validate combinations of options
run: |
cp ${CONTRIB}/examples/example_app/lwipcfg.h.example ${CONTRIB}/examples/example_app/lwipcfg.h
cd ${CONTRIB}/ports/unix/example_app
export CFLAGS="-DESP_LWIP=LWIP_NETCONN_FULLDUPLEX"
export LWIPDIR=../../../../src/
chmod +x iteropts.sh && ./iteropts.sh
- name: Build and run unit tests with cmake
run: |
cd ${CONTRIB}/ports/unix/check
mkdir build && cd build && cmake -DLWIP_DIR=`pwd`/../../../../.. .. -G Ninja
cmake --build . && ./lwip_unittests