move to new skeleton

This commit is contained in:
Sergio R. Caprile 2024-04-29 10:15:53 -03:00
parent 4f15392440
commit a0b6e70ff8
23 changed files with 34 additions and 37 deletions

View File

@ -1 +0,0 @@
../../mongoose.c

View File

@ -1 +0,0 @@
../../mongoose.h

View File

@ -1 +0,0 @@
../../mongoose.c

View File

@ -1 +0,0 @@
../../mongoose.h

View File

@ -1 +0,0 @@
../device-dashboard/net.c

View File

@ -1 +0,0 @@
../device-dashboard/net.h

View File

@ -1 +0,0 @@
../device-dashboard/packed_fs.c

View File

@ -14,14 +14,14 @@ IPV6 ?= 1
ASAN ?= -fsanitize=address,undefined,alignment -fno-sanitize-recover=all -fno-omit-frame-pointer -fno-common
ASAN_OPTIONS ?= detect_leaks=1
EXAMPLES := $(dir $(wildcard ../examples/*/Makefile))
EXAMPLES_QUICK := $(filter-out ../examples/mip-pcap/ ../examples/micropython/, $(EXAMPLES))
EXAMPLES_MAC := $(filter-out ../examples/mip-pcap/ ../examples/mip-tap/ ../examples/micropython/, $(EXAMPLES))
EXAMPLES_QUICK := $(filter-out ../examples/micropython/, $(EXAMPLES))
EXAMPLES_MAC := $(filter-out ../examples/micropython/, $(EXAMPLES))
EXAMPLES_WIN := $(dir $(wildcard ../examples/device-dashboard/Makefile) $(wildcard ../examples/file-*/Makefile) $(wildcard ../examples/http-*/Makefile) $(wildcard ../examples/mqtt-*/Makefile) $(wildcard ../examples/websocket-*/Makefile) $(wildcard ../examples/webui-*/Makefile))
EXAMPLES_EMBEDDED := $(filter-out $(wildcard ../examples/zephyr/*/), $(dir $(wildcard ../examples/*/*/Makefile)))
REFPROJS := $(dir $(wildcard ../reference-projects/windows-macos-linux/*/Makefile))
TUTORIALS := $(dir $(wildcard ../tutorials/*/*/Makefile))
TUTORIALS_QUICK := $(filter-out ../tutorials/tcpip_stack/pcap/ , $(TUTORIALS))
TUTORIALS_MAC := TUTORIALS
TUTORIALS_QUICK := $(filter-out ../tutorials/tcpip/pcap-driver/ , $(TUTORIALS))
TUTORIALS_MAC := $(filter-out ../tutorials/tcpip/pcap-driver/ ../tutorials/tcpip/tap-driver/, $(TUTORIALS))
TUTORIALS_WIN := $(dir $(wildcard ../tutorials/http/file-*/Makefile) $(wildcard ../tutorials/http/http-*/Makefile) $(wildcard ../tutorials/mqtt/mqtt-*/Makefile) $(wildcard ../tutorials/websocket/websocket-*/Makefile) $(wildcard ../tutorials/webui/webui-*/Makefile))
PREFIX ?= /usr/local
LIBDIR ?= $(PREFIX)/lib

View File

@ -0,0 +1 @@
See detailed tutorials at https://mongoose.ws/documentation/#drivers-for-mongoose-built-in-tcpip-stack

View File

