mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-03 21:14:40 +08:00
Reformat core code using astylerc
This commit is contained in:
parent
8c59be74c1
commit
931b5e643c
@ -823,8 +823,7 @@ dns_send(u8_t idx)
|
|||||||
if (entry->is_mdns) {
|
if (entry->is_mdns) {
|
||||||
dst_port = DNS_MQUERY_PORT;
|
dst_port = DNS_MQUERY_PORT;
|
||||||
#if LWIP_IPV6
|
#if LWIP_IPV6
|
||||||
if (LWIP_DNS_ADDRTYPE_IS_IPV6(entry->reqaddrtype))
|
if (LWIP_DNS_ADDRTYPE_IS_IPV6(entry->reqaddrtype)) {
|
||||||
{
|
|
||||||
dst = &dns_mquery_v6group;
|
dst = &dns_mquery_v6group;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -67,8 +67,7 @@
|
|||||||
# include "arch/bpstruct.h"
|
# include "arch/bpstruct.h"
|
||||||
#endif
|
#endif
|
||||||
PACK_STRUCT_BEGIN
|
PACK_STRUCT_BEGIN
|
||||||
struct packed_struct_test
|
struct packed_struct_test {
|
||||||
{
|
|
||||||
PACK_STRUCT_FLD_8(u8_t dummy1);
|
PACK_STRUCT_FLD_8(u8_t dummy1);
|
||||||
PACK_STRUCT_FIELD(u32_t dummy2);
|
PACK_STRUCT_FIELD(u32_t dummy2);
|
||||||
} PACK_STRUCT_STRUCT;
|
} PACK_STRUCT_STRUCT;
|
||||||
|
@ -229,8 +229,7 @@ pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
|
|||||||
case PBUF_ROM:
|
case PBUF_ROM:
|
||||||
p = pbuf_alloc_reference(NULL, length, type);
|
p = pbuf_alloc_reference(NULL, length, type);
|
||||||
break;
|
break;
|
||||||
case PBUF_POOL:
|
case PBUF_POOL: {
|
||||||
{
|
|
||||||
struct pbuf *q, *last;
|
struct pbuf *q, *last;
|
||||||
u16_t rem_len; /* remaining length */
|
u16_t rem_len; /* remaining length */
|
||||||
p = NULL;
|
p = NULL;
|
||||||
@ -268,8 +267,7 @@ pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
|
|||||||
} while (rem_len > 0);
|
} while (rem_len > 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PBUF_RAM:
|
case PBUF_RAM: {
|
||||||
{
|
|
||||||
u16_t payload_len = (u16_t)(LWIP_MEM_ALIGN_SIZE(offset) + LWIP_MEM_ALIGN_SIZE(length));
|
u16_t payload_len = (u16_t)(LWIP_MEM_ALIGN_SIZE(offset) + LWIP_MEM_ALIGN_SIZE(length));
|
||||||
mem_size_t alloc_len = (mem_size_t)(LWIP_MEM_ALIGN_SIZE(SIZEOF_STRUCT_PBUF) + payload_len);
|
mem_size_t alloc_len = (mem_size_t)(LWIP_MEM_ALIGN_SIZE(SIZEOF_STRUCT_PBUF) + payload_len);
|
||||||
|
|
||||||
@ -963,8 +961,7 @@ pbuf_copy(struct pbuf *p_to, const struct pbuf *p_from)
|
|||||||
(p_from != NULL) && (p_to->tot_len >= p_from->tot_len)), return ERR_ARG;);
|
(p_from != NULL) && (p_to->tot_len >= p_from->tot_len)), return ERR_ARG;);
|
||||||
|
|
||||||
/* iterate through pbuf chain */
|
/* iterate through pbuf chain */
|
||||||
do
|
do {
|
||||||
{
|
|
||||||
/* copy one part of the original chain */
|
/* copy one part of the original chain */
|
||||||
if ((p_to->len - offset_to) >= (p_from->len - offset_from)) {
|
if ((p_to->len - offset_to) >= (p_from->len - offset_from)) {
|
||||||
/* complete current p_from fits into current p_to */
|
/* complete current p_from fits into current p_to */
|
||||||
|
@ -475,8 +475,7 @@ raw_sendto_if_src(struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *dst_ip,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if IP_SOF_BROADCAST
|
#if IP_SOF_BROADCAST
|
||||||
if (IP_IS_V4(dst_ip))
|
if (IP_IS_V4(dst_ip)) {
|
||||||
{
|
|
||||||
/* broadcast filter? */
|
/* broadcast filter? */
|
||||||
if (!ip_get_option(pcb, SOF_BROADCAST) && ip_addr_isbroadcast(dst_ip, netif)) {
|
if (!ip_get_option(pcb, SOF_BROADCAST) && ip_addr_isbroadcast(dst_ip, netif)) {
|
||||||
LWIP_DEBUGF(RAW_DEBUG | LWIP_DBG_LEVEL_WARNING, ("raw_sendto: SOF_BROADCAST not enabled on pcb %p\n", (void *)pcb));
|
LWIP_DEBUGF(RAW_DEBUG | LWIP_DBG_LEVEL_WARNING, ("raw_sendto: SOF_BROADCAST not enabled on pcb %p\n", (void *)pcb));
|
||||||
|
@ -127,7 +127,8 @@ struct tcp_pcb *tcp_tw_pcbs;
|
|||||||
|
|
||||||
/** An array with all (non-temporary) PCB lists, mainly used for smaller code size */
|
/** An array with all (non-temporary) PCB lists, mainly used for smaller code size */
|
||||||
struct tcp_pcb **const tcp_pcb_lists[] = {&tcp_listen_pcbs.pcbs, &tcp_bound_pcbs,
|
struct tcp_pcb **const tcp_pcb_lists[] = {&tcp_listen_pcbs.pcbs, &tcp_bound_pcbs,
|
||||||
&tcp_active_pcbs, &tcp_tw_pcbs};
|
&tcp_active_pcbs, &tcp_tw_pcbs
|
||||||
|
};
|
||||||
|
|
||||||
u8_t tcp_active_pcbs_changed;
|
u8_t tcp_active_pcbs_changed;
|
||||||
|
|
||||||
@ -1075,8 +1076,7 @@ tcp_slowtmr_start:
|
|||||||
if (pcb->state == SYN_SENT && pcb->nrtx >= TCP_SYNMAXRTX) {
|
if (pcb->state == SYN_SENT && pcb->nrtx >= TCP_SYNMAXRTX) {
|
||||||
++pcb_remove;
|
++pcb_remove;
|
||||||
LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: max SYN retries reached\n"));
|
LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: max SYN retries reached\n"));
|
||||||
}
|
} else if (pcb->nrtx >= TCP_MAXRTX) {
|
||||||
else if (pcb->nrtx >= TCP_MAXRTX) {
|
|
||||||
++pcb_remove;
|
++pcb_remove;
|
||||||
LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: max DATA retries reached\n"));
|
LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: max DATA retries reached\n"));
|
||||||
} else {
|
} else {
|
||||||
@ -1175,8 +1175,7 @@ tcp_slowtmr_start:
|
|||||||
((pcb->state == ESTABLISHED) ||
|
((pcb->state == ESTABLISHED) ||
|
||||||
(pcb->state == CLOSE_WAIT))) {
|
(pcb->state == CLOSE_WAIT))) {
|
||||||
if ((u32_t)(tcp_ticks - pcb->tmr) >
|
if ((u32_t)(tcp_ticks - pcb->tmr) >
|
||||||
(pcb->keep_idle + TCP_KEEP_DUR(pcb)) / TCP_SLOW_INTERVAL)
|
(pcb->keep_idle + TCP_KEEP_DUR(pcb)) / TCP_SLOW_INTERVAL) {
|
||||||
{
|
|
||||||
LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: KEEPALIVE timeout. Aborting connection to "));
|
LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: KEEPALIVE timeout. Aborting connection to "));
|
||||||
ip_addr_debug_print_val(TCP_DEBUG, pcb->remote_ip);
|
ip_addr_debug_print_val(TCP_DEBUG, pcb->remote_ip);
|
||||||
LWIP_DEBUGF(TCP_DEBUG, ("\n"));
|
LWIP_DEBUGF(TCP_DEBUG, ("\n"));
|
||||||
@ -1185,8 +1184,7 @@ tcp_slowtmr_start:
|
|||||||
++pcb_reset;
|
++pcb_reset;
|
||||||
} else if ((u32_t)(tcp_ticks - pcb->tmr) >
|
} else if ((u32_t)(tcp_ticks - pcb->tmr) >
|
||||||
(pcb->keep_idle + pcb->keep_cnt_sent * TCP_KEEP_INTVL(pcb))
|
(pcb->keep_idle + pcb->keep_cnt_sent * TCP_KEEP_INTVL(pcb))
|
||||||
/ TCP_SLOW_INTERVAL)
|
/ TCP_SLOW_INTERVAL) {
|
||||||
{
|
|
||||||
err = tcp_keepalive(pcb);
|
err = tcp_keepalive(pcb);
|
||||||
if (err == ERR_OK) {
|
if (err == ERR_OK) {
|
||||||
pcb->keep_cnt_sent++;
|
pcb->keep_cnt_sent++;
|
||||||
|
@ -540,8 +540,7 @@ aborted:
|
|||||||
recv_data = NULL;
|
recv_data = NULL;
|
||||||
|
|
||||||
/* give up our reference to inseg.p */
|
/* give up our reference to inseg.p */
|
||||||
if (inseg.p != NULL)
|
if (inseg.p != NULL) {
|
||||||
{
|
|
||||||
pbuf_free(inseg.p);
|
pbuf_free(inseg.p);
|
||||||
inseg.p = NULL;
|
inseg.p = NULL;
|
||||||
}
|
}
|
||||||
@ -1408,8 +1407,7 @@ tcp_receive(struct tcp_pcb *pcb)
|
|||||||
/* cannot fail... */
|
/* cannot fail... */
|
||||||
pbuf_remove_header(p, off);
|
pbuf_remove_header(p, off);
|
||||||
inseg.tcphdr->seqno = seqno = pcb->rcv_nxt;
|
inseg.tcphdr->seqno = seqno = pcb->rcv_nxt;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (TCP_SEQ_LT(seqno, pcb->rcv_nxt)) {
|
if (TCP_SEQ_LT(seqno, pcb->rcv_nxt)) {
|
||||||
/* the whole segment is < rcv_nxt */
|
/* the whole segment is < rcv_nxt */
|
||||||
/* must be a duplicate of a packet that has already been correctly handled */
|
/* must be a duplicate of a packet that has already been correctly handled */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user