├── .gitignore ├── .travis.yml ├── AUTHORS ├── CHANGES ├── LICENSE ├── Makefile.am ├── README.md ├── acinclude.m4 ├── autogen.sh ├── build-debian.sh ├── configure.ac ├── contrib ├── VERSION ├── apps │ ├── chargen │ │ ├── README │ │ ├── chargen.c │ │ └── chargen.h │ ├── httpserver │ │ ├── README │ │ ├── httpserver-netconn.c │ │ └── httpserver-netconn.h │ ├── httpserver_raw │ │ ├── fs.c │ │ ├── fs.h │ │ ├── fs │ │ │ ├── 404.html │ │ │ ├── img │ │ │ │ └── sics.gif │ │ │ └── index.html │ │ ├── fsdata.c │ │ ├── fsdata.h │ │ ├── httpd.c │ │ ├── httpd.h │ │ ├── httpd_structs.h │ │ └── makefsdata │ │ │ ├── makefsdata │ │ │ ├── makefsdata.c │ │ │ └── readme.txt │ ├── netbios │ │ ├── netbios.c │ │ └── netbios.h │ ├── netio │ │ ├── netio.c │ │ └── netio.h │ ├── ping │ │ ├── ping.c │ │ └── ping.h │ ├── rtp │ │ ├── rtp.c │ │ ├── rtp.h │ │ └── rtpdata.h │ ├── shell │ │ ├── shell.c │ │ └── shell.h │ ├── smtp │ │ ├── smtp.c │ │ └── smtp.h │ ├── snmp_private_mib │ │ ├── lwip_prvmib.c │ │ └── private_mib.h │ ├── sntp │ │ ├── sntp.c │ │ └── sntp.h │ ├── socket_examples │ │ ├── socket_examples.c │ │ └── socket_examples.h │ ├── tcpecho │ │ ├── tcpecho.c │ │ └── tcpecho.h │ ├── tcpecho_raw │ │ ├── echo.c │ │ └── echo.h │ └── udpecho │ │ ├── udpecho.c │ │ └── udpecho.h └── ports │ ├── FILES │ ├── old │ ├── 6502 │ │ ├── README │ │ ├── include │ │ │ └── arch │ │ │ │ ├── cc.h │ │ │ │ ├── cpu.h │ │ │ │ ├── lib.h │ │ │ │ ├── perf.h │ │ │ │ └── sys_arch.h │ │ ├── lib_arch.c │ │ └── sys_c64.c │ ├── FILES │ ├── c16x │ │ ├── FILES │ │ ├── include │ │ │ ├── arch │ │ │ │ ├── cc.h │ │ │ │ ├── cpu.h │ │ │ │ ├── lib.h │ │ │ │ └── perf.h │ │ │ └── netif │ │ │ │ └── cs8900if.h │ │ ├── lib.c │ │ ├── netif │ │ │ └── cs8900if.c │ │ └── perf.c │ ├── coldfire │ │ ├── README │ │ ├── include │ │ │ ├── arch │ │ │ │ ├── cc.h │ │ │ │ ├── errno.h │ │ │ │ ├── mcf5272.h │ │ │ │ ├── perf.h │ │ │ │ └── sys_arch.h │ │ │ └── netif │ │ │ │ ├── 5272fec.h │ │ │ │ └── tcpdump.h │ │ ├── netif │ │ │ ├── 5272fec.c │ │ │ └── tcpdump.c │ │ ├── perf.c │ │ ├── proj │ │ │ └── lwipopts.h │ │ └── sys_arch.c │ ├── ecos │ │ ├── README │ │ ├── copy │ │ ├── ecos │ │ │ ├── net │ │ │ │ └── lwip_tcpip │ │ │ │ │ └── current │ │ │ │ │ ├── cdl │ │ │ │ │ └── lwip_net.cdl │ │ │ │ │ ├── include │ │ │ │ │ ├── arch │ │ │ │ │ │ ├── cc.h │ │ │ │ │ │ ├── perf.h │ │ │ │ │ │ └── sys_arch.h │ │ │ │ │ ├── lwipopts.h │ │ │ │ │ └── network.h │ │ │ │ │ ├── src │ │ │ │ │ └── ecos │ │ │ │ │ │ ├── init.c │ │ │ │ │ │ ├── sio.c │ │ │ │ │ │ └── sys_arch.c │ │ │ │ │ └── tests │ │ │ │ │ ├── httpd.c │ │ │ │ │ ├── nc_test_framework.h │ │ │ │ │ ├── nc_test_slave.c │ │ │ │ │ ├── socket.c │ │ │ │ │ ├── sys_timeout.c │ │ │ │ │ ├── tcpecho.c │ │ │ │ │ └── udpecho.c │ │ │ └── pkgadd.db │ │ ├── files │ │ ├── header │ │ └── mkepk │ ├── rtxc │ │ ├── include │ │ │ ├── arch │ │ │ │ ├── cc.h │ │ │ │ ├── cpu.h │ │ │ │ ├── init.h │ │ │ │ ├── lib.h │ │ │ │ ├── perf.h │ │ │ │ └── sys_arch.h │ │ │ └── netif │ │ │ │ ├── cs8900if.h │ │ │ │ └── sioslipif.h │ │ ├── lib.c │ │ ├── netif │ │ │ ├── FILES │ │ │ └── sioslipif.c │ │ ├── perf.c │ │ └── sys_arch.c │ ├── ti_c6711 │ │ ├── FILES │ │ ├── [Note] opt setting of lwIP .txt │ │ ├── include │ │ │ ├── arch │ │ │ │ ├── cc.h │ │ │ │ ├── init.h │ │ │ │ ├── lib.h │ │ │ │ ├── perf.h │ │ │ │ └── sys_arch.h │ │ │ └── netif │ │ │ │ └── ne2kif.h │ │ ├── lib_arch.c │ │ ├── netif │ │ │ └── ne2kif.c │ │ ├── proj │ │ │ ├── lwIP.c │ │ │ └── lwipopts.h │ │ └── sys_arch.c │ └── v2pro │ │ ├── Makefile │ │ ├── include │ │ ├── arch │ │ │ ├── cc.h │ │ │ ├── cpu.h │ │ │ ├── perf.h │ │ │ └── sys_arch.h │ │ └── netif │ │ │ └── xemacif.h │ │ ├── lib_arch.c │ │ ├── lwipopts.h │ │ ├── netif │ │ └── xemacif.c │ │ ├── perf.c │ │ └── sw_services │ │ └── lwip_v1_00_a │ │ ├── data │ │ ├── lwip_v2_1_0.mld │ │ └── lwip_v2_1_0.tcl │ │ └── src │ │ └── Makefile │ ├── unix │ ├── check │ │ ├── README │ │ └── sys_arch.c │ ├── include │ │ ├── arch │ │ │ ├── cc.h │ │ │ ├── perf.h │ │ │ └── sys_arch.h │ │ └── netif │ │ │ ├── delif.h │ │ │ ├── dropif.h │ │ │ ├── fifo.h │ │ │ ├── list.h │ │ │ ├── pcapif.h │ │ │ ├── sio.h │ │ │ ├── tapif.h │ │ │ ├── tcpdump.h │ │ │ ├── tunif.h │ │ │ └── unixif.h │ ├── lwip_chksum.c │ ├── netif │ │ ├── delif.c │ │ ├── fifo.c │ │ ├── list.c │ │ ├── pcapif.c │ │ ├── sio.c │ │ ├── tapif.c │ │ ├── tcpdump.c │ │ ├── tunif.c │ │ └── unixif.c │ ├── perf.c │ ├── proj │ │ ├── lib │ │ │ ├── Makefile │ │ │ ├── README │ │ │ ├── lwipopts.h │ │ │ └── unixlib.c │ │ ├── minimal │ │ │ ├── Makefile │ │ │ ├── README │ │ │ ├── lwipopts.h │ │ │ ├── main.c │ │ │ ├── mintapif.c │ │ │ ├── mintapif.h │ │ │ ├── timer.c │ │ │ └── timer.h │ │ └── unixsim │ │ │ ├── Makefile │ │ │ ├── README │ │ │ ├── lwipopts.h │ │ │ ├── simhost.c │ │ │ ├── simnode.c │ │ │ └── simrouter.c │ └── sys_arch.c │ └── win32 │ ├── .cvsignore │ ├── check │ ├── config.h │ ├── sys │ │ └── time.h │ ├── time.c │ └── unistd.h │ ├── include │ ├── arch │ │ ├── bpstruct.h │ │ ├── cc.h │ │ ├── epstruct.h │ │ ├── perf.h │ │ └── sys_arch.h │ └── lwipopts.h │ ├── lwipcfg_msvc.h.example │ ├── lwippools.h │ ├── msvc8 │ ├── libcheck.vcproj │ ├── lwIP.vcproj │ ├── lwIP_Test.sln │ ├── lwIP_Test.vcproj │ ├── lwIP_pcapif.vcproj │ ├── lwIP_unittests.sln │ ├── lwip_unittests.vcproj │ ├── makefsdata.vcproj │ └── readme.txt │ ├── pcapif.c │ ├── pcapif.h │ ├── pcapif_helper.c │ ├── pcapif_helper.h │ ├── readme.txt │ ├── sio.c │ ├── sys_arch.c │ └── test.c ├── lwip ├── .gitattributes ├── CHANGELOG ├── COPYING ├── FILES ├── README ├── UPGRADING ├── VERSION ├── doc │ ├── FILES │ ├── contrib.txt │ ├── rawapi.txt │ ├── savannah.txt │ ├── snmp_agent.txt │ └── sys_arch.txt ├── src │ ├── FILES │ ├── api │ │ ├── api_lib.c │ │ ├── api_msg.c │ │ ├── err.c │ │ ├── netbuf.c │ │ ├── netdb.c │ │ ├── netifapi.c │ │ ├── pppapi.c │ │ ├── sockets.c │ │ └── tcpip.c │ ├── core │ │ ├── def.c │ │ ├── dhcp.c │ │ ├── dns.c │ │ ├── inet_chksum.c │ │ ├── init.c │ │ ├── ipv4 │ │ │ ├── autoip.c │ │ │ ├── icmp.c │ │ │ ├── igmp.c │ │ │ ├── ip4.c │ │ │ ├── ip4_addr.c │ │ │ └── ip_frag.c │ │ ├── ipv6 │ │ │ ├── README │ │ │ ├── dhcp6.c │ │ │ ├── ethip6.c │ │ │ ├── icmp6.c │ │ │ ├── inet6.c │ │ │ ├── ip6.c │ │ │ ├── ip6_addr.c │ │ │ ├── ip6_frag.c │ │ │ ├── mld6.c │ │ │ └── nd6.c │ │ ├── mem.c │ │ ├── memp.c │ │ ├── netif.c │ │ ├── pbuf.c │ │ ├── raw.c │ │ ├── snmp │ │ │ ├── asn1_dec.c │ │ │ ├── asn1_enc.c │ │ │ ├── mib2.c │ │ │ ├── mib_structs.c │ │ │ ├── msg_in.c │ │ │ └── msg_out.c │ │ ├── stats.c │ │ ├── sys.c │ │ ├── tcp.c │ │ ├── tcp_in.c │ │ ├── tcp_out.c │ │ ├── timers.c │ │ └── udp.c │ ├── include │ │ ├── ipv4 │ │ │ └── lwip │ │ │ │ ├── autoip.h │ │ │ │ ├── icmp.h │ │ │ │ ├── igmp.h │ │ │ │ ├── inet.h │ │ │ │ ├── ip4.h │ │ │ │ ├── ip4_addr.h │ │ │ │ └── ip_frag.h │ │ ├── ipv6 │ │ │ └── lwip │ │ │ │ ├── dhcp6.h │ │ │ │ ├── ethip6.h │ │ │ │ ├── icmp6.h │ │ │ │ ├── inet6.h │ │ │ │ ├── ip6.h │ │ │ │ ├── ip6_addr.h │ │ │ │ ├── ip6_frag.h │ │ │ │ ├── mld6.h │ │ │ │ └── nd6.h │ │ ├── lwip │ │ │ ├── api.h │ │ │ ├── api_msg.h │ │ │ ├── arch.h │ │ │ ├── debug.h │ │ │ ├── def.h │ │ │ ├── dhcp.h │ │ │ ├── dns.h │ │ │ ├── err.h │ │ │ ├── inet_chksum.h │ │ │ ├── init.h │ │ │ ├── ip.h │ │ │ ├── ip_addr.h │ │ │ ├── mem.h │ │ │ ├── memp.h │ │ │ ├── memp_std.h │ │ │ ├── netbuf.h │ │ │ ├── netdb.h │ │ │ ├── netif.h │ │ │ ├── netifapi.h │ │ │ ├── opt.h │ │ │ ├── pbuf.h │ │ │ ├── pppapi.h │ │ │ ├── raw.h │ │ │ ├── sio.h │ │ │ ├── snmp.h │ │ │ ├── snmp_asn1.h │ │ │ ├── snmp_msg.h │ │ │ ├── snmp_structs.h │ │ │ ├── sockets.h │ │ │ ├── stats.h │ │ │ ├── sys.h │ │ │ ├── tcp.h │ │ │ ├── tcp_impl.h │ │ │ ├── tcpip.h │ │ │ ├── timers.h │ │ │ └── udp.h │ │ ├── netif │ │ │ ├── etharp.h │ │ │ ├── ppp │ │ │ │ ├── ccp.h │ │ │ │ ├── chap-md5.h │ │ │ │ ├── chap-new.h │ │ │ │ ├── chap_ms.h │ │ │ │ ├── eap.h │ │ │ │ ├── ecp.h │ │ │ │ ├── eui64.h │ │ │ │ ├── fsm.h │ │ │ │ ├── ipcp.h │ │ │ │ ├── ipv6cp.h │ │ │ │ ├── lcp.h │ │ │ │ ├── magic.h │ │ │ │ ├── polarssl │ │ │ │ │ ├── des.h │ │ │ │ │ ├── md4.h │ │ │ │ │ ├── md5.h │ │ │ │ │ └── sha1.h │ │ │ │ ├── ppp.h │ │ │ │ ├── ppp_impl.h │ │ │ │ ├── pppcrypt.h │ │ │ │ ├── pppdebug.h │ │ │ │ ├── pppoe.h │ │ │ │ ├── pppol2tp.h │ │ │ │ ├── upap.h │ │ │ │ └── vj.h │ │ │ └── slipif.h │ │ └── posix │ │ │ ├── netdb.h │ │ │ └── sys │ │ │ └── socket.h │ └── netif │ │ ├── FILES │ │ ├── etharp.c │ │ ├── ethernetif.c │ │ ├── ppp │ │ ├── PPPD_FOLLOWUP │ │ ├── auth.c │ │ ├── ccp.c │ │ ├── chap-md5.c │ │ ├── chap-new.c │ │ ├── chap_ms.c │ │ ├── demand.c │ │ ├── eap.c │ │ ├── ecp.c │ │ ├── eui64.c │ │ ├── fsm.c │ │ ├── ipcp.c │ │ ├── ipv6cp.c │ │ ├── lcp.c │ │ ├── magic.c │ │ ├── multilink.c │ │ ├── polarssl │ │ │ ├── README │ │ │ ├── des.c │ │ │ ├── md4.c │ │ │ ├── md5.c │ │ │ └── sha1.c │ │ ├── ppp.c │ │ ├── pppcrypt.c │ │ ├── pppoe.c │ │ ├── pppol2tp.c │ │ ├── upap.c │ │ ├── utils.c │ │ └── vj.c │ │ └── slipif.c └── test │ └── unit │ ├── core │ ├── test_mem.c │ ├── test_mem.h │ ├── test_pbuf.c │ └── test_pbuf.h │ ├── dhcp │ ├── test_dhcp.c │ └── test_dhcp.h │ ├── etharp │ ├── test_etharp.c │ └── test_etharp.h │ ├── lwip_check.h │ ├── lwip_unittests.c │ ├── lwipopts.h │ ├── tcp │ ├── tcp_helper.c │ ├── tcp_helper.h │ ├── test_tcp.c │ ├── test_tcp.h │ ├── test_tcp_oos.c │ └── test_tcp_oos.h │ └── udp │ ├── test_udp.c │ └── test_udp.h ├── ocproxy.1 ├── ppa ├── compat ├── control ├── copyright ├── patches │ └── series ├── rules ├── source │ └── format └── watch ├── release.sh ├── src ├── lwipopts.h ├── ocproxy.c └── vpnns.c └── vpnns.1 /.gitignore: -------------------------------------------------------------------------------- 1 | # autotools stuff 2 | Makefile 3 | Makefile.in 4 | aclocal.m4 5 | compile 6 | config.h 7 | config.h.in 8 | config.log 9 | config.status 10 | configure 11 | depcomp 12 | install-sh 13 | missing 14 | .deps/ 15 | .dirstamp 16 | stamp-h1 17 | autom4te.cache/ 18 | config.guess 19 | config.sub 20 | m4/ 21 | 22 | # objects 23 | *.o 24 | ocproxy 25 | vpnns 26 | ocproxy*.tar.gz 27 | ocproxy*.tar.gz.asc 28 | /TAGS 29 | /tags 30 | 31 | # Debian 32 | tmp.debian/ 33 | ocproxy*.deb 34 | lintian.txt 35 | ppa/changelog 36 | 37 | # scratch files 38 | .*.sw* 39 | *~ 40 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | compiler: 3 | - gcc 4 | - clang 5 | 6 | notifications: 7 | email: 8 | on_success: change 9 | on_failure: always 10 | 11 | before_install: 12 | - sudo apt-get update -qq 13 | - sudo apt-get install -qq autoconf automake debhelper dh-autoreconf devscripts fakeroot git-core libevent-dev 14 | 15 | script: 16 | - ./autogen.sh && 17 | mkdir build && 18 | pushd build && 19 | ../configure && 20 | make && 21 | make dist && 22 | mv ocproxy*.tar.gz ../ && 23 | popd && 24 | ./build-debian.sh 25 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | ocproxy / vpnns: 2 | 3 | Copyright (c) 2012-2014 David Edmondson 4 | Copyright (c) 2012-2014 Kevin Cernekee 5 | Copyright (c) 2016 Google Inc. 6 | 7 | lwIP: 8 | 9 | See lwip/COPYING and credits in each individual file 10 | -------------------------------------------------------------------------------- /CHANGES: -------------------------------------------------------------------------------- 1 | v1.70 - UNRELEASED 2 | 3 | - Have the vpnns watcher process re-create the bind mount if the underlying 4 | resolv.conf is deleted (e.g. by NetworkManager) 5 | 6 | - Eliminate the possible 1-second delay when starting a new vpnns instance 7 | 8 | - Minor manpage update 9 | 10 | v1.60 - 2017/01/08 11 | 12 | - Allow specifying the local SOCKS address via "-D :". 13 | 14 | - Add experimental vpnns program 15 | 16 | v1.50 - 2014/07/06 17 | 18 | - Fix a bunch of stability issues seen under load (web browsing on SOCKS) 19 | 20 | - Add man page 21 | 22 | - Switch build system to GNU autotools 23 | 24 | - Update to the latest lwIP and fix DNS lookup bugs 25 | 26 | - Delete unused netmask and gateway options 27 | 28 | - Add scripts to build one-off packages for Ubuntu PPA 29 | 30 | - Use Travis CI to run automated builds on each commit 31 | 32 | v1.20121120160713 - 2012/11/20 33 | 34 | - Initial release. 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Redistribution and use in source and binary forms, with or without 2 | modification, are permitted provided that the following conditions are met: 3 | 4 | 1. Redistributions of source code must retain the above copyright notice, 5 | this list of conditions and the following disclaimer. 6 | 2. Redistributions in binary form must reproduce the above copyright notice, 7 | this list of conditions and the following disclaimer in the documentation 8 | and/or other materials provided with the distribution. 9 | 3. The name of the author may not be used to endorse or promote products 10 | derived from this software without specific prior written permission. 11 | 12 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 13 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 14 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN 15 | NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 16 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 17 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 18 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 19 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 20 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 21 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | autoreconf --force --install --verbose 6 | rm -rf autom4te*.cache 7 | -------------------------------------------------------------------------------- /build-debian.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | gpgkey="BC0B0D65" 4 | ppaname="cernekee/ppa" 5 | 6 | builddir=tmp.debian 7 | pkg=ocproxy 8 | 9 | function build_one 10 | { 11 | arg="$1" 12 | 13 | rm -rf $builddir 14 | mkdir $builddir 15 | pushd $builddir 16 | 17 | cp ../$tarball "${pkg}_${ver}.orig.tar.gz" 18 | mkdir "$pkg-$ver" 19 | cd "$pkg-$ver" 20 | tar --strip 1 -zxf ../../$tarball 21 | cp -a ../../ppa debian 22 | if [ "$nosign" = "0" ]; then 23 | debuild "$arg" 24 | else 25 | debuild "$arg" -us -uc 26 | fi 27 | cd .. 28 | lintian -IE --pedantic *.changes | tee -a ../lintian.txt || true 29 | popd 30 | } 31 | 32 | # 33 | # MAIN 34 | # 35 | 36 | release=0 37 | 38 | while [ -n "$1" ]; do 39 | case "$1" in 40 | -r) 41 | release=1 42 | ;; 43 | *) 44 | echo "usage: $0 [-r]" 45 | exit 1 46 | ;; 47 | esac 48 | shift 49 | done 50 | 51 | tarball=$(ls -1 ${pkg}-*.tar.gz 2> /dev/null || true) 52 | if [ -z "$tarball" -o ! -e "$tarball" ]; then 53 | echo "missing release tarball" 54 | exit 1 55 | fi 56 | 57 | ver=${tarball#*-} 58 | ver=${ver%%.tar.gz} 59 | 60 | if gpg --list-secret-keys $gpgkey >& /dev/null; then 61 | nosign=0 62 | else 63 | nosign=1 64 | fi 65 | 66 | rm -f lintian.txt ${pkg}*.deb 67 | touch lintian.txt 68 | 69 | set -ex 70 | 71 | dist=$(lsb_release -si) 72 | if [ "$dist" = "Ubuntu" ]; then 73 | rm -f ppa/changelog 74 | codename=$(lsb_release -sc) 75 | 76 | if [ $release != 1 ]; then 77 | today=$(date +%Y%m%d%H%M%S) 78 | ver="${ver}~${today}" 79 | fi 80 | uver="${ver}-1ppa1" 81 | 82 | dch --create --changelog ppa/changelog --package $pkg \ 83 | --newversion "${uver}~${codename}" \ 84 | --distribution $codename \ 85 | "New PPA build." 86 | elif [ ! -e ppa/changelog ]; then 87 | dch --create --changelog ppa/changelog --package $pkg \ 88 | --newversion "${ver}-1" \ 89 | --distribution unstable \ 90 | "Test build. (Closes: #12345)" 91 | fi 92 | 93 | build_one "" 94 | cp $builddir/*.deb . 95 | echo "------------" >> lintian.txt 96 | build_one "-S" 97 | 98 | set +ex 99 | 100 | echo "--------" 101 | echo "lintian:" 102 | echo "--------" 103 | cat lintian.txt 104 | echo "--------" 105 | 106 | if [ -n "$uver" -a "$nosign" = "0" ]; then 107 | echo "" 108 | echo "UPLOAD COMMAND:" 109 | echo "" 110 | echo " dput ppa:$ppaname tmp.debian/*_source.changes" 111 | echo "" 112 | fi 113 | 114 | exit 0 115 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | AC_PREREQ([2.61]) 2 | AC_INIT([ocproxy], [1.70], [dme@dme.org], [ocproxy], [https://github.com/cernekee/ocproxy]) 3 | AM_INIT_AUTOMAKE 4 | AC_CONFIG_HEADERS([config.h]) 5 | AC_CONFIG_MACRO_DIR([m4]) 6 | AC_USE_SYSTEM_EXTENSIONS 7 | AC_GNU_SOURCE 8 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 9 | 10 | AC_PROG_CC 11 | AC_PROG_CC_C99 12 | AC_CANONICAL_HOST 13 | AC_CONFIG_FILES([Makefile]) 14 | 15 | # --enable-debug 16 | 17 | AC_ARG_ENABLE( 18 | [debug], 19 | [AS_HELP_STRING([--enable-debug],[enable debugging code and output])], 20 | [], 21 | [enable_debug="no"] 22 | ) 23 | 24 | if test "x$enable_debug" = xyes; then 25 | CFLAGS="$CFLAGS -O0 -ggdb" 26 | fi 27 | 28 | # --enable-vpnns 29 | 30 | case $host_os in 31 | *linux*) 32 | vpnns_default=yes 33 | ;; 34 | *) 35 | vpnns_default=no 36 | ;; 37 | esac 38 | 39 | AC_ARG_ENABLE( 40 | [vpnns], 41 | [AS_HELP_STRING([--enable-vpnns],[build vpnns binary (Linux only)])], 42 | [enable_vpnns="$enableval"], 43 | [enable_vpnns="$vpnns_default"] 44 | ) 45 | 46 | if test "x$enable_vpnns" = xyes; then 47 | AC_CHECK_HEADERS([linux/if_tun.h sched.h], [], 48 | [AC_MSG_ERROR([Missing headers for vpnns])]) 49 | 50 | fi 51 | AM_CONDITIONAL([ENABLE_VPNNS], [test "x$enable_vpnns" = xyes]) 52 | 53 | EXTRA_PC_LIBS="" 54 | 55 | AS_COMPILER_FLAGS(WFLAGS, 56 | "-Wall 57 | -Wextra 58 | -Wno-missing-field-initializers 59 | -Wno-sign-compare 60 | -Wno-pointer-sign 61 | -Wno-unused-parameter 62 | -Wno-address 63 | -Werror=pointer-to-int-cast 64 | -Wno-declaration-after-statement 65 | -Werror-implicit-function-declaration 66 | -Wformat-nonliteral 67 | -Wformat-security 68 | -Winit-self 69 | -Wno-missing-declarations 70 | -Wmissing-include-dirs 71 | -Wnested-externs 72 | -Wpointer-arith 73 | -Wwrite-strings") 74 | AC_SUBST(WFLAGS, [$WFLAGS]) 75 | 76 | AC_SEARCH_LIBS([event_add], [event]) 77 | AC_CHECK_HEADERS([event2/event.h], [], 78 | [AC_MSG_ERROR([Missing development files for libevent2])]) 79 | 80 | AX_PTHREAD 81 | LIBS="$PTHREAD_LIBS $LIBS" 82 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" 83 | CC="$PTHREAD_CC" 84 | 85 | AC_OUTPUT 86 | -------------------------------------------------------------------------------- /contrib/VERSION: -------------------------------------------------------------------------------- 1 | 36eab8918473ab575ed11c87cee33954a52e6a1d 2 | -------------------------------------------------------------------------------- /contrib/apps/chargen/README: -------------------------------------------------------------------------------- 1 | 2 | CHARGEN 3 | 4 | This file implements a nice example of handling multiple tcp sockets in a 5 | server environment. Just call chargen_init() from your application after 6 | you have initialized lwip and added your network interfaces. Change the 7 | MAX_SERV option to increase or decrease the number of sessions supported. 8 | 9 | chargen will jam as much data as possible into the output socket, so it 10 | will take up a lot of CPU time. Therefore it will be a good idea to run it 11 | as the lowest possible priority (just ahead of any idle task). 12 | 13 | This is also a good example of how to support multiple sessions in an 14 | embedded system where you might not have fork(). The multiple sessions are 15 | all handled by the same thread and select() is used for demultiplexing. 16 | 17 | No makefile is provided, just add chargen to the makefile for your 18 | application. It is OS and HW independent. 19 | 20 | Once the chargen server is running in your application, go to another system 21 | and open a telnet session to your lwip platform at port 19. You should see an 22 | ASCII pattern start to stream on you screen. 23 | 24 | As an example, lets say that your system running lwip is at IP address 25 | 192.168.10.244 and you have a linux system connected to it at IP address 26 | 192.168.10.59. Issue the following command at a terminal prompt on the linux system: 27 | 28 | telnet 192.168.10.244 19 29 | 30 | You will see a pattern similar to the following on streaming by on your 31 | screen: 32 | 33 | ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{ 34 | BCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{| 35 | CDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|} 36 | DEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ 37 | EFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~! 38 | FGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!" 39 | GHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"# 40 | HIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"#$ 41 | IJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"#$% 42 | JKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"#$%& 43 | KLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"#$%&' 44 | LMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"#$%&'( 45 | 46 | It even works from windows: At a dos prompt you can also issue the same 47 | telnet command and you will get a similar (but much slower, at least on W98) 48 | data stream. 49 | 50 | David Haas 51 | 52 | 53 | -------------------------------------------------------------------------------- /contrib/apps/chargen/chargen.h: -------------------------------------------------------------------------------- 1 | #ifndef LWIP_CHARGEN_H 2 | #define LWIP_CHARGEN_H 3 | 4 | #include "lwip/opt.h" 5 | 6 | #if LWIP_SOCKET 7 | 8 | void chargen_init(void); 9 | 10 | #endif /* LWIP_SOCKET */ 11 | 12 | 13 | #endif /* LWIP_CHARGEN_H */ 14 | -------------------------------------------------------------------------------- /contrib/apps/httpserver/README: -------------------------------------------------------------------------------- 1 | HTTPSERVER 2 | 3 | This is a demonstration of how to make the most basic kind 4 | of server using lWIP. 5 | 6 | * httpserver-raw.c - uses raw TCP calls (coming soon!) 7 | 8 | * httpserver-netconn.c - uses netconn and netbuf API 9 | 10 | This code updates the examples in Adam Dunkel's original 11 | lwIP documentation to match changes in the code since that 12 | PDF release. 13 | -------------------------------------------------------------------------------- /contrib/apps/httpserver/httpserver-netconn.h: -------------------------------------------------------------------------------- 1 | #ifndef LWIP_HTTPSERVER_NETCONN_H 2 | #define LWIP_HTTPSERVER_NETCONN_H 3 | 4 | void http_server_netconn_init(); 5 | 6 | #endif /* LWIP_HTTPSERVER_NETCONN_H */ 7 | -------------------------------------------------------------------------------- /contrib/apps/httpserver_raw/fs/404.html: -------------------------------------------------------------------------------- 1 | 2 | lwIP - A Lightweight TCP/IP Stack 3 | 4 | 5 | 6 | 19 |
7 | SICS logo 9 | 10 |

