Moved stack-internal parts of tcp.h to tcp_impl.h, tcp.h now only contains the actual application programmer's API

This commit is contained in:
goldsimon
2010-02-21 11:35:21 +00:00
parent 7c57ee0c17
commit bcd4b76d31
18 changed files with 578 additions and 424 deletions

View File

@@ -49,7 +49,7 @@
#include "lwip/ip.h"
#include "lwip/raw.h"
#include "lwip/udp.h"
#include "lwip/tcp.h"
#include "lwip/tcp_impl.h"
#include "lwip/snmp_msg.h"
#include "lwip/autoip.h"
#include "lwip/igmp.h"

View File

@@ -49,7 +49,7 @@
#include "lwip/igmp.h"
#include "lwip/raw.h"
#include "lwip/udp.h"
#include "lwip/tcp.h"
#include "lwip/tcp_impl.h"
#include "lwip/snmp.h"
#include "lwip/dhcp.h"
#include "lwip/stats.h"

View File

@@ -48,7 +48,7 @@
#include "lwip/netif.h"
#include "lwip/icmp.h"
#include "lwip/udp.h"
#include "lwip/tcp.h"
#include "lwip/tcp_impl.h"
#include "lwip/stats.h"

View File

@@ -44,7 +44,7 @@
#include "lwip/pbuf.h"
#include "lwip/udp.h"
#include "lwip/raw.h"
#include "lwip/tcp.h"
#include "lwip/tcp_impl.h"
#include "lwip/igmp.h"
#include "lwip/api.h"
#include "lwip/api_msg.h"

View File

@@ -41,7 +41,7 @@
#include "lwip/def.h"
#include "lwip/ip_addr.h"
#include "lwip/netif.h"
#include "lwip/tcp.h"
#include "lwip/tcp_impl.h"
#include "lwip/snmp.h"
#include "lwip/igmp.h"
#include "netif/etharp.h"

View File

@@ -71,7 +71,7 @@
#include "lwip/sys.h"
#include "arch/perf.h"
#if TCP_QUEUE_OOSEQ
#include "lwip/tcp.h"
#include "lwip/tcp_impl.h"
#endif
#include <string.h>

View File

@@ -43,7 +43,7 @@
#include "lwip/netif.h"
#include "lwip/ip.h"
#include "lwip/ip_frag.h"
#include "lwip/tcp.h"
#include "lwip/tcp_impl.h"
#include "lwip/udp.h"
#include "lwip/snmp_asn1.h"
#include "lwip/snmp_structs.h"

View File

@@ -49,6 +49,7 @@
#include "lwip/memp.h"
#include "lwip/snmp.h"
#include "lwip/tcp.h"
#include "lwip/tcp_impl.h"
#include "lwip/debug.h"
#include "lwip/stats.h"
@@ -271,6 +272,9 @@ tcp_shutdown(struct tcp_pcb *pcb, int shut_rx, int shut_tx)
case ESTABLISHED:
case CLOSE_WAIT:
return tcp_close_shutdown(pcb, 0);
default:
/* don't shut down other states */
break;
}
}
/* @todo: return another err_t if not in correct state or already shut? */
@@ -304,6 +308,7 @@ tcp_abandon(struct tcp_pcb *pcb, int reset)
tcp_pcb_remove(&tcp_tw_pcbs, pcb);
memp_free(MEMP_TCP_PCB, pcb);
} else {
/* @todo: pcb->state, LISTEN not allowed */
seqno = pcb->snd_nxt;
ackno = pcb->rcv_nxt;
ip_addr_copy(local_ip, pcb->local_ip);
@@ -335,6 +340,22 @@ tcp_abandon(struct tcp_pcb *pcb, int reset)
}
}
/**
* Aborts the connection by sending a RST (reset) segment to the remote
* host. The pcb is deallocated. This function never fails.
*
* ATTENTION: When calling this from one of the TCP callbacks, make
* sure you always return ERR_ABRT (and never return ERR_ABRT otherwise
* or you will risk accessing deallocated memory or memory leaks!
*
* @param pcb the tcp pcb to abort
*/
void
tcp_abort(struct tcp_pcb *pcb)
{
tcp_abandon(pcb, 1);
}
/**
* Binds the connection to a local portnumber and IP address. If the
* IP address is not given (i.e., ipaddr == NULL), the IP address of

View File

@@ -45,7 +45,7 @@
#if LWIP_TCP /* don't build if not configured for use in lwipopts.h */
#include "lwip/tcp.h"
#include "lwip/tcp_impl.h"
#include "lwip/def.h"
#include "lwip/ip_addr.h"
#include "lwip/netif.h"

View File

@@ -42,7 +42,7 @@
#if LWIP_TCP /* don't build if not configured for use in lwipopts.h */
#include "lwip/tcp.h"
#include "lwip/tcp_impl.h"
#include "lwip/def.h"
#include "lwip/mem.h"
#include "lwip/memp.h"

View File

@@ -46,7 +46,7 @@
#include "lwip/memp.h"
#include "lwip/tcpip.h"
#include "lwip/tcp.h"
#include "lwip/tcp_impl.h"
#include "lwip/ip_frag.h"
#include "netif/etharp.h"
#include "lwip/dhcp.h"