Unfortunately, I couldn't send you whole my project, but I can show my lwip
config and code, where I use sockets. If it is really needed, I can try to
create small project with only this tasks. (sorry, I can't send whole
project.)

1-st task with UDP socket:

    const upx_request_t* p_req = NULL;
    const upx_reply_t* p_rep = NULL;

    int socket_fd;
    struct sockaddr_in self;
    struct sockaddr_in client;
    size_t client_len;

    int bytes_recv = 0;
    int bytes_sent = 0;

    hal_base_type status = hal_queue_fail;

    while ( (socket_fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
        hal_task_delay(SHORT_DELAY);
    }

    memset(&self, 0, sizeof(struct sockaddr_in));
    self.sin_family = AF_INET;
    self.sin_len = sizeof(self);
    self.sin_addr.s_addr = htonl(INADDR_ANY);
    self.sin_port = htons(PRGSERVER_PORT);

    while ( bind(socket_fd,
                 (struct sockaddr*)&self,
                 sizeof(struct sockaddr_in)) < 0 ) {
        hal_task_delay(SHORT_DELAY);
    }

    LOG(LOG_PRGSERVER, LOG_DEVEL, "Bind to port: %u", PRGSERVER_PORT);

    while (true) {
        memset(&req, 0, sizeof(upx_request_t));

        bytes_recv = recvfrom(socket_fd, &req,
                              sizeof(req),
                              0,
                              (struct sockaddr *)&client,
                              &client_len);

        req.header.num = ntohl(req.header.num);
        LOG(LOG_PRGSERVER, LOG_NOTICE, "Received: %d bytes", bytes_recv);

        if(bytes_recv < UPX_MIN_DATA_LENGTH) {
            LOG(LOG_PRGSERVER,
                LOG_ERROR,
                "Insufficient UPX length: %d bytes. Minimum is: %d bytes",
                bytes_recv,
                UPX_MIN_DATA_LENGTH);

            continue;
        }

        p_req = &req;

        do {
            status = hal_queue_send(q_upx_request,
                                    &p_req,
                                    UPX_QUEUE_SEND_WAIT);
        } while ( hal_queue_ok != status);

        do {
            status = hal_queue_receive(q_upx_reply,
                                       &p_rep,
                                       UPX_QUEUE_RECEIVE_WAIT);
        } while ( hal_queue_ok != status);

        if( ! p_rep) {
            continue;
        }

        size_t send_len = sizeof(p_rep->id) + req.header.fld.len + 1;

        bytes_sent = sendto(socket_fd,
                            p_rep,
                            send_len,
                            0,
                            (struct sockaddr *)&client,
                            client_len);

        LOG(LOG_PRGSERVER, LOG_NOTICE, "Sent: %d bytes", bytes_sent);
    }



2-nd task with TCP socket:
    struct sockaddr_in self;
    struct sockaddr_in client;

    int client_fd;
    int socket_fd;
    int addr_len = sizeof( struct sockaddr_in );

    while ( (socket_fd = socket( AF_INET, SOCK_STREAM, 0 )) < 0 ) {
        hal_task_delay(SHORT_DELAY);
    }

    memset((char *)&self, 0, sizeof(self));
    self.sin_family = AF_INET;
    self.sin_len = sizeof(self);
    self.sin_addr.s_addr = htonl(INADDR_ANY);
    self.sin_port = ntohs( ( ( uint16_t ) LOG_PORT ) );

    while( bind( socket_fd, ( struct sockaddr *) &self, sizeof( self ) ) <
0 ) {
        hal_task_delay(SHORT_DELAY);
    }

    while( listen( socket_fd, LISTEN_SOCKET_BACKLOG ) != 0 ) {
        hal_task_delay(SHORT_DELAY);
    }

    while(true) {
        while( (client_fd = accept( socket_fd,
                                    ( struct sockaddr * ) &client,
                                    ( u32_t * ) &addr_len )) < 0 ) {
            hal_task_delay(SHORT_DELAY);
        }

        while(true) {
            if(hal_queue_ok == hal_queue_receive(q_log_net,
                                                 &msg,

LOG_NET_QUEUE_RECEIVE_WAIT)) {
                if( sendto(client_fd,
                           &(msg.message),
                           msg.length,
                           0,
                           (struct sockaddr *)&client,
                           addr_len) < 0) {
                    break;
                }
            }
        }

        close(client_fd);
    }

3-rd task with TCP socket:
    register_commands();

    hal_base_type status = hal_fail;

    struct sockaddr_in self;
    struct sockaddr_in client;

    int client_fd;
    int socket_fd;
    int addr_len = sizeof( struct sockaddr_in );

    char c_in = 0;
    uint8_t c_in_index = 0;
    signed char* p_out_string = NULL;

    int8_t input_string[ MAX_CMD_LEN ];
    int bytes = 0;

    while ( (socket_fd = socket( AF_INET, SOCK_STREAM, 0 )) < 0 ) {
        hal_task_delay(SHORT_DELAY);
    }

    memset((char *)&self, 0, sizeof(self));
    self.sin_family = AF_INET;
    self.sin_len = sizeof(self);
    self.sin_addr.s_addr = htonl(INADDR_ANY);
    self.sin_port = ntohs( ( ( uint16_t ) TELNET_PORT ) );

    while( bind( socket_fd, ( struct sockaddr *) &self, sizeof( self ) ) <
0 ) {
        hal_task_delay(SHORT_DELAY);
    }

    LOG(LOG_COMMAND_CENTER, LOG_DEVEL, "Bind to port: %u", TELNET_PORT);

    while( listen( socket_fd, LISTEN_SOCKET_BACKLOG ) != 0 ) {
        hal_task_delay(SHORT_DELAY);
    }

    while(true) {

        while( (client_fd = accept( socket_fd,
                                    ( struct sockaddr * ) &client,
                                    ( u32_t * ) &addr_len )) < 0L ) {
            hal_task_delay(SHORT_DELAY);
            hal_yield();
        }

        memset(input_string, 0x00, MAX_CMD_LEN);
        p_out_string = FreeRTOS_CLIGetOutputBuffer();

        while (send( client_fd, GREETING,
                     strlen( ( const char * ) GREETING ), 0 ) < 0) {
            hal_task_delay(SHORT_DELAY);
        }

        while (send( client_fd, "version: ",
                     strlen( ( const char * ) "version: " ), 0 ) < 0) {
            hal_task_delay(SHORT_DELAY);
        }

        while (send( client_fd, git_revision,
                     strlen( ( const char * ) git_revision ), 0 ) < 0) {
            hal_task_delay(SHORT_DELAY);
        }

        while (send( client_fd, PROMPT,
                     strlen( ( const char * ) PROMPT ), 0 ) < 0) {
            hal_task_delay(SHORT_DELAY);
        }

        c_in_index = 0;
        memset( input_string, 0x00, MAX_CMD_LEN );

        do {
            if ( (bytes = recv( client_fd, &c_in, sizeof( c_in ), 0 )) <=
0L ) {
                break;
            }

//            if(!is_character_allowed(c_in)) {
//                continue;
//            }

            if( c_in == '\n' ) {
                if( strncmp( QUIT_CMD, ( const char * ) input_string,
                             strlen(QUIT_CMD) ) == 0 ) {
                    bytes = 0L;
                } else {
                    do {
                        p_out_string[0]=0x00;
                        status = FreeRTOS_CLIProcessCommand( input_string,
                                                             p_out_string,

configCOMMAND_INT_MAX_OUTPUT_SIZE );
                        send( client_fd, p_out_string,
                              strlen( ( const char * ) p_out_string ), 0 );
                    } while( status != hal_fail );

                    c_in_index = 0;
                    memset( input_string, 0x00, MAX_CMD_LEN );
                    send( client_fd, PROMPT,
                          strlen( ( const char * ) PROMPT ), 0 );
                }
            } else if( (c_in == '\b') && (c_in_index > 0) ) {
                c_in_index--;
                input_string[ c_in_index ] = '\0';
            } else if( (c_in_index < MAX_CMD_LEN) && (c_in != '\r') ) {
                input_string[ c_in_index ] = c_in;
                c_in_index++;
            }
        } while( bytes > 0L );
        close(client_fd);
    }

Shortly, in UDP task, I receive UDP packet, process it, and send reply.
The 2-nd task is a log server, when I connects to port LOG_PORT, it start
send log messages to the connected client.

The 3-rd task is something like telnet server, it receives commands and
sends result to the client.
I've always only one client for each task.

In my application I have some hardware abstraction layer(hal), all
functions like hal_queue_receive is macroses, that expands to FreeRTOS
xQueueReceive call, for example.

My CPU have cortex-m4 architecture, if it is important.


On Fri, Mar 7, 2014 at 9:00 PM, <[email protected]> wrote:

> Send lwip-users mailing list submissions to
>         [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.nongnu.org/mailman/listinfo/lwip-users
> or, via email, send a message with subject or body 'help' to
>         [email protected]
>
> You can reach the person managing the list at
>         [email protected]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of lwip-users digest..."
>
>
> Today's Topics:
>
>    1. Re: LWIP_ASSERT conn->current_msg != NULL (Martin Velek)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 6 Mar 2014 22:10:29 +0100
> From: Martin Velek <[email protected]>
> To: Mailing list for lwIP users <[email protected]>
> Subject: Re: [lwip-users] LWIP_ASSERT conn->current_msg != NULL
> Message-ID:
>         <
> cab-o4cx7hqk-dgslwikt_fe2pkeag8yn4svkcikeb50lycp...@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi,
>
> could you provide some test case? I mean the code you are using (if it
> is possible) to be able to re-create the assertion failure.
>
> Best
> Martin
>
> On Thu, Mar 6, 2014 at 10:35 AM, Dmitriy Zabotlin <[email protected]>
> wrote:
> > Hi,
> >
> >
> > I have a problem with lwip in my embedded application, I'm using FreeRTOS
> > 7.6.0 with lwip 1.4.1, I'm using lwip driver from ASF, lwip-port-1.4.0.
> >
> > I have three threads, which uses lwip sockets, one creates UDP socket,
> two
> > TCP sockets. If I connect to my board via UDP, everything fine, but if I
> use
> > any of TCP sockets, after some time(every time different) assert fired at
> > api_msg.c:
> > LWIP_ASSERT("conn->current_msg != NULL", conn->current_msg != NULL);
> >
> >
> > Also if I connect to both TCP sockets, assert fired at tcp_in:1031
> >
> > LWIP_ASSERT("tcp_receive: valid queue length", pcb->unacked != NULL ||
> > pcb->unsent != NULL);
> >
> > I've read lwip-user list and found thread with such problem(first
> assert),
> > but there was wrong lwip-driver, I'm using corrected lwip-driver.
> >
> > I suppose some kind of memory error with concurrent access, but I don't
> know
> > where it could be. Looks like conn->current_msg freeing before it uses.
> >
> > I've no idea about second assert.
> >
> >
> > _______________________________________________
> > lwip-users mailing list
> > [email protected]
> > https://lists.nongnu.org/mailman/listinfo/lwip-users
>
>
>
> ------------------------------
>
> _______________________________________________
> lwip-users mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>
> End of lwip-users Digest, Vol 127, Issue 2
> ******************************************
>
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H

/*-----------------------------------------------------------
 * Application specific definitions.
 *
 * These definitions should be adjusted for your particular hardware and
 * application requirements.
 *
 * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
 * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
 *
 * See http://www.freertos.org/a00110.html.
 *----------------------------------------------------------*/

#if defined (__GNUC__) || defined (__ICCARM__)
    #include <stdint.h>
    #include <sysclk.h>
    #include "itimer.h"
    void assert_triggered(const char * file, uint32_t line);
#endif

#define configUSE_PREEMPTION                     1
#define configUSE_PORT_OPTIMISED_TASK_SELECTION  0
#define configUSE_TICKLESS_IDLE                  0
#define configUSE_IDLE_HOOK                      0
#define configUSE_TICK_HOOK                      1
#define configCPU_CLOCK_HZ                       (sysclk_get_cpu_hz())
#define configTICK_RATE_HZ                       ((portTickType)1000)
#define configMAX_PRIORITIES                     5
#define configMINIMAL_STACK_SIZE                 ((unsigned short)256)
// if heap 3 used, doesn't matter
#define configTOTAL_HEAP_SIZE                    ((size_t)(1024 * 64))
#define configMAX_TASK_NAME_LEN                  16
#define configUSE_TRACE_FACILITY                 1
#define configUSE_16_BIT_TICKS                   0
#define configIDLE_SHOULD_YIELD                  1
#define configUSE_MUTEXES                        1
#define configQUEUE_REGISTRY_SIZE                10
#define configCHECK_FOR_STACK_OVERFLOW           2
#define configUSE_RECURSIVE_MUTEXES              1
#define configUSE_MALLOC_FAILED_HOOK             1
#define configUSE_APPLICATION_TASK_TAG           0
#define configUSE_COUNTING_SEMAPHORES            1

#define portNUM_CONFIGURABLE_REGIONS             3

/* Run time stats gathering definitions. */
#if defined (__GNUC__) || defined (__ICCARM__)
    extern void configure_timer_for_run_time_stats( void );
    uint32_t get_run_time_counter_value( void );

    #define configGENERATE_RUN_TIME_STATS            1

    #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS()
    #define portGET_RUN_TIME_COUNTER_VALUE()         ( sys_get_ms() )
#endif

/* Co-routine definitions. */
#define configUSE_CO_ROUTINES                   1
#define configMAX_CO_ROUTINE_PRIORITIES         1

/* Software timer definitions. */
#define configUSE_TIMERS                        1
#define configTIMER_TASK_PRIORITY               (configMAX_PRIORITIES - 1)
#define configTIMER_QUEUE_LENGTH                5
#define configTIMER_TASK_STACK_DEPTH            (configMINIMAL_STACK_SIZE)

/* Set the following definitions to 1 to include the API function, or zero
to exclude the API function. */
#define INCLUDE_vTaskPrioritySet            1
#define INCLUDE_uxTaskPriorityGet           1
#define INCLUDE_vTaskDelete                 1
#define INCLUDE_vTaskCleanUpResources       1
#define INCLUDE_vTaskSuspend                1
#define INCLUDE_vTaskDelayUntil             1
#define INCLUDE_vTaskDelay                  1
#define INCLUDE_xTaskGetCurrentTaskHandle   1
#define INCLUDE_xTaskGetSchedulerState      1
#define INCLUDE_uxTaskGetStackHighWaterMark 1

#define configUSE_STATS_FORMATTING_FUNCTIONS 1

/* FreeRTOS+CLI definitions. */
/* Dimensions a buffer into which command outputs can be written. The buffer
 * can be declared in the CLI code itself, to allow multiple command consoles to
 * share the same buffer. For example, an application may allow access to the
 * command interpreter by UART and by Ethernet. Sharing a buffer is done purely
 * to save RAM. Note, however, that the command console itself is not re-entrant,
 * so only one command interpreter interface can be used at any one time. For
 * that reason, no attempt at providing mutual exclusion to the buffer is
 * attempted.
 */
#define configCOMMAND_INT_MAX_OUTPUT_SIZE  400

/* Cortex-M specific definitions. */

#ifdef __NVIC_PRIO_BITS
	/* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
	#define configPRIO_BITS       __NVIC_PRIO_BITS
#else
	#define configPRIO_BITS       4        /* 15 priority levels */
#endif

/* The lowest interrupt priority that can be used in a call to a "set priority"
function. */
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY  0x0f

/* The highest interrupt priority that can be used by any interrupt service
routine that makes calls to interrupt safe FreeRTOS API functions.  DO NOT CALL
INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
PRIORITY THAN THIS! (higher priorities are lower numeric values. */

#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY  8

/* Interrupt priorities used by the kernel port layer itself.  These are generic
to all Cortex-M ports, and do not rely on any particular library functions. */
#define configKERNEL_INTERRUPT_PRIORITY      (configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS))
#define configMAX_SYSCALL_INTERRUPT_PRIORITY (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS))

/* Normal assert() semantics without relying on the provision of an assert.h
header file. */
//#define configASSERT( x )     if( ( x ) == 0 ) vAssertCalled( __FILE__, __LINE__ )
#define configASSERT(x)
//if( ( x ) == 0 ) assert_triggered( __FILE__, __LINE__ )

//#define INCLUDE_MODULE_TEST 0

#define vPortSVCHandler       SVC_Handler
#define xPortPendSVHandler    PendSV_Handler
#define xPortSysTickHandler   SysTick_Handler

#endif /* FREERTOS_CONFIG_H */

#ifndef __LWIPOPTS_H__
#define __LWIPOPTS_H__

/* Include user defined options first */
#include "conf_eth.h"
#include "conf_lwip_threads.h"

#include "ilog.h"

/* ---------- System options ---------- */
/* Specify NO_SYS because we are not using an RTOS */
#define NO_SYS                      0
#define LWIP_RAW                    1
#define LWIP_NETIF_STATUS_CALLBACK  1

/* These options can be configured by the user in the standalone demo default demo */
//#define HTTP_RAW_USED
#undef HTTP_RAW_USED
//#define DHCP_USED
#undef DHCP_USED

/* These are not available when using "NO_SYS" */
#define LWIP_NETCONN                    1
#define LWIP_SOCKET                     1
#define LWIP_COMPAT_SOCKETS             1
#define LWIP_POSIX_SOCKETS_IO_NAMES     1

#define SYS_LIGHTWEIGHT_PROT            1

#define TCPIP_THREAD_NAME               "SYS_TCP"

/* ---------- Memory options ---------- */

/* These two control is reclaimer functions should be compiled
   in. Should always be turned on (1). */
#define MEM_RECLAIM             1
#define MEMP_RECLAIM            1

/* MEM_ALIGNMENT: should be set to the alignment of the CPU for which
   lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2
   byte alignment -> define MEM_ALIGNMENT to 2. */
#define MEM_ALIGNMENT           4

/* MEM_SIZE: the size of the heap memory. If the application will send
a lot of data that needs to be copied, this should be set high. */
#define MEM_SIZE                6 * 1024

#define MEMP_SANITY_CHECK       1

//#define MEM_USE_POOLS           1
//#define MEM_USE_POOLS_TRY_BIGGER_POOL 1

/* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
   sends a lot of data out of ROM (or other static memory), this
   should be set high. */
#define MEMP_NUM_PBUF           16

/* Number of raw connection PCBs */
#define MEMP_NUM_RAW_PCB        8

/* ---------- UDP options ---------- */
#define LWIP_UDP                1
#define UDP_TTL                 255
/* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
 per active UDP "connection". */
#define MEMP_NUM_UDP_PCB        16

/**
 * DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
 * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed
 * to sys_mbox_new() when the recvmbox is created.
 */
#define DEFAULT_RAW_RECVMBOX_SIZE       6

/**
 * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
 * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed
 * to sys_mbox_new() when the recvmbox is created.
 */
#define DEFAULT_UDP_RECVMBOX_SIZE       8

/**
 * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
 * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed
 * to sys_mbox_new() when the recvmbox is created.
 */
#define DEFAULT_TCP_RECVMBOX_SIZE       6

/**
 * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections.
 * The queue size value itself is platform-dependent, but is passed to
 * sys_mbox_new() when the acceptmbox is created.
 */
#define DEFAULT_ACCEPTMBOX_SIZE         6

#define TCPIP_MBOX_SIZE                 8

#define TCPIP_THREAD_STACKSIZE          1024

//#define MEM_LIBC_MALLOC                 1
//#define MEMP_MEM_MALLOC                 1
//#define MEMP_SEPARATE_POOLS             1
//#define MEMP_OVERFLOW_CHECK             1
//#define LWIP_TCP_KEEPALIVE              1
//#define LWIP_SO_SNDTIMEO                1
//#define LWIP_SO_RCVTIMEO                1
//#define SO_REUSE                        1
//#define ETHARP_TRUST_IP_MAC             1

/* ---------- Pbuf options ---------- */
/* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */
#define PBUF_POOL_SIZE          8
/* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
#define PBUF_POOL_BUFSIZE       512

/** ETH_PAD_SIZE: number of bytes added before the ethernet header to ensure
 * alignment of payload after that header. Since the header is 14 bytes long,
 * without this padding e.g. addresses in the IP header will not be aligned
 * on a 32-bit boundary, so setting this to 2 can speed up 32-bit-platforms.
 */
#define ETH_PAD_SIZE			2

/* PBUF_LINK_HLEN: the number of bytes that should be allocated for a
   link level header. */
#define PBUF_LINK_HLEN          (16 + ETH_PAD_SIZE)

/* ---------- TCP options ---------- */
#define LWIP_TCP                1
#define TCP_TTL                 255
/* TCP receive window. */
#define TCP_WND                 1500
/* Controls if TCP should queue segments that arrive out of
   order. Define to 0 if your device is low on memory. */
#define TCP_QUEUE_OOSEQ         1
/* TCP Maximum segment size. */
#define TCP_MSS                 1500
/* TCP sender buffer space (bytes). */
#define TCP_SND_BUF             2*TCP_MSS
/* TCP sender buffer space (pbufs). This must be at least = 2 *
   TCP_SND_BUF/TCP_MSS for things to work. */
/* TCP_SND_QUEUELEN: replace TCP_SND_BUF=3000 by 2150. 3000 don't work */
#define TCP_SND_QUEUELEN        ((6 * (2150/*TCP_SND_BUF*/) + (TCP_MSS - 1))/(TCP_MSS))
/* Maximum number of retransmissions of data segments. */
#define TCP_MAXRTX              12
/* Maximum number of retransmissions of SYN segments. */
#define TCP_SYNMAXRTX           4
#define TCP_SLOW_INTERVAL       800
/* -------- MEM ---------- */
/* MEMP_NUM_TCP_PCB: the number of simultaneously active TCP connections. */
#define MEMP_NUM_TCP_PCB        8
/* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections. */
#define MEMP_NUM_TCP_PCB_LISTEN 8
/* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. */
#define MEMP_NUM_TCP_SEG        TCP_SND_QUEUELEN
/* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts. */
#define MEMP_NUM_SYS_TIMEOUT    8

/* The following four are used only with the sequential API and can be
   set to 0 if the application only will use the raw API. */
/* MEMP_NUM_NETBUF: the number of struct netbufs. */
#define MEMP_NUM_NETBUF         16
/* MEMP_NUM_NETCONN: the number of struct netconns. */
#define MEMP_NUM_NETCONN        16

/* ---------- ARP options ---------- */
#define ARP_TABLE_SIZE          10
#define ARP_QUEUEING            1

/* ---------- IP options ---------- */
/* Define IP_FORWARD to 1 if you wish to have the ability to forward
   IP packets across network interfaces. If you are going to run lwIP
   on a device with only one network interface, define this to 0. */
#define IP_FORWARD              0
/* If defined to 1, IP options are allowed (but not parsed). If
   defined to 0, all packets with IP options are dropped. */
#define IP_OPTIONS              1

/* ---------- ICMP options ---------- */
#define ICMP_TTL                255

#if defined(DHCP_USED)
/* ---------- DHCP options ---------- */
/* Define LWIP_DHCP to 1 if you want DHCP configuration of
   interfaces. DHCP is not implemented in lwIP 0.5.1, however, so
   turning this on does currently not work. */
#define LWIP_DHCP               1

/* 1 if you want to do an ARP check on the offered address
   (recommended). */
 #define DHCP_DOES_ARP_CHECK     1
#endif

#define LWIP_NETIF_HOSTNAME      1

/* ---------- Statistics options ---------- */
#define LWIP_STATS 1
#define LWIP_STATS_DISPLAY 1

#if LWIP_STATS
#define LINK_STATS 1
#define IP_STATS   1
#define ICMP_STATS 1
#define UDP_STATS  1
#define TCP_STATS  1
#define MEM_STATS  1
#define MEMP_STATS 1
#define PBUF_STATS 1
#define SYS_STATS  1
#endif /* STATS */

/* ---------- Lwip Debug opt./src/core/ipv4/inet_chksum.cions ---------- */
/* Define default values for unconfigured parameters. */
// 1 == To suppress some errors for now (no debug output)
//#define LWIP_NOASSERT 			0


// Using GNOME log facility, may cause problems with performance.

//#define LWIP_PLATFORM_DIAG(message)       \
//        LOG(LOG_SYS, LOG_INFO, message);

#define LWIP_PLATFORM_DIAG(message)       \
    do {                                  \
        printf message;                   \
    } while( 0 );

#define LWIP_PLATFORM_ASSERT(x) do { \
    printf("Assertion \"%s\" failed at line %d in %s\n", x, __LINE__, __FILE__); \
    fflush(NULL); abort(); \
    } while(0);

