Commit Graph

6606 Commits

Author SHA1 Message Date
David Girault
b4be0d8808 mdns: added support for searching services
Two new API:
err_t mdns_search_service(const char *name, const char *service, enum mdns_sd_proto proto,
                          struct netif *netif, search_result_fn_t result_fn, void *arg,
                          s8_t *request_id);
void mdns_search_stop(s8_t request_id);

One compilation flags:
LWIP_MDNS_SEARCH

One options flags:
MDNS_MAX_REQUESTS

Some structure declarations moved to allow use by callback result function.

Result domain names are early uncompress before calling application callback
because it cannot be made by application itself.

Allow search services with multiples labels included, like '_services._dns-sd'.

Search for `_services._dns-sd._udp.local.` is handled in a special way.
Only `PTR` answers are send back to the application.

The `mdns_search_service()` function won't assert if no more space in `mdns_request`
table, just return an error if too many simultanous requests.
2019-01-30 20:05:51 +01:00
Ivan Warren
9263d44847 Small documentation fix for TFTP
Apparently the TFTP server now also invokes the error() function in the
tftp_context struct.

Some tftp clients (for example Windows 10 TFTP client) will open the
remote file before checking the local file can be opened - and will then
send an error indication to the server to indicate there was an error
opening the local file. When the happens, the LWIP tftp server will
invoke the error() member of the tftp_context.
2019-01-30 19:56:49 +01:00
David J. Fiddes
8f2f43f093 Implement RFC4075 Receive SNTP servers via DHCPv6
This adds support for RFC4075 SNTP server configuration via DHCPv6.
The DHCPv6 options transmitted are now conditional on how LwIP is
configured.

A new SNTP application option SNTP_GET_SERVERS_FROM_DHCPV6 is used
to enable. For simplicity this is configured to use the global
LWIP_DHCP6_GET_NTP_SRV configuration setting.

Tests:
 - Check the global options now control the DHCPv6 request sent
   in Wireshark
 - Check against 0, 1 and 3 SNTP servers configured on an odhcpd
   server configured to support RFC 4075 SNTP server lists.
   Verify that the SNTP server list is updated on connection
   establishment on an ESP8266 WeMOS D1.
 - Verify that SNTP packets are sent and recieved from a
   configured server and that system time is updated.

Signed-off-by: David J. Fiddes <D.J@fiddes.net>
2019-01-30 17:49:18 +01:00
David Girault
3cb6ae7770 altcp_tls: assert in altcp_mbedtls_bio_recv if bad state 2019-01-30 17:42:52 +01:00
David Girault
b04d8a6a6c altcp: support for setting keepalive parameters 2019-01-30 17:42:46 +01:00
David Girault
b298afabdc altcp_tls_mbedtls: remove entropy/ctr_drbg from altcp_tls_config struct
Use only one entropy/ctr_drbg context for all altcp_tls_config structure allocated.

(Small adjustments before committing: fix coding style, adapt to changes in master)
2019-01-30 17:42:39 +01:00
Simon Goldschmidt
2037ec371c test: fix compiling unit test on win32 2019-01-30 14:53:41 +01:00
David Girault
2cc420e434 mqtt: remove bad assert in mqtt_message_received()
- client->msg_idx can be > MQTT_VAR_HEADER_BUFFER_LEN in long message splitted in multiple pbufs
- renamed fixed_hdr_idx to fixed_hdr_len because it is length of fixed header in rx_buffer, not an index to it
- removed the cpy_start as data always copied right after the fixed header
2019-01-30 14:29:21 +01:00
Simon Goldschmidt
ed561a578b tcp: improve debug message a little 2019-01-30 14:27:16 +01:00
Simon Goldschmidt
3e59b224fa tcpecho_raw: fix bogus pbuf_free on error 2019-01-30 14:20:16 +01:00
Dirk Ziegelmeier
4c19a909c2 Fix bug #55537: Crash in SYN_SENT state when TCP_INPUT_DEBUG logs are ON 2019-01-28 14:21:34 +01:00
Dirk Ziegelmeier
941300c21c Apply patch #9737: Fix DHCPv6 DNS server assignment 2019-01-28 14:19:15 +01:00
Dirk Ziegelmeier
3efc43531b Fix bug #55536: lwIP 2.1.2: netconn_delete() called twice from lwip_accept()
netconn is deleted in free_socket() call
2019-01-28 14:13:52 +01:00
Dirk Ziegelmeier
a215eba50e Add documentation on how to debug memory pool sizes 2019-01-28 14:05:05 +01:00
Dirk Ziegelmeier
8bf2e21b4d TCP/UDP documentation: Add reference to PCB mempool #defines 2019-01-28 13:47:03 +01:00
Dirk Ziegelmeier
926e399355 Fix bug #55513: Uninitialized variable in struct netconn
using patch from Karol Domagalski
2019-01-18 20:51:58 +01:00
Dirk Ziegelmeier
ea14b774c8 Replace several occurences of stdint types by lwIPs portability typedefs
Fixes bug #55405: Usage of uint8_t instead of ui8_t in TCP code
2019-01-06 21:19:04 +01:00
Dirk Ziegelmeier
d504e27142 dhcp.c: Fix typo in debug message 2019-01-04 11:08:46 +01:00
Jacob Kroon
2f098c42a7 Fix compile of UDP unit test
Fix building unit tests via contrib/ports/unix/check on Debian 9, gcc 6.3.0.

