├── .gitignore ├── README.md ├── lwip ├── Makefile ├── contrib │ ├── 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 │ │ ├── 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 │ │ ├── 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 │ │ │ │ ├── lwipopts.old │ │ │ │ └── unixlib.c │ │ │ ├── minimal │ │ │ │ ├── Makefile │ │ │ │ ├── README │ │ │ │ ├── echo.c │ │ │ │ ├── echo.h │ │ │ │ ├── lwipopts.h │ │ │ │ ├── lwipopts.old │ │ │ │ ├── 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 │ │ ├── .cvsignore │ │ ├── libcheck.vcproj │ │ ├── lwIP.vcproj │ │ ├── lwIP_Test.sln │ │ ├── lwIP_Test.vcproj │ │ ├── lwIP_pcapif.vcproj │ │ ├── lwIP_pktif.vcproj │ │ ├── lwIP_unittests.sln │ │ ├── lwip_unittests.vcproj │ │ ├── makefsdata.vcproj │ │ └── readme.txt │ │ ├── pcap_helper.c │ │ ├── pcap_helper.h │ │ ├── pcapif.c │ │ ├── pcapif.h │ │ ├── pcapif_helper.c │ │ ├── pcapif_helper.h │ │ ├── pktdrv.c │ │ ├── pktdrv.h │ │ ├── pktif.c │ │ ├── pktif.h │ │ ├── readme.txt │ │ ├── sio.c │ │ ├── sys_arch.c │ │ └── test.c ├── lwip │ ├── CHANGELOG │ ├── COPYING │ ├── FILES │ ├── README │ ├── UPGRADING │ ├── doc │ │ ├── FILES │ │ ├── contrib.txt │ │ ├── rawapi.txt │ │ ├── savannah.txt │ │ ├── snmp_agent.txt │ │ └── sys_arch.txt │ ├── src │ │ ├── .hgignore │ │ ├── FILES │ │ ├── api │ │ │ ├── api_lib.c │ │ │ ├── api_msg.c │ │ │ ├── err.c │ │ │ ├── netbuf.c │ │ │ ├── netdb.c │ │ │ ├── netifapi.c │ │ │ ├── sockets.c │ │ │ └── tcpip.c │ │ ├── core │ │ │ ├── def.c │ │ │ ├── dhcp.c │ │ │ ├── dns.c │ │ │ ├── init.c │ │ │ ├── ipv4 │ │ │ │ ├── autoip.c │ │ │ │ ├── icmp.c │ │ │ │ ├── igmp.c │ │ │ │ ├── inet.c │ │ │ │ ├── inet_chksum.c │ │ │ │ ├── ip.c │ │ │ │ ├── ip_addr.c │ │ │ │ └── ip_frag.c │ │ │ ├── ipv6 │ │ │ │ ├── README │ │ │ │ ├── icmp6.c │ │ │ │ ├── inet6.c │ │ │ │ ├── ip6.c │ │ │ │ └── ip6_addr.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 │ │ │ │ │ ├── inet_chksum.h │ │ │ │ │ ├── ip.h │ │ │ │ │ ├── ip_addr.h │ │ │ │ │ └── ip_frag.h │ │ │ ├── ipv6 │ │ │ │ └── lwip │ │ │ │ │ ├── icmp.h │ │ │ │ │ ├── inet.h │ │ │ │ │ ├── ip.h │ │ │ │ │ └── ip_addr.h │ │ │ ├── lwip │ │ │ │ ├── api.h │ │ │ │ ├── api_msg.h │ │ │ │ ├── arch.h │ │ │ │ ├── debug.h │ │ │ │ ├── def.h │ │ │ │ ├── dhcp.h │ │ │ │ ├── dns.h │ │ │ │ ├── err.h │ │ │ │ ├── init.h │ │ │ │ ├── mem.h │ │ │ │ ├── memp.h │ │ │ │ ├── memp_std.h │ │ │ │ ├── netbuf.h │ │ │ │ ├── netdb.h │ │ │ │ ├── netif.h │ │ │ │ ├── netifapi.h │ │ │ │ ├── opt.h │ │ │ │ ├── pbuf.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_oe.h │ │ │ │ └── slipif.h │ │ └── netif │ │ │ ├── FILES │ │ │ ├── etharp.c │ │ │ ├── ethernetif.c │ │ │ ├── ppp │ │ │ ├── auth.c │ │ │ ├── auth.h │ │ │ ├── chap.c │ │ │ ├── chap.h │ │ │ ├── chpms.c │ │ │ ├── chpms.h │ │ │ ├── fsm.c │ │ │ ├── fsm.h │ │ │ ├── ipcp.c │ │ │ ├── ipcp.h │ │ │ ├── lcp.c │ │ │ ├── lcp.h │ │ │ ├── magic.c │ │ │ ├── magic.h │ │ │ ├── md5.c │ │ │ ├── md5.h │ │ │ ├── pap.c │ │ │ ├── pap.h │ │ │ ├── ppp.c │ │ │ ├── ppp.h │ │ │ ├── ppp_oe.c │ │ │ ├── pppdebug.h │ │ │ ├── randm.c │ │ │ ├── randm.h │ │ │ ├── vj.c │ │ │ └── vj.h │ │ │ └── slipif.c │ └── test │ │ └── unit │ │ ├── core │ │ ├── test_mem.c │ │ └── test_mem.h │ │ ├── etharp │ │ ├── test_etharp.c │ │ └── test_etharp.h │ │ ├── lwip_check.h │ │ ├── lwip_unittests.c │ │ ├── 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 ├── lwipopts.h ├── receiver.out ├── sender.out ├── tcpecho.c ├── tcpecho.h └── tcpsink.c ├── run ├── run_scripts ├── plot_figures.py ├── run_exps.py └── sender.py └── setup /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | *.out 4 | *.dump.* 5 | *.png 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | tcp-daytona 2 | =========== 3 | 4 | 5 | Replicating TCP Daytona 6 | ----------------------- 7 | 8 | Instructions: 9 | - launch a c1.xlarge Ubuntu 12.04 server instance on EC2 10 | - ssh in with X forwarding: ssh -X ubuntu@xxxxx.amazonaws.com 11 | - install git : sudo apt-get install git 12 | - clone github repo: git clone https://github.com/jamesbw/tcp-daytona.git 13 | - cd tcp-daytona 14 | - ./setup 15 | - ./run -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/contrib/apps/chargen/chargen.h: -------------------------------------------------------------------------------- 1 | #ifndef __CHARGEN_H__ 2 | #define __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 /* __CHARGEN_H__ */ 14 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/contrib/apps/httpserver/httpserver-netconn.h: -------------------------------------------------------------------------------- 1 | #ifndef __HTTPSERVER_NETCONN_H__ 2 | #define __HTTPSERVER_NETCONN_H__ 3 | 4 | void http_server_netconn_init(); 5 | 6 | #endif /* __HTTPSERVER_NETCONN_H__ */ 7 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/contrib/apps/httpserver_raw/fs/img/sics.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesbw/tcp-daytona/bf10e2b4def9670975d33f223b305a098f3dac92/lwip/contrib/apps/httpserver_raw/fs/img/sics.gif -------------------------------------------------------------------------------- /lwip/contrib/apps/httpserver_raw/fs/index.html: -------------------------------------------------------------------------------- 1 | 2 | lwIP - A Lightweight TCP/IP Stack 3 | 4 | 5 | 6 | 41 |
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 19 | of the Swedish Institute of Computer Science but now is 20 | being actively developed by a team of developers 21 | distributed world-wide. Since it's release, lwIP has 22 | spurred a lot of interest and has been ported to several 23 | platforms and operating systems. lwIP can be used either 24 | with or without an underlying OS. 25 |