lwIP - A Lightweight TCP/IP Stack

11 |

404 - Page not found

12 |

13 | Sorry, the page you are requesting was not found on this 14 | server. 15 |

16 |
17 |   18 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /contrib/apps/httpserver_raw/fs/img/sics.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cernekee/ocproxy/c98f06d942970cdf35dd66ab46840f7d6d567b60/contrib/apps/httpserver_raw/fs/img/sics.gif -------------------------------------------------------------------------------- /contrib/apps/httpserver_raw/fs/index.html: -------------------------------------------------------------------------------- 1 | 2 | lwIP - A Lightweight TCP/IP Stack 3 | 4 | 5 | 6 | 44 |
7 | SICS logo 9 | 10 |

lwIP - A Lightweight TCP/IP Stack

11 |

12 | The web page you are watching was served by a simple web 13 | server running on top of the lightweight TCP/IP stack lwIP. 15 |

16 |

17 | lwIP is an open source implementation of the TCP/IP 18 | protocol suite that was originally written by Adam Dunkels 20 | of the Swedish Institute of Computer Science but now is 21 | being actively developed by a team of developers 22 | distributed world-wide. Since it's release, lwIP has 23 | spurred a lot of interest and has been ported to several 24 | platforms and operating systems. lwIP can be used either 25 | with or without an underlying OS. 26 |

27 |

28 | The focus of the lwIP TCP/IP implementation is to reduce 29 | the RAM usage while still having a full scale TCP. This 30 | makes lwIP suitable for use in embedded systems with tens 31 | of kilobytes of free RAM and room for around 40 kilobytes 32 | of code ROM. 33 |

34 |

35 | More information about lwIP can be found at the lwIP 36 | homepage at http://savannah.nongnu.org/projects/lwip/ 38 | or at the lwIP wiki at http://lwip.wikia.com/. 40 |

