From 2680f038b02cfcfbfaadd626a843b64981bb5cc0 Mon Sep 17 00:00:00 2001 From: chrysn Date: Fri, 16 Jan 2015 08:45:10 +0100 Subject: [PATCH] lwip port: remove context struct members that are now in endpoint --- net.c | 5 +---- net.h | 5 ----- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/net.c b/net.c index c4f0163a..b2aefcd2 100644 --- a/net.c +++ b/net.c @@ -397,9 +397,6 @@ coap_free_context(coap_context_t *context) { #endif /* WITH_POSIX || WITH_LWIP */ coap_free_endpoint(context->endpoint); -#ifdef WITH_LWIP - udp_remove(context->pcb); -#endif /* WITH_LWIP */ #ifndef WITH_CONTIKI coap_free_type(COAP_CONTEXT, context); #endif/* not WITH_CONTIKI */ @@ -563,7 +560,7 @@ coap_send_impl(coap_context_t *context, pbuf_realloc(p, pdu->length); - udp_sendto(context->pcb, p, + udp_sendto(context->endpoint->pcb, p, &dst->addr, dst->port); pbuf_header(p, -(ptrdiff_t)((uint8_t*)pdu - (uint8_t*)p->payload) - sizeof(coap_pdu_t)); /* FIXME hack around udp_sendto not restoring; see http://lists.gnu.org/archive/html/lwip-users/2013-06/msg00008.html. for udp over ip over ethernet, this was -42; as we're doing ppp too, this has to be calculated generically */ diff --git a/net.h b/net.h index 31debc68..7b0e2ec0 100644 --- a/net.h +++ b/net.h @@ -120,11 +120,6 @@ typedef struct coap_context_t { struct etimer notify_timer; /**< used to check resources periodically */ #endif /* WITH_CONTIKI */ #ifdef WITH_LWIP - struct udp_pcb *pcb; /**< the underlying lwIP UDP PCB */ - struct pbuf *pending_package; /**< pbuf containing the last received package if not handled yet. This is only used to pass the package from the udp_recv callback into the coap_read function, which frees the pbuf and clears this field. */ - ip_addr_t pending_address; /**< the address associated with pending_package */ - u16_t pending_port; /**< the port associated with pending_package */ - uint8_t timer_configured; /**< Set to 1 when a retransmission is scheduled using lwIP timers for this context, otherwise 0. */ #endif /* WITH_LWIP */