updated picoTCP to 1.4.0, lowered build optimization levels to -O2, improved selftest

This commit is contained in:
Joseph Henry
2017-06-05 14:26:06 -07:00
parent 47a80e8954
commit 19839eeac9
367 changed files with 107850 additions and 3813 deletions

View File

@@ -1,6 +1,6 @@
/* ****************************************************************************
* PicoTCP. Copyright (c) 2014 TASS Belgium NV. Some rights reserved.
* See LICENSE and COPYING for usage.
* See COPYING, LICENSE.GPLv2 and LICENSE.GPLv3 for usage.
* .
* Author: Toon Stegen, Jelle De Vleeschouwer
* ****************************************************************************/
@@ -17,8 +17,24 @@
#define PICO_MDNS_ALLOW_CACHING 1 /* Enable caching on this host */
#define PICO_MDNS_DEFAULT_TTL 120 /* Default TTL of mDNS records */
#define PICO_MDNS_SERVICE_TTL 120 /* Default TTL of SRV/TXT/PTR/NSEC */
#define PICO_MDNS_PROBE_COUNT 4 /* Amount of probes to send */
#define PICO_MDNS_ANNOUNCEMENT_COUNT 3 /* Amount of announcements to send */
#define PICO_MDNS_PROBE_COUNT 3
/* Amount of probes to send:
RFC6762: 8.1. Probing:
250 ms after the first query, the host should send a second; then,
250 ms after that, a third. If, by 250 ms after the third probe, no
conflicting Multicast DNS responses have been received, the host may
move to the next step, announcing.
*/
#define PICO_MDNS_ANNOUNCEMENT_COUNT 3
/* Amount of announcements to send: (we've opted for 1 extra for robustness)
RFC6762: 8.3. Announcing:
The Multicast DNS responder MUST send at least two unsolicited
responses, one second apart. To provide increased robustness against
packet loss, a responder MAY send up to eight unsolicited responses,
provided that the interval between unsolicited responses increases by
at least a factor of two with every response sent.
*/
/* ****************************************************************************/
#define PICO_MDNS_DEST_ADDR4 "224.0.0.251"
@@ -27,6 +43,10 @@
#define PICO_MDNS_RECORD_UNIQUE 0x00u
#define PICO_MDNS_RECORD_SHARED 0x01u
/* To indicate if we reclaim or not */
#define PICO_MDNS_RECLAIM 1
#define PICO_MDNS_NO_RECLAIM 0
/* Flag to check for when records are returned, to determine the hostname */
#define PICO_MDNS_RECORD_HOSTNAME 0x02u
#define IS_HOSTNAME_RECORD(x) \
@@ -134,19 +154,20 @@ pico_mdns_claim( pico_mdns_rtree record_tree,
void *arg );
/* ****************************************************************************
* Sets the hostname for this machine. Claims automatically a unique A record
* with the IPv4-address of this host. The hostname won't be set directly when
* this functions returns, but only if the claiming of the unique record succ-
* eeded. Init-callback will be called when the hostname-record is successfully
* Tries to claim a hostname for this machine. Claims automatically a
* unique A record with the IPv4-address of this host.
* The hostname won't be set directly when this functions returns,
* but only if the claiming of the unique record succeeded.
* Init-callback will be called when the hostname-record is successfully
* registered.
*
* @param url URL to set the hostname to.
* @param arg Argument to pass to the init-callback.
* @return 0 when the host started registering the hostname-record successfully,
* Returns something else when it didn't succeeded.
* Returns something else when it didn't succeeded.
* ****************************************************************************/
int
pico_mdns_set_hostname( const char *url, void *arg );
pico_mdns_tryclaim_hostname( const char *url, void *arg );
/* ****************************************************************************
* Get the current hostname for this machine.