26 |

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

33 |

34 | More information about lwIP can be found at the lwIP 35 | homepage at http://www.sics.se/~adam/lwip/. 37 |

38 |
39 |   40 |
42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /lwip/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 __FSDATA_H__ 33 | #define __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 /* __FSDATA_H__ */ 51 | -------------------------------------------------------------------------------- /lwip/contrib/apps/httpserver_raw/makefsdata/makefsdata: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | open(OUTPUT, "> fsdata.c"); 4 | 5 | chdir("fs"); 6 | open(FILES, "find . -type f |"); 7 | 8 | while($file = ) { 9 | 10 | # Do not include files in CVS directories nor backup files. 11 | if($file =~ /(CVS|~)/) { 12 | next; 13 | } 14 | 15 | chop($file); 16 | 17 | open(HEADER, "> /tmp/header") || die $!; 18 | if($file =~ /404/) { 19 | print(HEADER "HTTP/1.0 404 File not found\r\n"); 20 | } else { 21 | print(HEADER "HTTP/1.0 200 OK\r\n"); 22 | } 23 | print(HEADER "Server: lwIP/pre-0.6 (http://www.sics.se/~adam/lwip/)\r\n"); 24 | if($file =~ /\.html$/) { 25 | print(HEADER "Content-type: text/html\r\n"); 26 | } elsif($file =~ /\.gif$/) { 27 | print(HEADER "Content-type: image/gif\r\n"); 28 | } elsif($file =~ /\.png$/) { 29 | print(HEADER "Content-type: image/png\r\n"); 30 | } elsif($file =~ /\.jpg$/) { 31 | print(HEADER "Content-type: image/jpeg\r\n"); 32 | } elsif($file =~ /\.class$/) { 33 | print(HEADER "Content-type: application/octet-stream\r\n"); 34 | } elsif($file =~ /\.ram$/) { 35 | print(HEADER "Content-type: audio/x-pn-realaudio\r\n"); 36 | } else { 37 | print(HEADER "Content-type: text/plain\r\n"); 38 | } 39 | print(HEADER "\r\n"); 40 | close(HEADER); 41 | 42 | unless($file =~ /\.plain$/ || $file =~ /cgi/) { 43 | system("cat /tmp/header $file > /tmp/file"); 44 | } else { 45 | system("cp $file /tmp/file"); 46 | } 47 | 48 | open(FILE, "/tmp/file"); 49 | unlink("/tmp/file"); 50 | unlink("/tmp/header"); 51 | 52 | $file =~ s/\.//; 53 | $fvar = $file; 54 | $fvar =~ s-/-_-g; 55 | $fvar =~ s-\.-_-g; 56 | print(OUTPUT "static const unsigned char data".$fvar."[] = {\n"); 57 | print(OUTPUT "\t/* $file */\n\t"); 58 | for($j = 0; $j < length($file); $j++) { 59 | printf(OUTPUT "%#02x, ", unpack("C", substr($file, $j, 1))); 60 | } 61 | printf(OUTPUT "0,\n"); 62 | 63 | 64 | $i = 0; 65 | while(read(FILE, $data, 1)) { 66 | if($i == 0) { 67 | print(OUTPUT "\t"); 68 | } 69 | printf(OUTPUT "%#02x, ", unpack("C", $data)); 70 | $i++; 71 | if($i == 10) { 72 | print(OUTPUT "\n"); 73 | $i = 0; 74 | } 75 | } 76 | print(OUTPUT "};\n\n"); 77 | close(FILE); 78 | push(@fvars, $fvar); 79 | push(@files, $file); 80 | } 81 | 82 | for($i = 0; $i < @fvars; $i++) { 83 | $file = $files[$i]; 84 | $fvar = $fvars[$i]; 85 | 86 | if($i == 0) { 87 | $prevfile = "NULL"; 88 | } else { 89 | $prevfile = "file" . $fvars[$i - 1]; 90 | } 91 | print(OUTPUT "const struct fsdata_file file".$fvar."[] = {{$prevfile, data$fvar, "); 92 | print(OUTPUT "data$fvar + ". (length($file) + 1) .", "); 93 | print(OUTPUT "sizeof(data$fvar) - ". (length($file) + 1) ."}};\n\n"); 94 | } 95 | 96 | print(OUTPUT "#define FS_ROOT file$fvars[$i - 1]\n\n"); 97 | print(OUTPUT "#define FS_NUMFILES $i\n"); 98 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/contrib/apps/netbios/netbios.h: -------------------------------------------------------------------------------- 1 | #ifndef __NETBIOS_H__ 2 | #define __NETBIOS_H__ 3 | 4 | void netbios_init(void); 5 | 6 | #endif /* __NETBIOS_H__ */ 7 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/contrib/apps/netio/netio.h: -------------------------------------------------------------------------------- 1 | #ifndef __NETIO_H__ 2 | #define __NETIO_H__ 3 | 4 | void netio_init(void); 5 | 6 | #endif /* __NETIO_H__ */ 7 | -------------------------------------------------------------------------------- /lwip/contrib/apps/ping/ping.h: -------------------------------------------------------------------------------- 1 | #ifndef __PING_H__ 2 | #define __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 /* __PING_H__ */ 19 | -------------------------------------------------------------------------------- /lwip/contrib/apps/rtp/rtp.h: -------------------------------------------------------------------------------- 1 | #ifndef __RTP_H__ 2 | #define __RTP_H__ 3 | 4 | #if LWIP_SOCKET && LWIP_IGMP 5 | void rtp_init(void); 6 | #endif /* LWIP_SOCKET && LWIP_IGMP */ 7 | 8 | #endif /* __RTP_H__ */ 9 | -------------------------------------------------------------------------------- /lwip/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 __SHELL_H__ 33 | #define __SHELL_H__ 34 | 35 | void shell_init(void); 36 | 37 | #endif /* __SHELL_H__ */ 38 | -------------------------------------------------------------------------------- /lwip/contrib/apps/snmp_private_mib/private_mib.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * Exports Private lwIP MIB 4 | */ 5 | 6 | #ifndef __LWIP_PRIVATE_MIB_H__ 7 | #define __LWIP_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 | -------------------------------------------------------------------------------- /lwip/contrib/apps/sntp/sntp.h: -------------------------------------------------------------------------------- 1 | #ifndef __SNTP_H__ 2 | #define __SNTP_H__ 3 | 4 | void sntp_init(void); 5 | 6 | #endif /* __SNTP_H__ */ 7 | -------------------------------------------------------------------------------- /lwip/contrib/apps/socket_examples/socket_examples.h: -------------------------------------------------------------------------------- 1 | #ifndef __SOCKET_EXAMPLES_H__ 2 | #define __SOCKET_EXAMPLES_H__ 3 | 4 | void socket_examples_init(void); 5 | 6 | #endif /* __SOCKET_EXAMPLES_H__ */ 7 | -------------------------------------------------------------------------------- /lwip/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 __TCPECHO_H__ 34 | #define __TCPECHO_H__ 35 | 36 | void tcpecho_init(void); 37 | 38 | #endif /* __TCPECHO_H__ */ 39 | -------------------------------------------------------------------------------- /lwip/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 __ECHO_H__ 31 | #define __ECHO_H__ 32 | 33 | void echo_init(void); 34 | 35 | #endif /* __MINIMAL_ECHO_H */ 36 | -------------------------------------------------------------------------------- /lwip/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 __UDPECHO_H__ 33 | #define __UDPECHO_H__ 34 | 35 | void udpecho_init(void); 36 | 37 | #endif /* __UDPECHO_H__ */ 38 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/contrib/ports/old/6502/README: -------------------------------------------------------------------------------- 1 | The 6502 code is far from complete. 2 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/contrib/ports/old/rtxc/netif/FILES: -------------------------------------------------------------------------------- 1 | sioslipif.c - Implementation of the SLIP protocol on top of a serial line. 2 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 -------------------------------------------------------------------------------- /lwip/contrib/ports/old/ti_c6711/include/arch/cc.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: cc.h,v 1.1 2007/06/14 12:34:09 kieranm Exp $ 34 | */ 35 | #ifndef __CC_H__ 36 | #define __CC_H__ 37 | 38 | typedef unsigned char u8_t; 39 | typedef signed char s8_t; 40 | typedef unsigned short u16_t; 41 | typedef signed short s16_t; 42 | typedef unsigned int u32_t; 43 | typedef signed int s32_t; 44 | 45 | typedef u32_t mem_ptr_t; 46 | 47 | #define U16_F "hu" 48 | #define S16_F "hd" 49 | #define X16_F "hx" 50 | #define U32_F "u" 51 | #define S32_F "d" 52 | #define X32_F "x" 53 | 54 | #define BYTE_ORDER LITTLE_ENDIAN 55 | 56 | #define PACK_STRUCT_FIELD(x) x//; #pragma STRUCT_ALIGN(x,1) 57 | #define PACK_STRUCT_STRUCT 58 | #define PACK_STRUCT_BEGIN 59 | #define PACK_STRUCT_END 60 | 61 | #ifndef LWIP_PLATFORM_DIAG 62 | #define LWIP_PLATFORM_DIAG(x) do {printf x;} while(0) 63 | #endif 64 | 65 | #ifndef LWIP_PLATFORM_ASSERT 66 | #define LWIP_PLATFORM_ASSERT(x) do {printf("Assertion \"%s\" failed at line %d in %s\n", x, __LINE__, __FILE__); fflush(NULL); abort();} while(0) 67 | #endif 68 | 69 | #endif /* __CC_H__ */ 70 | 71 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/contrib/ports/old/ti_c6711/include/netif/ne2kif.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesbw/tcp-daytona/bf10e2b4def9670975d33f223b305a098f3dac92/lwip/contrib/ports/old/ti_c6711/include/netif/ne2kif.h -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/contrib/ports/old/ti_c6711/netif/ne2kif.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesbw/tcp-daytona/bf10e2b4def9670975d33f223b305a098f3dac92/lwip/contrib/ports/old/ti_c6711/netif/ne2kif.c -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/contrib/ports/unix/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 __ARCH_PERF_H__ 33 | #define __ARCH_PERF_H__ 34 | 35 | #include 36 | 37 | #ifdef PERF 38 | #define PERF_START { \ 39 | unsigned long __c1l, __c1h, __c2l, __c2h; \ 40 | __asm__(".byte 0x0f, 0x31" : "=a" (__c1l), "=d" (__c1h)) 41 | #define PERF_STOP(x) __asm__(".byte 0x0f, 0x31" : "=a" (__c2l), "=d" (__c2h)); \ 42 | perf_print(__c1l, __c1h, __c2l, __c2h, x);} 43 | 44 | /*#define PERF_START do { \ 45 | struct tms __perf_start, __perf_end; \ 46 | times(&__perf_start) 47 | #define PERF_STOP(x) times(&__perf_end); \ 48 | perf_print_times(&__perf_start, &__perf_end, x);\ 49 | } while(0)*/ 50 | #else /* PERF */ 51 | #define PERF_START /* null definition */ 52 | #define PERF_STOP(x) /* null definition */ 53 | #endif /* PERF */ 54 | 55 | void perf_print(unsigned long c1l, unsigned long c1h, 56 | unsigned long c2l, unsigned long c2h, 57 | char *key); 58 | 59 | void perf_print_times(struct tms *start, struct tms *end, char *key); 60 | 61 | void perf_init(char *fname); 62 | 63 | #endif /* __ARCH_PERF_H__ */ 64 | -------------------------------------------------------------------------------- /lwip/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 __ARCH_SYS_ARCH_H__ 33 | #define __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 /* __ARCH_SYS_ARCH_H__ */ 59 | 60 | -------------------------------------------------------------------------------- /lwip/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 __DELIF_H__ 33 | #define __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 /* __DELIF_H__ */ 43 | -------------------------------------------------------------------------------- /lwip/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 __DROPIF_H__ 33 | #define __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 /* __DROPIF_H__ */ 42 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/contrib/ports/unix/include/netif/list.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __LIST_H__ 3 | #define __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 | -------------------------------------------------------------------------------- /lwip/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 __PCAPIF_H__ 33 | #define __PCAPIF_H__ 34 | 35 | #include "lwip/netif.h" 36 | 37 | err_t pcapif_init(struct netif *netif); 38 | 39 | #endif /* __PCAPIF_H__ */ 40 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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 __TAPIF_H__ 33 | #define __TAPIF_H__ 34 | 35 | #include "lwip/netif.h" 36 | 37 | err_t tapif_init(struct netif *netif); 38 | 39 | #endif /* __TAPIF_H__ */ 40 | -------------------------------------------------------------------------------- /lwip/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 __NETIF_TCPDUMP_H__ 33 | #define __NETIF_TCPDUMP_H__ 34 | 35 | #include "lwip/pbuf.h" 36 | 37 | void tcpdump_init(void); 38 | void tcpdump(struct pbuf *p); 39 | 40 | #endif /* __NETIF_TCPDUMP_H__ */ 41 | -------------------------------------------------------------------------------- /lwip/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 __TUNIF_H__ 33 | #define __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 /* __TUNIF_H__ */ 42 | -------------------------------------------------------------------------------- /lwip/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 __UNIXIF_H__ 33 | #define __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 /* __UNIXIF_H__ */ 41 | -------------------------------------------------------------------------------- /lwip/contrib/ports/unix/lwip_chksum.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 "lwip/debug.h" 34 | 35 | #include "lwip/arch.h" 36 | 37 | #include "lwip/def.h" 38 | #include "lwip/inet.h" 39 | 40 | 41 | /*-----------------------------------------------------------------------------------*/ 42 | /* lwip_chksum: 43 | * 44 | * Sums up all 16 bit words in a memory portion. Also includes any odd byte. 45 | * This function is used by the other checksum functions. 46 | * 47 | */ 48 | /*-----------------------------------------------------------------------------------*/ 49 | #if 0 50 | u16_t 51 | lwip_chksum(void *dataptr, int len) 52 | { 53 | u32_t acc; 54 | 55 | for(acc = 0; len > 1; len -= 2) { 56 | acc += *((u16_t *)dataptr)++; 57 | } 58 | 59 | /* add up any odd byte */ 60 | if (len == 1) { 61 | acc += htons((u16_t)((*(u8_t *)dataptr) & 0xff) << 8); 62 | LWIP_DEBUGF(INET_DEBUG, ("inet: chksum: odd byte %d\n", *(u8_t *)dataptr)); 63 | } 64 | acc = (acc >> 16) + (acc & 0xffffUL); 65 | 66 | if (acc & 0xffff0000 != 0) { 67 | acc = (acc >> 16) + (acc & 0xffffUL); 68 | } 69 | 70 | return (u16_t)acc; 71 | } 72 | /*-----------------------------------------------------------------------------------*/ 73 | #endif 74 | -------------------------------------------------------------------------------- /lwip/contrib/ports/unix/netif/sio.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesbw/tcp-daytona/bf10e2b4def9670975d33f223b305a098f3dac92/lwip/contrib/ports/unix/netif/sio.c -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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. -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/contrib/ports/unix/proj/minimal/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 __ECHO_H__ 31 | #define __ECHO_H__ 32 | 33 | void echo_init(void); 34 | 35 | #endif /* __MINIMAL_ECHO_H */ 36 | -------------------------------------------------------------------------------- /lwip/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 __MINTAPIF_H__ 33 | #define __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 | 45 | #endif /* __MINTAPIF_H__ */ 46 | -------------------------------------------------------------------------------- /lwip/contrib/ports/unix/proj/minimal/timer.h: -------------------------------------------------------------------------------- 1 | #ifndef _TIMER_H_ 2 | #define _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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/contrib/ports/win32/.cvsignore: -------------------------------------------------------------------------------- 1 | lwipcfg_msvc.h -------------------------------------------------------------------------------- /lwip/contrib/ports/win32/check/config.h: -------------------------------------------------------------------------------- 1 | /* config.h for check-0.9.8 on win32 under MSVC */ 2 | 3 | typedef unsigned int pid_t; 4 | typedef unsigned int uint32_t; 5 | 6 | #define ssize_t size_t 7 | #define snprintf _snprintf 8 | 9 | #define HAVE_DECL_STRDUP 1 10 | #define HAVE_DECL_FILENO 1 11 | #define HAVE_DECL_PUTENV 1 12 | 13 | #define _CRT_SECURE_NO_WARNINGS 14 | 15 | /* disable some warnings */ 16 | #pragma warning (disable: 4090) /* const assigned to non-const */ 17 | #pragma warning (disable: 4996) /* fileno is deprecated */ 18 | 19 | #define LWIP_UNITTESTS_NOFORK 20 | 21 | #include 22 | -------------------------------------------------------------------------------- /lwip/contrib/ports/win32/check/sys/time.h: -------------------------------------------------------------------------------- 1 | #ifndef __SYS__TIME_H__ 2 | #define __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 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/contrib/ports/win32/check/unistd.h: -------------------------------------------------------------------------------- 1 | #ifndef __UNISTD_H__ 2 | #define __UNISTD_H__ 3 | 4 | /* include io.h for read() and write() */ 5 | #include 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /lwip/contrib/ports/win32/include/arch/bpstruct.h: -------------------------------------------------------------------------------- 1 | #pragma pack(push,1) 2 | -------------------------------------------------------------------------------- /lwip/contrib/ports/win32/include/arch/epstruct.h: -------------------------------------------------------------------------------- 1 | #pragma pack(pop) 2 | -------------------------------------------------------------------------------- /lwip/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 __PERF_H__ 35 | #define __PERF_H__ 36 | 37 | #define PERF_START /* null definition */ 38 | #define PERF_STOP(x) /* null definition */ 39 | 40 | #endif /* __PERF_H__ */ 41 | -------------------------------------------------------------------------------- /lwip/contrib/ports/win32/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 __ARCH_SYS_ARCH_H__ 33 | #define __ARCH_SYS_ARCH_H__ 34 | 35 | /* HANDLE is used for sys_sem_t but we won't include windows.h */ 36 | struct _sys_sem { 37 | void *sem; 38 | }; 39 | typedef struct _sys_sem sys_sem_t; 40 | #define SYS_SEM_NULL NULL 41 | #define sys_sem_valid(sema) (((sema) != NULL) && ((sema)->sem != NULL) && ((sema)->sem != (void*)-1)) 42 | #define sys_sem_set_invalid(sema) ((sema)->sem = NULL) 43 | 44 | /* let sys.h use binary semaphores for mutexes */ 45 | #define LWIP_COMPAT_MUTEX 1 46 | 47 | #ifndef MAX_QUEUE_ENTRIES 48 | #define MAX_QUEUE_ENTRIES 100 49 | #endif 50 | struct lwip_mbox { 51 | void* sem; 52 | void* q_mem[MAX_QUEUE_ENTRIES]; 53 | u32_t head, tail; 54 | }; 55 | typedef struct lwip_mbox sys_mbox_t; 56 | #define SYS_MBOX_NULL NULL 57 | #define sys_mbox_valid(mbox) ((mbox != NULL) && ((mbox)->sem != NULL) && ((mbox)->sem != (void*)-1)) 58 | #define sys_mbox_set_invalid(mbox) ((mbox)->sem = NULL) 59 | 60 | /* DWORD (thread id) is used for sys_thread_t but we won't include windows.h */ 61 | typedef u32_t sys_thread_t; 62 | 63 | #endif /* __ARCH_SYS_ARCH_H__ */ 64 | 65 | -------------------------------------------------------------------------------- /lwip/contrib/ports/win32/lwipcfg_msvc.h.example: -------------------------------------------------------------------------------- 1 | /** 2 | * Additional settings for the win32 port. 3 | * Copy this to lwipcfg_msvc.h and make the config changes you need. 4 | */ 5 | 6 | /* configuration for this port */ 7 | #define PPP_USERNAME "Admin" 8 | #define PPP_PASSWORD "pass" 9 | 10 | /** Define this to the index of the windows network adapter to use */ 11 | #define PACKET_LIB_ADAPTER_NR 1 12 | /** Define this to the GUID of the windows network adapter to use 13 | * or NOT define this if you want PACKET_LIB_ADAPTER_NR to be used */ 14 | /*#define PACKET_LIB_ADAPTER_GUID "00000000-0000-0000-0000-000000000000"*/ 15 | /*#define PACKET_LIB_GET_ADAPTER_NETADDRESS(addr) IP4_ADDR((addr), 192,168,1,0)*/ 16 | /*#define PACKET_LIB_QUIET*/ 17 | 18 | #define LWIP_PORT_INIT_IPADDR(addr) IP4_ADDR((addr), 192,168,1,200) 19 | #define LWIP_PORT_INIT_GW(addr) IP4_ADDR((addr), 192,168,1,1) 20 | #define LWIP_PORT_INIT_NETMASK(addr) IP4_ADDR((addr), 255,255,255,0) 21 | 22 | /* remember to change this MAC address to suit your needs! 23 | the last octet will be increased by netif->num for each netif */ 24 | #define LWIP_MAC_ADDR_BASE {0x00,0x01,0x02,0x03,0x04,0x05} 25 | 26 | /* configuration for applications */ 27 | 28 | #define LWIP_CHARGEN_APP 0 29 | #define LWIP_DNS_APP 0 30 | #define LWIP_HTTPD_APP 0 31 | /* Set this to 1 to use the netconn http server, 32 | * otherwise the raw api server will be used. */ 33 | /*#define LWIP_HTTPD_APP_NETCONN */ 34 | #define LWIP_NETBIOS_APP 0 35 | #define LWIP_NETIO_APP 0 36 | #define LWIP_PING_APP 0 37 | #define LWIP_RTP_APP 0 38 | #define LWIP_SHELL_APP 0 39 | #define LWIP_SNTP_APP 0 40 | #define LWIP_SOCKET_EXAMPLES_APP 0 41 | #define LWIP_TCPECHO_APP 0 42 | /* Set this to 1 to use the netconn tcpecho server, 43 | * otherwise the raw api server will be used. */ 44 | /*#define LWIP_TCPECHO_APP_NETCONN */ 45 | #define LWIP_UDPECHO_APP 0 46 | -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/contrib/ports/win32/msvc8/.cvsignore: -------------------------------------------------------------------------------- 1 | Debug 2 | lwIP_Test.ncb 3 | lwIP_Test.suo -------------------------------------------------------------------------------- /lwip/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 | -------------------------------------------------------------------------------- /lwip/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", "lwIP.vcproj", "{2CC276FA-B226-49C9-8F82-7FCD5A228E28}" 4 | EndProject 5 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcheck", "libcheck.vcproj", "{EBB156DC-01BF-47B2-B69C-1A750B6B5F09}" 6 | EndProject 7 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lwip_unittests", "lwip_unittests.vcproj", "{6CCABAA4-F86F-4119-AFF8-43C9A4A234C2}" 8 | ProjectSection(ProjectDependencies) = postProject 9 | {EBB156DC-01BF-47B2-B69C-1A750B6B5F09} = {EBB156DC-01BF-47B2-B69C-1A750B6B5F09} 10 | {2CC276FA-B226-49C9-8F82-7FCD5A228E28} = {2CC276FA-B226-49C9-8F82-7FCD5A228E28} 11 | EndProjectSection 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|Win32 20 | {2CC276FA-B226-49C9-8F82-7FCD5A228E28}.Debug|Win32.Build.0 = Debug|Win32 21 | {2CC276FA-B226-49C9-8F82-7FCD5A228E28}.Release|Win32.ActiveCfg = Release|Win32 22 | {2CC276FA-B226-49C9-8F82-7FCD5A228E28}.Release|Win32.Build.0 = Release|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 | -------------------------------------------------------------------------------- /lwip/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. -------------------------------------------------------------------------------- /lwip/contrib/ports/win32/pcap_helper.c: -------------------------------------------------------------------------------- 1 | #include "pcap_helper.h" 2 | 3 | #define WIN32_LEAN_AND_MEAN 4 | /* get the windows definitions of the following 4 functions out of the way */ 5 | #include 6 | #include 7 | #define HAVE_REMOTE 8 | #include "pcap.h" 9 | 10 | /** Get the index of an adapter by its network address 11 | * 12 | * @param netaddr network address of the adapter (e.g. 192.168.1.0) 13 | * @return index of the adapter or negative on error 14 | */ 15 | int 16 | get_adapter_index_from_addr(struct in_addr *netaddr, char *guid, size_t guid_len) 17 | { 18 | pcap_if_t *alldevs; 19 | pcap_if_t *d; 20 | char errbuf[PCAP_ERRBUF_SIZE+1]; 21 | char source[] = "rpcap://"; 22 | int index = 0; 23 | 24 | memset(guid, 0, guid_len); 25 | memset(errbuf, 0, sizeof(errbuf)); 26 | 27 | /* Retrieve the interfaces list */ 28 | if (pcap_findalldevs_ex(source, NULL, &alldevs, errbuf) == -1) { 29 | printf("Error in pcap_findalldevs: %s\n", errbuf); 30 | return -1; 31 | } 32 | /* Scan the list printing every entry */ 33 | for (d = alldevs; d != NULL; d = d->next, index++) { 34 | pcap_addr_t *a; 35 | for(a = d->addresses; a != NULL; a = a->next) { 36 | if (a->addr->sa_family == AF_INET) { 37 | ULONG a_addr = ((struct sockaddr_in *)a->addr)->sin_addr.s_addr; 38 | ULONG a_netmask = ((struct sockaddr_in *)a->netmask)->sin_addr.s_addr; 39 | ULONG a_netaddr = a_addr & a_netmask; 40 | ULONG addr = (*netaddr).s_addr; 41 | if (a_netaddr == addr) { 42 | int ret = -1; 43 | char name[128]; 44 | char *start, *end; 45 | size_t len = strlen(d->name); 46 | if(len > 127) { 47 | len = 127; 48 | } 49 | memcpy(name, d->name, len); 50 | name[len] = 0; 51 | start = strstr(name, "{"); 52 | if (start != NULL) { 53 | end = strstr(start, "}"); 54 | if (end != NULL) { 55 | size_t len = end - start + 1; 56 | memcpy(guid, start, len); 57 | ret = index; 58 | } 59 | } 60 | pcap_freealldevs(alldevs); 61 | return ret; 62 | } 63 | } 64 | } 65 | } 66 | printf("Network address not found.\n"); 67 | 68 | pcap_freealldevs(alldevs); 69 | return -1; 70 | } 71 | -------------------------------------------------------------------------------- /lwip/contrib/ports/win32/pcap_helper.h: -------------------------------------------------------------------------------- 1 | #ifndef __PCAP_HELPER_H__ 2 | #define __PCAP_HELPER_H__ 3 | 4 | #include 5 | 6 | struct in_addr; 7 | 8 | 9 | int get_adapter_index_from_addr(struct in_addr* netaddr, char *guid, size_t guid_len); 10 | 11 | #endif /* __PCAP_HELPER_H__ */ -------------------------------------------------------------------------------- /lwip/contrib/ports/win32/pcapif.h: -------------------------------------------------------------------------------- 1 | #ifndef __PKTIF_H__ 2 | #define __PKTIF_H__ 3 | 4 | #include "lwip/err.h" 5 | 6 | /** Set to 1 to let rx use an own thread (only for NO_SYS==0). 7 | * If set to 0, ethernetif_poll is used to poll for packets. 8 | */ 9 | #ifndef PCAPIF_RX_USE_THREAD 10 | #define PCAPIF_RX_USE_THREAD !NO_SYS 11 | #endif 12 | #if PCAPIF_RX_USE_THREAD && NO_SYS 13 | #error "Can't create a dedicated RX thread with NO_SYS==1" 14 | #endif 15 | 16 | struct netif; 17 | 18 | err_t pcapif_init (struct netif *netif); 19 | void pcapif_shutdown(struct netif *netif); 20 | #if !PCAPIF_RX_USE_THREAD 21 | void pcapif_poll (struct netif *netif); 22 | #endif /* !PCAPIF_RX_USE_THREAD */ 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /lwip/contrib/ports/win32/pcapif_helper.h: -------------------------------------------------------------------------------- 1 | #ifndef __PCAPIF_HELPER_H__ 2 | #define __PCAPIF_HELPER_H__ 3 | 4 | 5 | struct pcapifh_linkstate; 6 | 7 | enum pcapifh_link_event { 8 | PCAPIF_LINKEVENT_UNKNOWN, 9 | PCAPIF_LINKEVENT_UP, 10 | PCAPIF_LINKEVENT_DOWN 11 | }; 12 | 13 | struct pcapifh_linkstate* pcapifh_linkstate_init(const char *adapter_name); 14 | enum pcapif_link_event pcapifh_linkstate_get(struct pcapifh_linkstate* state); 15 | void pcapifh_linkstate_close(struct pcapifh_linkstate* state); 16 | 17 | 18 | #endif /* __PCAPIF_HELPER_H__ */ -------------------------------------------------------------------------------- /lwip/contrib/ports/win32/pktdrv.h: -------------------------------------------------------------------------------- 1 | #ifndef __PKTDRV_H__ 2 | #define __PKTDRV_H__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | typedef void (*input_fn)(void *arg, void *packet, int len); 9 | 10 | enum link_adapter_event { 11 | LINKEVENT_UNCHANGED, 12 | LINKEVENT_UP, 13 | LINKEVENT_DOWN 14 | }; 15 | 16 | void* init_adapter (int adapter_num, char *mac_addr, input_fn input, void *arg, enum link_adapter_event *linkstate); 17 | void shutdown_adapter(void *adapter); 18 | int packet_send (void *adapter, void *buffer, int len); 19 | void update_adapter (void *adapter); 20 | enum link_adapter_event link_adapter (void *adapter); 21 | int get_adapter_index(const char* adapter_guid); 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /lwip/contrib/ports/win32/pktif.h: -------------------------------------------------------------------------------- 1 | #ifndef __PKTIF_H__ 2 | #define __PKTIF_H__ 3 | 4 | #include "lwip/err.h" 5 | #include "lwip/netif.h" 6 | 7 | err_t ethernetif_init (struct netif *netif); 8 | void ethernetif_shutdown(struct netif *netif); 9 | void ethernetif_poll (struct netif *netif); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /lwip/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/lwip/CHANGELOG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesbw/tcp-daytona/bf10e2b4def9670975d33f223b305a098f3dac92/lwip/lwip/CHANGELOG -------------------------------------------------------------------------------- /lwip/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/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/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/lwip/src/.hgignore: -------------------------------------------------------------------------------- 1 | syntax: glob 2 | 3 | *.pyc 4 | *.orig 5 | *.rej 6 | *~ 7 | TAGS 8 | Module.symvers 9 | *.ncb 10 | *.suo 11 | *.bak 12 | *.orig 13 | *.rej 14 | 15 | syntax: regexp 16 | \.\#.+ 17 | [\\/]CVS$ 18 | ^CVS$ 19 | ^build$ 20 | ^install$ 21 | ^logs.build_tree$ 22 | [\\/]bin$ 23 | ^bin$ 24 | [\\/]obj$ 25 | ^obj$ 26 | \.cvsignore 27 | -------------------------------------------------------------------------------- /lwip/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/lwip/src/core/ipv4/inet.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * Functions common to all TCP/IPv4 modules, such as the byte order functions. 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/inet.h" 42 | 43 | -------------------------------------------------------------------------------- /lwip/lwip/src/core/ipv6/README: -------------------------------------------------------------------------------- 1 | IPv6 support in lwIP is very experimental. 2 | -------------------------------------------------------------------------------- /lwip/lwip/src/core/ipv6/ip6_addr.c: -------------------------------------------------------------------------------- 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 | * Author: Adam Dunkels 30 | * 31 | */ 32 | 33 | #include "lwip/opt.h" 34 | #include "lwip/ip_addr.h" 35 | #include "lwip/inet.h" 36 | 37 | u8_t 38 | ip_addr_netcmp(struct ip_addr *addr1, struct ip_addr *addr2, 39 | struct ip_addr *mask) 40 | { 41 | return((addr1->addr[0] & mask->addr[0]) == (addr2->addr[0] & mask->addr[0]) && 42 | (addr1->addr[1] & mask->addr[1]) == (addr2->addr[1] & mask->addr[1]) && 43 | (addr1->addr[2] & mask->addr[2]) == (addr2->addr[2] & mask->addr[2]) && 44 | (addr1->addr[3] & mask->addr[3]) == (addr2->addr[3] & mask->addr[3])); 45 | 46 | } 47 | 48 | u8_t 49 | ip_addr_cmp(struct ip_addr *addr1, struct ip_addr *addr2) 50 | { 51 | return(addr1->addr[0] == addr2->addr[0] && 52 | addr1->addr[1] == addr2->addr[1] && 53 | addr1->addr[2] == addr2->addr[2] && 54 | addr1->addr[3] == addr2->addr[3]); 55 | } 56 | 57 | void 58 | ip_addr_set(struct ip_addr *dest, struct ip_addr *src) 59 | { 60 | SMEMCPY(dest, src, sizeof(struct ip_addr)); 61 | /* dest->addr[0] = src->addr[0]; 62 | dest->addr[1] = src->addr[1]; 63 | dest->addr[2] = src->addr[2]; 64 | dest->addr[3] = src->addr[3];*/ 65 | } 66 | 67 | u8_t 68 | ip_addr_isany(struct ip_addr *addr) 69 | { 70 | if (addr == NULL) return 1; 71 | return((addr->addr[0] | addr->addr[1] | addr->addr[2] | addr->addr[3]) == 0); 72 | } 73 | -------------------------------------------------------------------------------- /lwip/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 | /** 49 | * Sleep for some ms. Timeouts are NOT processed while sleeping. 50 | * 51 | * @param ms number of milliseconds to sleep 52 | */ 53 | void 54 | sys_msleep(u32_t ms) 55 | { 56 | if (ms > 0) { 57 | sys_sem_t delaysem; 58 | err_t err = sys_sem_new(&delaysem, 0); 59 | if (err == ERR_OK) { 60 | sys_arch_sem_wait(&delaysem, ms); 61 | sys_sem_free(&delaysem); 62 | } 63 | } 64 | } 65 | 66 | #endif /* !NO_SYS */ 67 | -------------------------------------------------------------------------------- /lwip/lwip/src/include/ipv6/lwip/inet.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 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __LWIP_INET_H__ 33 | #define __LWIP_INET_H__ 34 | 35 | #include "lwip/opt.h" 36 | #include "lwip/pbuf.h" 37 | #include "lwip/ip_addr.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | u16_t inet_chksum(void *data, u16_t len); 44 | u16_t inet_chksum_pbuf(struct pbuf *p); 45 | u16_t inet_chksum_pseudo(struct pbuf *p, 46 | struct ip_addr *src, struct ip_addr *dest, 47 | u8_t proto, u32_t proto_len); 48 | 49 | u32_t inet_addr(const char *cp); 50 | s8_t inet_aton(const char *cp, struct in_addr *addr); 51 | 52 | #ifndef _MACHINE_ENDIAN_H_ 53 | #ifndef _NETINET_IN_H 54 | #ifndef _LINUX_BYTEORDER_GENERIC_H 55 | u16_t htons(u16_t n); 56 | u16_t ntohs(u16_t n); 57 | u32_t htonl(u32_t n); 58 | u32_t ntohl(u32_t n); 59 | #endif /* _LINUX_BYTEORDER_GENERIC_H */ 60 | #endif /* _NETINET_IN_H */ 61 | #endif /* _MACHINE_ENDIAN_H_ */ 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | 67 | #endif /* __LWIP_INET_H__ */ 68 | 69 | -------------------------------------------------------------------------------- /lwip/lwip/src/include/netif/slipif.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 __NETIF_SLIPIF_H__ 35 | #define __NETIF_SLIPIF_H__ 36 | 37 | #include "lwip/netif.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | err_t slipif_init(struct netif * netif); 44 | void slipif_poll(struct netif *netif); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /lwip/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/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 | TFun tests[] = { 70 | test_mem_one, 71 | }; 72 | return create_suite("MEM", tests, sizeof(tests)/sizeof(TFun), mem_setup, mem_teardown); 73 | } 74 | -------------------------------------------------------------------------------- /lwip/lwip/test/unit/core/test_mem.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_MEM_H__ 2 | #define __TEST_MEM_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite *mem_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /lwip/lwip/test/unit/etharp/test_etharp.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_ETHARP_H__ 2 | #define __TEST_ETHARP_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite* etharp_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /lwip/lwip/test/unit/lwip_check.h: -------------------------------------------------------------------------------- 1 | #ifndef __LWIP_CHECK_H__ 2 | #define __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 for a function returning a test suite */ 17 | typedef Suite* (suite_getter_fn)(void); 18 | 19 | /** Create a test suite */ 20 | static Suite* create_suite(const char* name, TFun *tests, size_t num_tests, SFun setup, SFun teardown) 21 | { 22 | size_t i; 23 | Suite *s = suite_create(name); 24 | 25 | for(i = 0; i < num_tests; i++) { 26 | /* Core test case */ 27 | TCase *tc_core = tcase_create("Core"); 28 | if ((setup != NULL) || (teardown != NULL)) { 29 | tcase_add_checked_fixture(tc_core, setup, teardown); 30 | } 31 | tcase_add_test(tc_core, tests[i]); 32 | suite_add_tcase(s, tc_core); 33 | } 34 | return s; 35 | } 36 | 37 | #endif /* __LWIP_CHECK_H__ */ 38 | -------------------------------------------------------------------------------- /lwip/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 "etharp/test_etharp.h" 8 | 9 | #include "lwip/init.h" 10 | 11 | 12 | int main() 13 | { 14 | int number_failed; 15 | SRunner *sr; 16 | size_t i; 17 | suite_getter_fn* suites[] = { 18 | udp_suite, 19 | tcp_suite, 20 | tcp_oos_suite, 21 | mem_suite, 22 | etharp_suite, 23 | }; 24 | size_t num = sizeof(suites)/sizeof(void*); 25 | LWIP_ASSERT("No suites defined", num > 0); 26 | 27 | lwip_init(); 28 | 29 | sr = srunner_create((suites[0])()); 30 | for(i = 1; i < num; i++) { 31 | srunner_add_suite(sr, ((suite_getter_fn*)suites[i])()); 32 | } 33 | 34 | #ifdef LWIP_UNITTESTS_NOFORK 35 | srunner_set_fork_status(sr, CK_NOFORK); 36 | #endif 37 | #ifdef LWIP_UNITTESTS_FORK 38 | srunner_set_fork_status(sr, CK_FORK); 39 | #endif 40 | 41 | srunner_run_all(sr, CK_NORMAL); 42 | number_failed = srunner_ntests_failed(sr); 43 | srunner_free(sr); 44 | return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; 45 | } 46 | 47 | -------------------------------------------------------------------------------- /lwip/lwip/test/unit/tcp/tcp_helper.h: -------------------------------------------------------------------------------- 1 | #ifndef __TCP_HELPER_H__ 2 | #define __TCP_HELPER_H__ 3 | 4 | #include "../lwip_check.h" 5 | #include "lwip/arch.h" 6 | #include "lwip/tcp.h" 7 | 8 | /* counters used for test_tcp_counters_* callback functions */ 9 | struct test_tcp_counters { 10 | u32_t recv_calls; 11 | u32_t recved_bytes; 12 | u32_t recv_calls_after_close; 13 | u32_t recved_bytes_after_close; 14 | u32_t close_calls; 15 | u32_t err_calls; 16 | err_t last_err; 17 | char* expected_data; 18 | u32_t expected_data_len; 19 | }; 20 | 21 | /* Helper functions */ 22 | void tcp_remove_all(void); 23 | 24 | struct pbuf* tcp_create_segment(ip_addr_t* src_ip, ip_addr_t* dst_ip, 25 | u16_t src_port, u16_t dst_port, void* data, size_t data_len, 26 | u32_t seqno, u32_t ackno, u8_t headerflags); 27 | struct pbuf* tcp_create_rx_segment(struct tcp_pcb* pcb, void* data, size_t data_len, 28 | u32_t seqno_offset, u32_t ackno_offset, u8_t headerflags); 29 | void tcp_set_state(struct tcp_pcb* pcb, enum tcp_state state, ip_addr_t* local_ip, 30 | ip_addr_t* remote_ip, u16_t local_port, u16_t remote_port); 31 | void test_tcp_counters_err(void* arg, err_t err); 32 | err_t test_tcp_counters_recv(void* arg, struct tcp_pcb* pcb, struct pbuf* p, err_t err); 33 | 34 | struct tcp_pcb* test_tcp_new_counters_pcb(struct test_tcp_counters* counters); 35 | 36 | void test_tcp_input(struct pbuf *p, struct netif *inp); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /lwip/lwip/test/unit/tcp/test_tcp.c: -------------------------------------------------------------------------------- 1 | #include "test_tcp.h" 2 | 3 | #include "lwip/tcp_impl.h" 4 | #include "lwip/stats.h" 5 | #include "tcp_helper.h" 6 | 7 | #if !LWIP_STATS || !TCP_STATS || !MEMP_STATS 8 | #error "This tests needs TCP- and MEMP-statistics enabled" 9 | #endif 10 | 11 | /* Setups/teardown functions */ 12 | 13 | static void 14 | tcp_setup(void) 15 | { 16 | tcp_remove_all(); 17 | } 18 | 19 | static void 20 | tcp_teardown(void) 21 | { 22 | tcp_remove_all(); 23 | } 24 | 25 | 26 | /* Test functions */ 27 | 28 | /** Call tcp_new() and tcp_abort() and test memp stats */ 29 | START_TEST(test_tcp_new_abort) 30 | { 31 | struct tcp_pcb* pcb; 32 | LWIP_UNUSED_ARG(_i); 33 | 34 | fail_unless(lwip_stats.memp[MEMP_TCP_PCB].used == 0); 35 | 36 | pcb = tcp_new(); 37 | fail_unless(pcb != NULL); 38 | if (pcb != NULL) { 39 | fail_unless(lwip_stats.memp[MEMP_TCP_PCB].used == 1); 40 | tcp_abort(pcb); 41 | fail_unless(lwip_stats.memp[MEMP_TCP_PCB].used == 0); 42 | } 43 | } 44 | END_TEST 45 | 46 | /** Create an ESTABLISHED pcb and check if receive callback is called */ 47 | START_TEST(test_tcp_recv_inseq) 48 | { 49 | struct test_tcp_counters counters; 50 | struct tcp_pcb* pcb; 51 | struct pbuf* p; 52 | char data[] = {1, 2, 3, 4}; 53 | ip_addr_t remote_ip, local_ip; 54 | u16_t data_len; 55 | u16_t remote_port = 0x100, local_port = 0x101; 56 | struct netif netif; 57 | LWIP_UNUSED_ARG(_i); 58 | 59 | /* initialize local vars */ 60 | memset(&netif, 0, sizeof(netif)); 61 | IP4_ADDR(&local_ip, 192, 168, 1, 1); 62 | IP4_ADDR(&remote_ip, 192, 168, 1, 2); 63 | data_len = sizeof(data); 64 | /* initialize counter struct */ 65 | memset(&counters, 0, sizeof(counters)); 66 | counters.expected_data_len = data_len; 67 | counters.expected_data = data; 68 | 69 | /* create and initialize the pcb */ 70 | pcb = test_tcp_new_counters_pcb(&counters); 71 | EXPECT_RET(pcb != NULL); 72 | tcp_set_state(pcb, ESTABLISHED, &local_ip, &remote_ip, local_port, remote_port); 73 | 74 | /* create a segment */ 75 | p = tcp_create_rx_segment(pcb, counters.expected_data, data_len, 0, 0, 0); 76 | EXPECT(p != NULL); 77 | if (p != NULL) { 78 | /* pass the segment to tcp_input */ 79 | test_tcp_input(p, &netif); 80 | /* check if counters are as expected */ 81 | EXPECT(counters.close_calls == 0); 82 | EXPECT(counters.recv_calls == 1); 83 | EXPECT(counters.recved_bytes == data_len); 84 | EXPECT(counters.err_calls == 0); 85 | } 86 | 87 | /* make sure the pcb is freed */ 88 | EXPECT(lwip_stats.memp[MEMP_TCP_PCB].used == 1); 89 | tcp_abort(pcb); 90 | EXPECT(lwip_stats.memp[MEMP_TCP_PCB].used == 0); 91 | } 92 | END_TEST 93 | 94 | 95 | /** Create the suite including all tests for this module */ 96 | Suite * 97 | tcp_suite(void) 98 | { 99 | TFun tests[] = { 100 | test_tcp_new_abort, 101 | test_tcp_recv_inseq, 102 | }; 103 | return create_suite("TCP", tests, sizeof(tests)/sizeof(TFun), tcp_setup, tcp_teardown); 104 | } 105 | -------------------------------------------------------------------------------- /lwip/lwip/test/unit/tcp/test_tcp.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_TCP_H__ 2 | #define __TEST_TCP_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite *tcp_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /lwip/lwip/test/unit/tcp/test_tcp_oos.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_TCP_OOS_H__ 2 | #define __TEST_TCP_OOS_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite *tcp_oos_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /lwip/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 | TFun tests[] = { 65 | test_udp_new_remove, 66 | }; 67 | return create_suite("UDP", tests, sizeof(tests)/sizeof(TFun), udp_setup, udp_teardown); 68 | } 69 | -------------------------------------------------------------------------------- /lwip/lwip/test/unit/udp/test_udp.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_UDP_H__ 2 | #define __TEST_UDP_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite* udp_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /lwip/sender.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamesbw/tcp-daytona/bf10e2b4def9670975d33f223b305a098f3dac92/lwip/sender.out -------------------------------------------------------------------------------- /lwip/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 __TCPECHO_H__ 34 | #define __TCPECHO_H__ 35 | 36 | #include "lwip/sys.h" 37 | 38 | void tcpecho_init(u16_t port); 39 | 40 | #endif /* __TCPECHO_H__ */ 41 | -------------------------------------------------------------------------------- /run: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd ./run_scripts 4 | 5 | sudo python run_exps.py && \ 6 | sudo python plot_figures.py 7 | 8 | cd .. -------------------------------------------------------------------------------- /run_scripts/plot_figures.py: -------------------------------------------------------------------------------- 1 | import matplotlib.pyplot as plt 2 | import argparse 3 | 4 | parser = argparse.ArgumentParser() 5 | 6 | parser.add_argument('--max_duration', 7 | help="Max duration of trace", 8 | required=False, 9 | default=0.7, 10 | dest="max_duration") 11 | 12 | 13 | 14 | 15 | args = parser.parse_args() 16 | 17 | alpha = 0.5 18 | 19 | 20 | def parse_dump(dump_file): 21 | 22 | timestamps = [] 23 | seqnos = [] 24 | 25 | with open(dump_file) as f: 26 | lines = f.readlines() 27 | start = 0 28 | for line in lines: 29 | comma_split = line.split(", ") 30 | try: 31 | if comma_split[2] != "ack 1": 32 | continue 33 | if start == 0: 34 | start = float(comma_split[0].split(" ")[0]) 35 | timestamp = float(comma_split[0].split(" ")[0]) - start 36 | if timestamp > args.max_duration: 37 | continue 38 | seqnos += [int(comma_split[1].split(":")[1])] 39 | timestamps += [timestamp] 40 | except: 41 | print "%s" % comma_split 42 | continue 43 | 44 | print len(timestamps), len(seqnos) 45 | 46 | return timestamps, seqnos 47 | 48 | timestamps_baseline, seqnos_baseline = parse_dump("sender.dump.baseline") 49 | timestamps_ack_division, seqnos_ack_division = parse_dump("sender.dump.ack_division") 50 | timestamps_ack_duplication, seqnos_ack_duplication = parse_dump("sender.dump.ack_duplication") 51 | 52 | 53 | 54 | 55 | 56 | #figure 4 57 | plt.clf() 58 | plt.scatter(timestamps_baseline, seqnos_baseline, marker='^', label="Data Segments (normal)", color = "blue", alpha = alpha) 59 | plt.scatter(timestamps_ack_division, seqnos_ack_division, marker='s',label="Data Segments", color= "red", alpha = alpha) 60 | plt.title("TCP Daytona: Ack division (figure 4)") 61 | plt.ylabel("Sequence numbers (Bytes)") 62 | plt.grid() 63 | plt.legend(loc='upper left') 64 | plt.xlabel("Time (sec)") 65 | plt.ylim((0,max(seqnos_baseline + seqnos_ack_division))) 66 | print "Ack division plot saved as %s" % "ack_division_plot.png" 67 | plt.savefig("../ack_division_plot.png") 68 | plt.show() 69 | 70 | 71 | #figure 5 72 | plt.clf() 73 | plt.scatter(timestamps_baseline, seqnos_baseline, marker = '^', label="Data Segments (normal)", color = "blue", alpha = alpha) 74 | plt.scatter(timestamps_ack_duplication, seqnos_ack_duplication, marker='s',label="Data Segments", color="red", alpha = alpha) 75 | plt.title("TCP Daytona: Ack duplication (figure 5)") 76 | plt.ylabel("Sequence numbers (Bytes)") 77 | plt.grid() 78 | plt.legend(loc='upper left') 79 | plt.xlabel("Time (sec)") 80 | plt.ylim((0,max(seqnos_baseline + seqnos_ack_duplication))) 81 | print "Ack duplication plot saved as %s" % "ack_duplication_plot.png" 82 | plt.savefig("../ack_duplication_plot.png") 83 | plt.show() 84 | 85 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /run_scripts/sender.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | 3 | import socket 4 | import datetime 5 | import os 6 | import argparse 7 | 8 | 9 | def millis_since(start): 10 | secs = (datetime.datetime.now() - start).seconds 11 | micros = (datetime.datetime.now() - start).microseconds 12 | return secs * 1000 + micros / 1000 13 | 14 | def send(HOST): 15 | 16 | PORT = 5001 17 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 18 | print "Connecting to ", HOST, "port", PORT 19 | s.connect((HOST, PORT)) 20 | print "Connected to", HOST 21 | 22 | 23 | payload = "".join(['a']*4096) 24 | 25 | start = datetime.datetime.now() 26 | 27 | #saturate the sender buffer for a while 28 | while millis_since(start) < 1300: 29 | s.send(payload) 30 | 31 | s.close() 32 | 33 | print "Finished sending after %d millis" % millis_since(start) 34 | 35 | if __name__ == '__main__': 36 | parser = argparse.ArgumentParser(description="Sender script") 37 | parser.add_argument("--receiver", '-r', help="Receiver IP", required=True) 38 | 39 | args=parser.parse_args() 40 | send(args.receiver) -------------------------------------------------------------------------------- /setup: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd ~ 4 | sudo apt-get update 5 | git clone https://github.com/mininet/mininet.git 6 | cd mininet 7 | git checkout class/cs244 8 | 9 | #if an exact commit is preferred, use below 10 | #git checkout 8f310286f80c2885fff582b8f936a437efc3c8d9 11 | 12 | cd .. 13 | sudo mininet/util/install.sh -fnv 14 | 15 | cd tcp-daytona --------------------------------------------------------------------------------