Commit Graph

5221 Commits

Author SHA1 Message Date
goldsimon
f02119af62 lwip_recvfrom: fix tcp socket error handling 2017-03-06 22:13:58 +01:00
goldsimon
04bff63f49 sockets: netconn event callback is only used for select (nonblocking sockets are now implemented at netconn layer) -> add option LWIP_SOCKET_SELECT to reflect this 2017-03-06 22:06:53 +01:00
goldsimon
c77a7fe824 lwip_recv_tcp: fix full-duplex: remove invalid calls to done_socket() 2017-03-06 22:03:02 +01:00
goldsimon
30be7b582e sockets: remove sock->lastoffset and free unused pbufs instead (using pbuf_free_header) 2017-03-06 21:54:50 +01:00
goldsimon
49414826af pbuf: added new function pbuf_free_header() to gradually hide bytes and free pbufs from the front of a pbuf chain 2017-03-06 21:53:48 +01:00
goldsimon
c295717ce7 sockets: clean up all the if/else in lwip_recvfrom and use new nonblocking features in netconn API: I'm OK with code duplication if it gets more readable :-/ 2017-03-06 21:50:42 +01:00
goldsimon
1945582c10 netconn: added receive flag NETCONN_NOAUTORCVD and netconn_tcp_recvd() to delay rx window updates (e.g. when receiving more data as performance improvement) 2017-03-06 21:33:35 +01:00
goldsimon
b86787c39c Improve code readability by moving tcp-specific functionality from netconn_recv_data() to new static function netconn_recv_data_tcp() since all tcp code paths are different anyway 2017-03-06 21:27:33 +01:00
Dirk Ziegelmeier
e15e504217 Some minor SNMPv3 related cleanups 2017-03-06 09:38:58 +01:00
Joel Cunningham
dd4ded3978 do_writemore: fix blocking bug
A bug was introduced in the atomic vector feature for blocking netconns
where if we couldn't write the entire vector due to send buffer being
full (write_more is 0), we would not update the vector state and then
when sent_tcp() is called, it would actually re-send the previous vector
and if additional calls were required to finish the write, msg.w.offset
would eventually exceed msg.w.len, This was found by testing "stats"
from the shell and hitting the LWIP_ASSERT in do_writemore() that
checks offset < len

The fix simply updates the vector state after every ERR_OK return from
tcp_write().  While not all cases (non-blocking sockets) need to update
the state in this case, it keeps the logic simple and also makes
debugging simpler because you don't have stale vector state at any
point
2017-03-04 12:34:44 -06: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
927990d94e One enum icmp_te_type member is not in doxygen docs - fix it. 2017-03-03 09:56:27 +01:00
Joel Cunningham
2980f7cc58 Vectorize netconn_write for TCP
This commit adds support to the netconn write APIs to take an input of
vectors instead of a single data pointer

This allows vectors sent on a TCP connection via sendmsg to be treated
atomically.  The set of vectors is segmented into as much data as can
fit into the send buffer and then the TCP output function is called

Previously, each vector was passed to netconn_write_partly and tcp_write
segmented it into its own packet, which was then it was sent via
tcp_output (if not Nagleing)

This commit adds vector support to lwip_netconn_do_writemore() which
is the meat of the TCP write functionality from netconn/sockets layer.
A new netconn API netconn_write_vectors_partly() takes a set of vectors
as input and hooks up to do_writemore()

This commit also defines IOV_MAX because we are limited to only
supporting 65535 vectors due to choice of u16_t for the vector count
2017-03-02 16:52:14 -06:00
goldsimon
3feb748fee Simplify lwip_accept() and lwip_ioctl() by relying on nonblocking netconn functions instead of sock->rcvevent 2017-03-02 20:47:02 +01:00
goldsimon
5c3bb19923 added nonblocking accept/recv to netconn API (task #14396) (also added netconn_recv_udp_raw_netbuf_flags() and netconn_recv_tcp_pbuf_flags() to pass socket-like flags to nonblock for one call only) 2017-03-02 20:38:11 +01:00
Dirk Ziegelmeier
593b211d1b A few more SNMPv3 cleanups 2017-03-02 11:20:02 +01:00
goldsimon
1b3aaef525 lwip_sendmsg/tcp: prevent PSH until all iovecs are enqueued 2017-03-02 09:27:32 +01:00
Dirk Ziegelmeier
3fa3bf0570 Undo accidental activation of SNMPv3 code in my last commit 2017-03-02 07:50:34 +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
goldsimon
5f0fbdcde9 fixed warning about potentially unused variable 'netif' after changing ip4/6_input_accept to return in, not netif* 2017-03-01 21:46:36 +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
576a8228c2 Add new files to Filelists.ml 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
goldsimon
f978a7ed31 let ip4/6_input_accept return int instead of netif* 2017-03-01 14:16:27 +01:00
goldsimon
18c7c5d81c fixed my last commit (NETIF_FOREACH does not yet exist :) 2017-03-01 14:12:50 +01:00
goldsimon
7c9a6317b9 refactor ip4/ip6 packet-to-netif matching to remove the ugly 'first' flag 2017-03-01 14:09:18 +01:00
Dirk Ziegelmeier
ec4f00179d Fix bug #50242: dhcp_release does not stop autoip (in coop mode)
Create new function dhcp_release_and_stop() that stops DHCP statemachine and sends release message if needed. Also stops AUTOIP if in coop mode.
Old dhcp_release() and dhcp_stop() function internally call dhcp_release_and_stop() now.
2017-03-01 13:18:37 +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
goldsimon
f85eed0ab3 tcp: fixed bug #50418: LWIP_EVENT_API: fix invalid calbacks for SYN_RCVD pcb 2017-02-28 12:13:26 +01:00