Fixed compiling with LWIP_TCP==0

This commit is contained in:
goldsimon 2015-11-16 09:37:56 +01:00
parent ecf9d25ed0
commit 98b9d31f24
6 changed files with 15 additions and 11 deletions

View File

@ -721,11 +721,13 @@ netconn_close_shutdown(struct netconn *conn, u8_t how)
{
API_MSG_VAR_DECLARE(msg);
err_t err;
LWIP_UNUSED_ARG(how);
LWIP_ERROR("netconn_close: invalid conn", (conn != NULL), return ERR_ARG;);
API_MSG_VAR_ALLOC(msg);
API_MSG_VAR_REF(msg).msg.conn = conn;
#if LWIP_TCP
/* shutting down both ends is the same as closing */
API_MSG_VAR_REF(msg).msg.msg.sd.shut = how;
#if LWIP_SO_SNDTIMEO || LWIP_SO_LINGER
@ -736,6 +738,7 @@ netconn_close_shutdown(struct netconn *conn, u8_t how)
API_MSG_VAR_REF(msg).msg.msg.sd.polls_left =
((LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT + TCP_SLOW_INTERVAL - 1) / TCP_SLOW_INTERVAL) + 1;
#endif /* LWIP_SO_SNDTIMEO || LWIP_SO_LINGER */
#endif /* LWIP_TCP */
TCPIP_APIMSG(&API_MSG_VAR_REF(msg), lwip_netconn_do_close, err);
API_MSG_VAR_FREE(msg);

View File

@ -508,7 +508,6 @@ static err_t
tcp_accept_null(void *arg, struct tcp_pcb *pcb, err_t err)
{
LWIP_UNUSED_ARG(arg);
LWIP_UNUSED_ARG(pcb);
LWIP_UNUSED_ARG(err);
tcp_abort(pcb);

View File

@ -118,6 +118,7 @@ struct api_msg_msg {
struct {
u32_t len;
} r;
#if LWIP_TCP
/** used for lwip_netconn_do_close (/shutdown) */
struct {
u8_t shut;
@ -127,6 +128,7 @@ struct api_msg_msg {
u8_t polls_left;
#endif /* LWIP_SO_SNDTIMEO || LWIP_SO_LINGER */
} sd;
#endif /* LWIP_TCP */
#if LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD)
/** used for lwip_netconn_do_join_leave_group */
struct {

View File

@ -480,7 +480,7 @@ static err_t ppp_netif_output(struct netif *netif, struct pbuf *pb, u16_t protoc
}
#endif /* MPPE_SUPPORT */
#if VJ_SUPPORT
#if VJ_SUPPORT && LWIP_TCP
/*
* Attempt Van Jacobson header compression if VJ is configured and
* this is an IP packet.
@ -505,7 +505,7 @@ static err_t ppp_netif_output(struct netif *netif, struct pbuf *pb, u16_t protoc
return ERR_VAL;
}
}
#endif /* VJ_SUPPORT */
#endif /* VJ_SUPPORT && LWIP_TCP */
#if CCP_SUPPORT
if (pcb->ccp_is_up) {
@ -665,9 +665,9 @@ void ppp_clear(ppp_pcb *pcb) {
(*protp->init)(pcb);
}
#if VJ_SUPPORT
#if VJ_SUPPORT && LWIP_TCP
vj_compress_init(&pcb->vj_comp);
#endif /* VJ_SUPPORT */
#endif /* VJ_SUPPORT && LWIP_TCP */
new_phase(pcb, PPP_PHASE_INITIALIZE);
}
@ -822,7 +822,7 @@ void ppp_input(ppp_pcb *pcb, struct pbuf *pb) {
return;
#endif /* PPP_IPV6_SUPPORT */
#if VJ_SUPPORT
#if VJ_SUPPORT && LWIP_TCP
case PPP_VJC_COMP: /* VJ compressed TCP */
/*
* Clip off the VJ header and prepend the rebuilt TCP/IP header and
@ -850,7 +850,7 @@ void ppp_input(ppp_pcb *pcb, struct pbuf *pb) {
/* Something's wrong so drop it. */
PPPDEBUG(LOG_WARNING, ("ppp_input[%d]: Dropping VJ uncompressed\n", pcb->netif->num));
break;
#endif /* VJ_SUPPORT */
#endif /* VJ_SUPPORT && LWIP_TCP */
default: {
int i;

View File

@ -808,9 +808,9 @@ pppos_input_drop(pppos_pcb *pppos)
PPPDEBUG(LOG_INFO, ("pppos_input_drop: pbuf len=%d, addr %p\n", pppos->in_head->len, (void*)pppos->in_head));
}
pppos_input_free_current_packet(pppos);
#if VJ_SUPPORT
#if VJ_SUPPORT && LWIP_TCP
vj_uncompress_err(&pppos->ppp->vj_comp);
#endif /* VJ_SUPPORT */
#endif /* VJ_SUPPORT && LWIP_TCP */
LINK_STATS_INC(link.drop);
MIB2_STATS_NETIF_INC(pppos->ppp->netif, ifindiscards);

View File

@ -29,7 +29,7 @@
*/
#include "lwip/opt.h"
#if PPP_SUPPORT && VJ_SUPPORT /* don't build if not configured for use in lwipopts.h */
#if PPP_SUPPORT && VJ_SUPPORT && LWIP_TCP /* don't build if not configured for use in lwipopts.h */
#include "netif/ppp/ppp_impl.h"
#include "netif/ppp/pppdebug.h"
@ -654,4 +654,4 @@ bad:
return (-1);
}
#endif /* PPP_SUPPORT && VJ_SUPPORT */
#endif /* PPP_SUPPORT && VJ_SUPPORT && LWIP_TCP */