mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-03 21:14:40 +08:00
Whitespace cleanup lwIP
This commit is contained in:
parent
64e0ede1a1
commit
06cc825431
@ -519,7 +519,7 @@ tcpip_api_call(tcpip_api_call_fn fn, struct tcpip_api_call_data *call)
|
|||||||
* e.g. the message is allocated once and posted several times from an IRQ
|
* e.g. the message is allocated once and posted several times from an IRQ
|
||||||
* using tcpip_callbackmsg_trycallback().
|
* using tcpip_callbackmsg_trycallback().
|
||||||
* Example usage: Trigger execution of an ethernet IRQ DPC routine in lwIP thread context.
|
* Example usage: Trigger execution of an ethernet IRQ DPC routine in lwIP thread context.
|
||||||
*
|
*
|
||||||
* @param function the function to call
|
* @param function the function to call
|
||||||
* @param ctx parameter passed to function
|
* @param ctx parameter passed to function
|
||||||
* @return a struct pointer to pass to tcpip_callbackmsg_trycallback().
|
* @return a struct pointer to pass to tcpip_callbackmsg_trycallback().
|
||||||
|
@ -880,7 +880,7 @@ altcp_tls_free_config(struct altcp_tls_config *conf)
|
|||||||
}
|
}
|
||||||
if (conf->ca) {
|
if (conf->ca) {
|
||||||
mbedtls_x509_crt_free(conf->ca);
|
mbedtls_x509_crt_free(conf->ca);
|
||||||
}
|
}
|
||||||
altcp_mbedtls_free_config(conf);
|
altcp_mbedtls_free_config(conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -334,4 +334,3 @@ FS_FILE_FLAGS_HEADER_INCLUDED | FS_FILE_FLAGS_HEADER_PERSISTENT,
|
|||||||
|
|
||||||
#define FS_ROOT file__index_html
|
#define FS_ROOT file__index_html
|
||||||
#define FS_NUMFILES 3
|
#define FS_NUMFILES 3
|
||||||
|
|
||||||
|
@ -614,7 +614,7 @@ httpc_init_connection_addr(httpc_state_t **connection, const httpc_connection_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup httpc
|
* @ingroup httpc
|
||||||
* HTTP client API: get a file by passing server IP address
|
* HTTP client API: get a file by passing server IP address
|
||||||
*
|
*
|
||||||
* @param server_addr IP address of the server to connect
|
* @param server_addr IP address of the server to connect
|
||||||
@ -659,7 +659,7 @@ httpc_get_file(const ip_addr_t* server_addr, u16_t port, const char* uri, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup httpc
|
* @ingroup httpc
|
||||||
* HTTP client API: get a file by passing server name as string (DNS name or IP address string)
|
* HTTP client API: get a file by passing server name as string (DNS name or IP address string)
|
||||||
*
|
*
|
||||||
* @param server_name server name as string (DNS name or IP address string)
|
* @param server_name server name as string (DNS name or IP address string)
|
||||||
@ -801,7 +801,7 @@ httpc_fs_tcp_recv(void *arg, struct altcp_pcb *pcb, struct pbuf *p, err_t err)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup httpc
|
* @ingroup httpc
|
||||||
* HTTP client API: get a file to disk by passing server IP address
|
* HTTP client API: get a file to disk by passing server IP address
|
||||||
*
|
*
|
||||||
* @param server_addr IP address of the server to connect
|
* @param server_addr IP address of the server to connect
|
||||||
@ -853,7 +853,7 @@ httpc_get_file_to_disk(const ip_addr_t* server_addr, u16_t port, const char* uri
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup httpc
|
* @ingroup httpc
|
||||||
* HTTP client API: get a file to disk by passing server name as string (DNS name or IP address string)
|
* HTTP client API: get a file to disk by passing server name as string (DNS name or IP address string)
|
||||||
*
|
*
|
||||||
* @param server_name server name as string (DNS name or IP address string)
|
* @param server_name server name as string (DNS name or IP address string)
|
||||||
|
@ -233,7 +233,7 @@ struct http_ssi_state {
|
|||||||
|
|
||||||
struct http_ssi_tag_description {
|
struct http_ssi_tag_description {
|
||||||
const char *lead_in;
|
const char *lead_in;
|
||||||
const char *lead_out;
|
const char *lead_out;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* LWIP_HTTPD_SSI */
|
#endif /* LWIP_HTTPD_SSI */
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* SMTP client module
|
* SMTP client module
|
||||||
*
|
*
|
||||||
* Author: Simon Goldschmidt
|
* Author: Simon Goldschmidt
|
||||||
*
|
*
|
||||||
* @defgroup smtp SMTP client
|
* @defgroup smtp SMTP client
|
||||||
* @ingroup apps
|
* @ingroup apps
|
||||||
*
|
*
|
||||||
* This is simple SMTP client for raw API.
|
* This is simple SMTP client for raw API.
|
||||||
* It is a minimal implementation of SMTP as specified in RFC 5321.
|
* It is a minimal implementation of SMTP as specified in RFC 5321.
|
||||||
*
|
*
|
||||||
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
* When using from any other thread than the tcpip_thread (for NO_SYS==0), use
|
* When using from any other thread than the tcpip_thread (for NO_SYS==0), use
|
||||||
* smtp_send_mail_int()!
|
* smtp_send_mail_int()!
|
||||||
*
|
*
|
||||||
* SMTP_BODYDH usage:
|
* SMTP_BODYDH usage:
|
||||||
@code{.c}
|
@code{.c}
|
||||||
int my_smtp_bodydh_fn(void *arg, struct smtp_bodydh *bdh)
|
int my_smtp_bodydh_fn(void *arg, struct smtp_bodydh *bdh)
|
||||||
@ -42,11 +42,11 @@
|
|||||||
++bdh->state;
|
++bdh->state;
|
||||||
return BDH_WORKING;
|
return BDH_WORKING;
|
||||||
}
|
}
|
||||||
|
|
||||||
smtp_send_mail_bodycback("sender", "recipient", "subject",
|
smtp_send_mail_bodycback("sender", "recipient", "subject",
|
||||||
my_smtp_bodydh_fn, my_smtp_result_fn, some_argument);
|
my_smtp_bodydh_fn, my_smtp_result_fn, some_argument);
|
||||||
@endcode
|
@endcode
|
||||||
*
|
*
|
||||||
* @todo:
|
* @todo:
|
||||||
* - attachments (the main difficulty here is streaming base64-encoding to
|
* - attachments (the main difficulty here is streaming base64-encoding to
|
||||||
* prevent having to allocate a buffer for the whole encoded file at once)
|
* prevent having to allocate a buffer for the whole encoded file at once)
|
||||||
|
@ -158,7 +158,7 @@ altcp_free(struct altcp_pcb *conn)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup altcp
|
* @ingroup altcp
|
||||||
* altcp_new_ip6: @ref altcp_new for IPv6
|
* altcp_new_ip6: @ref altcp_new for IPv6
|
||||||
*/
|
*/
|
||||||
struct altcp_pcb *
|
struct altcp_pcb *
|
||||||
altcp_new_ip6(altcp_allocator_t *allocator)
|
altcp_new_ip6(altcp_allocator_t *allocator)
|
||||||
@ -166,9 +166,9 @@ altcp_new_ip6(altcp_allocator_t *allocator)
|
|||||||
return altcp_new_ip_type(allocator, IPADDR_TYPE_V6);
|
return altcp_new_ip_type(allocator, IPADDR_TYPE_V6);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup altcp
|
* @ingroup altcp
|
||||||
* altcp_new: @ref altcp_new for IPv4
|
* altcp_new: @ref altcp_new for IPv4
|
||||||
*/
|
*/
|
||||||
struct altcp_pcb *
|
struct altcp_pcb *
|
||||||
altcp_new(altcp_allocator_t *allocator)
|
altcp_new(altcp_allocator_t *allocator)
|
||||||
|
@ -1047,7 +1047,7 @@ options_done:
|
|||||||
LWIP_DEBUGF(IP6_DEBUG, ("ip6_input: p->len %"U16_F" p->tot_len %"U16_F"\n", p->len, p->tot_len));
|
LWIP_DEBUGF(IP6_DEBUG, ("ip6_input: p->len %"U16_F" p->tot_len %"U16_F"\n", p->len, p->tot_len));
|
||||||
|
|
||||||
ip_data.current_ip_header_tot_len = hlen_tot;
|
ip_data.current_ip_header_tot_len = hlen_tot;
|
||||||
|
|
||||||
#if LWIP_RAW
|
#if LWIP_RAW
|
||||||
/* p points to IPv6 header again for raw_input. */
|
/* p points to IPv6 header again for raw_input. */
|
||||||
pbuf_add_header_force(p, hlen_tot);
|
pbuf_add_header_force(p, hlen_tot);
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @ingroup ip6
|
* @ingroup ip6
|
||||||
* Multicast listener discovery for IPv6. Aims to be compliant with RFC 2710.
|
* Multicast listener discovery for IPv6. Aims to be compliant with RFC 2710.
|
||||||
* No support for MLDv2.\n
|
* No support for MLDv2.\n
|
||||||
* Note: The allnodes (ff01::1, ff02::1) group is assumed be received by your
|
* Note: The allnodes (ff01::1, ff02::1) group is assumed be received by your
|
||||||
* netif since it must always be received for correct IPv6 operation (e.g. SLAAC).
|
* netif since it must always be received for correct IPv6 operation (e.g. SLAAC).
|
||||||
* Ensure the netif filters are configured accordingly!\n
|
* Ensure the netif filters are configured accordingly!\n
|
||||||
* The netif flags also need NETIF_FLAG_MLD6 flag set to enable MLD6 on a
|
* The netif flags also need NETIF_FLAG_MLD6 flag set to enable MLD6 on a
|
||||||
|
@ -1835,9 +1835,9 @@ nd6_new_router(const ip6_addr_t *router_addr, struct netif *netif)
|
|||||||
for (router_index = LWIP_ND6_NUM_ROUTERS - 1; router_index >= 0; router_index--) {
|
for (router_index = LWIP_ND6_NUM_ROUTERS - 1; router_index >= 0; router_index--) {
|
||||||
/* check if router already exists (this is a special case for 2 netifs on the same subnet
|
/* check if router already exists (this is a special case for 2 netifs on the same subnet
|
||||||
- e.g. wifi and cable) */
|
- e.g. wifi and cable) */
|
||||||
if(default_router_list[router_index].neighbor_entry == &(neighbor_cache[neighbor_index])){
|
if(default_router_list[router_index].neighbor_entry == &(neighbor_cache[neighbor_index])){
|
||||||
return router_index;
|
return router_index;
|
||||||
}
|
}
|
||||||
if (default_router_list[router_index].neighbor_entry == NULL) {
|
if (default_router_list[router_index].neighbor_entry == NULL) {
|
||||||
/* remember lowest free index to create a new entry */
|
/* remember lowest free index to create a new entry */
|
||||||
free_router_index = router_index;
|
free_router_index = router_index;
|
||||||
|
@ -895,7 +895,7 @@ netif_issue_reports(struct netif *netif, u8_t report_type)
|
|||||||
#if LWIP_ARP && !LWIP_ACD
|
#if LWIP_ARP && !LWIP_ACD
|
||||||
/* For Ethernet network interfaces:
|
/* For Ethernet network interfaces:
|
||||||
* we would like to send a "gratuitous ARP".
|
* we would like to send a "gratuitous ARP".
|
||||||
* Only needs to be done here if ACD isn't configured.
|
* Only needs to be done here if ACD isn't configured.
|
||||||
*/
|
*/
|
||||||
if (netif->flags & (NETIF_FLAG_ETHARP)) {
|
if (netif->flags & (NETIF_FLAG_ETHARP)) {
|
||||||
etharp_gratuitous(netif);
|
etharp_gratuitous(netif);
|
||||||
|
@ -166,4 +166,3 @@ stats_display(void)
|
|||||||
#endif /* LWIP_STATS_DISPLAY */
|
#endif /* LWIP_STATS_DISPLAY */
|
||||||
|
|
||||||
#endif /* LWIP_STATS */
|
#endif /* LWIP_STATS */
|
||||||
|
|
||||||
|
@ -45,30 +45,30 @@
|
|||||||
* No need to implement functions in this section in NO_SYS mode.
|
* No need to implement functions in this section in NO_SYS mode.
|
||||||
* The OS-specific code should be implemented in arch/sys_arch.h
|
* The OS-specific code should be implemented in arch/sys_arch.h
|
||||||
* and sys_arch.c of your port.
|
* and sys_arch.c of your port.
|
||||||
*
|
*
|
||||||
* The operating system emulation layer provides a common interface
|
* The operating system emulation layer provides a common interface
|
||||||
* between the lwIP code and the underlying operating system kernel. The
|
* between the lwIP code and the underlying operating system kernel. The
|
||||||
* general idea is that porting lwIP to new architectures requires only
|
* general idea is that porting lwIP to new architectures requires only
|
||||||
* small changes to a few header files and a new sys_arch
|
* small changes to a few header files and a new sys_arch
|
||||||
* implementation. It is also possible to do a sys_arch implementation
|
* implementation. It is also possible to do a sys_arch implementation
|
||||||
* that does not rely on any underlying operating system.
|
* that does not rely on any underlying operating system.
|
||||||
*
|
*
|
||||||
* The sys_arch provides semaphores, mailboxes and mutexes to lwIP. For the full
|
* The sys_arch provides semaphores, mailboxes and mutexes to lwIP. For the full
|
||||||
* lwIP functionality, multiple threads support can be implemented in the
|
* lwIP functionality, multiple threads support can be implemented in the
|
||||||
* sys_arch, but this is not required for the basic lwIP
|
* sys_arch, but this is not required for the basic lwIP
|
||||||
* functionality. Timer scheduling is implemented in lwIP, but can be implemented
|
* functionality. Timer scheduling is implemented in lwIP, but can be implemented
|
||||||
* by the sys_arch port (LWIP_TIMERS_CUSTOM==1).
|
* by the sys_arch port (LWIP_TIMERS_CUSTOM==1).
|
||||||
*
|
*
|
||||||
* In addition to the source file providing the functionality of sys_arch,
|
* In addition to the source file providing the functionality of sys_arch,
|
||||||
* the OS emulation layer must provide several header files defining
|
* the OS emulation layer must provide several header files defining
|
||||||
* macros used throughout lwip. The files required and the macros they
|
* macros used throughout lwip. The files required and the macros they
|
||||||
* must define are listed below the sys_arch description.
|
* must define are listed below the sys_arch description.
|
||||||
*
|
*
|
||||||
* Since lwIP 1.4.0, semaphore, mutexes and mailbox functions are prototyped in a way that
|
* Since lwIP 1.4.0, semaphore, mutexes and mailbox functions are prototyped in a way that
|
||||||
* allows both using pointers or actual OS structures to be used. This way, memory
|
* allows both using pointers or actual OS structures to be used. This way, memory
|
||||||
* required for such types can be either allocated in place (globally or on the
|
* required for such types can be either allocated in place (globally or on the
|
||||||
* stack) or on the heap (allocated internally in the "*_new()" functions).
|
* stack) or on the heap (allocated internally in the "*_new()" functions).
|
||||||
*
|
*
|
||||||
* Note:
|
* Note:
|
||||||
* -----
|
* -----
|
||||||
* Be careful with using mem_malloc() in sys_arch. When malloc() refers to
|
* Be careful with using mem_malloc() in sys_arch. When malloc() refers to
|
||||||
@ -96,7 +96,7 @@
|
|||||||
* Mailboxes should be implemented as a queue which allows multiple messages
|
* Mailboxes should be implemented as a queue which allows multiple messages
|
||||||
* to be posted (implementing as a rendez-vous point where only one message can be
|
* to be posted (implementing as a rendez-vous point where only one message can be
|
||||||
* posted at a time can have a highly negative impact on performance). A message
|
* posted at a time can have a highly negative impact on performance). A message
|
||||||
* in a mailbox is just a pointer, nothing more.
|
* in a mailbox is just a pointer, nothing more.
|
||||||
*
|
*
|
||||||
* @defgroup sys_time Time
|
* @defgroup sys_time Time
|
||||||
* @ingroup sys_layer
|
* @ingroup sys_layer
|
||||||
|
@ -355,7 +355,7 @@ tcp_write_checks(struct tcp_pcb *pcb, u16_t len)
|
|||||||
* it can send them more efficiently by combining them together).
|
* it can send them more efficiently by combining them together).
|
||||||
* To prompt the system to send data now, call tcp_output() after
|
* To prompt the system to send data now, call tcp_output() after
|
||||||
* calling tcp_write().
|
* calling tcp_write().
|
||||||
*
|
*
|
||||||
* This function enqueues the data pointed to by the argument dataptr. The length of
|
* This function enqueues the data pointed to by the argument dataptr. The length of
|
||||||
* the data is passed as the len parameter. The apiflags can be one or more of:
|
* the data is passed as the len parameter. The apiflags can be one or more of:
|
||||||
* - TCP_WRITE_FLAG_COPY: indicates whether the new memory should be allocated
|
* - TCP_WRITE_FLAG_COPY: indicates whether the new memory should be allocated
|
||||||
|
@ -241,7 +241,7 @@ lwip_cyclic_timer(void *arg)
|
|||||||
cyclic->handler();
|
cyclic->handler();
|
||||||
|
|
||||||
now = sys_now();
|
now = sys_now();
|
||||||
next_timeout_time = (u32_t)(current_timeout_due_time + cyclic->interval_ms); /* overflow handled by TIME_LESS_THAN macro */
|
next_timeout_time = (u32_t)(current_timeout_due_time + cyclic->interval_ms); /* overflow handled by TIME_LESS_THAN macro */
|
||||||
if (TIME_LESS_THAN(next_timeout_time, now)) {
|
if (TIME_LESS_THAN(next_timeout_time, now)) {
|
||||||
/* timer would immediately expire again -> "overload" -> restart without any correction */
|
/* timer would immediately expire again -> "overload" -> restart without any correction */
|
||||||
#if LWIP_DEBUG_TIMERNAMES
|
#if LWIP_DEBUG_TIMERNAMES
|
||||||
@ -296,7 +296,7 @@ sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg)
|
|||||||
|
|
||||||
LWIP_ASSERT("Timeout time too long, max is LWIP_UINT32_MAX/4 msecs", msecs <= (LWIP_UINT32_MAX / 4));
|
LWIP_ASSERT("Timeout time too long, max is LWIP_UINT32_MAX/4 msecs", msecs <= (LWIP_UINT32_MAX / 4));
|
||||||
|
|
||||||
next_timeout_time = (u32_t)(sys_now() + msecs); /* overflow handled by TIME_LESS_THAN macro */
|
next_timeout_time = (u32_t)(sys_now() + msecs); /* overflow handled by TIME_LESS_THAN macro */
|
||||||
|
|
||||||
#if LWIP_DEBUG_TIMERNAMES
|
#if LWIP_DEBUG_TIMERNAMES
|
||||||
sys_timeout_abs(next_timeout_time, handler, arg, handler_name);
|
sys_timeout_abs(next_timeout_time, handler, arg, handler_name);
|
||||||
|
@ -911,7 +911,7 @@ udp_sendto_if_src_chksum(struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *d
|
|||||||
/**
|
/**
|
||||||
* @ingroup udp_raw
|
* @ingroup udp_raw
|
||||||
* Bind an UDP PCB.
|
* Bind an UDP PCB.
|
||||||
*
|
*
|
||||||
* @param pcb UDP PCB to be bound with a local address ipaddr and port.
|
* @param pcb UDP PCB to be bound with a local address ipaddr and port.
|
||||||
* @param ipaddr local IP address to bind with. Use IP_ANY_TYPE to
|
* @param ipaddr local IP address to bind with. Use IP_ANY_TYPE to
|
||||||
* bind to all local interfaces.
|
* bind to all local interfaces.
|
||||||
@ -1168,8 +1168,8 @@ udp_recv(struct udp_pcb *pcb, udp_recv_fn recv, void *recv_arg)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup udp_raw
|
* @ingroup udp_raw
|
||||||
* Removes and deallocates the pcb.
|
* Removes and deallocates the pcb.
|
||||||
*
|
*
|
||||||
* @param pcb UDP PCB to be removed. The PCB is removed from the list of
|
* @param pcb UDP PCB to be removed. The PCB is removed from the list of
|
||||||
* UDP PCB's and the data structure is freed from memory.
|
* UDP PCB's and the data structure is freed from memory.
|
||||||
*
|
*
|
||||||
@ -1242,7 +1242,7 @@ udp_new(void)
|
|||||||
* Create a UDP PCB for specific IP type.
|
* Create a UDP PCB for specific IP type.
|
||||||
* The pcb is not active until it has either been bound to a local address
|
* The pcb is not active until it has either been bound to a local address
|
||||||
* or connected to a remote address.
|
* or connected to a remote address.
|
||||||
*
|
*
|
||||||
* @param type IP address type, see @ref lwip_ip_addr_type definitions.
|
* @param type IP address type, see @ref lwip_ip_addr_type definitions.
|
||||||
* If you want to listen to IPv4 and IPv6 (dual-stack) packets,
|
* If you want to listen to IPv4 and IPv6 (dual-stack) packets,
|
||||||
* supply @ref IPADDR_TYPE_ANY as argument and bind to @ref IP_ANY_TYPE.
|
* supply @ref IPADDR_TYPE_ANY as argument and bind to @ref IP_ANY_TYPE.
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* Copyright (c) 2017 Joel Cunningham, Garmin International, Inc. <joel.cunningham@garmin.com>
|
* Copyright (c) 2017 Joel Cunningham, Garmin International, Inc. <joel.cunningham@garmin.com>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
* Redistribution and use in source and binary forms, with or without modification,
|
||||||
* are permitted provided that the following conditions are met:
|
* are permitted provided that the following conditions are met:
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
@ -16,17 +16,17 @@
|
|||||||
* this list of conditions and the following disclaimer in the documentation
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
* and/or other materials provided with the distribution.
|
* and/or other materials provided with the distribution.
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
* 3. The name of the author may not be used to endorse or promote products
|
||||||
* derived from this software without specific prior written permission.
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||||
* OF SUCH DAMAGE.
|
* OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
* This file is part of the lwIP TCP/IP stack.
|
||||||
|
@ -153,27 +153,27 @@ enum netconn_state {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** Used to inform the callback function about changes
|
/** Used to inform the callback function about changes
|
||||||
*
|
*
|
||||||
* Event explanation:
|
* Event explanation:
|
||||||
*
|
*
|
||||||
* In the netconn implementation, there are three ways to block a client:
|
* In the netconn implementation, there are three ways to block a client:
|
||||||
*
|
*
|
||||||
* - accept mbox (sys_arch_mbox_fetch(&conn->acceptmbox, &accept_ptr, 0); in netconn_accept())
|
* - accept mbox (sys_arch_mbox_fetch(&conn->acceptmbox, &accept_ptr, 0); in netconn_accept())
|
||||||
* - receive mbox (sys_arch_mbox_fetch(&conn->recvmbox, &buf, 0); in netconn_recv_data())
|
* - receive mbox (sys_arch_mbox_fetch(&conn->recvmbox, &buf, 0); in netconn_recv_data())
|
||||||
* - send queue is full (sys_arch_sem_wait(LWIP_API_MSG_SEM(msg), 0); in lwip_netconn_do_write())
|
* - send queue is full (sys_arch_sem_wait(LWIP_API_MSG_SEM(msg), 0); in lwip_netconn_do_write())
|
||||||
*
|
*
|
||||||
* The events have to be seen as events signaling the state of these mboxes/semaphores. For non-blocking
|
* The events have to be seen as events signaling the state of these mboxes/semaphores. For non-blocking
|
||||||
* connections, you need to know in advance whether a call to a netconn function call would block or not,
|
* connections, you need to know in advance whether a call to a netconn function call would block or not,
|
||||||
* and these events tell you about that.
|
* and these events tell you about that.
|
||||||
*
|
*
|
||||||
* RCVPLUS events say: Safe to perform a potentially blocking call call once more.
|
* RCVPLUS events say: Safe to perform a potentially blocking call call once more.
|
||||||
* They are counted in sockets - three RCVPLUS events for accept mbox means you are safe
|
* They are counted in sockets - three RCVPLUS events for accept mbox means you are safe
|
||||||
* to call netconn_accept 3 times without being blocked.
|
* to call netconn_accept 3 times without being blocked.
|
||||||
* Same thing for receive mbox.
|
* Same thing for receive mbox.
|
||||||
*
|
*
|
||||||
* RCVMINUS events say: Your call to to a possibly blocking function is "acknowledged".
|
* RCVMINUS events say: Your call to to a possibly blocking function is "acknowledged".
|
||||||
* Socket implementation decrements the counter.
|
* Socket implementation decrements the counter.
|
||||||
*
|
*
|
||||||
* For TX, there is no need to count, its merely a flag. SENDPLUS means you may send something.
|
* For TX, there is no need to count, its merely a flag. SENDPLUS means you may send something.
|
||||||
* SENDPLUS occurs when enough data was delivered to peer so netconn_send() can be called again.
|
* SENDPLUS occurs when enough data was delivered to peer so netconn_send() can be called again.
|
||||||
* A SENDMINUS event occurs when the next call to a netconn_send() would be blocking.
|
* A SENDMINUS event occurs when the next call to a netconn_send() would be blocking.
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.
|
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
* Redistribution and use in source and binary forms, with or without modification,
|
||||||
* are permitted provided that the following conditions are met:
|
* are permitted provided that the following conditions are met:
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
@ -11,21 +11,21 @@
|
|||||||
* this list of conditions and the following disclaimer in the documentation
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
* and/or other materials provided with the distribution.
|
* and/or other materials provided with the distribution.
|
||||||
* 3. The name of the author may not be used to endorse or promote products
|
* 3. The name of the author may not be used to endorse or promote products
|
||||||
* derived from this software without specific prior written permission.
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||||
* OF SUCH DAMAGE.
|
* OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
* This file is part of the lwIP TCP/IP stack.
|
||||||
*
|
*
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
* Author: Adam Dunkels <adam@sics.se>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -52,7 +52,7 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup httpc
|
* @ingroup httpc
|
||||||
* HTTPC_HAVE_FILE_IO: define this to 1 to have functions dowloading directly
|
* HTTPC_HAVE_FILE_IO: define this to 1 to have functions dowloading directly
|
||||||
* to disk via fopen/fwrite.
|
* to disk via fopen/fwrite.
|
||||||
* These functions are example implementations of the interface only.
|
* These functions are example implementations of the interface only.
|
||||||
@ -62,13 +62,13 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup httpc
|
* @ingroup httpc
|
||||||
* The default TCP port used for HTTP
|
* The default TCP port used for HTTP
|
||||||
*/
|
*/
|
||||||
#define HTTP_DEFAULT_PORT LWIP_IANA_PORT_HTTP
|
#define HTTP_DEFAULT_PORT LWIP_IANA_PORT_HTTP
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup httpc
|
* @ingroup httpc
|
||||||
* HTTP client result codes
|
* HTTP client result codes
|
||||||
*/
|
*/
|
||||||
typedef enum ehttpc_result {
|
typedef enum ehttpc_result {
|
||||||
@ -97,7 +97,7 @@ typedef enum ehttpc_result {
|
|||||||
typedef struct _httpc_state httpc_state_t;
|
typedef struct _httpc_state httpc_state_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup httpc
|
* @ingroup httpc
|
||||||
* Prototype of a http client callback function
|
* Prototype of a http client callback function
|
||||||
*
|
*
|
||||||
* @param arg argument specified when initiating the request
|
* @param arg argument specified when initiating the request
|
||||||
@ -110,7 +110,7 @@ typedef struct _httpc_state httpc_state_t;
|
|||||||
typedef void (*httpc_result_fn)(void *arg, httpc_result_t httpc_result, u32_t rx_content_len, u32_t srv_res, err_t err);
|
typedef void (*httpc_result_fn)(void *arg, httpc_result_t httpc_result, u32_t rx_content_len, u32_t srv_res, err_t err);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup httpc
|
* @ingroup httpc
|
||||||
* Prototype of http client callback: called when the headers are received
|
* Prototype of http client callback: called when the headers are received
|
||||||
*
|
*
|
||||||
* @param connection http client connection
|
* @param connection http client connection
|
||||||
|
@ -175,7 +175,7 @@
|
|||||||
#define HTTPD_DEBUG LWIP_DBG_OFF
|
#define HTTPD_DEBUG LWIP_DBG_OFF
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** Set this to 1 to use a memp pool for allocating
|
/** Set this to 1 to use a memp pool for allocating
|
||||||
* struct http_state instead of the heap.
|
* struct http_state instead of the heap.
|
||||||
* If enabled, you'll need to define MEMP_NUM_PARALLEL_HTTPD_CONNS
|
* If enabled, you'll need to define MEMP_NUM_PARALLEL_HTTPD_CONNS
|
||||||
* (and MEMP_NUM_PARALLEL_HTTPD_SSI_CONNS for SSI) to set the size of
|
* (and MEMP_NUM_PARALLEL_HTTPD_SSI_CONNS for SSI) to set the size of
|
||||||
|
@ -78,4 +78,3 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_MDNS_OPTS_H */
|
#endif /* LWIP_HDR_APPS_MDNS_OPTS_H */
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ enum {
|
|||||||
MQTT_DATA_FLAG_LAST = 1
|
MQTT_DATA_FLAG_LAST = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup mqtt
|
* @ingroup mqtt
|
||||||
* Function prototype for MQTT incoming publish data callback function. Called when data
|
* Function prototype for MQTT incoming publish data callback function. Called when data
|
||||||
* arrives to a subscribed topic @see mqtt_subscribe
|
* arrives to a subscribed topic @see mqtt_subscribe
|
||||||
@ -149,7 +149,7 @@ enum {
|
|||||||
typedef void (*mqtt_incoming_data_cb_t)(void *arg, const u8_t *data, u16_t len, u8_t flags);
|
typedef void (*mqtt_incoming_data_cb_t)(void *arg, const u8_t *data, u16_t len, u8_t flags);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup mqtt
|
* @ingroup mqtt
|
||||||
* Function prototype for MQTT incoming publish function. Called when an incoming publish
|
* Function prototype for MQTT incoming publish function. Called when an incoming publish
|
||||||
* arrives to a subscribed topic @see mqtt_subscribe
|
* arrives to a subscribed topic @see mqtt_subscribe
|
||||||
|
@ -6,14 +6,14 @@
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @defgroup smtp_opts Options
|
* @defgroup smtp_opts Options
|
||||||
* @ingroup smtp
|
* @ingroup smtp
|
||||||
*
|
*
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** Set this to 1 to enable data handler callback on BODY */
|
/** Set this to 1 to enable data handler callback on BODY */
|
||||||
#ifndef SMTP_BODYDH
|
#ifndef SMTP_BODYDH
|
||||||
#define SMTP_BODYDH 0
|
#define SMTP_BODYDH 0
|
||||||
@ -78,4 +78,3 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* SMTP_OPTS_H */
|
#endif /* SMTP_OPTS_H */
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ extern "C" {
|
|||||||
/** error codes predefined by SNMP prot. */
|
/** error codes predefined by SNMP prot. */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SNMP_ERR_NOERROR = 0,
|
SNMP_ERR_NOERROR = 0,
|
||||||
/*
|
/*
|
||||||
outdated v1 error codes. do not use anmore!
|
outdated v1 error codes. do not use anmore!
|
||||||
#define SNMP_ERR_NOSUCHNAME 2 use SNMP_ERR_NOSUCHINSTANCE instead
|
#define SNMP_ERR_NOSUCHNAME 2 use SNMP_ERR_NOSUCHINSTANCE instead
|
||||||
#define SNMP_ERR_BADVALUE 3 use SNMP_ERR_WRONGTYPE,SNMP_ERR_WRONGLENGTH,SNMP_ERR_WRONGENCODING or SNMP_ERR_WRONGVALUE instead
|
#define SNMP_ERR_BADVALUE 3 use SNMP_ERR_WRONGTYPE,SNMP_ERR_WRONGLENGTH,SNMP_ERR_WRONGENCODING or SNMP_ERR_WRONGVALUE instead
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification,are permitted provided that the following conditions are met:
|
* modification,are permitted provided that the following conditions are met:
|
||||||
*
|
*
|
||||||
|
@ -74,7 +74,7 @@
|
|||||||
|
|
||||||
/** Platform specific diagnostic output.\n
|
/** Platform specific diagnostic output.\n
|
||||||
* Note the default implementation pulls in printf, which may
|
* Note the default implementation pulls in printf, which may
|
||||||
* in turn pull in a lot of standard libary code. In resource-constrained
|
* in turn pull in a lot of standard libary code. In resource-constrained
|
||||||
* systems, this should be defined to something less resource-consuming.
|
* systems, this should be defined to something less resource-consuming.
|
||||||
*/
|
*/
|
||||||
#ifndef LWIP_PLATFORM_DIAG
|
#ifndef LWIP_PLATFORM_DIAG
|
||||||
@ -85,7 +85,7 @@
|
|||||||
|
|
||||||
/** Platform specific assertion handling.\n
|
/** Platform specific assertion handling.\n
|
||||||
* Note the default implementation pulls in printf, fflush and abort, which may
|
* Note the default implementation pulls in printf, fflush and abort, which may
|
||||||
* in turn pull in a lot of standard libary code. In resource-constrained
|
* in turn pull in a lot of standard libary code. In resource-constrained
|
||||||
* systems, this should be defined to something less resource-consuming.
|
* systems, this should be defined to something less resource-consuming.
|
||||||
*/
|
*/
|
||||||
#ifndef LWIP_PLATFORM_ASSERT
|
#ifndef LWIP_PLATFORM_ASSERT
|
||||||
|
@ -78,7 +78,7 @@ struct dhcp
|
|||||||
u8_t state;
|
u8_t state;
|
||||||
/** retries of current request */
|
/** retries of current request */
|
||||||
u8_t tries;
|
u8_t tries;
|
||||||
|
|
||||||
u8_t subnet_mask_given;
|
u8_t subnet_mask_given;
|
||||||
|
|
||||||
u16_t request_timeout; /* #ticks with period DHCP_FINE_TIMER_SECS for request timeout */
|
u16_t request_timeout; /* #ticks with period DHCP_FINE_TIMER_SECS for request timeout */
|
||||||
|
@ -99,7 +99,7 @@ err_t igmp_leavegroup(const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr);
|
|||||||
err_t igmp_leavegroup_netif(struct netif *netif, const ip4_addr_t *groupaddr);
|
err_t igmp_leavegroup_netif(struct netif *netif, const ip4_addr_t *groupaddr);
|
||||||
void igmp_tmr(void);
|
void igmp_tmr(void);
|
||||||
|
|
||||||
/** @ingroup igmp
|
/** @ingroup igmp
|
||||||
* Get list head of IGMP groups for netif.
|
* Get list head of IGMP groups for netif.
|
||||||
* Note: The allsystems group IP is contained in the list as first entry.
|
* Note: The allsystems group IP is contained in the list as first entry.
|
||||||
* @see @ref netif_set_igmp_mac_filter()
|
* @see @ref netif_set_igmp_mac_filter()
|
||||||
|
@ -102,4 +102,3 @@ u16_t ip_chksum_pseudo_partial(struct pbuf *p, u8_t proto, u16_t proto_len,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* LWIP_HDR_INET_H */
|
#endif /* LWIP_HDR_INET_H */
|
||||||
|
|
||||||
|
@ -326,5 +326,3 @@ err_t ip_input(struct pbuf *p, struct netif *inp);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* LWIP_HDR_IP_H */
|
#endif /* LWIP_HDR_IP_H */
|
||||||
|
|
||||||
|
|
||||||
|
@ -107,5 +107,3 @@ void ip4_debug_print(struct pbuf *p);
|
|||||||
#endif /* LWIP_IPV4 */
|
#endif /* LWIP_IPV4 */
|
||||||
|
|
||||||
#endif /* LWIP_HDR_IP_H */
|
#endif /* LWIP_HDR_IP_H */
|
||||||
|
|
||||||
|
|
||||||
|
@ -404,7 +404,7 @@ extern const ip_addr_t ip_addr_broadcast;
|
|||||||
|
|
||||||
extern const ip_addr_t ip6_addr_any;
|
extern const ip_addr_t ip6_addr_any;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup ip6addr
|
* @ingroup ip6addr
|
||||||
* IP6_ADDR_ANY can be used as a fixed ip_addr_t
|
* IP6_ADDR_ANY can be used as a fixed ip_addr_t
|
||||||
* for the IPv6 wildcard address
|
* for the IPv6 wildcard address
|
||||||
|
@ -84,7 +84,7 @@ err_t mld6_leavegroup_netif(struct netif *netif, const ip6_addr_t *groupaddr);
|
|||||||
|
|
||||||
/** @ingroup mld6
|
/** @ingroup mld6
|
||||||
* Get list head of MLD6 groups for netif.
|
* Get list head of MLD6 groups for netif.
|
||||||
* Note: The allnodes group IP is NOT in the list, since it must always
|
* Note: The allnodes group IP is NOT in the list, since it must always
|
||||||
* be received for correct IPv6 operation.
|
* be received for correct IPv6 operation.
|
||||||
* @see @ref netif_set_mld_mac_filter()
|
* @see @ref netif_set_mld_mac_filter()
|
||||||
*/
|
*/
|
||||||
|
@ -55,7 +55,7 @@ extern "C" {
|
|||||||
#define LWIP_SUPPORT_CUSTOM_PBUF ((IP_FRAG && !LWIP_NETIF_TX_SINGLE_PBUF) || (LWIP_IPV6 && LWIP_IPV6_FRAG))
|
#define LWIP_SUPPORT_CUSTOM_PBUF ((IP_FRAG && !LWIP_NETIF_TX_SINGLE_PBUF) || (LWIP_IPV6 && LWIP_IPV6_FRAG))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** @ingroup pbuf
|
/** @ingroup pbuf
|
||||||
* PBUF_NEEDS_COPY(p): return a boolean value indicating whether the given
|
* PBUF_NEEDS_COPY(p): return a boolean value indicating whether the given
|
||||||
* pbuf needs to be copied in order to be kept around beyond the current call
|
* pbuf needs to be copied in order to be kept around beyond the current call
|
||||||
* stack without risking being corrupted. The default setting provides safety:
|
* stack without risking being corrupted. The default setting provides safety:
|
||||||
|
@ -53,7 +53,7 @@ enum lwip_ieee_eth_type {
|
|||||||
/** Internet protocol v4 */
|
/** Internet protocol v4 */
|
||||||
ETHTYPE_IP = 0x0800U,
|
ETHTYPE_IP = 0x0800U,
|
||||||
/** Address resolution protocol */
|
/** Address resolution protocol */
|
||||||
ETHTYPE_ARP = 0x0806U,
|
ETHTYPE_ARP = 0x0806U,
|
||||||
/** Wake on lan */
|
/** Wake on lan */
|
||||||
ETHTYPE_WOL = 0x0842U,
|
ETHTYPE_WOL = 0x0842U,
|
||||||
/** RARP */
|
/** RARP */
|
||||||
|
@ -130,7 +130,7 @@ typedef void (*lwip_thread_fn)(void *arg);
|
|||||||
* If the mutex has been created, ERR_OK should be returned. Returning any
|
* If the mutex has been created, ERR_OK should be returned. Returning any
|
||||||
* other error will provide a hint what went wrong, but except for assertions,
|
* other error will provide a hint what went wrong, but except for assertions,
|
||||||
* no real error handling is implemented.
|
* no real error handling is implemented.
|
||||||
*
|
*
|
||||||
* @param mutex pointer to the mutex to create
|
* @param mutex pointer to the mutex to create
|
||||||
* @return ERR_OK if successful, another err_t otherwise
|
* @return ERR_OK if successful, another err_t otherwise
|
||||||
*/
|
*/
|
||||||
@ -205,13 +205,13 @@ void sys_sem_signal(sys_sem_t *sem);
|
|||||||
* "timeout" argument is non-zero, the thread should only be blocked for the
|
* "timeout" argument is non-zero, the thread should only be blocked for the
|
||||||
* specified time (measured in milliseconds). If the "timeout" argument is zero,
|
* specified time (measured in milliseconds). If the "timeout" argument is zero,
|
||||||
* the thread should be blocked until the semaphore is signalled.
|
* the thread should be blocked until the semaphore is signalled.
|
||||||
*
|
*
|
||||||
* The return value is SYS_ARCH_TIMEOUT if the semaphore wasn't signaled within
|
* The return value is SYS_ARCH_TIMEOUT if the semaphore wasn't signaled within
|
||||||
* the specified time or any other value if it was signaled (with or without
|
* the specified time or any other value if it was signaled (with or without
|
||||||
* waiting).
|
* waiting).
|
||||||
* Notice that lwIP implements a function with a similar name,
|
* Notice that lwIP implements a function with a similar name,
|
||||||
* sys_sem_wait(), that uses the sys_arch_sem_wait() function.
|
* sys_sem_wait(), that uses the sys_arch_sem_wait() function.
|
||||||
*
|
*
|
||||||
* @param sem the semaphore to wait for
|
* @param sem the semaphore to wait for
|
||||||
* @param timeout timeout in milliseconds to wait (0 = wait forever)
|
* @param timeout timeout in milliseconds to wait (0 = wait forever)
|
||||||
* @return SYS_ARCH_TIMEOUT on timeout, any other value on success
|
* @return SYS_ARCH_TIMEOUT on timeout, any other value on success
|
||||||
@ -277,7 +277,7 @@ void sys_msleep(u32_t ms); /* only has a (close to) 1 ms resolution. */
|
|||||||
* If the mailbox has been created, ERR_OK should be returned. Returning any
|
* If the mailbox has been created, ERR_OK should be returned. Returning any
|
||||||
* other error will provide a hint what went wrong, but except for assertions,
|
* other error will provide a hint what went wrong, but except for assertions,
|
||||||
* no real error handling is implemented.
|
* no real error handling is implemented.
|
||||||
*
|
*
|
||||||
* @param mbox pointer to the mbox to create
|
* @param mbox pointer to the mbox to create
|
||||||
* @param size (minimum) number of messages in this mbox
|
* @param size (minimum) number of messages in this mbox
|
||||||
* @return ERR_OK if successful, another err_t otherwise
|
* @return ERR_OK if successful, another err_t otherwise
|
||||||
@ -287,7 +287,7 @@ err_t sys_mbox_new(sys_mbox_t *mbox, int size);
|
|||||||
* @ingroup sys_mbox
|
* @ingroup sys_mbox
|
||||||
* Post a message to an mbox - may not fail
|
* Post a message to an mbox - may not fail
|
||||||
* -> blocks if full, only to be used from tasks NOT from ISR!
|
* -> blocks if full, only to be used from tasks NOT from ISR!
|
||||||
*
|
*
|
||||||
* @param mbox mbox to posts the message
|
* @param mbox mbox to posts the message
|
||||||
* @param msg message to post (ATTENTION: can be NULL)
|
* @param msg message to post (ATTENTION: can be NULL)
|
||||||
*/
|
*/
|
||||||
@ -297,7 +297,7 @@ void sys_mbox_post(sys_mbox_t *mbox, void *msg);
|
|||||||
* Try to post a message to an mbox - may fail if full.
|
* Try to post a message to an mbox - may fail if full.
|
||||||
* Can be used from ISR (if the sys arch layer allows this).
|
* Can be used from ISR (if the sys arch layer allows this).
|
||||||
* Returns ERR_MEM if it is full, else, ERR_OK if the "msg" is posted.
|
* Returns ERR_MEM if it is full, else, ERR_OK if the "msg" is posted.
|
||||||
*
|
*
|
||||||
* @param mbox mbox to posts the message
|
* @param mbox mbox to posts the message
|
||||||
* @param msg message to post (ATTENTION: can be NULL)
|
* @param msg message to post (ATTENTION: can be NULL)
|
||||||
*/
|
*/
|
||||||
@ -307,7 +307,7 @@ err_t sys_mbox_trypost(sys_mbox_t *mbox, void *msg);
|
|||||||
* Try to post a message to an mbox - may fail if full.
|
* Try to post a message to an mbox - may fail if full.
|
||||||
* To be be used from ISR.
|
* To be be used from ISR.
|
||||||
* Returns ERR_MEM if it is full, else, ERR_OK if the "msg" is posted.
|
* Returns ERR_MEM if it is full, else, ERR_OK if the "msg" is posted.
|
||||||
*
|
*
|
||||||
* @param mbox mbox to posts the message
|
* @param mbox mbox to posts the message
|
||||||
* @param msg message to post (ATTENTION: can be NULL)
|
* @param msg message to post (ATTENTION: can be NULL)
|
||||||
*/
|
*/
|
||||||
@ -324,10 +324,10 @@ err_t sys_mbox_trypost_fromisr(sys_mbox_t *mbox, void *msg);
|
|||||||
* The return values are the same as for the sys_arch_sem_wait() function:
|
* The return values are the same as for the sys_arch_sem_wait() function:
|
||||||
* SYS_ARCH_TIMEOUT if there was a timeout, any other value if a messages
|
* SYS_ARCH_TIMEOUT if there was a timeout, any other value if a messages
|
||||||
* is received.
|
* is received.
|
||||||
*
|
*
|
||||||
* Note that a function with a similar name, sys_mbox_fetch(), is
|
* Note that a function with a similar name, sys_mbox_fetch(), is
|
||||||
* implemented by lwIP.
|
* implemented by lwIP.
|
||||||
*
|
*
|
||||||
* @param mbox mbox to get a message from
|
* @param mbox mbox to get a message from
|
||||||
* @param msg pointer where the message is stored
|
* @param msg pointer where the message is stored
|
||||||
* @param timeout maximum time (in milliseconds) to wait for a message (0 = wait forever)
|
* @param timeout maximum time (in milliseconds) to wait for a message (0 = wait forever)
|
||||||
@ -346,7 +346,7 @@ u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout);
|
|||||||
* example, a naive implementation could be:
|
* example, a naive implementation could be:
|
||||||
* \#define sys_arch_mbox_tryfetch(mbox,msg) sys_arch_mbox_fetch(mbox,msg,1)
|
* \#define sys_arch_mbox_tryfetch(mbox,msg) sys_arch_mbox_fetch(mbox,msg,1)
|
||||||
* although this would introduce unnecessary delays.
|
* although this would introduce unnecessary delays.
|
||||||
*
|
*
|
||||||
* @param mbox mbox to get a message from
|
* @param mbox mbox to get a message from
|
||||||
* @param msg pointer where the message is stored
|
* @param msg pointer where the message is stored
|
||||||
* @return 0 (milliseconds) if a message has been received
|
* @return 0 (milliseconds) if a message has been received
|
||||||
@ -363,7 +363,7 @@ u32_t sys_arch_mbox_tryfetch(sys_mbox_t *mbox, void **msg);
|
|||||||
* Deallocates a mailbox. If there are messages still present in the
|
* Deallocates a mailbox. If there are messages still present in the
|
||||||
* mailbox when the mailbox is deallocated, it is an indication of a
|
* mailbox when the mailbox is deallocated, it is an indication of a
|
||||||
* programming error in lwIP and the developer should be notified.
|
* programming error in lwIP and the developer should be notified.
|
||||||
*
|
*
|
||||||
* @param mbox mbox to delete
|
* @param mbox mbox to delete
|
||||||
*/
|
*/
|
||||||
void sys_mbox_free(sys_mbox_t *mbox);
|
void sys_mbox_free(sys_mbox_t *mbox);
|
||||||
@ -411,7 +411,7 @@ void sys_mbox_set_invalid(sys_mbox_t *mbox);
|
|||||||
* the "stacksize" parameter. The id of the new thread is returned. Both the id
|
* the "stacksize" parameter. The id of the new thread is returned. Both the id
|
||||||
* and the priority are system dependent.
|
* and the priority are system dependent.
|
||||||
* ATTENTION: although this function returns a value, it MUST NOT FAIL (ports have to assert this!)
|
* ATTENTION: although this function returns a value, it MUST NOT FAIL (ports have to assert this!)
|
||||||
*
|
*
|
||||||
* @param name human-readable name for the thread (used for debugging purposes)
|
* @param name human-readable name for the thread (used for debugging purposes)
|
||||||
* @param thread thread-function
|
* @param thread thread-function
|
||||||
* @param arg parameter passed to 'thread'
|
* @param arg parameter passed to 'thread'
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2017 Benjamin Aigner
|
* Copyright (c) 2017 Benjamin Aigner
|
||||||
* Copyright (c) 2015 Inico Technologies Ltd. , Author: Ivan Delamer <delamer@inicotech.com>
|
* Copyright (c) 2015 Inico Technologies Ltd. , Author: Ivan Delamer <delamer@inicotech.com>
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
* Redistribution and use in source and binary forms, with or without modification,
|
||||||
@ -32,10 +32,10 @@
|
|||||||
* OF SUCH DAMAGE.
|
* OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* Author: Benjamin Aigner <aignerb@technikum-wien.at>
|
* Author: Benjamin Aigner <aignerb@technikum-wien.at>
|
||||||
*
|
*
|
||||||
* Based on the original 6lowpan implementation of lwIP ( @see 6lowpan.c)
|
* Based on the original 6lowpan implementation of lwIP ( @see 6lowpan.c)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LWIP_HDR_LOWPAN6_BLE_H
|
#ifndef LWIP_HDR_LOWPAN6_BLE_H
|
||||||
#define LWIP_HDR_LOWPAN6_BLE_H
|
#define LWIP_HDR_LOWPAN6_BLE_H
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@
|
|||||||
#define LWIP_RFC7668_IP_UNCOMPRESSED_DEBUG LWIP_DBG_OFF
|
#define LWIP_RFC7668_IP_UNCOMPRESSED_DEBUG LWIP_DBG_OFF
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS:
|
/** LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS:
|
||||||
* Currently, the linux kernel driver for 6lowpan sets/clears a bit in
|
* Currently, the linux kernel driver for 6lowpan sets/clears a bit in
|
||||||
* the address, depending on the BD address (either public or not).
|
* the address, depending on the BD address (either public or not).
|
||||||
* Might not be RFC7668 conform, so you may select to do that (=1) or
|
* Might not be RFC7668 conform, so you may select to do that (=1) or
|
||||||
|
@ -84,4 +84,3 @@ void slipif_received_bytes(struct netif *netif, u8_t *data, u8_t len);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* LWIP_HDR_NETIF_SLIPIF_H */
|
#endif /* LWIP_HDR_NETIF_SLIPIF_H */
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ typedef struct bridgeif_dfdb_s {
|
|||||||
* remembers known src mac addresses to know which port to send frames destined for that
|
* remembers known src mac addresses to know which port to send frames destined for that
|
||||||
* mac address.
|
* mac address.
|
||||||
*
|
*
|
||||||
* ATTENTION: This is meant as an example only, in real-world use, you should
|
* ATTENTION: This is meant as an example only, in real-world use, you should
|
||||||
* provide a better implementation :-)
|
* provide a better implementation :-)
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
@ -120,9 +120,9 @@ bridgeif_fdb_update_src(void *fdb_ptr, struct eth_addr *src_addr, u8_t port_idx)
|
|||||||
/* not found, no free entry -> flood */
|
/* not found, no free entry -> flood */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup bridgeif_fdb
|
* @ingroup bridgeif_fdb
|
||||||
* Walk our list of auto-learnt fdb entries and return a port to forward or BR_FLOOD if unknown
|
* Walk our list of auto-learnt fdb entries and return a port to forward or BR_FLOOD if unknown
|
||||||
*/
|
*/
|
||||||
bridgeif_portmask_t
|
bridgeif_portmask_t
|
||||||
bridgeif_fdb_get_dst_ports(void *fdb_ptr, struct eth_addr *dst_addr)
|
bridgeif_fdb_get_dst_ports(void *fdb_ptr, struct eth_addr *dst_addr)
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2017 Benjamin Aigner
|
* Copyright (c) 2017 Benjamin Aigner
|
||||||
* Copyright (c) 2015 Inico Technologies Ltd. , Author: Ivan Delamer <delamer@inicotech.com>
|
* Copyright (c) 2015 Inico Technologies Ltd. , Author: Ivan Delamer <delamer@inicotech.com>
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
* Redistribution and use in source and binary forms, with or without modification,
|
||||||
@ -32,7 +32,7 @@
|
|||||||
* OF SUCH DAMAGE.
|
* OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* Author: Benjamin Aigner <aignerb@technikum-wien.at>
|
* Author: Benjamin Aigner <aignerb@technikum-wien.at>
|
||||||
*
|
*
|
||||||
* Based on the original 6lowpan implementation of lwIP ( @see 6lowpan.c)
|
* Based on the original 6lowpan implementation of lwIP ( @see 6lowpan.c)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -95,15 +95,15 @@ static struct lowpan6_link_addr rfc7668_peer_addr;
|
|||||||
/**
|
/**
|
||||||
* @ingroup rfc7668if
|
* @ingroup rfc7668if
|
||||||
* convert BT address to EUI64 addr
|
* convert BT address to EUI64 addr
|
||||||
*
|
*
|
||||||
* This method converts a Bluetooth MAC address to an EUI64 address,
|
* This method converts a Bluetooth MAC address to an EUI64 address,
|
||||||
* which is used within IPv6 communication
|
* which is used within IPv6 communication
|
||||||
*
|
*
|
||||||
* @param dst IPv6 destination space
|
* @param dst IPv6 destination space
|
||||||
* @param src BLE MAC address source
|
* @param src BLE MAC address source
|
||||||
* @param public_addr If the LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS
|
* @param public_addr If the LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS
|
||||||
* option is set, bit 0x02 will be set if param=0 (no public addr); cleared otherwise
|
* option is set, bit 0x02 will be set if param=0 (no public addr); cleared otherwise
|
||||||
*
|
*
|
||||||
* @see LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS
|
* @see LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
@ -128,12 +128,12 @@ ble_addr_to_eui64(uint8_t *dst, const uint8_t *src, int public_addr)
|
|||||||
/**
|
/**
|
||||||
* @ingroup rfc7668if
|
* @ingroup rfc7668if
|
||||||
* convert EUI64 address to Bluetooth MAC addr
|
* convert EUI64 address to Bluetooth MAC addr
|
||||||
*
|
*
|
||||||
* This method converts an EUI64 address to a Bluetooth MAC address,
|
* This method converts an EUI64 address to a Bluetooth MAC address,
|
||||||
*
|
*
|
||||||
* @param dst BLE MAC address destination
|
* @param dst BLE MAC address destination
|
||||||
* @param src IPv6 source
|
* @param src IPv6 source
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
eui64_to_ble_addr(uint8_t *dst, const uint8_t *src)
|
eui64_to_ble_addr(uint8_t *dst, const uint8_t *src)
|
||||||
@ -214,16 +214,16 @@ rfc7668_set_peer_addr_mac48(struct netif *netif, const u8_t *peer_addr, size_t p
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Encapsulate IPv6 frames for BLE transmission
|
/** Encapsulate IPv6 frames for BLE transmission
|
||||||
*
|
*
|
||||||
* This method implements the IPv6 header compression:
|
* This method implements the IPv6 header compression:
|
||||||
* *) According to RFC6282
|
* *) According to RFC6282
|
||||||
* *) See Figure 2, contains base format of bit positions
|
* *) See Figure 2, contains base format of bit positions
|
||||||
* *) Fragmentation not necessary (done at L2CAP layer of BLE)
|
* *) Fragmentation not necessary (done at L2CAP layer of BLE)
|
||||||
* @note Currently the pbuf allocation uses 256 bytes. If longer packets are used (possible due to MTU=1480Bytes), increase it here!
|
* @note Currently the pbuf allocation uses 256 bytes. If longer packets are used (possible due to MTU=1480Bytes), increase it here!
|
||||||
*
|
*
|
||||||
* @param p Pbuf struct, containing the payload data
|
* @param p Pbuf struct, containing the payload data
|
||||||
* @param netif Output network interface. Should be of RFC7668 type
|
* @param netif Output network interface. Should be of RFC7668 type
|
||||||
*
|
*
|
||||||
* @return Same as netif->output.
|
* @return Same as netif->output.
|
||||||
*/
|
*/
|
||||||
static err_t
|
static err_t
|
||||||
@ -340,7 +340,7 @@ rfc7668_output(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr)
|
|||||||
* @param p the received packet, p->payload pointing to the
|
* @param p the received packet, p->payload pointing to the
|
||||||
* IPv6 header (maybe compressed)
|
* IPv6 header (maybe compressed)
|
||||||
* @param netif the network interface on which the packet was received
|
* @param netif the network interface on which the packet was received
|
||||||
*
|
*
|
||||||
* @return ERR_OK if everything was fine
|
* @return ERR_OK if everything was fine
|
||||||
*/
|
*/
|
||||||
err_t
|
err_t
|
||||||
@ -352,7 +352,7 @@ rfc7668_input(struct pbuf * p, struct netif *netif)
|
|||||||
|
|
||||||
/* Load first header byte */
|
/* Load first header byte */
|
||||||
puc = (u8_t*)p->payload;
|
puc = (u8_t*)p->payload;
|
||||||
|
|
||||||
/* no IP header compression */
|
/* no IP header compression */
|
||||||
if (*puc == 0x41) {
|
if (*puc == 0x41) {
|
||||||
LWIP_DEBUGF(LWIP_LOWPAN6_DECOMPRESSION_DEBUG, ("Completed packet, removing dispatch: 0x%2x \n", *puc));
|
LWIP_DEBUGF(LWIP_LOWPAN6_DECOMPRESSION_DEBUG, ("Completed packet, removing dispatch: 0x%2x \n", *puc));
|
||||||
@ -398,12 +398,12 @@ rfc7668_input(struct pbuf * p, struct netif *netif)
|
|||||||
/**
|
/**
|
||||||
* @ingroup rfc7668if
|
* @ingroup rfc7668if
|
||||||
* Initialize the netif
|
* Initialize the netif
|
||||||
*
|
*
|
||||||
* No flags are used (broadcast not possible, not ethernet, ...)
|
* No flags are used (broadcast not possible, not ethernet, ...)
|
||||||
* The shortname for this netif is "BT"
|
* The shortname for this netif is "BT"
|
||||||
*
|
*
|
||||||
* @param netif the network interface to be initialized as RFC7668 netif
|
* @param netif the network interface to be initialized as RFC7668 netif
|
||||||
*
|
*
|
||||||
* @return ERR_OK if everything went fine
|
* @return ERR_OK if everything went fine
|
||||||
*/
|
*/
|
||||||
err_t
|
err_t
|
||||||
@ -433,7 +433,7 @@ rfc7668_if_init(struct netif *netif)
|
|||||||
* @param p the received packet, p->payload pointing to the
|
* @param p the received packet, p->payload pointing to the
|
||||||
* IEEE 802.15.4 header.
|
* IEEE 802.15.4 header.
|
||||||
* @param inp the network interface on which the packet was received
|
* @param inp the network interface on which the packet was received
|
||||||
*
|
*
|
||||||
* @return see @ref tcpip_inpkt, same return values
|
* @return see @ref tcpip_inpkt, same return values
|
||||||
*/
|
*/
|
||||||
err_t
|
err_t
|
||||||
|
@ -430,7 +430,7 @@ lowpan6_decompress_hdr(u8_t *lowpan6_buffer, size_t lowpan6_bufsize,
|
|||||||
|
|
||||||
/* offset for inline IP headers (RFC 6282 ch3)*/
|
/* offset for inline IP headers (RFC 6282 ch3)*/
|
||||||
lowpan6_offset = 2;
|
lowpan6_offset = 2;
|
||||||
/* if CID is set (context identifier), the context byte
|
/* if CID is set (context identifier), the context byte
|
||||||
* follows immediately after the header, so other IPHC fields are @+3 */
|
* follows immediately after the header, so other IPHC fields are @+3 */
|
||||||
if (lowpan6_buffer[1] & 0x80) {
|
if (lowpan6_buffer[1] & 0x80) {
|
||||||
lowpan6_offset++;
|
lowpan6_offset++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user