Fixes:
  <snip>/ip_addr.h:105:58: error: the comparison will always evaluate as ‘true’ for the address of ‘ip1’ will never be NULL [-Werror=address]
   #define IP_SET_TYPE(ipaddr, iptype)     do { if((ipaddr) != NULL) { IP_SET_TYPE_VAL(*(ipaddr),iptype); }}while(0)

Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com>
2019-01-03 07:09:51 +01:00
Jacob Kroon
c02fea0961 PPP, PPPoE: use service name and concentrator name
Make pppoe_create() actually store the passed service name and
concentrator name, so that they are passed in the PADI/PADR/PADS
packets.

Assume that the user application won't be freeing the strings and just
copy the string pointers, therefore remove the mem_free() in
pppoe_destroy().

Since only the pointers are copied now, make them 'const' in
pppoe_softc.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2018-12-20 13:24:04 +01:00
Sylvain Rochet
48615984c7 PPP, PPPoE: remove leftover from PPPOE_SCNAME_SUPPORT support
Stupid me managed to push a pending patch, remove it.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2018-12-18 22:19:37 +01:00
Jacob Kroon
7eab5947af PPP, PPPoE: fix build when PPPOE_SCNAME_SUPPORT is defined
lwip/src/netif/ppp/pppoe.c:768:24: error: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Werror=poin$
     l1 = (int)strlen(sc->sc_service_name);
lwip/src/netif/ppp/pppoe.c:772:24: error: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Werror=poin$
     l2 = (int)strlen(sc->sc_concentrator_name);