@ -41,10 +41,7 @@ $ sudo ifconfig bridge0 addm feth1
We can start an example using the `feth0`:
```sh
$ make -C examples/mip-pcap/ clean all ARGS="-i feth0"
...
2386718 3 mip.c:279:arp_cache_add ARP cache: added 0xc0a80201 @ 36:77:4d:be:e0:80
2386718 2 mip.c:300:onstatechange READY, IP: 192.168.2.17
$ make -C tutorials/tcpip/pcap-driver/ clean all ARGS="-i feth0"
```
The diagram of the setup is below:
@ -59,7 +56,7 @@ The diagram of the setup is below:
┌─────────┐ │ └─────────┘ │ └────┬────┘
│ en0 │ │ │ │
└────┬────┘ │ ┌─────────┐ ┌─────────┐ ┌─────────┐ │ │
│ │ │ en1 │ │ en2 │ │ en3 │ │ mip-pcap
│ │ │ en1 │ │ en2 │ │ en3 │ │ pcap-driver
│ └────┬────┘ └────┬────┘ └────┬────┘ │
WiFi │ │ │ │ │
└──────┼───────────┼───────────┼──────┘
@ -97,11 +94,11 @@ This is similar to using the loopback device, Mongoose is only reachable from th
- Start your DHCP server at that interface serving that subnet, or otherwise configure Mongoose to use a fixed address within that subnet.
- Now start the example opening the other end of the virtual interface:
```sh
$ make -C examples/mip-pcap/ clean all ARGS="-i my0"
$ make -C tutorials/tcpip/pcap-driver/ clean all ARGS="-i my0"
```
- In some systems, you will probably need superuser privileges to open the device:
```sh
$ sudo examples/mip-pcap/example -i my0
$ sudo tutorials/tcpip/pcap-driver/example -i my0
```
```
@ -112,7 +109,7 @@ This is similar to using the loopback device, Mongoose is only reachable from th
└─────────┘ └────┬────┘
mip-pcap
pcap-driver
```
As you can't access any other host than your workstation, you need to add any required services (as DNS) there, and configure Mongoose appropriately. This is a foundation, you can expand it by choosing one of the solutions that follow.
@ -144,11 +141,11 @@ We will attach one end of the virtual interface to a bridge, which will also be
```
- Now start the example opening the other end of the virtual interface:
```sh
$ make -C examples/mip-pcap/ clean all ARGS="-i my0"
$ make -C tutorials/tcpip/pcap-driver/ clean all ARGS="-i my0"
```
- In some systems, you will probably need superuser privileges to open the device:
```sh
$ sudo examples/mip-pcap/example -i my0
$ sudo tutorials/tcpip/pcap-driver/example -i my0
```
```
@ -162,7 +159,7 @@ We will attach one end of the virtual interface to a bridge, which will also be
│ └─────────┘ │ └────┬────┘
│ │ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │ │
│ │ vnet1 │ │ enp9s0 │ │ vnet2 │ │ mip-pcap
│ │ vnet1 │ │ enp9s0 │ │ vnet2 │ │ pcap-driver
│ └────┬────┘ └────┬────┘ └────┬────┘ │
│ │ │ │ │
└──────┼───────────┼───────────┼──────┘
@ -189,11 +186,11 @@ Once you have your virtual interface up and running with an IP address, you can
Remember to use the proper network interface name
- Now start the example opening the other end of the virtual interface:
```sh
$ make -C examples/mip-pcap/ clean all ARGS="-i my0"
$ make -C tutorials/tcpip/pcap-driver/ clean all ARGS="-i my0"
```
- In some systems, you will probably need superuser privileges to open the device:
```sh
$ sudo examples/mip-pcap/example -i my0
$ sudo tutorials/tcpip/pcap-driver/example -i my0
```
```
@ -204,7 +201,7 @@ Once you have your virtual interface up and running with an IP address, you can
│ └─────────┘ └────┬────┘
▼ │
Your IP (LAN / Public) │
┌─────────┐ mip-pcap
┌─────────┐ pcap-driver
│ enp9s0 │
└────┬────┘
@ -231,7 +228,7 @@ You can also use this setup if your NIC is part of a bridge (for example: you ha
│ └─────────┘ └────┬────┘
┌──────────────────┴──────────────────┐ │
│ │ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │ mip-pcap
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │ pcap-driver
│ │ vnet1 │ │ enp9s0 │ │ vnet2 │ │
│ └────┬────┘ └────┬────┘ └────┬────┘ │
│ │ │ │ │

View File

@ -0,0 +1 @@
../../../mongoose.c

View File

@ -0,0 +1 @@
../../../mongoose.h

View File

@ -26,7 +26,7 @@ In this scenario, Mongoose is only reachable from the hosting machine, but you c
- Start your DHCP server at that interface serving that subnet, or otherwise configure Mongoose to use a fixed address within that subnet.
- Now start the example opening the very same TAP interface:
```sh
$ make -C examples/mip-tap/ clean all
$ make -C tutorials/tcpip/tap-driver/ clean all
```
If you are using a different interface name than `tap0`, add `ARGS="-i ifcname"`, and use the proper interface name
@ -34,7 +34,7 @@ In this scenario, Mongoose is only reachable from the hosting machine, but you c
[DHCP server for 192.168.0.x]
192.168.0.1 192.168.0.x
┌─────────┐
│ tap0 ├──────────────────── mip-tap
│ tap0 ├──────────────────── tap-driver
└─────────┘
```
@ -69,7 +69,7 @@ We will attach one end of the virtual interface to a bridge, which will also be
```
- Now start the example
```sh
$ make -C examples/mip-tap/ clean all
$ make -C tutorials/tcpip/tap-driver/ clean all
```
If you are using a different interface name than `tap0`, add `ARGS="-i ifcname"`, and use the proper interface name
- Now if everything is fine, besides the example working, you'll see your interface state is UP:
@ -88,7 +88,7 @@ We will attach one end of the virtual interface to a bridge, which will also be
┌──────────────────┴──────────────────┐
│ │ 10.1.0.x
│ ┌────────┐ │
│ │ tap0 ├─────────────┼─────── mip-tap
│ │ tap0 ├─────────────┼─────── tap-driver
│ └────────┘ │
│ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
@ -119,7 +119,7 @@ Once you have your virtual interface up and running with an IP address, you can
Remember to use the proper network interface name
- Now start the example
```sh
$ make -C examples/mip-tap/ clean all
$ make -C tutorials/tcpip/tap-driver/ clean all
```
If you are using a different interface name than `tap0`, add `ARGS="-i ifcname"`, and use the proper interface name
@ -127,7 +127,7 @@ Once you have your virtual interface up and running with an IP address, you can
[DHCP server for 192.168.0.x]
┌────────────► 192.168.0.1 192.168.0.x
│ forwarding ┌─────────┐
│ masquerading │ tap0 ├──────────────────── mip-tap
│ masquerading │ tap0 ├──────────────────── tap-driver
│ └─────────┘
Your IP (LAN / Public)
@ -154,7 +154,7 @@ You can also use this setup if your NIC is part of a bridge (for example: you ha
[DHCP server for 192.168.0.x]
10.1.0.10 ◀──────────────► 192.168.0.1 192.168.0.x
virbr0 forwarding ┌─────────┐
│ masquerading │ tap0 ├──────────────────── mip-tap
│ masquerading │ tap0 ├──────────────────── tap-driver
│ └─────────┘
┌──────────────────┴──────────────────┐
│ │

View File

@ -0,0 +1 @@
../../../mongoose.c

View File

@ -0,0 +1 @@
../../../mongoose.h

View File

@ -0,0 +1 @@
../../../examples/device-dashboard/net.c

View File

@ -0,0 +1 @@
../../../examples/device-dashboard/net.h

View File

@ -0,0 +1 @@
../../../examples/device-dashboard/packed_fs.c

View File

@ -1 +0,0 @@
See detailed tutorials at https://mongoose.ws/documentation/#tcpip-stack