41 |
42 |   43 |
45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /contrib/apps/httpserver_raw/fsdata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef LWIP_FSDATA_H 33 | #define LWIP_FSDATA_H 34 | 35 | #include "lwip/opt.h" 36 | #include "fs.h" 37 | 38 | struct fsdata_file { 39 | const struct fsdata_file *next; 40 | const unsigned char *name; 41 | const unsigned char *data; 42 | int len; 43 | u8_t http_header_included; 44 | #if HTTPD_PRECALCULATED_CHECKSUM 45 | u16_t chksum_count; 46 | const struct fsdata_chksum *chksum; 47 | #endif /* HTTPD_PRECALCULATED_CHECKSUM */ 48 | }; 49 | 50 | #endif /* LWIP_FSDATA_H */ 51 | -------------------------------------------------------------------------------- /contrib/apps/httpserver_raw/makefsdata/readme.txt: -------------------------------------------------------------------------------- 1 | This directory contains a script ('makefsdata') to create C code suitable for 2 | httpd for given html pages (or other files) in a directory. 3 | 4 | There is also a plain C console application doing the same and extended a bit. 5 | 6 | Usage: htmlgen [targetdir] [-s] [-i]s 7 | targetdir: relative or absolute path to files to convert 8 | switch -s: toggle processing of subdirectories (default is on) 9 | switch -e: exclude HTTP header from file (header is created at runtime, default is on) 10 | switch -11: include HTTP 1.1 header (1.0 is default) 11 | 12 | if targetdir not specified, makefsdata will attempt to 13 | process files in subdirectory 'fs'. 14 | -------------------------------------------------------------------------------- /contrib/apps/netbios/netbios.h: -------------------------------------------------------------------------------- 1 | #ifndef LWIP_NETBIOS_H 2 | #define LWIP_NETBIOS_H 3 | 4 | void netbios_init(void); 5 | 6 | #endif /* LWIP_NETBIOS_H */ 7 | -------------------------------------------------------------------------------- /contrib/apps/netio/netio.c: -------------------------------------------------------------------------------- 1 | #include "netio.h" 2 | 3 | #include "lwip/opt.h" 4 | #include "lwip/tcp.h" 5 | 6 | /* See http://www.nwlab.net/art/netio/netio.html to get the netio tool */ 7 | 8 | #if LWIP_TCP 9 | static err_t netio_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err) 10 | { 11 | 12 | LWIP_UNUSED_ARG(arg); 13 | 14 | if (err == ERR_OK && p != NULL) { 15 | tcp_recved(pcb, p->tot_len); 16 | pbuf_free(p); 17 | } else { 18 | pbuf_free(p); 19 | } 20 | 21 | if (err == ERR_OK && p == NULL) { 22 | tcp_arg(pcb, NULL); 23 | tcp_sent(pcb, NULL); 24 | tcp_recv(pcb, NULL); 25 | tcp_close(pcb); 26 | } 27 | 28 | return ERR_OK; 29 | } 30 | 31 | static err_t netio_accept(void *arg, struct tcp_pcb *pcb, err_t err) 32 | { 33 | LWIP_UNUSED_ARG(arg); 34 | LWIP_UNUSED_ARG(err); 35 | 36 | tcp_arg(pcb, NULL); 37 | tcp_sent(pcb, NULL); 38 | tcp_recv(pcb, netio_recv); 39 | return ERR_OK; 40 | } 41 | 42 | void netio_init(void) 43 | { 44 | struct tcp_pcb *pcb; 45 | 46 | pcb = tcp_new(); 47 | tcp_bind(pcb, IP_ADDR_ANY, 18767); 48 | pcb = tcp_listen(pcb); 49 | tcp_accept(pcb, netio_accept); 50 | } 51 | #endif /* LWIP_TCP */ 52 | -------------------------------------------------------------------------------- /contrib/apps/netio/netio.h: -------------------------------------------------------------------------------- 1 | #ifndef LWIP_NETIO_H 2 | #define LWIP_NETIO_H 3 | 4 | void netio_init(void); 5 | 6 | #endif /* LWIP_NETIO_H */ 7 | -------------------------------------------------------------------------------- /contrib/apps/ping/ping.h: -------------------------------------------------------------------------------- 1 | #ifndef LWIP_PING_H 2 | #define LWIP_PING_H 3 | 4 | /** 5 | * PING_USE_SOCKETS: Set to 1 to use sockets, otherwise the raw api is used 6 | */ 7 | #ifndef PING_USE_SOCKETS 8 | #define PING_USE_SOCKETS LWIP_SOCKET 9 | #endif 10 | 11 | 12 | void ping_init(void); 13 | 14 | #if !PING_USE_SOCKETS 15 | void ping_send_now(void); 16 | #endif /* !PING_USE_SOCKETS */ 17 | 18 | #endif /* LWIP_PING_H */ 19 | -------------------------------------------------------------------------------- /contrib/apps/rtp/rtp.h: -------------------------------------------------------------------------------- 1 | #ifndef LWIP_RTP_H 2 | #define LWIP_RTP_H 3 | 4 | #if LWIP_SOCKET && LWIP_IGMP 5 | void rtp_init(void); 6 | #endif /* LWIP_SOCKET && LWIP_IGMP */ 7 | 8 | #endif /* LWIP_RTP_H */ 9 | -------------------------------------------------------------------------------- /contrib/apps/shell/shell.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef LWIP_SHELL_H 33 | #define LWIP_SHELL_H 34 | 35 | void shell_init(void); 36 | 37 | #endif /* LWIP_SHELL_H */ 38 | -------------------------------------------------------------------------------- /contrib/apps/snmp_private_mib/private_mib.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * Exports Private lwIP MIB 4 | */ 5 | 6 | #ifndef LWIP_HDR_PRIVATE_MIB_H 7 | #define LWIP_HDR_PRIVATE_MIB_H 8 | 9 | #include "arch/cc.h" 10 | #include "lwip/opt.h" 11 | 12 | #if LWIP_SNMP 13 | #include "lwip/snmp_structs.h" 14 | extern const struct mib_array_node mib_private; 15 | 16 | /** @todo remove this?? */ 17 | struct private_msg 18 | { 19 | u8_t dummy; 20 | }; 21 | 22 | void lwip_privmib_init(void); 23 | 24 | #define SNMP_PRIVATE_MIB_INIT() lwip_privmib_init() 25 | 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /contrib/apps/sntp/sntp.h: -------------------------------------------------------------------------------- 1 | #ifndef LWIP_SNTP_H 2 | #define LWIP_SNTP_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | void sntp_init(void); 9 | void sntp_stop(void); 10 | 11 | #ifdef __cplusplus 12 | } 13 | #endif 14 | 15 | #endif /* LWIP_SNTP_H */ 16 | -------------------------------------------------------------------------------- /contrib/apps/socket_examples/socket_examples.h: -------------------------------------------------------------------------------- 1 | #ifndef LWIP_SOCKET_EXAMPLES_H 2 | #define LWIP_SOCKET_EXAMPLES_H 3 | 4 | void socket_examples_init(void); 5 | 6 | #endif /* LWIP_SOCKET_EXAMPLES_H */ 7 | -------------------------------------------------------------------------------- /contrib/apps/tcpecho/tcpecho.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | 33 | #ifndef LWIP_TCPECHO_H 34 | #define LWIP_TCPECHO_H 35 | 36 | void tcpecho_init(void); 37 | 38 | #endif /* LWIP_TCPECHO_H */ 39 | -------------------------------------------------------------------------------- /contrib/apps/tcpecho_raw/echo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | */ 30 | #ifndef LWIP_ECHO_H 31 | #define LWIP_ECHO_H 32 | 33 | void echo_init(void); 34 | 35 | #endif /* LWIP_ECHO_H */ 36 | -------------------------------------------------------------------------------- /contrib/apps/udpecho/udpecho.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef LWIP_UDPECHO_H 33 | #define LWIP_UDPECHO_H 34 | 35 | void udpecho_init(void); 36 | 37 | #endif /* LWIP_UDPECHO_H */ 38 | -------------------------------------------------------------------------------- /contrib/ports/FILES: -------------------------------------------------------------------------------- 1 | unix/ - Architectural files for testing on unix-like systems 2 | (assuming gcc and pthreads). 3 | - Maintained by Kieran Mansley 4 | 5 | msvc6/ - Architectural files for Microsoft Visual C++ 6.0. 6 | - Maintained by Simon Goldschmidt 7 | 8 | old/ - Ports that are no longer actively maintained 9 | -------------------------------------------------------------------------------- /contrib/ports/old/6502/README: -------------------------------------------------------------------------------- 1 | The 6502 code is far from complete. 2 | -------------------------------------------------------------------------------- /contrib/ports/old/6502/include/arch/cc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __CC_H__ 33 | #define __CC_H__ 34 | 35 | typedef unsigned char u8_t; 36 | typedef signed char s8_t; 37 | typedef unsigned short u16_t; 38 | typedef signed short s16_t; 39 | typedef unsigned long u32_t; 40 | typedef signed long s32_t; 41 | 42 | #define U16_F "hu" 43 | #define S16_F "hd" 44 | #define X16_F "hx" 45 | #define U32_F "lu" 46 | #define S32_F "ld" 47 | #define X32_F "lx" 48 | 49 | #define PACK_STRUCT_BEGIN 50 | #define PACK_STRUCT_STRUCT 51 | #define PACK_STRUCT_END 52 | #define PACK_STRUCT_FIELD(x) x 53 | 54 | #endif /* __CC_H__ */ 55 | -------------------------------------------------------------------------------- /contrib/ports/old/6502/include/arch/cpu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __CPU_H__ 33 | #define __CPU_H__ 34 | 35 | #define BYTE_ORDER LITTLE_ENDIAN 36 | 37 | #endif /* __CPU_H__ */ 38 | -------------------------------------------------------------------------------- /contrib/ports/old/6502/include/arch/lib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __LIB_H__ 33 | #define __LIB_H__ 34 | 35 | int strlen(const char *str); 36 | int strncmp(const char *str1, const char *str2, int len); 37 | 38 | #endif /* __LIB_H__ */ 39 | -------------------------------------------------------------------------------- /contrib/ports/old/6502/include/arch/perf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __PERF_H__ 33 | #define __PERF_H__ 34 | 35 | #define PERF_START /* null definition */ 36 | #define PERF_STOP(x) /* null definition */ 37 | 38 | #endif /* __PERF_H__ */ 39 | -------------------------------------------------------------------------------- /contrib/ports/old/6502/include/arch/sys_arch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __SYS_C64_H__ 33 | #define __SYS_C64_H__ 34 | 35 | #define SYS_MBOX_NULL 0 36 | 37 | typedef int sys_sem_t; 38 | typedef int sys_mbox_t; 39 | typedef int sys_thread_t; 40 | 41 | #endif /* __SYS_C64_H__ */ 42 | -------------------------------------------------------------------------------- /contrib/ports/old/6502/lib_arch.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | 33 | /* These are generic implementations of various library functions used 34 | * throughout the lwIP code. When porting, those should be optimized 35 | * for the particular processor architecture, preferably coded in 36 | * assembler. 37 | */ 38 | 39 | 40 | -------------------------------------------------------------------------------- /contrib/ports/old/FILES: -------------------------------------------------------------------------------- 1 | This directory contains ports that are no longer actively maintained. 2 | 3 | 6502/ - Architectural files for the 6502 CPU. 4 | 5 | c16x/ - Architectural files for the C16x/ST10 uC. 6 | Supports lwIP Raw API only. 7 | CS8900a Ethernet driver for 16-bit mode. 8 | 9 | rtxc/ - Architectural files for the RTXC operating system. 10 | 11 | v2pro/ - Architectural files for the Xilinx Virtex-II PRO device with 12 | embedded PowerPC 405 Processor. Supports lwIP Raw API only. 13 | (requires EDK - http://www.xilinx.com/ise/embedded/edk.htm) 14 | 15 | coldfire/ - Architectural files for Motorola Coldfire 5272 CPU running 16 | under Nucleus OS. Supports DMA and ISRs in ethernet driver. 17 | 18 | ti_c6711/ - Architectural files for TI TMS320C6000 DSP running under uC/OS-II. 19 | Supports lwIP Raw API only. 20 | It's done with an 10/100M ethernet daughtercard. 21 | [more info at https://sourceforge.net/projects/ucos-lwip-c6x/] 22 | 23 | 24 | Each subdirectory (may) also include: 25 | 26 | perf.c - Optional file that should be implemented when running 27 | performance tests of lwIP. 28 | 29 | sys.c - Implementation of the operating system emulation layer. 30 | 31 | include/ - Architectural specific header files. 32 | 33 | netif/ - Architectural specific network interfaces. 34 | 35 | -------------------------------------------------------------------------------- /contrib/ports/old/c16x/FILES: -------------------------------------------------------------------------------- 1 | This directory contains architecture and compiler specific stuff for porting lwIP 2 | to the C16x and ST10 microcontrollers. The compiler specifics are for Tasking EDE 3 | v7.5r2. 4 | 5 | The sequential API has not been ported; its functions are empties. If someone is 6 | interested in adding a sequential API, please contact the author (see below). 7 | 8 | Besides this, a Cirrus (formerly Crystal Semiconductors) CS8900a Ethernet driver 9 | is included, which assumes a 16-bit data bus configuration. When porting this 10 | driver, note that the CS8900a does not support interrupts in 8-bit mode. 11 | 12 | Leon Woestenberg 13 | 14 | -------------------------------------------------------------------------------- /contrib/ports/old/c16x/include/arch/cc.h: -------------------------------------------------------------------------------- 1 | #ifndef __CC_H__ 2 | #define __CC_H__ 3 | 4 | /* memset(), memcpy() */ 5 | #include 6 | /* printf() and abort() */ 7 | #include 8 | #include 9 | /* isdigit() */ 10 | #include 11 | 12 | #include "arch/cpu.h" 13 | 14 | typedef unsigned char u8_t; 15 | typedef signed char s8_t; 16 | typedef unsigned short u16_t; 17 | typedef signed short s16_t; 18 | typedef unsigned long u32_t; 19 | typedef signed long s32_t; 20 | 21 | typedef u32_t mem_ptr_t; 22 | 23 | /* Define (sn)printf formatters for these lwIP types */ 24 | #define U16_F "hu" 25 | #define S16_F "hd" 26 | #define X16_F "hx" 27 | #define U32_F "lu" 28 | #define S32_F "ld" 29 | #define X32_F "lx" 30 | 31 | /* LW: Supported in at least >=v7.5 r2, but lwIP worked without the "_packed" attribute already */ 32 | #define PACK_STRUCT_BEGIN _packed 33 | #define PACK_STRUCT_STRUCT 34 | #define PACK_STRUCT_END 35 | #define PACK_STRUCT_FIELD(x) x 36 | 37 | #define LWIP_PLATFORM_BYTESWAP 1 38 | #define LWIP_PLATFORM_HTONS(x) _ror(x,8) 39 | #define LWIP_PLATFORM_HTONL(x) c16x_htonl(x) 40 | 41 | _inline u32_t c16x_htonl(u32_t n) 42 | { 43 | u16_t msw, lsw; 44 | 45 | msw = n >> 16; 46 | msw = _ror(msw,8); 47 | lsw = n; 48 | lsw = _ror(lsw,8); 49 | n = ((u32_t)lsw << 16) | (u32_t)msw; 50 | return n; 51 | } 52 | 53 | #ifdef LWIP_DEBUG 54 | 55 | /* LW: forward declaration */ 56 | void debug_printf(char *format, ...); 57 | void page_printf(char *format, ...); 58 | 59 | /* Plaform specific diagnostic output */ 60 | #define LWIP_PLATFORM_DIAG(x) { debug_printf x; } 61 | #define LWIP_PLATFORM_ASSERT(x) { debug_printf("\fline %d in %s\n", __LINE__, __FILE__); while(1); } 62 | 63 | #endif/* LWIP_DEBUG */ 64 | 65 | #endif /* __CC_H__ */ 66 | -------------------------------------------------------------------------------- /contrib/ports/old/c16x/include/arch/cpu.h: -------------------------------------------------------------------------------- 1 | #ifndef __CPU_H__ 2 | #define __CPU_H__ 3 | 4 | #define BYTE_ORDER LITTLE_ENDIAN 5 | 6 | #endif /* __CPU_H__ */ 7 | -------------------------------------------------------------------------------- /contrib/ports/old/c16x/include/arch/lib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of the Institute nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | * Author: Adam Dunkels 32 | * 33 | * $Id: lib.h,v 1.1 2007/06/14 12:33:57 kieranm Exp $ 34 | */ 35 | #ifndef __LIB_H__ 36 | #define __LIB_H__ 37 | 38 | 39 | #endif /* __LIB_H__ */ 40 | -------------------------------------------------------------------------------- /contrib/ports/old/c16x/include/arch/perf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of the Institute nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | * Author: Adam Dunkels 32 | * 33 | * $Id: perf.h,v 1.1 2007/06/14 12:33:57 kieranm Exp $ 34 | */ 35 | #ifndef __PERF_H__ 36 | #define __PERF_H__ 37 | 38 | #define PERF_START /* null definition */ 39 | #define PERF_STOP(x) /* null definition */ 40 | 41 | #endif /* __PERF_H__ */ 42 | -------------------------------------------------------------------------------- /contrib/ports/old/c16x/perf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of the Institute nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | * Author: Adam Dunkels 32 | * 33 | * $Id: perf.c,v 1.1 2007/06/14 12:33:57 kieranm Exp $ 34 | */ 35 | 36 | #include "arch/perf.h" 37 | 38 | void 39 | perf_init(char *fname) 40 | { 41 | if (fname); // LEON: prevent warning 42 | } 43 | -------------------------------------------------------------------------------- /contrib/ports/old/coldfire/README: -------------------------------------------------------------------------------- 1 | ### README --- c:/cygwin/home/dhaas/work/cfimage/lwip/arch/coldfire/ 2 | 3 | ## 4 | ## Author: dhaas@alum.rpi.edu 5 | 6 | These files are a port of lwip to coldfire (specifically the MCF5272 with 7 | on-board FEC) under the Nucleus OS. Nucleus is pretty generic so it should be 8 | fairly easy to port this to any other embedded OS. Nucleus memory managment 9 | is not used. It is assumed you have a working malloc (which at least 10 | long-word aligns memory). 11 | 12 | The compiler used was Diab 4.3b. You will almost certainly need to change 13 | cc.h for your compiler. 14 | 15 | IMPORTANT NOTE: If you use the fec driver for a different processor which has 16 | a data cache you will need to make sure the buffer descriptors and memory 17 | used for pbufs are not in a cachable area. Otherwise the fec driver is 18 | guarrenteed to malfunction. The 5272 which this was written for does not 19 | support data cache so it did not matter and malloc was used. 20 | 21 | -------------------------------------------------------------------------------- /contrib/ports/old/coldfire/include/arch/errno.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of the Institute nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | * Author: David Haas 32 | * 33 | * $Id: 34 | */ 35 | #ifndef __ERRNO_H__ 36 | #define __ERRNO_H__ 37 | 38 | /* This can be used to test whether errno is implemented */ 39 | #define ERRNO 40 | 41 | #define errno (*sys_arch_errno()) 42 | 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /contrib/ports/old/coldfire/include/arch/perf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __PERF_H__ 33 | #define __PERF_H__ 34 | 35 | #define PERF_START /* null definition */ 36 | #define PERF_STOP(x) /* null definition */ 37 | 38 | #endif /* __PERF_H__ */ 39 | -------------------------------------------------------------------------------- /contrib/ports/old/coldfire/include/arch/sys_arch.h: -------------------------------------------------------------------------------- 1 | /* @(#)sys_arch.h 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: David Haas 30 | * 31 | */ 32 | 33 | #ifndef _SYS_ARCH_H 34 | #define _SYS_ARCH_H 1 35 | 36 | #include 37 | #include 38 | #include "netif/etharp.h" 39 | 40 | #define SYS_MBOX_NULL NULL 41 | #define SYS_SEM_NULL NULL 42 | 43 | /* sockets needs this definition. include time.h if this is a unix system */ 44 | struct timeval { 45 | long tv_sec; 46 | long tv_usec; 47 | }; 48 | 49 | typedef NU_SEMAPHORE * sys_sem_t; 50 | typedef NU_QUEUE * sys_mbox_t; 51 | typedef NU_TASK * sys_thread_t; 52 | typedef u32_t sys_prot_t; 53 | 54 | /* Functions specific to Coldfire/Nucleus */ 55 | void 56 | sys_setvect(u32_t vector, void (*isr_function)(void), void (*dis_funct)(void)); 57 | void 58 | sys_get_eth_addr(struct eth_addr *eth_addr); 59 | int * 60 | sys_arch_errno(void); 61 | 62 | 63 | #include "arch/errno.h" 64 | 65 | #endif /* _SYS_ARCH_H */ 66 | 67 | -------------------------------------------------------------------------------- /contrib/ports/old/coldfire/include/netif/5272fec.h: -------------------------------------------------------------------------------- 1 | /* @(#)5272fec.h 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Purpose: MCF5272 fec ethernet driver 30 | * 31 | * Author: David Haas 32 | * 33 | */ 34 | 35 | #ifndef _5272FEC_H 36 | #define _5272FEC_H 1 37 | 38 | 39 | err_t 40 | mcf5272fecif_init(struct netif *netif); 41 | 42 | 43 | #endif /* _5272FEC_H */ 44 | 45 | -------------------------------------------------------------------------------- /contrib/ports/old/coldfire/include/netif/tcpdump.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __NETIF_TCPDUMP_H__ 33 | #define __NETIF_TCPDUMP_H__ 34 | 35 | #include "lwip/pbuf.h" 36 | 37 | void tcpdump(struct pbuf *p); 38 | 39 | #endif /* __NETIF_TCPDUMP_H__ */ 40 | -------------------------------------------------------------------------------- /contrib/ports/old/coldfire/netif/tcpdump.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | 33 | #include 34 | 35 | #include "netif/tcpdump.h" 36 | #include "lwip/ip.h" 37 | #include "lwip/tcp.h" 38 | #include "lwip/udp.h" 39 | #include "lwip/inet.h" 40 | 41 | /*-----------------------------------------------------------------------------------*/ 42 | void 43 | tcpdump(struct pbuf *p) 44 | { 45 | } 46 | /*-----------------------------------------------------------------------------------*/ 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /contrib/ports/old/coldfire/perf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | 33 | #include "arch/perf.h" 34 | 35 | void 36 | perf_init(char *fname) 37 | { 38 | } 39 | -------------------------------------------------------------------------------- /contrib/ports/old/ecos/README: -------------------------------------------------------------------------------- 1 | This part of the lwip-contrib section is the ecos glue 2 | 3 | Check out latest ecos from CVS (>= 19 Jan 2004) so it has the latest io/eth glue for lwip. 4 | 5 | You must have the current lwip sources checked out and the scripts here will hopefully generate 6 | a correct EPK suitable for use with ecos. 7 | 8 | 9 | To make an ecos package: 10 | 11 | Run the mkepk script something like this 12 | 13 | # EPK=/dir/of/epk LWIP_CVS=/dir/of/checked/out/lwip ./mkepk 14 | 15 | This will put the generated EPK in the dir you specify 16 | 17 | 18 | then add that EPK to your package repository and use it 19 | 20 | Build example: 21 | #ecosconfig new edb7xxx kernel 22 | #ecosconfig add lwip 23 | this will default to SLIP connection.If you also 24 | #ecosconfig add net_drivers 25 | you'll be able to configure for ethernet 26 | 27 | In both cases set LWIP_MY_ADDR and LWIP_SERV_ADDR (means host/gateway for eth or host/peer for slip) 28 | #ecosconfig tree 29 | #make tests 30 | and you can try any of the five tests included 31 | 32 | Tests: 33 | udpecho - echo service port 7 on UDP 34 | tcpecho - ditto on TCP 35 | sockets - as tcpecho but written with the socket API not the lwip specific API 36 | https - http server on port 80 written with the raw API 37 | nc_test_slave - a port of the test with the same name in net/common to lwip. Used to compare 38 | lwIP throughput to that of the FreeBSD stack.In this matchup lwIP gets a well deserved 39 | silver medal.Not bad for a newcomer ;) 40 | 41 | 42 | Bugreports (or even better patches) at jani@iv.ro not the lwip or ecos mailing lists!! 43 | Only if you peek into the lwip sources and think you found a bug post to lwip-users. 44 | -------------------------------------------------------------------------------- /contrib/ports/old/ecos/copy: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #make an ecos epk from CVS lwIP 4 | CURRENT=$EPK/net/lwip_tcpip/current 5 | mkdir -p `dirname $CURRENT/$2` 6 | 7 | #prepend eCos license text to all files but the ones 8 | #in the ppp directory: those have the advertising clause 9 | #type of BSD license which is not compatible with GPL 10 | #or that's what I'be been told and IANAL 11 | if [ "`dirname $1`" != "src/netif/ppp" ]; then 12 | #cat header $LWIP_CVS/$1 > $CURRENT/$2 13 | cp -f $LWIP_CVS/$1 $CURRENT/$2 14 | else 15 | cp -f $LWIP_CVS/$1 $CURRENT/$2 16 | fi 17 | -------------------------------------------------------------------------------- /contrib/ports/old/ecos/ecos/net/lwip_tcpip/current/include/arch/sys_arch.h: -------------------------------------------------------------------------------- 1 | //========================================================================== 2 | //####ECOSGPLCOPYRIGHTBEGIN#### 3 | // ------------------------------------------- 4 | // This file is part of eCos, the Embedded Configurable Operating System. 5 | // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. 6 | // 7 | // eCos is free software; you can redistribute it and/or modify it under 8 | // the terms of the GNU General Public License as published by the Free 9 | // Software Foundation; either version 2 or (at your option) any later version. 10 | // 11 | // eCos is distributed in the hope that it will be useful, but WITHOUT ANY 12 | // WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | // for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License along 17 | // with eCos; if not, write to the Free Software Foundation, Inc., 18 | // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 19 | // 20 | // As a special exception, if other files instantiate templates or use macros 21 | // or inline functions from this file, or you compile this file and link it 22 | // with other works to produce a work based on this file, this file does not 23 | // by itself cause the resulting work to be covered by the GNU General Public 24 | // License. However the source code for this file must still be made available 25 | // in accordance with section (3) of the GNU General Public License. 26 | // 27 | // This exception does not invalidate any other reasons why a work based on 28 | // this file might be covered by the GNU General Public License. 29 | // ------------------------------------------- 30 | //####ECOSGPLCOPYRIGHTEND#### 31 | //========================================================================== 32 | 33 | #ifndef __SYS_ECOS_H__ 34 | #define __SYS_ECOS_H__ 35 | 36 | #include 37 | 38 | #define SYS_MBOX_NULL (sys_mbox_t)NULL 39 | #define SYS_SEM_NULL (sys_sem_t)NULL 40 | 41 | typedef cyg_sem_t * sys_sem_t; 42 | typedef cyg_handle_t sys_mbox_t; 43 | typedef cyg_thread * sys_thread_t; 44 | #endif /* __SYS_ECOS_H__ */ 45 | 46 | -------------------------------------------------------------------------------- /contrib/ports/old/ecos/ecos/net/lwip_tcpip/current/include/network.h: -------------------------------------------------------------------------------- 1 | /* network.h for compatibility with the other eCos network stacks */ 2 | 3 | #include /* lwIP stack includes */ 4 | #define LWIP_COMPAT_SOCKETS 1 5 | #include 6 | #include 7 | -------------------------------------------------------------------------------- /contrib/ports/old/ecos/ecos/pkgadd.db: -------------------------------------------------------------------------------- 1 | package CYGPKG_NET_LWIP { 2 | alias {"lwIP" lwip} 3 | directory net/lwip_tcpip 4 | script cdl/lwip_net.cdl 5 | description "lightweight TCP/IP stack: lwIP" 6 | } 7 | 8 | -------------------------------------------------------------------------------- /contrib/ports/old/ecos/header: -------------------------------------------------------------------------------- 1 | //========================================================================== 2 | //####ECOSGPLCOPYRIGHTBEGIN#### 3 | // ------------------------------------------- 4 | // This file is part of eCos, the Embedded Configurable Operating System. 5 | // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. 6 | // 7 | // eCos is free software; you can redistribute it and/or modify it under 8 | // the terms of the GNU General Public License as published by the Free 9 | // Software Foundation; either version 2 or (at your option) any later version. 10 | // 11 | // eCos is distributed in the hope that it will be useful, but WITHOUT ANY 12 | // WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | // for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License along 17 | // with eCos; if not, write to the Free Software Foundation, Inc., 18 | // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 19 | // 20 | // As a special exception, if other files instantiate templates or use macros 21 | // or inline functions from this file, or you compile this file and link it 22 | // with other works to produce a work based on this file, this file does not 23 | // by itself cause the resulting work to be covered by the GNU General Public 24 | // License. However the source code for this file must still be made available 25 | // in accordance with section (3) of the GNU General Public License. 26 | // 27 | // This exception does not invalidate any other reasons why a work based on 28 | // this file might be covered by the GNU General Public License. 29 | // ------------------------------------------- 30 | //####ECOSGPLCOPYRIGHTEND#### 31 | //========================================================================== 32 | 33 | -------------------------------------------------------------------------------- /contrib/ports/old/ecos/mkepk: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #make an ecos epk from CVS lwIP 4 | 5 | if test $EPK"" == "" ; then 6 | echo you must set the EPK environment var to the dir you want the EPK in 7 | exit; 8 | fi 9 | 10 | if test $LWIP_CVS"" == "" ; then 11 | echo you must set the LWIP_CVS environment var to the dir you checked out the lwip module 12 | LWIP_CVS=../../../lwip; 13 | exit; 14 | fi 15 | EPK=$EPK/lwip_epk 16 | 17 | #cleanup 18 | rm -Rf $EPK 19 | 20 | 21 | #copy files from CVS 22 | xargs -n 2 ./copy < files 23 | 24 | #copy ecos specific files 25 | cd ecos && find . ! -path '*CVS*' -a -type f -exec cp --parents {} $EPK \; 26 | #make epk 27 | cd $EPK && tar czf lwip.epk * 28 | 29 | -------------------------------------------------------------------------------- /contrib/ports/old/rtxc/include/arch/cc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __CC_H__ 33 | #define __CC_H__ 34 | 35 | typedef unsigned char u8_t; 36 | typedef signed char s8_t; 37 | typedef unsigned short u16_t; 38 | typedef signed short s16_t; 39 | typedef unsigned long u32_t; 40 | typedef signed long s32_t; 41 | 42 | #define U16_F "hu" 43 | #define S16_F "hd" 44 | #define X16_F "hx" 45 | #define U32_F "lu" 46 | #define S32_F "ld" 47 | #define X32_F "lx" 48 | 49 | #define PACK_STRUCT_BEGIN 50 | #define PACK_STRUCT_STRUCT 51 | #define PACK_STRUCT_END 52 | #define PACK_STRUCT_FIELD(x) x 53 | 54 | #endif /* __CC_H__ */ 55 | -------------------------------------------------------------------------------- /contrib/ports/old/rtxc/include/arch/cpu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __CPU_H__ 33 | #define __CPU_H__ 34 | 35 | #define BYTE_ORDER LITTLE_ENDIAN 36 | 37 | #endif /* __CPU_H__ */ 38 | -------------------------------------------------------------------------------- /contrib/ports/old/rtxc/include/arch/init.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __ARCH_INIT_H__ 33 | #define __ARCH_INIT_H__ 34 | 35 | #define TCPIP_INIT_DONE(arg) tcpip_init_done(arg) 36 | 37 | void tcpip_init_done(void *); 38 | int wait_for_tcpip_init(void); 39 | 40 | #endif /* __ARCH_INIT_H__ */ 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /contrib/ports/old/rtxc/include/arch/lib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __LIB_H__ 33 | #define __LIB_H__ 34 | 35 | #include 36 | 37 | 38 | #endif /* __LIB_H__ */ 39 | -------------------------------------------------------------------------------- /contrib/ports/old/rtxc/include/arch/perf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __PERF_H__ 33 | #define __PERF_H__ 34 | 35 | #define PERF_START /* null definition */ 36 | #define PERF_STOP(x) /* null definition */ 37 | 38 | #endif /* __PERF_H__ */ 39 | -------------------------------------------------------------------------------- /contrib/ports/old/rtxc/include/arch/sys_arch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __SYS_RTXC_H__ 33 | #define __SYS_RTXC_H__ 34 | 35 | #include "rtxcapi.h" 36 | 37 | #define SYS_MBOX_NULL (QUEUE)0 38 | #define SYS_SEM_NULL (SEMA)0 39 | 40 | typedef SEMA sys_sem_t; 41 | typedef QUEUE sys_mbox_t; 42 | typedef TASK sys_thread_t; 43 | 44 | #endif /* __SYS_RTXC_H__ */ 45 | 46 | -------------------------------------------------------------------------------- /contrib/ports/old/rtxc/include/netif/cs8900if.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __NETIF_CS8900IF_H__ 33 | #define __NETIF_CS8900IF_H__ 34 | 35 | #include "lwip/netif.h" 36 | 37 | void cs8900if_init(struct netif *); 38 | u8_t cs8900if_poll(struct netif *); 39 | void cs8900if_input(struct netif *); 40 | 41 | #endif /* __NETIF_CS8900IF_H__ */ 42 | -------------------------------------------------------------------------------- /contrib/ports/old/rtxc/include/netif/sioslipif.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __NETIF_SIOSLIPIF_H__ 33 | #define __NETIF_SIOSLIPIF_H__ 34 | 35 | #include "lwip/netif.h" 36 | 37 | void sioslipif_init(struct netif *); 38 | 39 | #endif /* __NETIF_SIOSLIPIF_H__ */ 40 | -------------------------------------------------------------------------------- /contrib/ports/old/rtxc/lib.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | 33 | /* These are generic implementations of various library functions used 34 | * throughout the lwIP code. When porting, those should be optimized 35 | * for the particular processor architecture, preferably coded in 36 | * assembler. 37 | */ 38 | 39 | -------------------------------------------------------------------------------- /contrib/ports/old/rtxc/netif/FILES: -------------------------------------------------------------------------------- 1 | sioslipif.c - Implementation of the SLIP protocol on top of a serial line. 2 | -------------------------------------------------------------------------------- /contrib/ports/old/rtxc/perf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | 33 | #include "arch/perf.h" 34 | 35 | void 36 | perf_init(char *fname) 37 | { 38 | } 39 | -------------------------------------------------------------------------------- /contrib/ports/old/ti_c6711/FILES: -------------------------------------------------------------------------------- 1 | This directory contains architecture and compiler specific stuff for porting lwIP 2 | to the TI TMS320C6711 DSP. It's done on the official C6711 DSK board, in CCS v2.10. 3 | 4 | The sequential API has not been ported; its functions are empties. If someone is 5 | interested in adding a sequential API, please contact the author (see below). 6 | 7 | The ethernet connection was based on an daughtercard design by the author. 8 | Schematic files can be found as part of project "ucos-lwip-c6x" on SourceForge.net 9 | The daughtercard is NE2000 compliant. And the driver supports interrupts. 10 | 11 | 12 | Zeng, Ming 13 | 14 | -------------------------------------------------------------------------------- /contrib/ports/old/ti_c6711/[Note] opt setting of lwIP .txt: -------------------------------------------------------------------------------- 1 | [Note]: 2 | 3 | Special options setting of lwIP in this project (for using it with uC/OS-II on TI C6000 DSP) 4 | 5 | ******************************************************************************************* 6 | This port was for project ucos-lwip-c6x (http://gro.clinux.org/projects/ucos-lwip-c6x/). 7 | 8 | For the moment we were writing this note, lwIP v1.1.0 was used in this project. 9 | 10 | This note was written in Jan.22 2005 by zengming99@mails.tsinghua.edu.cn. 11 | ******************************************************************************************* 12 | 13 | Usually, options of lwIP can be set in file "lwipopts.h". 14 | 15 | It was included by "opt.h", amd all options would be set as default value in "opt.h" 16 | if they were not defined in "lwipopts.h". 17 | 18 | Each project should have its own "lwiports.h", and keep "opt.h" as it was. 19 | 20 | In this project, for making lwIP work with uC/OS-II on a 32bits TI DSP, 21 | following options should be set: 22 | ------------------------------------------------------------------------------------ 23 | 24 | 1. Define symbol "LWIP_PROVIDE_ERRNO" in compiler of CodeComposerStudio 25 | 26 | 27 | 2. #define MEM_ALIGNMENT 4 (in "lwipopts.h" ) 28 | #define ETH_PAD_SIZE 2 (in "lwipopts.h" ) 29 | 30 | For the struct align problem on 32bits DSP. 31 | 32 | 33 | 3. #define ARP_QUEUEING 0 (in "lwipopts.h") 34 | 35 | ARP_QUEUEING has a bug in lwIP v1.0.0 with TCP 36 | 37 | 38 | 4. #define LWIP_TASK_MAX 5 (in "sys_arch.h" ) 39 | #define LWIP_START_PRIO 10 (in "sys_arch.h" ) 40 | 41 | #define TCPIP_THREAD_PRIO 5 (in "lwipopts.h" ) 42 | 43 | The default TCPIP_THREAD used priority 5. 44 | 45 | And, 5 lwIP threads were allowed, user defined lwIP thread should have its priority between 10 ~ 14. 46 | 47 | 48 | 5. #define SYS_LIGHTWEIGHT_PROT 1 (in "lwipopts.h" ) 49 | 50 | #define SYS_ARCH_DECL_PROTECT(lev) (in "sys_arch.h" ) 51 | #define SYS_ARCH_PROTECT(lev) OS_ENTER_CRITICAL() (in "sys_arch.h" ) 52 | #define SYS_ARCH_UNPROTECT(lev) OS_EXIT_CRITICAL() (in "sys_arch.h" ) 53 | 54 | These were very important when ethernet driver used intrrupt to check packet 55 | and pBuf function was called in ISR. Or else, uC/OS-II would run away. 56 | 57 | A much better and clean method is to set up a thread for the driver, in ISR 58 | just check packet and post MailBox to the thread. 59 | 60 | 61 | Zeng, Ming 62 | 63 | 2005-01-18 -------------------------------------------------------------------------------- /contrib/ports/old/ti_c6711/include/arch/init.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of the Institute nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | * Author: Adam Dunkels 32 | * 33 | * $Id: init.h,v 1.1 2007/06/14 12:34:09 kieranm Exp $ 34 | */ 35 | #ifndef __ARCH_INIT_H__ 36 | #define __ARCH_INIT_H__ 37 | 38 | #define TCPIP_INIT_DONE(arg) sys_sem_signal(*(sys_sem_t *)arg) 39 | 40 | #endif /* __ARCH_INIT_H__ */ 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /contrib/ports/old/ti_c6711/include/arch/lib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of the Institute nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | * Author: Adam Dunkels 32 | * 33 | * $Id: lib.h,v 1.1 2007/06/14 12:34:09 kieranm Exp $ 34 | */ 35 | #ifndef __LIB_H__ 36 | #define __LIB_H__ 37 | 38 | #include "arch/cc.h" 39 | 40 | u16_t htons(u16_t n); 41 | u16_t ntohs(u16_t n); 42 | u32_t htonl(u32_t n); 43 | u32_t ntohl(u32_t n); 44 | 45 | #endif /* __LIB_H__ */ 46 | -------------------------------------------------------------------------------- /contrib/ports/old/ti_c6711/include/arch/perf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of the Institute nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | * Author: Adam Dunkels 32 | * 33 | * $Id: perf.h,v 1.1 2007/06/14 12:34:09 kieranm Exp $ 34 | */ 35 | #ifndef __PERF_H__ 36 | #define __PERF_H__ 37 | 38 | #define PERF_START /* null definition */ 39 | #define PERF_STOP(x) /* null definition */ 40 | 41 | #endif /* __PERF_H__ */ 42 | -------------------------------------------------------------------------------- /contrib/ports/old/ti_c6711/include/netif/ne2kif.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cernekee/ocproxy/c98f06d942970cdf35dd66ab46840f7d6d567b60/contrib/ports/old/ti_c6711/include/netif/ne2kif.h -------------------------------------------------------------------------------- /contrib/ports/old/ti_c6711/lib_arch.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of the Institute nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | * Author: Adam Dunkels 32 | * 33 | * $Id: lib_arch.c,v 1.1 2007/06/14 12:34:09 kieranm Exp $ 34 | */ 35 | 36 | /* These are generic implementations of various library functions used 37 | * throughout the lwIP code. When porting, those should be optimized 38 | * for the particular processor architecture, preferably coded in 39 | * assembler. 40 | */ 41 | 42 | 43 | //yangye 2003-1-22 44 | #include "lwip/arch.h" 45 | 46 | /*u16_t 47 | htons(u16_t n) 48 | { 49 | return ((n & 0xff) << 8) | ((n & 0xff00) >> 8); 50 | } 51 | 52 | u16_t 53 | ntohs(u16_t n) 54 | { 55 | return htons(n); 56 | } 57 | 58 | 59 | u32_t 60 | htonl(u32_t n) 61 | { 62 | return ((n & 0xff) << 24) | 63 | ((n & 0xff00) << 8) | 64 | ((n & 0xff0000) >> 8) | 65 | ((n & 0xff000000) >> 24); 66 | } 67 | 68 | 69 | u32_t 70 | ntohl(u32_t n) 71 | { 72 | return htonl(n); 73 | }*/ 74 | /*-----------------------------------------------------------------------------------*/ 75 | -------------------------------------------------------------------------------- /contrib/ports/old/ti_c6711/netif/ne2kif.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cernekee/ocproxy/c98f06d942970cdf35dd66ab46840f7d6d567b60/contrib/ports/old/ti_c6711/netif/ne2kif.c -------------------------------------------------------------------------------- /contrib/ports/old/v2pro/include/arch/cc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 3. The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 20 | * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | * This file is part of the lwIP TCP/IP stack. 29 | * 30 | * Author: Adam Dunkels 31 | * 32 | */ 33 | 34 | #ifndef __ARCH_CC_H__ 35 | #define __ARCH_CC_H__ 36 | 37 | #define BYTE_ORDER BIG_ENDIAN 38 | 39 | typedef unsigned char u8_t; 40 | typedef signed char s8_t; 41 | typedef unsigned short u16_t; 42 | typedef signed short s16_t; 43 | typedef unsigned long u32_t; 44 | typedef signed long s32_t; 45 | 46 | typedef u32_t mem_ptr_t; 47 | 48 | #define U16_F "hu" 49 | #define S16_F "hd" 50 | #define X16_F "hx" 51 | #define U32_F "lu" 52 | #define S32_F "ld" 53 | #define X32_F "lx" 54 | 55 | #define PACK_STRUCT_FIELD(x) x __attribute__((packed)) 56 | #define PACK_STRUCT_STRUCT __attribute__((packed)) 57 | #define PACK_STRUCT_BEGIN 58 | #define PACK_STRUCT_END 59 | 60 | #endif /* __ARCH_CC_H__ */ 61 | -------------------------------------------------------------------------------- /contrib/ports/old/v2pro/include/arch/cpu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 3. The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 20 | * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | * This file is part of the lwIP TCP/IP stack. 29 | * 30 | * Author: Adam Dunkels 31 | * 32 | */ 33 | 34 | #ifndef __ARCH_CPU_H__ 35 | #define __ARCH_CPU_H__ 36 | 37 | #define BYTE_ORDER BIG_ENDIAN 38 | 39 | #endif /* __ARCH_CPU_H__ */ 40 | -------------------------------------------------------------------------------- /contrib/ports/old/v2pro/include/arch/perf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 3. The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 20 | * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | * This file is part of the lwIP TCP/IP stack. 29 | * 30 | * Author: Adam Dunkels 31 | * 32 | */ 33 | 34 | #ifndef __ARCH_PERF_H__ 35 | #define __ARCH_PERF_H__ 36 | 37 | #define PERF_START /* null definition */ 38 | #define PERF_STOP(x) /* null definition */ 39 | 40 | void perf_init(char *fname); 41 | 42 | #endif /* __ARCH_PERF_H__ */ 43 | -------------------------------------------------------------------------------- /contrib/ports/old/v2pro/include/arch/sys_arch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 3. The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 20 | * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | * This file is part of the lwIP TCP/IP stack. 29 | * 30 | * Author: Adam Dunkels 31 | * 32 | */ 33 | 34 | #ifndef __SYS_XILINX_V2P_H__ 35 | #define __SYS_XILINX_V2P_H__ 36 | 37 | #define SYS_MBOX_NULL 0 38 | 39 | #endif /* __SYS_XILINX_V2P_H__ */ 40 | -------------------------------------------------------------------------------- /contrib/ports/old/v2pro/include/netif/xemacif.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, 2002, 2003 Xilinx, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 3. The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 20 | * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | * This file is part of the lwIP TCP/IP stack. 29 | * 30 | * Author: Chris Borrelli 31 | * 32 | */ 33 | 34 | #ifndef __NETIF_XEMACIF_H__ 35 | #define __NETIF_XEMACIF_H__ 36 | 37 | #include "lwip/netif.h" 38 | #include "netif/etharp.h" 39 | #include "xemac.h" 40 | 41 | void xemacif_setmac(u32_t index, u8_t *addr); 42 | u8_t * xemacif_getmac(u32_t index); 43 | err_t xemacif_init(struct netif *netif); 44 | err_t xemacif_input(void *CallBackRef); 45 | 46 | /** 47 | * This typedef contains configuration information for an xemac instance. 48 | */ 49 | typedef struct 50 | { 51 | Xuint32 DevId; 52 | Xuint32 IntrId; 53 | struct eth_addr ethaddr; 54 | XEmac* instance_ptr; 55 | } XEmacIf_Config; 56 | 57 | #endif /* __NETIF_XEMACIF_H__ */ 58 | -------------------------------------------------------------------------------- /contrib/ports/old/v2pro/lib_arch.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 3. The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 20 | * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | * This file is part of the lwIP TCP/IP stack. 29 | * 30 | * Author: Adam Dunkels 31 | * 32 | */ 33 | 34 | -------------------------------------------------------------------------------- /contrib/ports/old/v2pro/perf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | 33 | #include "arch/perf.h" 34 | 35 | void 36 | perf_init(char *fname) 37 | { 38 | return; 39 | } 40 | 41 | -------------------------------------------------------------------------------- /contrib/ports/unix/check/README: -------------------------------------------------------------------------------- 1 | 2 | Helper files to run lwIP unit tests on unix-like systems. 3 | 4 | 1. Install the check library, through a package manager or from http://check.sourceforge.net/ 5 | 2. Put the lwip code in a directory called 'lwip' in the same directory as lwip-contrib is 6 | 3. Run `make check` 7 | 4. Make sure all tests pass 8 | 9 | -------------------------------------------------------------------------------- /contrib/ports/unix/check/sys_arch.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lwip/opt.h" 3 | 4 | u32_t 5 | sys_now(void) 6 | { 7 | struct timeval tv; 8 | if (gettimeofday(&tv, NULL)) 9 | return 0; 10 | else 11 | return tv.tv_sec * 1000 + tv.tv_usec / 1000; 12 | } 13 | -------------------------------------------------------------------------------- /contrib/ports/unix/include/arch/sys_arch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef LWIP_ARCH_SYS_ARCH_H 33 | #define LWIP_ARCH_SYS_ARCH_H 34 | 35 | #include 36 | 37 | #define SYS_MBOX_NULL NULL 38 | #define SYS_SEM_NULL NULL 39 | 40 | typedef u32_t sys_prot_t; 41 | 42 | struct sys_sem; 43 | typedef struct sys_sem * sys_sem_t; 44 | #define sys_sem_valid(sem) (((sem) != NULL) && (*(sem) != NULL)) 45 | #define sys_sem_set_invalid(sem) do { if((sem) != NULL) { *(sem) = NULL; }}while(0) 46 | 47 | /* let sys.h use binary semaphores for mutexes */ 48 | #define LWIP_COMPAT_MUTEX 1 49 | 50 | struct sys_mbox; 51 | typedef struct sys_mbox *sys_mbox_t; 52 | #define sys_mbox_valid(mbox) (((mbox) != NULL) && (*(mbox) != NULL)) 53 | #define sys_mbox_set_invalid(mbox) do { if((mbox) != NULL) { *(mbox) = NULL; }}while(0) 54 | 55 | struct sys_thread; 56 | typedef struct sys_thread * sys_thread_t; 57 | 58 | #endif /* LWIP_ARCH_SYS_ARCH_H */ 59 | 60 | -------------------------------------------------------------------------------- /contrib/ports/unix/include/netif/delif.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef LWIP_DELIF_H 33 | #define LWIP_DELIF_H 34 | 35 | #include "lwip/netif.h" 36 | 37 | #include "lwip/pbuf.h" 38 | 39 | err_t delif_init(struct netif *netif); 40 | err_t delif_init_thread(struct netif *netif); 41 | 42 | #endif /* LWIP_DELIF_H */ 43 | -------------------------------------------------------------------------------- /contrib/ports/unix/include/netif/dropif.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef LWIP_DROPIF_H 33 | #define LWIP_DROPIF_H 34 | 35 | #include "lwip/netif.h" 36 | 37 | #include "lwip/pbuf.h" 38 | 39 | err_t dropif_init(struct netif *netif); 40 | 41 | #endif /* LWIP_DROPIF_H */ 42 | -------------------------------------------------------------------------------- /contrib/ports/unix/include/netif/fifo.h: -------------------------------------------------------------------------------- 1 | #ifndef FIFO_H 2 | #define FIFO_H 3 | 4 | #include "lwip/sys.h" 5 | 6 | /** How many bytes in fifo */ 7 | #define FIFOSIZE 2048 8 | 9 | /** fifo data structure, this one is passed to all fifo functions */ 10 | typedef struct fifo_t { 11 | u8_t data[FIFOSIZE+10]; /* data segment, +10 is a hack probably not needed.. FIXME! */ 12 | int dataslot; /* index to next char to be read */ 13 | int emptyslot; /* index to next empty slot */ 14 | int len; /* len probably not needed, may be calculated from dataslot and emptyslot in conjunction with FIFOSIZE */ 15 | 16 | sys_sem_t sem; /* semaphore protecting simultaneous data manipulation */ 17 | sys_sem_t getSem; /* sepaphore used to signal new data if getWaiting is set */ 18 | u8_t getWaiting; /* flag used to indicate that fifoget is waiting for data. fifoput is suposed to clear */ 19 | /* this flag prior to signaling the getSem semaphore */ 20 | } fifo_t; 21 | 22 | 23 | /** 24 | * Get a character from fifo 25 | * Blocking call. 26 | * @param pointer to fifo data structure 27 | * @return character read from fifo 28 | */ 29 | u8_t fifoGet(fifo_t * fifo); 30 | 31 | /** 32 | * Get a character from fifo 33 | * Non blocking call. 34 | * @param pointer to fifo data structure 35 | * @return character read from fifo, or < zero if non was available 36 | */ 37 | s16_t fifoGetNonBlock(fifo_t * fifo); 38 | 39 | /** 40 | * fifoput is called by the signalhandler when new data has arrived (or some other event is indicated) 41 | * fifoput reads directly from the serialport and is thus highly dependent on unix arch at this moment 42 | * @param fifo pointer to fifo data structure 43 | * @param fd unix file descriptor 44 | */ 45 | void fifoPut(fifo_t * fifo, int fd); 46 | 47 | /** 48 | * fifoinit initiate fifo 49 | * @param fifo pointer to fifo data structure, allocated by the user 50 | */ 51 | void fifoInit(fifo_t * fifo); 52 | 53 | #endif 54 | 55 | -------------------------------------------------------------------------------- /contrib/ports/unix/include/netif/list.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef LWIP_LIST_H 3 | #define LWIP_LIST_H 4 | 5 | struct elem; 6 | 7 | struct list { 8 | struct elem *first, *last; 9 | int size, elems; 10 | }; 11 | 12 | struct elem { 13 | struct elem *next; 14 | void *data; 15 | }; 16 | 17 | struct list *list_new(int size); 18 | int list_push(struct list *list, void *data); 19 | void *list_pop(struct list *list); 20 | void *list_first(struct list *list); 21 | int list_elems(struct list *list); 22 | void list_delete(struct list *list); 23 | int list_remove(struct list *list, void *elem); 24 | void list_map(struct list *list, void (* func)(void *arg)); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /contrib/ports/unix/include/netif/pcapif.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef LWIP_PCAPIF_H 33 | #define LWIP_PCAPIF_H 34 | 35 | #include "lwip/netif.h" 36 | 37 | err_t pcapif_init(struct netif *netif); 38 | 39 | #endif /* LWIP_PCAPIF_H */ 40 | -------------------------------------------------------------------------------- /contrib/ports/unix/include/netif/sio.h: -------------------------------------------------------------------------------- 1 | #ifndef SIO_H 2 | #define SIO_H 3 | 4 | #include "lwip/sys.h" 5 | #include "lwip/netif.h" 6 | #include "netif/fifo.h" 7 | /*#include "netif/pppif.h"*/ 8 | /* BAUDRATE is defined in sio.c as it is implementation specific */ 9 | 10 | typedef struct sio_status_t { 11 | int fd; 12 | fifo_t myfifo; 13 | } sio_status_t; 14 | 15 | 16 | /** Baudrates */ 17 | typedef enum sioBaudrates { 18 | SIO_BAUD_9600, 19 | SIO_BAUD_19200, 20 | SIO_BAUD_38400, 21 | SIO_BAUD_57600, 22 | SIO_BAUD_115200 23 | } sioBaudrates; 24 | 25 | /** 26 | * Read a char from incoming data stream, this call blocks until data has arrived 27 | * @param siostat siostatus struct, contains sio instance data, given by sio_open 28 | * @return char read from input stream 29 | */ 30 | u8_t sio_recv( sio_status_t * siostat ); 31 | 32 | /** 33 | * Poll for a new character from incoming data stream 34 | * @param siostat siostatus struct, contains sio instance data, given by sio_open 35 | * @return char read from input stream, or < 0 if no char was available 36 | */ 37 | s16_t sio_poll(sio_status_t * siostat); 38 | 39 | /** 40 | * Parse incoming characters until a string str is recieved, blocking call 41 | * @param str zero terminated string to expect 42 | * @param siostat siostatus struct, contains sio instance data, given by sio_open 43 | */ 44 | void sio_expect_string(u8_t *str, sio_status_t * siostat); 45 | 46 | /** 47 | * Write a char to output data stream 48 | * @param c char to write to output stream 49 | * @param siostat siostatus struct, contains sio instance data, given by sio_open 50 | */ 51 | void sio_send( u8_t c, sio_status_t * siostat ); 52 | 53 | /** 54 | * Write a char to output data stream 55 | * @param str pointer to a zero terminated string 56 | * @param siostat siostatus struct, contains sio instance data, given by sio_open 57 | */ 58 | void sio_send_string(u8_t *str, sio_status_t * siostat); 59 | 60 | /** 61 | * Flush outbuffer (send everything in buffer now), useful if some layer below is 62 | * holding on to data, waitng to fill a buffer 63 | * @param siostat siostatus struct, contains sio instance data, given by sio_open 64 | */ 65 | void sio_flush( sio_status_t * siostat ); 66 | 67 | /** 68 | * Open serial port entry point from serial protocol (slipif, pppif) 69 | * @param devnum the device number to use, i.e. ttySx, comx:, etc. there x = devnum 70 | * @return siostatus struct, contains sio instance data, use when calling sio functions 71 | */ 72 | sio_status_t * sio_open( int devnum ); 73 | 74 | /** 75 | * Change baudrate of port, may close and reopen port 76 | * @param baud new baudrate 77 | * @param siostat siostatus struct, contains sio instance data, given by sio_open 78 | */ 79 | void sio_change_baud( sioBaudrates baud, sio_status_t * siostat ); 80 | 81 | #endif 82 | 83 | -------------------------------------------------------------------------------- /contrib/ports/unix/include/netif/tapif.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef LWIP_TAPIF_H 33 | #define LWIP_TAPIF_H 34 | 35 | #include "lwip/netif.h" 36 | 37 | err_t tapif_init(struct netif *netif); 38 | 39 | #endif /* LWIP_TAPIF_H */ 40 | -------------------------------------------------------------------------------- /contrib/ports/unix/include/netif/tcpdump.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef LWIP_NETIF_TCPDUMP_H 33 | #define LWIP_NETIF_TCPDUMP_H 34 | 35 | #include "lwip/pbuf.h" 36 | 37 | void tcpdump_init(void); 38 | void tcpdump(struct pbuf *p); 39 | 40 | #endif /* LWIP_NETIF_TCPDUMP_H */ 41 | -------------------------------------------------------------------------------- /contrib/ports/unix/include/netif/tunif.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef LWIP_TUNIF_H 33 | #define LWIP_TUNIF_H 34 | 35 | #include "lwip/netif.h" 36 | 37 | #include "lwip/pbuf.h" 38 | 39 | err_t tunif_init(struct netif *netif); 40 | 41 | #endif /* LWIP_TUNIF_H */ 42 | -------------------------------------------------------------------------------- /contrib/ports/unix/include/netif/unixif.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef LWIP_UNIXIF_H 33 | #define LWIP_UNIXIF_H 34 | 35 | #include "lwip/netif.h" 36 | 37 | err_t unixif_init_server(struct netif *netif); 38 | err_t unixif_init_client(struct netif *netif); 39 | 40 | #endif /* LWIP_UNIXIF_H */ 41 | -------------------------------------------------------------------------------- /contrib/ports/unix/netif/sio.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cernekee/ocproxy/c98f06d942970cdf35dd66ab46840f7d6d567b60/contrib/ports/unix/netif/sio.c -------------------------------------------------------------------------------- /contrib/ports/unix/perf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | 33 | #include "arch/perf.h" 34 | 35 | #include 36 | 37 | static FILE *f; 38 | 39 | void 40 | perf_print(unsigned long c1l, unsigned long c1h, 41 | unsigned long c2l, unsigned long c2h, 42 | char *key) 43 | { 44 | unsigned long sub_ms, sub_ls; 45 | 46 | sub_ms = c2h - c1h; 47 | sub_ls = c2l - c1l; 48 | if (c2l < c1l) sub_ms--; 49 | fprintf(f, "%s: %.8lu%.8lu\n", key, sub_ms, sub_ls); 50 | fflush(NULL); 51 | } 52 | 53 | void 54 | perf_print_times(struct tms *start, struct tms *end, char *key) 55 | { 56 | fprintf(f, "%s: %lu\n", key, end->tms_stime - start->tms_stime); 57 | fflush(NULL); 58 | } 59 | 60 | void 61 | perf_init(char *fname) 62 | { 63 | f = fopen(fname, "w"); 64 | } 65 | 66 | -------------------------------------------------------------------------------- /contrib/ports/unix/proj/lib/README: -------------------------------------------------------------------------------- 1 | This directory contains an example of how to compile lwIP as a self 2 | initialising shared library on Linux. 3 | 4 | Some brief instructions: 5 | 6 | * Compile the code: 7 | 8 | > make clean all 9 | 10 | This should produce liblwip4unixlib.so. This is the shared library. 11 | 12 | * Link an application against the shared library 13 | 14 | If you're using gcc you can do this by including -llwip4unixlib in 15 | your link command. 16 | 17 | * Run your application 18 | 19 | Ensure that LD_LIBRARY_PATH includes the directory that contains 20 | liblwip4unixlib.so (ie. this directory) 21 | 22 | 23 | 24 | If you are unsure about shared libraries and libraries on linux in 25 | general, you might find this HOWTO useful: 26 | 27 | 28 | 29 | 30 | 31 | Kieran Mansley, October 2002. -------------------------------------------------------------------------------- /contrib/ports/unix/proj/minimal/README: -------------------------------------------------------------------------------- 1 | This is an example of a very minimal lwIP project. It runs in a single 2 | thread and runs a single example application - an echo server. The 3 | echo application is implemented using the raw API. Additionally this 4 | raw API example hosts the SNMPv1 agent for development purposes. 5 | -------------------------------------------------------------------------------- /contrib/ports/unix/proj/minimal/mintapif.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef LWIP_MINTAPIF_H 33 | #define LWIP_MINTAPIF_H 34 | 35 | #include "lwip/netif.h" 36 | 37 | enum mintapif_signal { 38 | MINTAPIF_TIMEOUT, 39 | MINTAPIF_PACKET 40 | }; 41 | 42 | err_t mintapif_init(struct netif *netif); 43 | int mintapif_select(struct netif *netif); 44 | enum mintapif_signal mintapif_wait(struct netif *netif, u16_t time); 45 | 46 | #endif /* LWIP_MINTAPIF_H */ 47 | -------------------------------------------------------------------------------- /contrib/ports/unix/proj/minimal/timer.h: -------------------------------------------------------------------------------- 1 | #ifndef LWIP_TIMER_H_ 2 | #define LWIP_TIMER_H_ 3 | 4 | #define TIMER_EVT_ETHARPTMR 0 5 | #define TIMER_EVT_TCPTMR 1 6 | #define TIMER_EVT_IPREASSTMR 2 7 | #define TIMER_NUM 3 8 | 9 | void timer_init(void); 10 | void timer_set_interval(unsigned char tmr, unsigned int interval); 11 | unsigned char timer_testclr_evt(unsigned char tmr); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /contrib/ports/unix/proj/unixsim/README: -------------------------------------------------------------------------------- 1 | This directory contains an example of how a project using lwIP might 2 | look. It is also the development platform of lwIP, since it can be run 3 | as a user process under FreeBSD or Linux. There are also a number of 4 | example applications (including a simple web server) in the apps/ 5 | directory. 6 | 7 | Some short instructions on how to build and run lwIP on a FreeBSD or 8 | Linux host. For FreeBSD, the tap interface must be enabled in the 9 | kernel configuration and the kernel must be recompiled. The tap 10 | interface is enabled by adding the line "pseudo-device tap" in the 11 | kernel configuration. See Chapter 9 in the FreeBSD handbook for 12 | instructions on how to build a custom FreeBSD kernel. 13 | 14 | For Linux you might need to create a device node with 15 | 16 | > mknod /dev/net/tun c 10 200 17 | 18 | * Compile the code. This must be done by using GNU Make. Under 19 | FreeBSD, GNU Make can be found in the ports collection under 20 | /usr/ports/devel/gmake (type "make install distclean" to 21 | install). Under Linux, GNU Make is the default "make". 22 | 23 | > gmake (FreeBSD) 24 | 25 | > make (Linux) 26 | 27 | * The compilation process produces the executable file "simhost". To 28 | run this, you have to be root. 29 | 30 | > su (Type password for the root account) 31 | # ./simhost 32 | 33 | * The lwIP TCP/IP stack is now running with IP address 34 | 192.168.0.2. Some things that you can try: 35 | 36 | To see the packets that are going to and from the lwIP stack, run 37 | tcpdump: 38 | 39 | # tcpdump -l -n -i tap0 40 | 41 | You can ping lwIP: 42 | 43 | > ping 192.168.0.2 44 | 45 | For a telnet shell, run: 46 | 47 | > telnet 192.168.0.2 48 | 49 | Finally, "simhost" also includes a simple web server; the URL is 50 | of course http://192.168.0.2/. 51 | 52 | * Simhost has some extra features that can be 53 | selected with command line options. 54 | 55 | To enable runtime debug output (project must be build with -DLWIP_DEBUG): 56 | 57 | # ./simhost -d 58 | 59 | To ping any host, e.g. the gateway: 60 | 61 | # ./simhost -p 192.168.0.1 62 | -------------------------------------------------------------------------------- /contrib/ports/win32/.cvsignore: -------------------------------------------------------------------------------- 1 | lwipcfg_msvc.h -------------------------------------------------------------------------------- /contrib/ports/win32/check/config.h: -------------------------------------------------------------------------------- 1 | /* config.h for check-0.9.8 on win32 under MSVC/MinGW */ 2 | 3 | #ifdef _MSC_VER 4 | 5 | typedef unsigned int pid_t; 6 | typedef unsigned int uint32_t; 7 | 8 | #define ssize_t size_t 9 | #define snprintf _snprintf 10 | 11 | #define HAVE_DECL_STRDUP 1 12 | #define HAVE_DECL_FILENO 1 13 | #define HAVE_DECL_PUTENV 1 14 | 15 | #define _CRT_SECURE_NO_WARNINGS 16 | 17 | /* disable some warnings */ 18 | #pragma warning (disable: 4090) /* const assigned to non-const */ 19 | #pragma warning (disable: 4996) /* fileno is deprecated */ 20 | 21 | #endif /* _ MSC_VER */ 22 | 23 | 24 | #define LWIP_UNITTESTS_NOFORK 25 | 26 | #include 27 | -------------------------------------------------------------------------------- /contrib/ports/win32/check/sys/time.h: -------------------------------------------------------------------------------- 1 | #ifndef LWIP_SYS__TIME_H 2 | #define LWIP_SYS__TIME_H 3 | 4 | #include /* time_t */ 5 | 6 | struct timeval { 7 | time_t tv_sec; /* seconds */ 8 | long tv_usec; /* and microseconds */ 9 | }; 10 | int gettimeofday(struct timeval* tp, void* tzp); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /contrib/ports/win32/check/time.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) 5 | #define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64 6 | #else 7 | #define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL 8 | #endif 9 | 10 | #include "config.h" 11 | 12 | struct timezone 13 | { 14 | int tz_minuteswest; /* minutes W of Greenwich */ 15 | int tz_dsttime; /* type of dst correction */ 16 | }; 17 | 18 | int gettimeofday(struct timeval *tv, struct timezone *tz) 19 | { 20 | FILETIME ft; 21 | unsigned __int64 tmpres = 0; 22 | static int tzflag; 23 | 24 | if (NULL != tv) 25 | { 26 | GetSystemTimeAsFileTime(&ft); 27 | 28 | tmpres |= ft.dwHighDateTime; 29 | tmpres <<= 32; 30 | tmpres |= ft.dwLowDateTime; 31 | 32 | /*converting file time to unix epoch*/ 33 | tmpres -= DELTA_EPOCH_IN_MICROSECS; 34 | tmpres /= 10; /*convert into microseconds*/ 35 | tv->tv_sec = (long)(tmpres / 1000000UL); 36 | tv->tv_usec = (long)(tmpres % 1000000UL); 37 | } 38 | 39 | if (NULL != tz) 40 | { 41 | if (!tzflag) 42 | { 43 | _tzset(); 44 | tzflag++; 45 | } 46 | tz->tz_minuteswest = _timezone / 60; 47 | tz->tz_dsttime = _daylight; 48 | } 49 | 50 | return 0; 51 | } 52 | 53 | struct tm * 54 | localtime_r(const time_t *timer, struct tm *result) 55 | { 56 | struct tm *local_result; 57 | local_result = localtime (timer); 58 | 59 | if (local_result == NULL || result == NULL) 60 | return NULL; 61 | 62 | memcpy (result, local_result, sizeof (result)); 63 | return result; 64 | } 65 | -------------------------------------------------------------------------------- /contrib/ports/win32/check/unistd.h: -------------------------------------------------------------------------------- 1 | #ifndef LWIP_UNISTD_H 2 | #define LWIP_UNISTD_H 3 | 4 | /* include io.h for read() and write() */ 5 | #include 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /contrib/ports/win32/include/arch/bpstruct.h: -------------------------------------------------------------------------------- 1 | #pragma pack(push,1) 2 | -------------------------------------------------------------------------------- /contrib/ports/win32/include/arch/epstruct.h: -------------------------------------------------------------------------------- 1 | #pragma pack(pop) 2 | -------------------------------------------------------------------------------- /contrib/ports/win32/include/arch/perf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of the Institute nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | * Author: Adam Dunkels 32 | * 33 | */ 34 | #ifndef LWIP_PERF_H 35 | #define LWIP_PERF_H 36 | 37 | #define PERF_START /* null definition */ 38 | #define PERF_STOP(x) /* null definition */ 39 | 40 | #endif /* LWIP_PERF_H */ 41 | -------------------------------------------------------------------------------- /contrib/ports/win32/lwippools.h: -------------------------------------------------------------------------------- 1 | /* OPTIONAL: Pools to replace heap allocation 2 | * Optional: Pools can be used instead of the heap for mem_malloc. If 3 | * so, these should be defined here, in increasing order according to 4 | * the pool element size. 5 | * 6 | * LWIP_MALLOC_MEMPOOL(number_elements, element_size) 7 | */ 8 | #if MEM_USE_POOLS 9 | LWIP_MALLOC_MEMPOOL_START 10 | LWIP_MALLOC_MEMPOOL(100, 256) 11 | LWIP_MALLOC_MEMPOOL(50, 512) 12 | LWIP_MALLOC_MEMPOOL(20, 1024) 13 | LWIP_MALLOC_MEMPOOL(20, 1536) 14 | LWIP_MALLOC_MEMPOOL_END 15 | #endif /* MEM_USE_POOLS */ 16 | 17 | /* Optional: Your custom pools can go here if you would like to use 18 | * lwIP's memory pools for anything else. 19 | */ 20 | LWIP_MEMPOOL(SYS_MBOX, 22, 100, "SYS_MBOX") 21 | -------------------------------------------------------------------------------- /contrib/ports/win32/msvc8/lwIP_Test.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 9.00 2 | # Visual C++ Express 2005 3 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lwIP_test", "lwIP_Test.vcproj", "{8CC0CE51-32CF-4585-BFAF-A9343BC5A96D}" 4 | ProjectSection(ProjectDependencies) = postProject 5 | {6F44E49E-9F21-4144-91EC-53B92AEF62CE} = {6F44E49E-9F21-4144-91EC-53B92AEF62CE} 6 | {2CC276FA-B226-49C9-8F82-7FCD5A228E28} = {2CC276FA-B226-49C9-8F82-7FCD5A228E28} 7 | EndProjectSection 8 | EndProject 9 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lwIP pcapif", "lwIP_pcapif.vcproj", "{6F44E49E-9F21-4144-91EC-53B92AEF62CE}" 10 | ProjectSection(ProjectDependencies) = postProject 11 | {2CC276FA-B226-49C9-8F82-7FCD5A228E28} = {2CC276FA-B226-49C9-8F82-7FCD5A228E28} 12 | EndProjectSection 13 | EndProject 14 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lwIP", "lwIP.vcproj", "{2CC276FA-B226-49C9-8F82-7FCD5A228E28}" 15 | EndProject 16 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "makefsdata", "makefsdata.vcproj", "{0BFC0F21-8E84-4E68-A9E1-CE2A09B72F6D}" 17 | EndProject 18 | Global 19 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 20 | Debug|Win32 = Debug|Win32 21 | Release|Win32 = Release|Win32 22 | EndGlobalSection 23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 24 | {8CC0CE51-32CF-4585-BFAF-A9343BC5A96D}.Debug|Win32.ActiveCfg = Debug|Win32 25 | {8CC0CE51-32CF-4585-BFAF-A9343BC5A96D}.Debug|Win32.Build.0 = Debug|Win32 26 | {8CC0CE51-32CF-4585-BFAF-A9343BC5A96D}.Release|Win32.ActiveCfg = Release|Win32 27 | {8CC0CE51-32CF-4585-BFAF-A9343BC5A96D}.Release|Win32.Build.0 = Release|Win32 28 | {6F44E49E-9F21-4144-91EC-53B92AEF62CE}.Debug|Win32.ActiveCfg = Debug|Win32 29 | {6F44E49E-9F21-4144-91EC-53B92AEF62CE}.Debug|Win32.Build.0 = Debug|Win32 30 | {6F44E49E-9F21-4144-91EC-53B92AEF62CE}.Release|Win32.ActiveCfg = Release|Win32 31 | {6F44E49E-9F21-4144-91EC-53B92AEF62CE}.Release|Win32.Build.0 = Release|Win32 32 | {2CC276FA-B226-49C9-8F82-7FCD5A228E28}.Debug|Win32.ActiveCfg = Debug|Win32 33 | {2CC276FA-B226-49C9-8F82-7FCD5A228E28}.Debug|Win32.Build.0 = Debug|Win32 34 | {2CC276FA-B226-49C9-8F82-7FCD5A228E28}.Release|Win32.ActiveCfg = Release|Win32 35 | {2CC276FA-B226-49C9-8F82-7FCD5A228E28}.Release|Win32.Build.0 = Release|Win32 36 | {0BFC0F21-8E84-4E68-A9E1-CE2A09B72F6D}.Debug|Win32.ActiveCfg = Debug|Win32 37 | {0BFC0F21-8E84-4E68-A9E1-CE2A09B72F6D}.Debug|Win32.Build.0 = Debug|Win32 38 | {0BFC0F21-8E84-4E68-A9E1-CE2A09B72F6D}.Release|Win32.ActiveCfg = Release|Win32 39 | {0BFC0F21-8E84-4E68-A9E1-CE2A09B72F6D}.Release|Win32.Build.0 = Release|Win32 40 | EndGlobalSection 41 | GlobalSection(SolutionProperties) = preSolution 42 | HideSolutionNode = FALSE 43 | EndGlobalSection 44 | EndGlobal 45 | -------------------------------------------------------------------------------- /contrib/ports/win32/msvc8/lwIP_unittests.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 9.00 2 | # Visual Studio 2005 3 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lwip_unittests", "lwip_unittests.vcproj", "{6CCABAA4-F86F-4119-AFF8-43C9A4A234C2}" 4 | ProjectSection(ProjectDependencies) = postProject 5 | {EBB156DC-01BF-47B2-B69C-1A750B6B5F09} = {EBB156DC-01BF-47B2-B69C-1A750B6B5F09} 6 | {2CC276FA-B226-49C9-8F82-7FCD5A228E28} = {2CC276FA-B226-49C9-8F82-7FCD5A228E28} 7 | EndProjectSection 8 | EndProject 9 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lwIP", "lwIP.vcproj", "{2CC276FA-B226-49C9-8F82-7FCD5A228E28}" 10 | EndProject 11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcheck", "libcheck.vcproj", "{EBB156DC-01BF-47B2-B69C-1A750B6B5F09}" 12 | EndProject 13 | Global 14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 15 | Debug|Win32 = Debug|Win32 16 | Release|Win32 = Release|Win32 17 | EndGlobalSection 18 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 19 | {2CC276FA-B226-49C9-8F82-7FCD5A228E28}.Debug|Win32.ActiveCfg = Debug unittests|Win32 20 | {2CC276FA-B226-49C9-8F82-7FCD5A228E28}.Debug|Win32.Build.0 = Debug unittests|Win32 21 | {2CC276FA-B226-49C9-8F82-7FCD5A228E28}.Release|Win32.ActiveCfg = Release unittests|Win32 22 | {2CC276FA-B226-49C9-8F82-7FCD5A228E28}.Release|Win32.Build.0 = Release unittests|Win32 23 | {EBB156DC-01BF-47B2-B69C-1A750B6B5F09}.Debug|Win32.ActiveCfg = Debug|Win32 24 | {EBB156DC-01BF-47B2-B69C-1A750B6B5F09}.Debug|Win32.Build.0 = Debug|Win32 25 | {EBB156DC-01BF-47B2-B69C-1A750B6B5F09}.Release|Win32.ActiveCfg = Release|Win32 26 | {EBB156DC-01BF-47B2-B69C-1A750B6B5F09}.Release|Win32.Build.0 = Release|Win32 27 | {6CCABAA4-F86F-4119-AFF8-43C9A4A234C2}.Debug|Win32.ActiveCfg = Debug|Win32 28 | {6CCABAA4-F86F-4119-AFF8-43C9A4A234C2}.Debug|Win32.Build.0 = Debug|Win32 29 | {6CCABAA4-F86F-4119-AFF8-43C9A4A234C2}.Release|Win32.ActiveCfg = Release|Win32 30 | {6CCABAA4-F86F-4119-AFF8-43C9A4A234C2}.Release|Win32.Build.0 = Release|Win32 31 | EndGlobalSection 32 | GlobalSection(SolutionProperties) = preSolution 33 | HideSolutionNode = FALSE 34 | EndGlobalSection 35 | EndGlobal 36 | -------------------------------------------------------------------------------- /contrib/ports/win32/msvc8/readme.txt: -------------------------------------------------------------------------------- 1 | lwIP for Win32 2 | 3 | This is a quickly hacked port and example project of the lwIP library to 4 | Win32/MSVC9. 5 | 6 | It doesn't (yet?) include support for dhcp, autoip, slipif, ppp or pppoe. This 7 | is simply because none of the active developers using this port are using these 8 | interfaces right now. 9 | 10 | To get this compiling, you have to set a couple of environment variables: 11 | - LWIP_DIR: points to the main lwip tree (the folder where is the CHANGELOG file). 12 | - PCAP_DIR: points to the WinPcap Developer's Packs (containing 'include' and 'lib') 13 | 14 | You also will have to copy the file 'lwipcfg_msvc.h.example' to 15 | 'lwipcfg_msvc.h' and modify to suit your needs (WinPcap adapter number, 16 | IP configuration, applications...). 17 | 18 | Note that you also have to set the PCAP_DIR environment variable to point 19 | to the WinPcap Developer's Packs (containing 'include' and 'lib'). 20 | 21 | Included in the contrib\ports\win32 directory is the network interface driver 22 | using the winpcap library. 23 | 24 | lwIP: http://savannah.nongnu.org/projects/lwip/ 25 | WinPCap: http://netgroup-serv.polito.it/winpcap/ 26 | 27 | To compile the unittests, download check (tested with v0.9.8) from 28 | http://sourceforge.net/projects/check/ 29 | and place it in a folder "check" next to the "contrib" folder. -------------------------------------------------------------------------------- /contrib/ports/win32/pcapif.h: -------------------------------------------------------------------------------- 1 | #ifndef LWIP_PCAPIF_H 2 | #define LWIP_PCAPIF_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include "lwip/err.h" 9 | 10 | /** Set to 1 to let rx use an own thread (only for NO_SYS==0). 11 | * If set to 0, ethernetif_poll is used to poll for packets. 12 | */ 13 | #ifndef PCAPIF_RX_USE_THREAD 14 | #define PCAPIF_RX_USE_THREAD !NO_SYS 15 | #endif 16 | #if PCAPIF_RX_USE_THREAD && NO_SYS 17 | #error "Can't create a dedicated RX thread with NO_SYS==1" 18 | #endif 19 | 20 | struct netif; 21 | 22 | err_t pcapif_init (struct netif *netif); 23 | void pcapif_shutdown(struct netif *netif); 24 | #if !PCAPIF_RX_USE_THREAD 25 | void pcapif_poll (struct netif *netif); 26 | #endif /* !PCAPIF_RX_USE_THREAD */ 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif /* LWIP_PCAPIF_H */ 33 | -------------------------------------------------------------------------------- /contrib/ports/win32/pcapif_helper.h: -------------------------------------------------------------------------------- 1 | #ifndef LWIP_PCAPIF_HELPER_H 2 | #define LWIP_PCAPIF_HELPER_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | struct pcapifh_linkstate; 9 | 10 | enum pcapifh_link_event { 11 | PCAPIF_LINKEVENT_UNKNOWN, 12 | PCAPIF_LINKEVENT_UP, 13 | PCAPIF_LINKEVENT_DOWN 14 | }; 15 | 16 | struct pcapifh_linkstate* pcapifh_linkstate_init(const char *adapter_name); 17 | enum pcapifh_link_event pcapifh_linkstate_get(struct pcapifh_linkstate* state); 18 | void pcapifh_linkstate_close(struct pcapifh_linkstate* state); 19 | 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | 25 | #endif /* LWIP_PCAPIF_HELPER_H */ -------------------------------------------------------------------------------- /contrib/ports/win32/readme.txt: -------------------------------------------------------------------------------- 1 | lwIP for Win32 2 | 3 | - MSVC6 compiler, read contrib\ports\win32\msvc6\readme.txt 4 | 5 | - MSVC8 compiler, read contrib\ports\win32\msvc8\readme.txt 6 | 7 | lwIP: http://savannah.nongnu.org/projects/lwip/ 8 | WinPCap: http://netgroup-serv.polito.it/winpcap/ 9 | Visual C++: http://www.microsoft.com/express/download/ 10 | -------------------------------------------------------------------------------- /lwip/.gitattributes: -------------------------------------------------------------------------------- 1 | # These files are text and should be normalized 2 | *.txt text 3 | *.c text 4 | *.h text 5 | -------------------------------------------------------------------------------- /lwip/CHANGELOG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cernekee/ocproxy/c98f06d942970cdf35dd66ab46840f7d6d567b60/lwip/CHANGELOG -------------------------------------------------------------------------------- /lwip/COPYING: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, 2002 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | 33 | 34 | -------------------------------------------------------------------------------- /lwip/FILES: -------------------------------------------------------------------------------- 1 | src/ - The source code for the lwIP TCP/IP stack. 2 | doc/ - The documentation for lwIP. 3 | 4 | See also the FILES file in each subdirectory. 5 | -------------------------------------------------------------------------------- /lwip/VERSION: -------------------------------------------------------------------------------- 1 | e7f32240917cc912eb6e3e36780ecb3c4a06f264 2 | -------------------------------------------------------------------------------- /lwip/doc/FILES: -------------------------------------------------------------------------------- 1 | savannah.txt - How to obtain the current development source code. 2 | contrib.txt - How to contribute to lwIP as a developer. 3 | rawapi.txt - The documentation for the core API of lwIP. 4 | Also provides an overview about the other APIs and multithreading. 5 | snmp_agent.txt - The documentation for the lwIP SNMP agent. 6 | sys_arch.txt - The documentation for a system abstraction layer of lwIP. 7 | -------------------------------------------------------------------------------- /lwip/src/FILES: -------------------------------------------------------------------------------- 1 | api/ - The code for the high-level wrapper API. Not needed if 2 | you use the lowel-level call-back/raw API. 3 | 4 | core/ - The core of the TPC/IP stack; protocol implementations, 5 | memory and buffer management, and the low-level raw API. 6 | 7 | include/ - lwIP include files. 8 | 9 | netif/ - Generic network interface device drivers are kept here, 10 | as well as the ARP module. 11 | 12 | For more information on the various subdirectories, check the FILES 13 | file in each directory. 14 | -------------------------------------------------------------------------------- /lwip/src/core/ipv6/README: -------------------------------------------------------------------------------- 1 | IPv6 support in lwIP is very experimental. 2 | -------------------------------------------------------------------------------- /lwip/src/core/ipv6/dhcp6.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * 4 | * DHCPv6. 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2010 Inico Technologies Ltd. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Ivan Delamer 36 | * 37 | * 38 | * Please coordinate changes and requests with Ivan Delamer 39 | * 40 | */ 41 | 42 | #include "lwip/opt.h" 43 | 44 | #if LWIP_IPV6_DHCP6 /* don't build if not configured for use in lwipopts.h */ 45 | 46 | #include "lwip/ip6_addr.h" 47 | #include "lwip/def.h" 48 | 49 | 50 | #endif /* LWIP_IPV6_DHCP6 */ 51 | -------------------------------------------------------------------------------- /lwip/src/core/ipv6/inet6.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * 4 | * INET v6 addresses. 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2010 Inico Technologies Ltd. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Ivan Delamer 36 | * 37 | * 38 | * Please coordinate changes and requests with Ivan Delamer 39 | * 40 | */ 41 | 42 | #include "lwip/opt.h" 43 | 44 | #if LWIP_IPV6 && LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */ 45 | 46 | #include "lwip/def.h" 47 | #include "lwip/inet6.h" 48 | 49 | /** @see ip6_addr.c for implementation of functions. */ 50 | 51 | #endif /* LWIP_IPV6 */ 52 | -------------------------------------------------------------------------------- /lwip/src/core/sys.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * lwIP Operating System abstraction 4 | * 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Adam Dunkels 36 | * 37 | */ 38 | 39 | #include "lwip/opt.h" 40 | 41 | #include "lwip/sys.h" 42 | 43 | /* Most of the functions defined in sys.h must be implemented in the 44 | * architecture-dependent file sys_arch.c */ 45 | 46 | #if !NO_SYS 47 | 48 | #ifndef sys_msleep 49 | /** 50 | * Sleep for some ms. Timeouts are NOT processed while sleeping. 51 | * 52 | * @param ms number of milliseconds to sleep 53 | */ 54 | void 55 | sys_msleep(u32_t ms) 56 | { 57 | if (ms > 0) { 58 | sys_sem_t delaysem; 59 | err_t err = sys_sem_new(&delaysem, 0); 60 | if (err == ERR_OK) { 61 | sys_arch_sem_wait(&delaysem, ms); 62 | sys_sem_free(&delaysem); 63 | } 64 | } 65 | } 66 | #endif /* sys_msleep */ 67 | 68 | #endif /* !NO_SYS */ 69 | -------------------------------------------------------------------------------- /lwip/src/include/ipv6/lwip/dhcp6.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * 4 | * IPv6 address autoconfiguration as per RFC 4862. 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2010 Inico Technologies Ltd. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Ivan Delamer 36 | * 37 | * IPv6 address autoconfiguration as per RFC 4862. 38 | * 39 | * Please coordinate changes and requests with Ivan Delamer 40 | * 41 | */ 42 | 43 | #ifndef LWIP_HDR_IP6_DHCP6_H 44 | #define LWIP_HDR_IP6_DHCP6_H 45 | 46 | #include "lwip/opt.h" 47 | 48 | #if LWIP_IPV6_DHCP6 /* don't build if not configured for use in lwipopts.h */ 49 | 50 | 51 | struct dhcp6 52 | { 53 | /*TODO: implement DHCP6*/ 54 | }; 55 | 56 | #endif /* LWIP_IPV6_DHCP6 */ 57 | 58 | #endif /* LWIP_HDR_IP6_DHCP6_H */ 59 | -------------------------------------------------------------------------------- /lwip/src/include/ipv6/lwip/ethip6.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * 4 | * Ethernet output for IPv6. Uses ND tables for link-layer addressing. 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2010 Inico Technologies Ltd. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Ivan Delamer 36 | * 37 | * 38 | * Please coordinate changes and requests with Ivan Delamer 39 | * 40 | */ 41 | 42 | #ifndef LWIP_HDR_ETHIP6_H 43 | #define LWIP_HDR_ETHIP6_H 44 | 45 | #include "lwip/opt.h" 46 | 47 | #if LWIP_IPV6 && LWIP_ETHERNET /* don't build if not configured for use in lwipopts.h */ 48 | 49 | #include "lwip/pbuf.h" 50 | #include "lwip/ip6.h" 51 | #include "lwip/ip6_addr.h" 52 | #include "lwip/netif.h" 53 | 54 | 55 | #ifdef __cplusplus 56 | extern "C" { 57 | #endif 58 | 59 | 60 | err_t ethip6_output(struct netif *netif, struct pbuf *q, ip6_addr_t *ip6addr); 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif /* LWIP_IPV6 && LWIP_ETHERNET */ 67 | 68 | #endif /* LWIP_HDR_ETHIP6_H */ 69 | -------------------------------------------------------------------------------- /lwip/src/include/netif/ppp/ccp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ccp.h - Definitions for PPP Compression Control Protocol. 3 | * 4 | * Copyright (c) 1994-2002 Paul Mackerras. All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 13 | * 2. The name(s) of the authors of this software must not be used to 14 | * endorse or promote products derived from this software without 15 | * prior written permission. 16 | * 17 | * 3. Redistributions of any form whatsoever must retain the following 18 | * acknowledgment: 19 | * "This product includes software developed by Paul Mackerras 20 | * ". 21 | * 22 | * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO 23 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 24 | * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY 25 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 26 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 27 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 28 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 29 | * 30 | * $Id: ccp.h,v 1.12 2004/11/04 10:02:26 paulus Exp $ 31 | */ 32 | 33 | #include "lwip/opt.h" 34 | #if PPP_SUPPORT && CCP_SUPPORT /* don't build if not configured for use in lwipopts.h */ 35 | 36 | typedef struct ccp_options { 37 | bool bsd_compress; /* do BSD Compress? */ 38 | bool deflate; /* do Deflate? */ 39 | bool predictor_1; /* do Predictor-1? */ 40 | bool predictor_2; /* do Predictor-2? */ 41 | bool deflate_correct; /* use correct code for deflate? */ 42 | bool deflate_draft; /* use draft RFC code for deflate? */ 43 | bool mppe; /* do MPPE? */ 44 | u_short bsd_bits; /* # bits/code for BSD Compress */ 45 | u_short deflate_size; /* lg(window size) for Deflate */ 46 | short method; /* code for chosen compression method */ 47 | } ccp_options; 48 | 49 | extern fsm ccp_fsm[]; 50 | extern ccp_options ccp_wantoptions[]; 51 | extern ccp_options ccp_gotoptions[]; 52 | extern ccp_options ccp_allowoptions[]; 53 | extern ccp_options ccp_hisoptions[]; 54 | 55 | extern const struct protent ccp_protent; 56 | 57 | #endif /* PPP_SUPPORT && CCP_SUPPORT */ 58 | -------------------------------------------------------------------------------- /lwip/src/include/netif/ppp/chap-md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * chap-md5.h - New CHAP/MD5 implementation. 3 | * 4 | * Copyright (c) 2003 Paul Mackerras. All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 13 | * 2. The name(s) of the authors of this software must not be used to 14 | * endorse or promote products derived from this software without 15 | * prior written permission. 16 | * 17 | * 3. Redistributions of any form whatsoever must retain the following 18 | * acknowledgment: 19 | * "This product includes software developed by Paul Mackerras 20 | * ". 21 | * 22 | * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO 23 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 24 | * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY 25 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 26 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 27 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 28 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 29 | */ 30 | 31 | #include "lwip/opt.h" 32 | #if PPP_SUPPORT && CHAP_SUPPORT /* don't build if not configured for use in lwipopts.h */ 33 | 34 | extern const struct chap_digest_type md5_digest; 35 | 36 | #endif /* PPP_SUPPORT && CHAP_SUPPORT */ 37 | -------------------------------------------------------------------------------- /lwip/src/include/netif/ppp/ecp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ecp.h - Definitions for PPP Encryption Control Protocol. 3 | * 4 | * Copyright (c) 2002 Google, Inc. 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in 16 | * the documentation and/or other materials provided with the 17 | * distribution. 18 | * 19 | * 3. The name(s) of the authors of this software must not be used to 20 | * endorse or promote products derived from this software without 21 | * prior written permission. 22 | * 23 | * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO 24 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 25 | * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY 26 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 27 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 28 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 29 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 30 | * 31 | * $Id: ecp.h,v 1.2 2003/01/10 07:12:36 fcusack Exp $ 32 | */ 33 | 34 | #include "lwip/opt.h" 35 | #if PPP_SUPPORT && ECP_SUPPORT /* don't build if not configured for use in lwipopts.h */ 36 | 37 | typedef struct ecp_options { 38 | bool required; /* Is ECP required? */ 39 | unsigned enctype; /* Encryption type */ 40 | } ecp_options; 41 | 42 | extern fsm ecp_fsm[]; 43 | extern ecp_options ecp_wantoptions[]; 44 | extern ecp_options ecp_gotoptions[]; 45 | extern ecp_options ecp_allowoptions[]; 46 | extern ecp_options ecp_hisoptions[]; 47 | 48 | extern const struct protent ecp_protent; 49 | 50 | #endif /* PPP_SUPPORT && ECP_SUPPORT */ 51 | -------------------------------------------------------------------------------- /lwip/src/include/netif/ppp/ipv6cp.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cernekee/ocproxy/c98f06d942970cdf35dd66ab46840f7d6d567b60/lwip/src/include/netif/ppp/ipv6cp.h -------------------------------------------------------------------------------- /lwip/src/include/netif/ppp/pppcrypt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * pppcrypt.c - PPP/DES linkage for MS-CHAP and EAP SRP-SHA1 3 | * 4 | * Extracted from chap_ms.c by James Carlson. 5 | * 6 | * Copyright (c) 1995 Eric Rosenquist. All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * 3. The name(s) of the authors of this software must not be used to 21 | * endorse or promote products derived from this software without 22 | * prior written permission. 23 | * 24 | * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO 25 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 26 | * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY 27 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 28 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 29 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 30 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 31 | */ 32 | 33 | #include "lwip/opt.h" 34 | #if PPP_SUPPORT && MSCHAP_SUPPORT /* don't build if not configured for use in lwipopts.h */ 35 | 36 | #ifndef PPPCRYPT_H 37 | #define PPPCRYPT_H 38 | 39 | void pppcrypt_56_to_64_bit_key(u_char *key, u_char *des_key); 40 | 41 | #endif /* PPPCRYPT_H */ 42 | 43 | #endif /* PPP_SUPPORT && MSCHAP_SUPPORT */ 44 | -------------------------------------------------------------------------------- /lwip/src/include/posix/netdb.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * This file is a posix wrapper for lwip/netdb.h. 4 | */ 5 | 6 | /* 7 | * Redistribution and use in source and binary forms, with or without modification, 8 | * are permitted provided that the following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 3. The name of the author may not be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 21 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 23 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 26 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 27 | * OF SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | */ 32 | 33 | #include "lwip/netdb.h" 34 | -------------------------------------------------------------------------------- /lwip/src/include/posix/sys/socket.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * This file is a posix wrapper for lwip/sockets.h. 4 | */ 5 | 6 | /* 7 | * Redistribution and use in source and binary forms, with or without modification, 8 | * are permitted provided that the following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 3. The name of the author may not be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 21 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 23 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 26 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 27 | * OF SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | */ 32 | 33 | #include "lwip/sockets.h" 34 | -------------------------------------------------------------------------------- /lwip/src/netif/FILES: -------------------------------------------------------------------------------- 1 | This directory contains generic network interface device drivers that 2 | do not contain any hardware or architecture specific code. The files 3 | are: 4 | 5 | etharp.c 6 | Implements the ARP (Address Resolution Protocol) over 7 | Ethernet. The code in this file should be used together with 8 | Ethernet device drivers. Note that this module has been 9 | largely made Ethernet independent so you should be able to 10 | adapt this for other link layers (such as Firewire). 11 | 12 | ethernetif.c 13 | An example of how an Ethernet device driver could look. This 14 | file can be used as a "skeleton" for developing new Ethernet 15 | network device drivers. It uses the etharp.c ARP code. 16 | 17 | loopif.c 18 | A "loopback" network interface driver. It requires configuration 19 | through the define LWIP_LOOPIF_MULTITHREADING (see opt.h). 20 | 21 | slipif.c 22 | A generic implementation of the SLIP (Serial Line IP) 23 | protocol. It requires a sio (serial I/O) module to work. 24 | 25 | ppp/ Point-to-Point Protocol stack 26 | The PPP stack has been ported from ucip (http://ucip.sourceforge.net). 27 | It matches quite well to pppd 2.3.1 (http://ppp.samba.org), although 28 | compared to that, it has some modifications for embedded systems and 29 | the source code has been reordered a bit. -------------------------------------------------------------------------------- /lwip/src/netif/ppp/eui64.c: -------------------------------------------------------------------------------- 1 | /* 2 | * eui64.c - EUI64 routines for IPv6CP. 3 | * 4 | * Copyright (c) 1999 Tommi Komulainen. All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in 15 | * the documentation and/or other materials provided with the 16 | * distribution. 17 | * 18 | * 3. The name(s) of the authors of this software must not be used to 19 | * endorse or promote products derived from this software without 20 | * prior written permission. 21 | * 22 | * 4. Redistributions of any form whatsoever must retain the following 23 | * acknowledgment: 24 | * "This product includes software developed by Tommi Komulainen 25 | * ". 26 | * 27 | * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO 28 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 29 | * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY 30 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 31 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 32 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 33 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 34 | * 35 | * $Id: eui64.c,v 1.6 2002/12/04 23:03:32 paulus Exp $ 36 | */ 37 | 38 | #include "lwip/opt.h" 39 | #if PPP_SUPPORT && PPP_IPV6_SUPPORT /* don't build if not configured for use in lwipopts.h */ 40 | 41 | #include "netif/ppp/ppp_impl.h" 42 | #include "netif/ppp/eui64.h" 43 | 44 | /* 45 | * eui64_ntoa - Make an ascii representation of an interface identifier 46 | */ 47 | char *eui64_ntoa(eui64_t e) { 48 | static char buf[32]; 49 | 50 | snprintf(buf, 32, "%02x%02x:%02x%02x:%02x%02x:%02x%02x", 51 | e.e8[0], e.e8[1], e.e8[2], e.e8[3], 52 | e.e8[4], e.e8[5], e.e8[6], e.e8[7]); 53 | return buf; 54 | } 55 | 56 | #endif /* PPP_SUPPORT && PPP_IPV6_SUPPORT */ 57 | -------------------------------------------------------------------------------- /lwip/src/netif/ppp/ipv6cp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cernekee/ocproxy/c98f06d942970cdf35dd66ab46840f7d6d567b60/lwip/src/netif/ppp/ipv6cp.c -------------------------------------------------------------------------------- /lwip/src/netif/ppp/polarssl/README: -------------------------------------------------------------------------------- 1 | About PolarSSL files into lwIP PPP support 2 | ------------------------------------------ 3 | 4 | This folder contains some files fetched from the latest BSD release of 5 | the PolarSSL project for ciphers and encryption methods we need for lwIP 6 | PPP support. 7 | 8 | The PolarSSL files were cleaned to contain only the necessary struct 9 | fields and functions needed for lwIP. 10 | 11 | 12 | The PolarSSL API was not changed at all, so if you are already using 13 | PolarSSL you can choose to skip the compilation of the included PolarSSL 14 | library into lwIP: 15 | 16 | The following defines are available for flexibility: 17 | 18 | LWIP_INCLUDED_POLARSSL_MD4 ; Use lwIP internal PolarSSL for MD4 19 | LWIP_INCLUDED_POLARSSL_MD5 ; Use lwIP internal PolarSSL for MD5 20 | LWIP_INCLUDED_POLARSSL_SHA1 ; Use lwIP internal PolarSSL for SHA1 21 | LWIP_INCLUDED_POLARSSL_DES ; Use lwIP internal PolarSSL for DES 22 | 23 | If set (=1), the default if required by another enabled PPP feature unless 24 | explicitly set to 0, using included lwIP PolarSSL. 25 | 26 | If clear (=0), using external PolarSSL. 27 | 28 | Undefined if not needed. 29 | 30 | Beware of the stack requirements which can be a lot larger if you are not 31 | using our cleaned PolarSSL library. 32 | 33 | 34 | PolarSSL project website: http://polarssl.org/ 35 | -------------------------------------------------------------------------------- /lwip/src/netif/ppp/pppcrypt.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pppcrypt.c - PPP/DES linkage for MS-CHAP and EAP SRP-SHA1 3 | * 4 | * Extracted from chap_ms.c by James Carlson. 5 | * 6 | * Copyright (c) 1995 Eric Rosenquist. All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * 3. The name(s) of the authors of this software must not be used to 21 | * endorse or promote products derived from this software without 22 | * prior written permission. 23 | * 24 | * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO 25 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 26 | * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY 27 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 28 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 29 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 30 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 31 | */ 32 | 33 | #include "lwip/opt.h" 34 | #if PPP_SUPPORT && MSCHAP_SUPPORT /* don't build if not necessary */ 35 | 36 | #include "netif/ppp/ppp_impl.h" 37 | 38 | #include "netif/ppp/pppcrypt.h" 39 | 40 | 41 | static u_char pppcrypt_get_7bits(u_char *input, int startBit) { 42 | unsigned int word; 43 | 44 | word = (unsigned)input[startBit / 8] << 8; 45 | word |= (unsigned)input[startBit / 8 + 1]; 46 | 47 | word >>= 15 - (startBit % 8 + 7); 48 | 49 | return word & 0xFE; 50 | } 51 | 52 | /* IN 56 bit DES key missing parity bits 53 | * OUT 64 bit DES key with parity bits added 54 | */ 55 | void pppcrypt_56_to_64_bit_key(u_char *key, u_char * des_key) { 56 | des_key[0] = pppcrypt_get_7bits(key, 0); 57 | des_key[1] = pppcrypt_get_7bits(key, 7); 58 | des_key[2] = pppcrypt_get_7bits(key, 14); 59 | des_key[3] = pppcrypt_get_7bits(key, 21); 60 | des_key[4] = pppcrypt_get_7bits(key, 28); 61 | des_key[5] = pppcrypt_get_7bits(key, 35); 62 | des_key[6] = pppcrypt_get_7bits(key, 42); 63 | des_key[7] = pppcrypt_get_7bits(key, 49); 64 | } 65 | 66 | #endif /* PPP_SUPPORT && MSCHAP_SUPPORT */ 67 | -------------------------------------------------------------------------------- /lwip/test/unit/core/test_mem.c: -------------------------------------------------------------------------------- 1 | #include "test_mem.h" 2 | 3 | #include "lwip/mem.h" 4 | #include "lwip/stats.h" 5 | 6 | #if !LWIP_STATS || !MEM_STATS 7 | #error "This tests needs MEM-statistics enabled" 8 | #endif 9 | #if LWIP_DNS 10 | #error "This test needs DNS turned off (as it mallocs on init)" 11 | #endif 12 | 13 | /* Setups/teardown functions */ 14 | 15 | static void 16 | mem_setup(void) 17 | { 18 | } 19 | 20 | static void 21 | mem_teardown(void) 22 | { 23 | } 24 | 25 | 26 | /* Test functions */ 27 | 28 | /** Call mem_malloc, mem_free and mem_trim and check stats */ 29 | START_TEST(test_mem_one) 30 | { 31 | #define SIZE1 16 32 | #define SIZE1_2 12 33 | #define SIZE2 16 34 | void *p1, *p2; 35 | mem_size_t s1, s2; 36 | LWIP_UNUSED_ARG(_i); 37 | 38 | #if LWIP_DNS 39 | fail("This test needs DNS turned off (as it mallocs on init)"); 40 | #endif 41 | 42 | fail_unless(lwip_stats.mem.used == 0); 43 | 44 | p1 = mem_malloc(SIZE1); 45 | fail_unless(p1 != NULL); 46 | fail_unless(lwip_stats.mem.used >= SIZE1); 47 | s1 = lwip_stats.mem.used; 48 | 49 | p2 = mem_malloc(SIZE2); 50 | fail_unless(p2 != NULL); 51 | fail_unless(lwip_stats.mem.used >= SIZE2 + s1); 52 | s2 = lwip_stats.mem.used; 53 | 54 | mem_trim(p1, SIZE1_2); 55 | 56 | mem_free(p2); 57 | fail_unless(lwip_stats.mem.used <= s2 - SIZE2); 58 | 59 | mem_free(p1); 60 | fail_unless(lwip_stats.mem.used == 0); 61 | } 62 | END_TEST 63 | 64 | 65 | /** Create the suite including all tests for this module */ 66 | Suite * 67 | mem_suite(void) 68 | { 69 | testfunc tests[] = { 70 | TESTFUNC(test_mem_one) 71 | }; 72 | return create_suite("MEM", tests, sizeof(tests)/sizeof(testfunc), mem_setup, mem_teardown); 73 | } 74 | -------------------------------------------------------------------------------- /lwip/test/unit/core/test_mem.h: -------------------------------------------------------------------------------- 1 | #ifndef LWIP_HDR_TEST_MEM_H__ 2 | #define LWIP_HDR_TEST_MEM_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite *mem_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /lwip/test/unit/core/test_pbuf.h: -------------------------------------------------------------------------------- 1 | #ifndef LWIP_HDR_TEST_PBUF_H__ 2 | #define LWIP_HDR_TEST_PBUF_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite *pbuf_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /lwip/test/unit/dhcp/test_dhcp.h: -------------------------------------------------------------------------------- 1 | #ifndef LWIP_HDR_TEST_DHCP_H__ 2 | #define LWIP_HDR_TEST_DHCP_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite* dhcp_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /lwip/test/unit/etharp/test_etharp.h: -------------------------------------------------------------------------------- 1 | #ifndef LWIP_HDR_TEST_ETHARP_H__ 2 | #define LWIP_HDR_TEST_ETHARP_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite* etharp_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /lwip/test/unit/lwip_check.h: -------------------------------------------------------------------------------- 1 | #ifndef LWIP_HDR_LWIP_CHECK_H__ 2 | #define LWIP_HDR_LWIP_CHECK_H__ 3 | 4 | /* Common header file for lwIP unit tests using the check framework */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #define FAIL_RET() do { fail(); return; } while(0) 11 | #define EXPECT(x) fail_unless(x) 12 | #define EXPECT_RET(x) do { fail_unless(x); if(!(x)) { return; }} while(0) 13 | #define EXPECT_RETX(x, y) do { fail_unless(x); if(!(x)) { return y; }} while(0) 14 | #define EXPECT_RETNULL(x) EXPECT_RETX(x, NULL) 15 | 16 | typedef struct { 17 | TFun func; 18 | const char *name; 19 | } testfunc; 20 | 21 | #define TESTFUNC(x) {(x), "" # x "" } 22 | 23 | /* Modified function from check.h, supplying function name */ 24 | #define tcase_add_named_test(tc,tf) \ 25 | _tcase_add_test((tc),(tf).func,(tf).name,0, 0, 0, 1) 26 | 27 | /** typedef for a function returning a test suite */ 28 | typedef Suite* (suite_getter_fn)(void); 29 | 30 | /** Create a test suite */ 31 | static Suite* create_suite(const char* name, testfunc *tests, size_t num_tests, SFun setup, SFun teardown) 32 | { 33 | size_t i; 34 | Suite *s = suite_create(name); 35 | 36 | for(i = 0; i < num_tests; i++) { 37 | TCase *tc_core = tcase_create(name); 38 | if ((setup != NULL) || (teardown != NULL)) { 39 | tcase_add_checked_fixture(tc_core, setup, teardown); 40 | } 41 | tcase_add_named_test(tc_core, tests[i]); 42 | suite_add_tcase(s, tc_core); 43 | } 44 | return s; 45 | } 46 | 47 | #endif /* LWIP_HDR_LWIP_CHECK_H__ */ 48 | -------------------------------------------------------------------------------- /lwip/test/unit/lwip_unittests.c: -------------------------------------------------------------------------------- 1 | #include "lwip_check.h" 2 | 3 | #include "udp/test_udp.h" 4 | #include "tcp/test_tcp.h" 5 | #include "tcp/test_tcp_oos.h" 6 | #include "core/test_mem.h" 7 | #include "core/test_pbuf.h" 8 | #include "etharp/test_etharp.h" 9 | #include "dhcp/test_dhcp.h" 10 | 11 | #include "lwip/init.h" 12 | 13 | 14 | int main() 15 | { 16 | int number_failed; 17 | SRunner *sr; 18 | size_t i; 19 | suite_getter_fn* suites[] = { 20 | udp_suite, 21 | tcp_suite, 22 | tcp_oos_suite, 23 | mem_suite, 24 | pbuf_suite, 25 | etharp_suite, 26 | dhcp_suite 27 | }; 28 | size_t num = sizeof(suites)/sizeof(void*); 29 | LWIP_ASSERT("No suites defined", num > 0); 30 | 31 | lwip_init(); 32 | 33 | sr = srunner_create((suites[0])()); 34 | for(i = 1; i < num; i++) { 35 | srunner_add_suite(sr, ((suite_getter_fn*)suites[i])()); 36 | } 37 | 38 | #ifdef LWIP_UNITTESTS_NOFORK 39 | srunner_set_fork_status(sr, CK_NOFORK); 40 | #endif 41 | #ifdef LWIP_UNITTESTS_FORK 42 | srunner_set_fork_status(sr, CK_FORK); 43 | #endif 44 | 45 | srunner_run_all(sr, CK_NORMAL); 46 | number_failed = srunner_ntests_failed(sr); 47 | srunner_free(sr); 48 | return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; 49 | } 50 | -------------------------------------------------------------------------------- /lwip/test/unit/tcp/tcp_helper.h: -------------------------------------------------------------------------------- 1 | #ifndef LWIP_HDR_TCP_HELPER_H__ 2 | #define LWIP_HDR_TCP_HELPER_H__ 3 | 4 | #include "../lwip_check.h" 5 | #include "lwip/arch.h" 6 | #include "lwip/tcp.h" 7 | #include "lwip/netif.h" 8 | 9 | /* counters used for test_tcp_counters_* callback functions */ 10 | struct test_tcp_counters { 11 | u32_t recv_calls; 12 | u32_t recved_bytes; 13 | u32_t recv_calls_after_close; 14 | u32_t recved_bytes_after_close; 15 | u32_t close_calls; 16 | u32_t err_calls; 17 | err_t last_err; 18 | char* expected_data; 19 | u32_t expected_data_len; 20 | }; 21 | 22 | struct test_tcp_txcounters { 23 | u32_t num_tx_calls; 24 | u32_t num_tx_bytes; 25 | u8_t copy_tx_packets; 26 | struct pbuf *tx_packets; 27 | }; 28 | 29 | /* Helper functions */ 30 | void tcp_remove_all(void); 31 | 32 | struct pbuf* tcp_create_segment(ip_addr_t* src_ip, ip_addr_t* dst_ip, 33 | u16_t src_port, u16_t dst_port, void* data, size_t data_len, 34 | u32_t seqno, u32_t ackno, u8_t headerflags); 35 | struct pbuf* tcp_create_rx_segment(struct tcp_pcb* pcb, void* data, size_t data_len, 36 | u32_t seqno_offset, u32_t ackno_offset, u8_t headerflags); 37 | struct pbuf* tcp_create_rx_segment_wnd(struct tcp_pcb* pcb, void* data, size_t data_len, 38 | u32_t seqno_offset, u32_t ackno_offset, u8_t headerflags, u16_t wnd); 39 | void tcp_set_state(struct tcp_pcb* pcb, enum tcp_state state, ip_addr_t* local_ip, 40 | ip_addr_t* remote_ip, u16_t local_port, u16_t remote_port); 41 | void test_tcp_counters_err(void* arg, err_t err); 42 | err_t test_tcp_counters_recv(void* arg, struct tcp_pcb* pcb, struct pbuf* p, err_t err); 43 | 44 | struct tcp_pcb* test_tcp_new_counters_pcb(struct test_tcp_counters* counters); 45 | 46 | void test_tcp_input(struct pbuf *p, struct netif *inp); 47 | 48 | void test_tcp_init_netif(struct netif *netif, struct test_tcp_txcounters *txcounters, 49 | ip_addr_t *ip_addr, ip_addr_t *netmask); 50 | 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /lwip/test/unit/tcp/test_tcp.h: -------------------------------------------------------------------------------- 1 | #ifndef LWIP_HDR_TEST_TCP_H__ 2 | #define LWIP_HDR_TEST_TCP_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite *tcp_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /lwip/test/unit/tcp/test_tcp_oos.h: -------------------------------------------------------------------------------- 1 | #ifndef LWIP_HDR_TEST_TCP_OOS_H__ 2 | #define LWIP_HDR_TEST_TCP_OOS_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite *tcp_oos_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /lwip/test/unit/udp/test_udp.c: -------------------------------------------------------------------------------- 1 | #include "test_udp.h" 2 | 3 | #include "lwip/udp.h" 4 | #include "lwip/stats.h" 5 | 6 | #if !LWIP_STATS || !UDP_STATS || !MEMP_STATS 7 | #error "This tests needs UDP- and MEMP-statistics enabled" 8 | #endif 9 | 10 | /* Helper functions */ 11 | static void 12 | udp_remove_all(void) 13 | { 14 | struct udp_pcb *pcb = udp_pcbs; 15 | struct udp_pcb *pcb2; 16 | 17 | while(pcb != NULL) { 18 | pcb2 = pcb; 19 | pcb = pcb->next; 20 | udp_remove(pcb2); 21 | } 22 | fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 0); 23 | } 24 | 25 | /* Setups/teardown functions */ 26 | 27 | static void 28 | udp_setup(void) 29 | { 30 | udp_remove_all(); 31 | } 32 | 33 | static void 34 | udp_teardown(void) 35 | { 36 | udp_remove_all(); 37 | } 38 | 39 | 40 | /* Test functions */ 41 | 42 | START_TEST(test_udp_new_remove) 43 | { 44 | struct udp_pcb* pcb; 45 | LWIP_UNUSED_ARG(_i); 46 | 47 | fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 0); 48 | 49 | pcb = udp_new(); 50 | fail_unless(pcb != NULL); 51 | if (pcb != NULL) { 52 | fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 1); 53 | udp_remove(pcb); 54 | fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 0); 55 | } 56 | } 57 | END_TEST 58 | 59 | 60 | /** Create the suite including all tests for this module */ 61 | Suite * 62 | udp_suite(void) 63 | { 64 | testfunc tests[] = { 65 | TESTFUNC(test_udp_new_remove), 66 | }; 67 | return create_suite("UDP", tests, sizeof(tests)/sizeof(testfunc), udp_setup, udp_teardown); 68 | } 69 | -------------------------------------------------------------------------------- /lwip/test/unit/udp/test_udp.h: -------------------------------------------------------------------------------- 1 | #ifndef LWIP_HDR_TEST_UDP_H__ 2 | #define LWIP_HDR_TEST_UDP_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite* udp_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /ppa/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /ppa/control: -------------------------------------------------------------------------------- 1 | Source: ocproxy 2 | Maintainer: Kevin Cernekee 3 | Section: net 4 | Priority: optional 5 | Build-Depends: debhelper (>= 9), dh-autoreconf, libevent-dev 6 | Standards-Version: 3.9.8 7 | Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/ocproxy.git 8 | Vcs-Git: https://anonscm.debian.org/git/collab-maint/ocproxy.git 9 | Homepage: https://github.com/cernekee/ocproxy 10 | 11 | Package: ocproxy 12 | Architecture: any 13 | Depends: ${misc:Depends}, ${shlibs:Depends} 14 | Recommends: openconnect 15 | Description: lwIP based proxy for openconnect 16 | ocproxy is a lwIP based SOCKS and port-forwarding proxy for use with 17 | openconnect. It allows a non-administrator to use openconnect without 18 | the need for tunnel devices. Rather than adding the host machine to 19 | the network at the other end of the VPN, ocproxy allows a user to 20 | create a local SOCKS and port-forwarding proxy that is connected to 21 | the VPN. Web browsers, remote login utilities and other programs can 22 | then access the systems at the other end of the VPN via the proxy. 23 | -------------------------------------------------------------------------------- /ppa/patches/series: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cernekee/ocproxy/c98f06d942970cdf35dd66ab46840f7d6d567b60/ppa/patches/series -------------------------------------------------------------------------------- /ppa/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | export V = 1 4 | export DEB_BUILD_MAINT_OPTIONS = hardening=+all 5 | 6 | %: 7 | dh $@ --with autoreconf 8 | -------------------------------------------------------------------------------- /ppa/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /ppa/watch: -------------------------------------------------------------------------------- 1 | version=3 2 | 3 | https://github.com/cernekee/ocproxy/tags .*/(.*)\.tar\.gz 4 | -------------------------------------------------------------------------------- /release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | gpgkey="BC0B0D65" 4 | 5 | set -ex 6 | set -o pipefail 7 | 8 | # autotools will search .:..:../.. for support files 9 | # let's make sure it can't search our repo, so we know it is getting all 10 | # required files from the release tarball 11 | builddir=tmp.build/a/b/c/d 12 | reldir=tmp.build/w/x/y/z 13 | repodir=`pwd` 14 | 15 | rm -rf tmp.build ocproxy-*.tar.gz ocproxy-*.tar.gz.asc 16 | mkdir -p $reldir 17 | git clone . $reldir 18 | 19 | pushd $reldir 20 | ./autogen.sh 21 | ./configure 22 | fakeroot make dist 23 | tarball=$(ls -1 ocproxy-*.tar.gz) 24 | mv $tarball $repodir 25 | popd 26 | 27 | mkdir -p $builddir 28 | pushd $builddir 29 | tar -zxf $repodir/$tarball --strip 1 30 | ./configure --enable-vpnns 31 | make 32 | make distclean 33 | ./configure --enable-vpnns --prefix=/ CFLAGS="-Werror" 34 | make 35 | make install DESTDIR=`pwd`/pfx 36 | make clean 37 | popd 38 | 39 | rm -rf tmp.build 40 | 41 | if gpg --list-secret-keys $gpgkey >& /dev/null; then 42 | gpg --yes --armor --detach-sign --default-key $gpgkey $tarball 43 | fi 44 | 45 | exit 0 46 | --------------------------------------------------------------------------------