Commit Graph

578 Commits

Author SHA1 Message Date
goldsimon
bd2e820829 Fix double-free when closing mbedTLS connections
Partly revert commit 0486100a2b from 07.08.2017 as it breaks layering: every layer must free its own altcp_pcb. Freeing the inner_conn is not the right way.
2017-11-14 22:21:08 +01:00
Dirk Ziegelmeier
1a1478551e Fix bug #52345: MQTT buffer length check seems wrong
(for empty payload in publish message)
2017-11-13 22:29:25 +01:00
goldsimon
365e031340 httpd: fixed double-free for default 404 file () for LWIP_HTTPD_DYNAMIC_HEADERS==1 2017-11-13 21:04:24 +01:00
Dirk Ziegelmeier
7eb462867b Fix follow-up to [bug #52315] Minor typo in output of MIB compiler
LWIP_SNMP_OBJ_ID_LEN -> SNMP_MAX_OBJ_ID_LEN
2017-11-05 11:51:23 +01:00
Dirk Ziegelmeier
de991b1158 Apply patch #9478: MQTT.c printf warning in debug messages
in a modified version that uses lwIP's format string #defines
2017-11-05 09:51:26 +01:00
goldsimon
283fec0a36 fixed copy&paste bug introduced in last commit 2017-10-26 11:30:26 +02:00
goldsimon
0f685e4fb5 Fixed bug #52279: httpd.c http_init_file() miss uri 2017-10-25 21:58:53 +02:00
Dirk Ziegelmeier
856b0c3260 Fix bug #52189: list add and remove bug in <lwiperf.c>
Apply patch from xuyao hong
2017-10-09 12:30:12 +02:00
goldsimon
0c2d94a283 sntp: allow SNTP_UPDATE_DELAY to be a function 2017-09-22 06:26:53 +02:00
Dirk Ziegelmeier
8faf765632 Fix bug #52059: httpd/makefsdata assumes UNICODE
Patch by Gisle Vanem
And fixup one variable name (currName -> curName)
2017-09-20 12:41:31 +02:00
Dirk Ziegelmeier
3ed24085fa Reformat SNMP code using astylerc 2017-09-17 20:29:18 +02:00
Dirk Ziegelmeier
6e7fe4520a Reformat tftp_server.c using astylerc 2017-09-17 18:08:43 +02:00
Dirk Ziegelmeier
2ab73ad572 Reformat sntp.c using astylerc 2017-09-17 18:07:26 +02:00
Dirk Ziegelmeier
52d65ed1d0 Reformat netbiosns.c using astylerc 2017-09-17 18:05:07 +02:00
Dirk Ziegelmeier
be5bcc172d Reformat mqtt.c using astylerc 2017-09-17 18:04:29 +02:00
Dirk Ziegelmeier
914a20728e Reformat mdns.c using astylerc 2017-09-17 18:00:33 +02:00
Dirk Ziegelmeier
014420bfa0 Reformat lwiperf.c using astylerc 2017-09-17 18:00:23 +02:00
Dirk Ziegelmeier
6164f0cd34 Reformat httpd* using astylerc 2017-09-17 17:58:36 +02:00
Dirk Ziegelmeier
c35b1099a4 Reformat altcp_tls_mbedtls* using astylerc 2017-09-17 17:52:44 +02:00
Dirk Ziegelmeier
772bf96752 Fix makefsdata.c on Win32 after moving to tinydir.h 2017-08-14 09:13:36 +02:00
Dirk Ziegelmeier
01bbbdb19f More makefsdata fixes:
- fix lwip_itoa usage was totally messed up
- fix size_t format string was missing % prefix
2017-08-11 22:50:08 +02:00
Dirk Ziegelmeier
8878a042dc Apply patch #9399: makefsdata for linux
+ some more fixes in compiling under Linux by Dirk Ziegelmeier
2017-08-11 22:50:08 +02:00
goldsimon
991f751305 Even more pbuf_header -> pbuf_add/remove_header replacements (also in strings) 2017-08-08 20:51:57 +02:00
goldsimon
07434aa73a More pbuf_header -> pbuf_add/remove_header replacements 2017-08-08 20:40:26 +02:00
goldsimon
6d28e9de79 Some cleanups after applying David Girault's altcp patches 2017-08-08 12:59:49 +02:00
David Girault
bc3edfb4d7 altcp_tls_mbedtls: remove "rx pbufs left at end of handshake" assert
There is case where a close notify come right after the handshake and is in the same pbuf!
So just handle these data like any other data.
2017-08-08 12:59:48 +02:00
David Girault
0486100a2b altcp_tls: some fixes
- added `altcp_tls_free_config()`.
- added `altcp_tls_context()` function to allow mbedtls parameter tweak.

  Since state structure isn't exported, this allow application to get
  internal context (port dependent) to tweak it.

- free altcp_pcb when lower error callback called.
2017-08-08 12:59:47 +02:00
David Girault
8b1a4ef711 altcp_tls_mbedtls: fix log messages by include a \n 2017-08-08 12:59:44 +02:00
Dirk Ziegelmeier
0eb8d19e82 Move several port number #defines to iana.h 2017-08-08 11:37:08 +02:00
Dirk Ziegelmeier
42fd01547d Fix bug #51681: mqtt: cannot free client
Add free function
2017-08-07 20:43:25 +02:00
goldsimon
a1c7924cb6 task #14597: cleanup pbuf_header usages (use pbuf_add_header/pbuf_remove_header instead) 2017-08-04 22:38:11 +02:00
Dirk Ziegelmeier
ca76c302f1 Probably fix bug #51602: MQTT Ring buffer 'get'
Rollover of get index was wrong
2017-07-28 08:01:30 +02:00
Dirk Ziegelmeier
ecd6c7ceae Fix bug #51525: MQTT_OUTPUT_RINGBUF_SIZE validation
Ringbuf now supports sizes that are not a power of two
2017-07-26 18:53:12 +02:00
Dirk Ziegelmeier
0d23d686eb snmp_asn1.c: Fix handling of u64 values 2017-07-26 12:48:19 +02:00
Dirk Ziegelmeier
0dabc8df9b snmp_asn1: Surround u64_t handling functions with #if LWIP_HAVE_INT64 2017-07-26 09:42:41 +02:00
Dirk Ziegelmeier
b7e24fdc58 Accidentally removed a break statement in my last commit 2017-07-26 09:32:40 +02:00
Dirk Ziegelmeier
aa4d978448 Fix [bug #51520] Big endian bug in apps/snmp/snmp_asn1.c
Apply patch from Art Heers that does not need endianess checks
2017-07-26 09:28:07 +02:00
Dirk Ziegelmeier
f5d7535323 Work on [bug #51577] snmp/asn1: 64 bit encoding/decoding seems broken for big endian
We should support COUNTER64 data type only when we have u64_t on the system
2017-07-26 09:27:11 +02:00
goldsimon
4c13c32473 fix bug #51578 (SNMP failed to decode some values on non 32bit platforms) 2017-07-26 08:41:13 +02:00
Our Air Quality
5eff45cac0 Correct a few uses of sizeof(ip6_addr_t) to sizeof(ip6_addr_p_t)
The ip6_addr_t structure may have an addition slot so is not necessarily
the size of an ipv6 address, so some uses of sizeof(ip6_addr_t) were not
correct.

Signed-off-by: goldsimon <goldsimon@gmx.de>
2017-07-18 19:17:17 +02:00
goldsimon
f3c860958f -Wconversion (still far from finished) and other minor compilation fixes... 2017-07-06 22:47:11 +02:00
goldsimon
44f7a3cb0d work on -Wconversion... 2017-07-05 22:31:58 +02:00
Dirk Ziegelmeier
5a27e97baf smtp.c: Fix detecting overlength server names
Thanks to Axel Lin
2017-06-14 22:06:37 +02:00
Dirk Ziegelmeier
3073affaaf Axel Lin correctly pointed out that there is no buffer overflow because smtp_server[SMTP_MAX_SERVERNAME_LEN + 1] - there is always room for terminating 0 byte 2017-06-14 14:11:27 +02:00
Dirk Ziegelmeier
3611b583f5 smtp.c, smtp_set_server_addr: Avoid smtp_server buffer overrun when server name length is SMTP_MAX_SERVERNAME_LEN -> "smtp_server[len] = 0" is an out-of-bound access 2017-06-14 12:40:58 +02:00
Axel Lin
4af438916a apps/smtp: Ensure smtp_server is NULL terminated
Ensure we set correct setting when changing smtp_server setting.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2017-06-14 12:33:57 +02:00
goldsimon
bab7a32eec Remove smtp_server when passing NULL to smtp_set_server_addr() (see patch #9373 for discussion) 2017-06-13 22:00:48 +02:00
Axel Lin
117d3abdf8 apps/smtp: Make smtp_state_str/smtp_result_strs/base64_table static
These tables are only referenced in smtp.c, so make them static.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2017-06-13 21:57:03 +02:00
goldsimon
07cc25a9df httpd: remove unnecessary "\0" suffix for CRLF string constant (see bug #51232) 2017-06-13 21:53:35 +02:00
goldsimon
a92e838687 httpd: include hooks header file so that redefined defines/functions can be defined there 2017-06-13 21:13:45 +02:00
goldsimon
e80b2eb4cf Fix mdns_resp_del_service 2017-05-12 13:21:42 +02:00
David Girault
c8b7759e10 mdns: added support for removing service in mdns responder
New function `mdns_resp_del_service()` added.

Signed-off-by: goldsimon <goldsimon@gmx.de>
2017-05-12 13:12:22 +02:00
Axel Lin
9dee346000 apps/smtp: Fix memory leak in smtp_send_mail_alloced error paths
Call smtp_free_struct(s) in all smtp_send_mail_alloced error paths to ensure
no memory leak.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net>
2017-05-11 10:47:20 +02:00
goldsimon
ec9096be40 fixed typo in httpd debug message 2017-05-10 13:41:26 +02:00
Axel Lin
ae210967f2 apps/smtp: Fix memory leak if SMTP_BODYDH_MALLOC fails
Need to free s before return error.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net>
2017-05-10 11:25:34 +02:00
Axel Lin
5bbe190b3b apps/smtp: Make smtp_send_bodyh_data takes "const char **from" parameter
Fixes below build error:
cc -g -Wall -DLWIP_DEBUG -pedantic -Werror -Wparentheses -Wsequence-point -Wswitch-default -Wextra -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wc++-compat -Wwrite-strings -Wold-style-definition -Wcast-align -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Wno-address -Wunreachable-code -Wuninitialized -Wlogical-op -I. -I../../.. -I../../../../lwip/src/include -I../../../ports/unix/port/include -I../../../../mbedtls/include -Wno-redundant-decls -DLWIP_HAVE_MBEDTLS=1 -c ../../../../lwip/src/apps/smtp/smtp.c
../../../../lwip/src/apps/smtp/smtp.c: In function ‘smtp_send_body_data_handler’:
../../../../lwip/src/apps/smtp/smtp.c:1487:41: error: cast discards ‘const’ qualifier from pointer target type [-Werror=cast-qual]
     if((res = smtp_send_bodyh_data(pcb, (char **)&s->body, &s->body_len))
                                         ^
../../../../lwip/src/apps/smtp/smtp.c:1507:47: error: cast discards ‘const’ qualifier from pointer target type [-Werror=cast-qual]
             ((res = smtp_send_bodyh_data(pcb, (char **)&s->body, &s->body_len)) == BDHALLDATASENT)
                                               ^
cc1: all warnings being treated as errors
../../Common.allports.mk:94: recipe for target 'smtp.o' failed
make: *** [smtp.o] Error 1

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2017-05-10 08:43:07 +02:00
Axel Lin
f5f34f138c apps/smtp: Fix missing altcp conversion in smtp_send_bodyh_data
The pcb is "struct altcp_pcb *" so we cannot call tcp_sndbuf/tcp_write here.
Use altcp_sndbuf/altcp_write instead.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net>
2017-05-10 08:18:00 +02:00
Axel Lin
b9d5399ec1 apps/smtp: Trivial typo fixes
s/smpt/smtp/g

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net>
2017-05-10 08:06:49 +02:00
goldsimon
d36306e30b sntp_process: fixed unused variable if sub-second time info is not used 2017-05-04 15:49:12 +02:00
Axel Lin
bf510fee51 SNMP: Cleanup unreachable code
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net>
2017-05-04 09:15:29 +02:00
Daniel Elstner
ccf10a5023 SNTP: Avoid warning if debugging is disabled 2017-05-03 16:40:11 +02:00
goldsimon
39316bb9de httpd: fixed bug #50915 (HTTP_IS_DATA_VOLATILE was wrong for LWIP_HTTPD_DYNAMIC_FILE_READ==1) 2017-05-03 09:57:12 +02:00
Dmitry
42eb98c9fc Fix bugs in httpd with "LWIP_HTTPD_CUSTOM_FILES && LWIP_HTTPD_DYNAMIC_FILE_READ" when SSI tags (from '<' to '>' when they span from one read to the next or end at one read buffer) - bugs #50844 aqnd #50845
Signed-off-by: goldsimon <goldsimon@gmx.de>
2017-04-24 22:33:17 +02:00
Dirk Ziegelmeier
13f51a0318 Fix bug #50824: Bug in SNTP POLL mode
Ignore all broken packets
Stop timeouts only when correct packet is received
2017-04-21 22:10:52 +02:00
goldsimon
554f5d7f9e sntp: fix SNTP_LI_* bits; fix todo comment 2017-04-21 13:13:56 +02:00
goldsimon
84461e90e2 mqtt: fix shadowing global 'dup' 2017-04-21 07:23:32 +02:00
goldsimon
dfc57f0289 mqtt: move struct mqtt_client_s and inner structs to new file mqtt_priv.h (to hide it from apps but provide it for tests) 2017-04-12 21:50:58 +02:00
Joel Cunningham
557a11047d Patch #9307: Replace mem_malloc+memset with mem_calloc
Aside from reducing source code, on systems which use MEM_LIBC_MALLOC,
this has the potential to improve performance depending on the underlying
memory allocator

See http://stackoverflow.com/questions/2688466/why-mallocmemset-is-slower-than-calloc
2017-04-05 14:53:24 -05:00
goldsimon
97f4033a8a bridgeif: improve documentation 2017-04-04 21:54:52 +02:00
Dirk Ziegelmeier
6559ffd848 Fix C++ style comment in altcp_tls_mbedtls.c 2017-03-31 13:05:04 +02:00
goldsimon
aa0601a66d snmp_asn1_dec_tlv: explicitly check 'length_bytes > pbuf_stream->length' (for clarity, even if it would fail in pbuf_stream later) 2017-03-30 21:31:44 +02:00
goldsimon
4313bf2a74 altcp_tls_mbedtls: fix TX when lower write returns ERR_MEM 2017-03-30 14:55:37 +02:00
goldsimon
51dbd1a7c0 altcp: added altcp_get_port() 2017-03-30 14:19:31 +02:00
Dirk Ziegelmeier
4a7569fc2d SNMP traps: Fix ignored return values 2017-03-30 13:01:10 +02:00
Dirk Ziegelmeier
132c285fd4 SNMP. Fix several ignored return values 2017-03-30 12:50:32 +02:00
Dirk Ziegelmeier
2673e635a3 Fix community string length copying - correctly handle long strings 2017-03-30 11:09:35 +02:00
Dirk Ziegelmeier
8d149e63a6 SNMP: strcpy -> strncpy, strlen -> strnlen 2017-03-30 08:57:53 +02:00
goldsimon
720f9b3a0b fix compiling altcp_tls_mbedtls sources/headers if mbedtls is not available 2017-03-29 23:02:16 +02:00
Dirk Ziegelmeier
40df1474cc SNMP: Advertise SNMPv3 support 2017-03-28 21:33:37 +02:00
Dirk Ziegelmeier
3266511ebb Improve documentation, add TLS stuff 2017-03-28 21:25:49 +02:00
Dirk Ziegelmeier
9b6192bd65 Create smtp_opts.h and add SMTP client to doxygen docs 2017-03-28 21:14:56 +02:00
Dirk Ziegelmeier
3826bcceab Move SMTP from contrib to main lwIP rep - with TLS support, it becomes useful again 2017-03-28 20:40:47 +02:00
Dirk Ziegelmeier
38651b8069 Cleanup #include structure of altcp_tls a bit
(as discussed with Simon today)
2017-03-28 20:31:25 +02:00
goldsimon
898d3832a7 more fixes for !LWIP_ALTCP: move mqtt client struct definitions to mqtt.c 2017-03-28 14:12:22 +02:00
goldsimon
537c258efa httpd/altcp: add forgotten functions 2017-03-28 14:04:40 +02:00
Dirk Ziegelmeier
7599706808 One more try to fix mqtt.c 2017-03-28 12:30:26 +02:00
goldsimon
8673610f3f mqtt: add TLS support 2017-03-28 09:19:32 +02:00
goldsimon
26a6e034fc mqtt: convert to altcp API 2017-03-28 09:14:35 +02:00
goldsimon
881ab3011e mqtt: pass client_user/client_pass to server if != NULL 2017-03-27 22:25:26 +02:00
Daniel Elstner
751ee7a534 SNTP: Implement round-trip delay compensation
Introduce a new configuration define SNTP_COMP_ROUNDTRIP to compensate
for network round-trip delays when setting the system clock from SNTP.
Note that this feature requires compiler support for 64-bit arithmetic.
2017-03-27 10:43:03 +02:00
Daniel Elstner
cc77b308a4 SNTP: Unify timestamp extraction from response packet
Avoid piecemeal invocation of pbuf_copy_partial() for each SNTP header
field. The new code may sometimes copy more than necessary, but the
complexity is reduced.
2017-03-27 10:43:02 +02:00
Daniel Elstner
2fa9cd8530 SNTP: Streamline timestamp handling
Generalize the NTP timestamp conversion arithmetic, and provide hooks
for using native NTP timestamps when setting or getting the system
clock time. Convert microseconds to a fraction as needed when getting
the system time.
2017-03-27 10:43:01 +02:00
goldsimon
425b2dda61 altcp_get_ip: added altcp_get_ip(), added default functions that only defer a call to the inner_conn (moved from tls_mbedtls to generic altcp) 2017-03-26 22:26:40 +02:00
goldsimon
6add16e36b altcp_tls_mbedtls: fixed memory leak introduced by delayed deallocation 2017-03-25 20:35:46 +01:00
goldsimon
0581a77731 Prepare altcp_tls_mbedtls for TLS clients (not fully tested yet) 2017-03-24 15:25:43 +01:00
goldsimon
a2bc02d682 altcp_tls_mbedtls: improve sent/recved handling 2017-03-23 22:04:36 +01:00
goldsimon
1ddb125e2c altcp_tls_mbedtls_mem: fix compiling for sizeof(mem_size_t) < sizeof(size_t) 2017-03-23 12:15:54 +01:00
goldsimon
1e26652d2e renamed altcp_mbedtls files to altcp_tls_mbedtls 2017-03-23 08:34:02 +01:00
Dirk Ziegelmeier
d04dc46ccb Add altcp_tls to Filelists.mk
Some compile fixes in altcp_mbedtls.c
2017-03-22 23:09:48 +01:00
Dirk Ziegelmeier
060a47f88a Add altcp to Filelists.mk
Some compile fixes in altcp_tcp.c and httpd.c
2017-03-22 22:57:50 +01:00
Mikhail Lappo
7eba14cb76 Possible null-pointer dereference
The value should be dereferenced after
assertion is performed. This can lead
to crash
2017-03-22 22:50:16 +01:00
Mikhail Lappo
08cb949aea Fread return value unused
Assert that fread was able to read
specified amount of chunks
2017-03-22 22:47:15 +01:00
goldsimon
8360054884 sanity check hdr_buf size 2017-03-22 22:46:49 +01:00
Mikhail Lappo
89b6fa479e Possible out of bound exception
hdr_buf has size of 4096. Makes sense to assert that
we do not exceed this size before copying there
2017-03-22 22:45:06 +01:00
goldsimon
d386374449 httpd: add support for https 2017-03-22 22:42:09 +01:00
goldsimon
afaa7d9561 httpd: prepare for https: move initialization code to shared function 2017-03-22 22:41:24 +01:00
goldsimon
2f3b00efb4 httpd: convert to altcp API (a simple search & replace...) 2017-03-22 22:33:50 +01:00
goldsimon
c18393b52b altcp: added 'addrinfo' and 'tcp_state' functions 2017-03-22 22:29:11 +01:00
goldsimon
a46664eab2 Add opts header for altcp_tls 2017-03-22 21:40:32 +01:00
goldsimon
82d9e45f74 Add protoypes for TLS connections for the new altcp API + an implementation doing HTTPS (server mode for now) with mbedTLS (ATTENTION: this might not be coded secure enough for productive use yet!) 2017-03-22 21:33:05 +01:00
goldsimon
ee5021deb1 tftp_server: fix bogus comment lines in file header 2017-03-22 21:14:36 +01:00
goldsimon
c3912e35f6 httpd: regenerate example fs (fsdata.c) with current makefsdata 2017-03-21 13:06:26 +01:00
goldsimon
ec24a2a4e8 Revert "httpd: regenerate example fs (fsdata.c) with current makefsdata"
This reverts commit 66fb52ff5c.
2017-03-21 12:57:56 +01:00
goldsimon
66fb52ff5c httpd: regenerate example fs (fsdata.c) with current makefsdata 2017-03-20 22:19:54 +01:00
goldsimon
d11292505b httpd: use capital 'T' for content types, add more content types, provide the possibility to add more content types at compile time (HTTPD_ADDITIONAL_CONTENT_TYPES) 2017-03-20 22:19:05 +01:00
Dirk Ziegelmeier
1f1f2e1c46 Try to fix line endings of tftp_server.c in git rep 2017-03-14 09:12:25 +01:00
Dirk Ziegelmeier
59973c96e4 Fix bug #50534: TFTP server does not copy terminating null of filename
Patch by David Rodgers
2017-03-13 21:26:06 +01:00
Dirk Ziegelmeier
1371400c2b mdns_domain_add_label_base should be static 2017-03-11 10:41:47 +01:00
goldsimon
7bcb4eafec mdns: minor(?) stack usage and performance improvement by letting mdns_readname_loop() copy from pbuf to struct (instead of pbuf->buffer->struct) 2017-03-10 23:00:46 +01:00
Dirk Ziegelmeier
e15e504217 Some minor SNMPv3 related cleanups 2017-03-06 09:38:58 +01:00
Dirk Ziegelmeier
02be2f8f42 Move snmpv3_dummy.* from main lwIP rep to contrib 2017-03-03 13:42:37 +01:00
Dirk Ziegelmeier
9719c52e62 SNMPv3: Missed two locations where the new enums can be used 2017-03-03 13:21:22 +01:00
Dirk Ziegelmeier
c961ac70b6 Fixump snmp/snmpv3_dummy.h copyright header 2017-03-03 13:17:06 +01:00
Dirk Ziegelmeier
6f485cc870 snmp/snmpv3_dummy.c: Set default configuration in snmpv3_dummy_init()
(Note: snmpv3_dummy.* will be moved to lwip-contrib soon)
2017-03-03 13:12:47 +01:00
Dirk Ziegelmeier
461f1fe1a9 More SNMPv3 cleanups: Create own header snmpv3_dummy.h and move functions in there
Decouple snmp_netconn.c from snmpv3_dummy.c (snmpv3_enginetime_timer)
Make SNMP API more type-safe using enums
2017-03-03 13:01:04 +01:00
Dirk Ziegelmeier
ecb3867803 SNMPv3: Rename tcpip_enginetime_timer to snmpv3_enginetime_timer 2017-03-03 12:32:22 +01:00
Dirk Ziegelmeier
593b211d1b A few more SNMPv3 cleanups 2017-03-02 11:20:02 +01:00
Dirk Ziegelmeier
0065cd915f Several Win32 compile fixes in SNMP code 2017-03-02 07:49:42 +01:00
Dirk Ziegelmeier
83de16678c SNMP: TABs -> spaces 2017-03-02 07:33:18 +01:00
goldsimon
05a595f745 httpd: LWIP_HTTPD_POST_MANUAL_WND: fixed double-free when httpd_post_data_recved is called nested from httpd_post_receive_data() (bug #50424) 2017-03-01 22:08:05 +01:00
Dirk Ziegelmeier
ea41480232 Replace several C++ style comments by C-style 2017-03-01 21:25:03 +01:00
Dirk Ziegelmeier
4ef21e2597 Fix compile when SNMPv3 is disabled 2017-03-01 20:39:39 +01:00
Dirk Ziegelmeier
78cdbff1b3 Several compile fixes for Marco's patch 2017-03-01 20:39:39 +01:00
Dirk Ziegelmeier
fef7ce3c0d Some whitespace fixes to Marco's patches 2017-03-01 20:39:39 +01:00
Marco
f0605a510f Modified the snmpv3_dummy implementation to be more functional.
The dummy implementation also implements the user table as a reference.
2017-03-01 20:39:39 +01:00
Marco
3b8bb580e4 Add framework MIB and USM mib if SNMPv3 is enabled. 2017-03-01 20:39:39 +01:00
Marco
4b97f2bb8e Implemented usm mib. 2017-03-01 20:39:39 +01:00
Marco
46df850cb9 Implemented framework mib. 2017-03-01 20:39:39 +01:00
Marco
f8f3cc039a Start a timer for enginetime handling.
This timer function should be implemented in the snmpv3_xxx.c file.
2017-03-01 20:39:39 +01:00
Marco
f092d09121 Added handling invalid packets in SNMPv3. 2017-03-01 20:39:39 +01:00
Marco
78806001e5 Made accepted SNMP version runtime configurable.
This feature can be disabled by setting LWIP_SNMP_CONFIGURE_VERSIONS to 0.
2017-03-01 20:39:39 +01:00
Marco
8fd09d4608 Added missing context specific tags. 2017-03-01 20:39:39 +01:00
Marco
ec044e826e Replaced old LWIP_SNMPV3_GET_ENGINE_BOOTS macro.
Replaced old LWIP_SNMPV3_GET_ENGINE_BOOTS macro with the new snmpv3_get_engine_boots_internal function.
2017-03-01 20:39:39 +01:00
goldsimon
a9bfe7b72f Fix compiling httpd for LWIP_HTTPD_SUPPORT_POST==1 (assigning int to u16_t) 2017-03-01 20:32:13 +01:00
goldsimon
0d585d55d3 Added LWIP_SINGLE_NETIF for small targets with only one netif (see task #13515, there might be more optimizations to come with this option) 2017-03-01 16:10:50 +01:00
Dirk Ziegelmeier
d8135f9ae2 Fix bug #50427: SNMP: ifIndex should use netif_get_index()
We have netif_get_index(netif) now
2017-03-01 12:34:47 +01:00
goldsimon
1741edf159 make tcp apps depend on LWIP_CALLBACK_API, too 2017-02-28 12:19:16 +01:00
Dirk Ziegelmeier
d7b51b5906 MDNS: Fix accessing wrong union member in netif ext callback 2017-02-15 14:38:57 +01:00
Dirk Ziegelmeier
498913b982 Third draft of task #14283: Add more detailed status callback
Implement Joel's idea of a union
2017-02-15 10:14:06 +01:00
Dirk Ziegelmeier
35e148e26d MDNS: Use new netif callback, now does not need mdns_resp_netif_settings_changed() calls from user any more when LWIP_NETIF_EXT_STATUS_CALLBACK is enabled 2017-02-14 21:03:49 +01:00
goldsimon
ea093d3a53 http_add_connection: add connections to the front to be faster (and really fix bug #50059) 2017-02-09 13:08:17 +01:00
goldsimon
5743864744 Fixed bug #50059 (httpd LWIP_HTTPD_SUPPORT_11_KEEPALIVE vs. LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED) 2017-02-09 13:01:37 +01:00
Dirk Ziegelmeier
5c58e25de5 Minor code readability improvement in mqtt.c 2017-01-15 09:22:13 +01:00
Dirk Ziegelmeier
f8ef8c48f7 Simplify HTTPD #include path handling
- Move fsdata.h content to lwip/apps/fs.h -> no #include path needed any more to src/apps/httpd/
- Create a #define to specify fsdata file name. One can use path in there now, e.g. "../mywebserver/mkfsdata_output.c" -> no #include path needed any more to location of generated file
2017-01-11 10:59:15 +01:00
Dirk Ziegelmeier
52f448978f MQTT: Add check that WILL topic length must be > 0 2017-01-08 19:08:54 +01:00
Dirk Ziegelmeier
6d5ddb7139 MQTT: Fix possible bug in connect message generation that WILL flag can be set without appending a will message
The boolean condition of setting the WILL flag differs from that of appending the will message
Found by Axel Lin
(I fixed it the same way as Axel suggested, but I wanted a different commit message)
2017-01-08 19:07:43 +01:00
Axel Lin
a2915b7142 mqtt: Slightly improve mqtt_create_request
Mainly for better readability, also save NULL test while iterating the for loop.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2017-01-07 20:39:41 +01:00
Axel Lin
7faa4bcbe2 mqtt: Prevent NULL pointer dereference before assertion checking
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2017-01-06 12:15:03 +01:00
Dirk Ziegelmeier
0ffaccaec3 Add missing #include in httpd.c for atoi() 2017-01-05 08:53:26 +01:00
Erik Ekman
d2631e6a53 mqtt: Fix pedantic enum warning
src/apps/mqtt/mqtt.c:81:17: error: comma at end of enumerator list [-Werror=pedantic]
2017-01-04 00:24:00 +01:00
Dirk Ziegelmeier
2096f1a657 Fix C++ style comment in mqtt.c 2017-01-01 20:23:11 +01:00
Axel Lin
edfeab7932 mqtt: Trivial coding style fix
Add proper blank for if/for/while statements.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2017-01-01 19:20:24 +01:00
Dirk Ziegelmeier
f874d15185 Add #include <string.h> in snmp_netconn.c because memset() is used 2017-01-01 12:38:34 +01:00
Dirk Ziegelmeier
1466b7ac61 Several mqtt documentation fixes found by clang 2016-12-29 09:44:07 +01:00
Axel Lin
bfa0358a52 mqtt: Allow setting server port to connect
This is a mqtt client, so it does not make sense to determinate the server port
at compile time. Update mqtt_client_connect() function to allow setting server
port.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-12-23 09:52:31 +01:00
Dirk Ziegelmeier
3a557baedd Move a few MQTT options from mqtt.c to mqtt_opts.h 2016-12-21 09:42:25 +01:00
Dirk Ziegelmeier
6e219b6b11 Change signature of mqtt_client_connect() to take an IP addr instead of a string 2016-12-21 09:36:28 +01:00
Dirk Ziegelmeier
ec1450bac4 Add mqtt documentation from Erik Anderson, rev 4b84fff 2016-12-21 09:29:47 +01:00
Axel Lin
5be91de56c mqtt: Trivial error message fix
Fix trivial copy-paste mistake.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-12-21 08:54:57 +01:00
Axel Lin
d5bc856f45 mqtt: Check conn_state before create request for sub_unsub
This also avoid a request leak in client->conn_state == TCP_DISCONNECTED error
path.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-12-20 19:45:31 +01:00
Dirk Ziegelmeier
16b895b466 Undo removal of mqtt_publish() from documentation in Simon's last commit (guess it was by accident) 2016-12-20 10:48:19 +01:00
Dirk Ziegelmeier
dcb761637d Minor documentation fix in MQTT 2016-12-20 10:42:56 +01:00
Axel Lin
02f4610b1c mqtt: Use LWIP_ARRAYSIZE to replace hardcoded value
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-12-20 10:36:42 +01:00
goldsimon
b6a131edfb mqtt: fix C usage (declaration after statement), fix casting to smaller type 2016-12-20 10:27:43 +01:00
Dirk Ziegelmeier
12bc2c0425 MQTT cleanups:
- create mqtt_opts.h file and move options in there
- documentation cleanups
2016-12-20 10:08:50 +01:00
Dirk Ziegelmeier
14e36866f5 Some cleanups in MQTT client
Integrate in documentation
Compile fixes, mostly: Variables must be declared before any statement in a function
2016-12-20 09:41:21 +01:00
Dirk Ziegelmeier
1e82465766 task #14281: Add MQTT client
Thanks to Erik Andersen
Taken from https://github.com/erian747/, branch mqtt, rev 5d59470
2016-12-20 09:16:21 +01:00
goldsimon
fb07d47b82 more LWIP_NOASSERT fixes 2016-12-19 10:34:49 +01:00
Dirk Ziegelmeier
e5f9f187ad Continue to fix incorrect casts via size_t for some platforms
Now also for casts:
- to remove alignment warnings
- casts between pointers and ints
2016-12-12 10:17:33 +01:00
Dirk Ziegelmeier
f2a5aa2866 Fix bug #49827: wrong cast to size_t on 16-bit x86 architecture
I hope I caught all of them.
TODO: Same for casts to get rid of alignment warnings, these are also casts via size_t
2016-12-12 10:07:00 +01:00
goldsimon
ac4d994249 mdns.c: use group initializer constants from prot/dns.h 2016-12-09 13:10:12 +01:00
goldsimon
f308694dd4 Revert "mdns.c: use constants from dns.h/.c"
This reverts commit 0e883bbbc5.
2016-12-09 13:08:00 +01:00
goldsimon
0e883bbbc5 mdns.c: use constants from dns.h/.c 2016-12-09 12:49:49 +01:00
Dirk Ziegelmeier
89cb7b7aa1 Try to remove #include <stdlib.h> from many files. Does not seem necessary any more and might cause problems when porting lwIP. 2016-12-08 11:05:01 +01:00
Dirk Ziegelmeier
e00a131160 Fix bug #49778: sntp_stop does not cancel all timers
Patch by Ari Suutari
2016-12-06 20:29:12 +01:00
Axel Lin
795acf020e lwiperf: Simplify #if LWIPERF_CHECK_RX_DATA guard
The variable i is equal to q->len after exit the for loop.
Check the received data should not change the logic of update packet_idx.
So let's simplify the code a bit.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-12-06 11:36:25 +01:00
Dirk Ziegelmeier
1687721600 Fix compile when IPv4 is disabled 2016-12-05 22:01:58 +01:00
Axel Lin
12e35c4c12 mdns: Fix assertion message in mdns_resp_add_service_txtitem()
So we know which function emits the assertion.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-11-30 11:36:05 +01:00
Dirk Ziegelmeier
ad17f345e7 mdns: Use strlen to determine string length of strings contained in a struct - padding seems to be applied to these strings, and sizeof() returns the _padded_ size???
Found by compiling with CLANG with address sanitizer enabled
2016-11-16 21:01:15 +01:00
Erik Ekman
b90682dc8b Update email address
I am leaving Verisure at the end of the month.
2016-11-10 11:19:51 +01:00
Dirk Ziegelmeier
5d22679c67 Use API function instead of accessing struct members directly 2016-11-05 16:14:11 +01:00
Erik Ekman
725feb0d4a mdns: Use netif_get/set_client_data helpers 2016-10-11 11:34:59 +02:00
Dirk Ziegelmeier
f6e27940bd Make lwIP compile with clang -Wdocumentation -> several documentation fixes 2016-10-09 12:21:39 +02:00
Dirk Ziegelmeier
13fb616bb2 Cleanup hton*/ntoh* function handling and platform abstraction
Let lwip use functions/macros prefixed by lwip_ internally to avoid naming clashes with external #includes.
Remove over-complicated #define handling in def.h
Make functions easier to override in cc.h. The following is sufficient now (no more LWIP_PLATFORM_BYTESWAP):
#define lwip_htons(x) <your_htons>
#define lwip_htonl(x) <your_htonl>
2016-10-06 12:55:57 +02:00
Dirk Ziegelmeier
fa211096c2 Fix macro name clash with windows headers in TFTP server
Reported by Gisle Vanem
2016-10-05 21:02:46 +02:00
Axel Lin
87172d6d35 mdns: Use NETIF_TO_HOST at appropriate places
Trivial cleanup, use NETIF_TO_HOST macro to get mdns_host from netif.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-10-05 11:23:08 +02:00
Dirk Ziegelmeier
81549578bf Fix compile of TFTP with MSVC 2016-10-04 08:54:52 +02:00
Dirk Ziegelmeier
f8683499a6 TFTP: Add missing newline at end of file 2016-10-03 14:33:57 +02:00
Dirk Ziegelmeier
1e5efee7cb TFTP server depends on UDP 2016-10-03 09:50:34 +02:00
Dirk Ziegelmeier
b040544628 task #14150: Add TFTP server from Logan Gunthorpe
Originally written by Logan Gunthorpe, modifications/fixes/IPv6 by Dirk Ziegelmeier
2016-10-03 09:47:41 +02:00