#define DBG_TYPES_ON                    0x00
#define LWIP_DBG_TYPES_ON               0x00

//#define DBG_TYPES_ON                    0xFF
//#define LWIP_DBG_TYPES_ON               0xFF

#define ETHARP_DEBUG                    LWIP_DBG_OFF
#define NETIF_DEBUG                     LWIP_DBG_OFF
#define PBUF_DEBUG                      LWIP_DBG_OFF
#define API_LIB_DEBUG                   LWIP_DBG_OFF
#define API_MSG_DEBUG                   LWIP_DBG_OFF
#define SOCKETS_DEBUG                   LWIP_DBG_OFF
#define ICMP_DEBUG                      LWIP_DBG_OFF
#define INET_DEBUG                      LWIP_DBG_OFF
#define IP_DEBUG                        LWIP_DBG_OFF
#define IP_REASS_DEBUG                  LWIP_DBG_OFF
#define RAW_DEBUG                       LWIP_DBG_OFF
#define MEM_DEBUG                       LWIP_DBG_OFF
#define MEMP_DEBUG                      LWIP_DBG_OFF
#define SYS_DEBUG                       LWIP_DBG_OFF
#define TCP_DEBUG                       LWIP_DBG_OFF
#define TCP_INPUT_DEBUG                 LWIP_DBG_OFF
#define TCP_FR_DEBUG                    LWIP_DBG_OFF
#define TCP_RTO_DEBUG                   LWIP_DBG_OFF
#define TCP_CWND_DEBUG                  LWIP_DBG_OFF
#define TCP_WND_DEBUG                   LWIP_DBG_OFF
#define TCP_OUTPUT_DEBUG                LWIP_DBG_OFF
#define TCP_RST_DEBUG                   LWIP_DBG_OFF
#define TCP_QLEN_DEBUG                  LWIP_DBG_OFF
#define UDP_DEBUG                       LWIP_DBG_OFF
#define TCPIP_DEBUG                     LWIP_DBG_OFF
#define DBG_MIN_LEVEL                   LWIP_DBG_LEVEL_ALL

// \note For a list of all possible lwIP configurations, check http://lwip.wikia.com/wiki/Lwipopts.h

#endif /* __LWIPOPTS_H__ */
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to