sc->sc_service_name and sc->sc_concentrator_name are best defined as
char* because there are passed to libc strings functions which expect
a char*.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2018-12-18 22:13:46 +01:00
Sylvain Rochet
96548ede2b PPP, PPPoE: rename PPPOE_TODO to PPPOE_SCNAME_SUPPORT, prepare service name and concentrator support
Rename PPPOE_TODO to PPPOE_SCNAME_SUPPORT because this is the only
feature enclosed by them. Prepare for proper service name and
concentrator name support by moving PPPOE_SCNAME_SUPPORT define to
ppp_opts.h.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2018-12-18 22:09:48 +01:00
Dirk Ziegelmeier
2ff0db9a9b Fix bug #55171: Binding UDP PCB with different IP type PCBs does not work
by additionally checking IP address type
2018-12-06 14:40:57 +01:00
Dirk Ziegelmeier
91037b4c28 Add testcase for bug #55171: Binding UDP PCB with different IP type PCBs does not work 2018-12-06 14:40:20 +01:00
Jasper Verschueren
75f33081c2 DEF: added lwip_strnistr() for case insensitive matching 2018-12-05 19:59:45 +01:00
Simon Goldschmidt
dcb29c591f nd6: fix copying more than one DNS server
See bug #55163
2018-12-05 19:56:48 +01:00
Simon Goldschmidt
282389a332 altcp_tls_mbedtls: listen: free members of the ssl context
The ssl context is not used on listening pcbs. This includes freeing
input/output buffers, so saves ~32KByte by default.
2018-12-03 07:14:02 +01:00
Dirk Ziegelmeier
930eb27ba7 CMake: add debug info only for debug builds 2018-11-28 22:43:21 +01:00
Dirk Ziegelmeier
aaf7f03d95 List supported build types in top-level CMakeLists.txt 2018-11-26 09:26:37 +01:00
Dirk Ziegelmeier
0df4109074 Fix MSVC optimization flags 2018-11-26 08:11:39 +01:00
Dirk Ziegelmeier
781a4ccb62 mdns_domain.c: Fix doxygen comments 2018-11-25 14:39:31 +01:00
Dirk Ziegelmeier
c79af6e53e Doxygen: Warnings are errors 2018-11-25 14:38:16 +01:00
Dirk Ziegelmeier
982b86fa48 CMake: Add support for Debug/Release builds 2018-11-25 14:25:23 +01:00
Dirk Ziegelmeier
92a18bf638 Fix bug #55078: Add custom data to pbuf struct
Add a #define that users can use to store custom data on a pbuf
2018-11-25 14:01:23 +01:00
Simon Goldschmidt
3f583a1757 altcp_tls: add functions to create servers with multiple certificates 2018-11-24 13:41:34 +01:00
Simon Goldschmidt
6f232b7c3f altcp_tls_mbedtls: add session tickes, improve configuration for session cache 2018-11-23 22:39:58 +01:00
Simon Goldschmidt
54448559bb altcp_tls_mbedtls: add debug output of mbedtls library 2018-11-23 22:25:21 +01:00
Simon Goldschmidt
7859c6832b makefsdata: fix compiling for win32 2018-11-23 12:59:07 +01:00
Axel Lin
d116d235a5 apps/smtp: Remove redundant LWIP_ASSERT checking in smtp_send_mail_bodycback
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-11-23 19:28:24 +08:00
Dirk Ziegelmeier
b1fbb5ad45 Fix warnings about ignored return values in makefsdata.c
These only show up when compiling with -O3
2018-11-22 21:53:12 +01:00
Dirk Ziegelmeier
e31f1b918c mdns.c: Fix accessing potentially uninitialized variable
myprobe_inpkt.pbuf may not be set to NULL in mdns_handle_probe_tiebreaking()
2018-11-22 13:36:20 +01:00
Dirk Ziegelmeier
45a055840d snmp_traps.c: Portability fix: Don't use non-constant initializers 2018-11-22 13:25:43 +01:00
Dirk Ziegelmeier
5da6c0cfd0 CMake build system: Fix STREQUAL comparisons and set /Wall for MSVC 2018-11-22 13:25:43 +01:00
Craig McQueen
ef76bbe3f0 DNS: Allow a DNS look-up with a trailing dot in the name
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-11-22 13:14:41 +01:00
Simon Goldschmidt
9071db11af snmp: don't allocat outbound msg for GET RESP (inform cb) 2018-11-22 12:54:50 +01:00
Simon Goldschmidt
ed59260b92 snmp: fix coding style
no need to initialize global static variables to NULL
2018-11-22 12:51:46 +01:00
Dirk Ziegelmeier
c23aa713f9 Try to fix compile warning in mdns.c
src/apps/mdns/mdns.c: In function 'mdns_debug_print_answer':
src/apps/mdns/mdns.c:796:24: warning: ', rdata = ' directive output may be truncated writing 10 bytes into a region of size between 8 and 15 [-Wformat-truncation=]
   snprintf(string, 35, "Type = %2d, class = %1d, rdata = ", a->info.type, a->info.klass);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/apps/mdns/mdns.c:796:3: note: 'snprintf' output between 31 and 38 bytes into a destination of size 35
   snprintf(string, 35, "Type = %2d, class = %1d, rdata = ", a->info.type, a->info.klass);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2018-11-22 11:37:24 +01:00
Dirk Ziegelmeier
10e0130a4a netbiosns_name_decode: Take CONST char* as first argument 2018-11-21 21:03:36 +01:00
Jens Nielsen
b0c753da96 Fix netbiosns expecting too large packet 2018-11-21 20:50:35 +01:00