Hey guys,

After implementing the lwIP driver for my platform, I am starting it with
the following instructions:

  struct netif *netif=(struct netif *)malloc(sizeof(struct netif));
>   ip_addr_t ipaddr, netmask, gw;
>   IP4_ADDR(&ipaddr, 192, 168, 0, 24);
>   IP4_ADDR(&netmask, 255, 255, 0, 0);
>   IP4_ADDR(&gw, 192, 168, 0, 1);
>   netif_add(netif, &ipaddr, &netmask, &gw, NULL, LWIP_driver_init,
> LWIP_driver_input);
>   netif_set_default(netif);


And I am trying to ping the address 192.168.0.24 from 192.168.0.1 and the
result is Destination host unreachable.

I attached the lwipopts file for more info.

Can you please tell me if there is something that I need to do to "start"
lwIP's functionality?

Thank you in advance,
Angel C
/** This file is created by Energy Micro, based on the reptile/lwip/src/include/lwip/opt.h
*   with the following aspects that need to be taken into account
*   * unnecesarry options have been removed 
*   * details about each option can be found in the original file
*   * default values are to be found in the original file
*/

#ifndef _LWIP_OPTS_H_
#define _LWIP_OPTS_H_

#define NO_SYS                          1
#define SYS_LIGHTWEIGHT_PROT            (!NO_SYS)
#define MEM_ALIGNMENT                   4
#define MEM_SIZE                        128 * 1024

/** Internal memory pool sizes */
#define MEMP_NUM_PBUF                   16
#define MEMP_NUM_NETBUF                 16
#define MEMP_NUM_RAW_PCB                4
#define MEMP_NUM_UDP_PCB                4
#define MEMP_NUM_TCP_PCB                5
#define MEMP_NUM_TCP_PCB_LISTEN         8
#define MEMP_NUM_TCP_SEG                16
#define MEMP_NUM_REASSDATA              5
#define MEMP_NUM_FRAG_PBUF              15
#define MEMP_NUM_ARP_QUEUE              30
#define MEMP_NUM_IGMP_GROUP             8
#define MEMP_NUM_SYS_TIMEOUT            8
#define MEMP_NUM_TCPIP_MSG_API          8
#define MEMP_NUM_TCPIP_MSG_INPKT        8
#define MEMP_NUM_SNMP_NODE              50
#define MEMP_NUM_SNMP_ROOTNODE          30
#define MEMP_NUM_SNMP_VARBIND           2
#define MEMP_NUM_SNMP_VALUE             3
#define MEMP_NUM_NETDB                  1
#define MEMP_NUM_LOCALHOSTLIST          1
#define MEMP_NUM_PPPOE_INTERFACES       1
#define PBUF_POOL_SIZE                  16

/** ARP options */
#define ETH_PAD_SIZE                    2
#define LWIP_ARP                        1
#if LWIP_ARP == 1
#define ARP_TABLE_SIZE                  30
#define ARP_QUEUEING                    1       
#define ETHARP_TRUST_IP_MAC             1
#define ETHARP_SUPPORT_VLAN             0
#define LWIP_ETH_ARP_INTERVAL 2000 /**< ARP timer interval in miliseconds */
#endif

/** IP options */
#define IP_FORWARD                      0
#define IP_OPTIONS_ALLOWED              1
#define IP_REASSEMBLY                   0
#define IP_FRAG                         0
#define IP_DEFAULT_TTL                  255

/** ICMP options */
#define LWIP_ICMP                       1
#define LWIP_BROADCAST_PING             0
#define LWIP_MULTICAST_PING             0

/** RAW options */
#define LWIP_RAW                        1

/** DHCP options */
#define LWIP_DHCP                       0

/** AUTOIP options */
#define LWIP_AUTOIP                     1
#define LWIP_DHCP_AUTOIP_COOP           0

/** SNMP options */
#define LWIP_SNMP                       0

/** IGMP options */
#define LWIP_IGMP                       1

/** DNS options */
#define LWIP_DNS                        0

/** UDP options */
#define LWIP_UDP                        1
#define LWIP_UDPLITE                    0
#define LWIP_NETBUF_RECVINFO            0

/** TCP options */
#define LWIP_TCP                        1
#define LWIP_TCP_TIMESTAMPS             0
#define TCP_WND                         8192
#define TCP_MAXRTX                      10
#define TCP_SYNMAXRTX                   3
#define TCP_QUEUE_OOSEQ                 1
#define TCP_MSS                         1460
#define TCP_SND_BUF                     (8 * TCP_MSS)
#define TCP_SND_QUEUELEN                (2 * TCP_SND_BUF/TCP_MSS)
#define TCP_SNDLOWAT                    (TCP_SND_BUF/2)
#define TCP_LISTEN_BACKLOG              1
#define LWIP_ETH_TCP_INTERVAL 2000 /**< TCP timer interval in miliseconds */

/** Pbuf options */
#define PBUF_POOL_BUFSIZE               1520		// + sizeof(pbuf) = 1536 = 12 cache lines of 128 bytes
#define PBUF_LINK_HLEN                  (14 + ETH_PAD_SIZE)

/** Network Interfaces options */
#define LWIP_NETIF_HOSTNAME             1
#define LWIP_NETIF_API                  (!NO_SYS)
#define LWIP_NETIF_HWADDRHINT           1
#define LWIP_NETIF_LOOPBACK             1
#define LWIP_NETIF_LINK_CALLBACK        0

/** LOOPIF options */
#define LWIP_HAVE_LOOPIF                0

/** Thread options */
#define TCPIP_MBOX_SIZE                 32
#define DEFAULT_UDP_RECVMBOX_SIZE       32
#define DEFAULT_TCP_RECVMBOX_SIZE       32
#define DEFAULT_ACCEPTMBOX_SIZE         4

/** thread priorities are in VDK terms - 1 is highest, 30 is lowest */
#define TCPIP_THREAD_PRIO               5
#define DEFAULT_THREAD_PRIO             10
#define LOW_THREAD_PRIO                 29

/** Sequential layer options */
#define LWIP_NETCONN                    (!NO_SYS)

/** Socket options */
#define LWIP_SOCKET                     (!NO_SYS)
#define LWIP_COMPAT_SOCKETS             1
#define LWIP_TCP_KEEPALIVE              1
#define LWIP_SO_RCVTIMEO                1
#define LWIP_SO_RCVBUF                  0
#define SO_REUSE                        1
#define SO_REUSE_RXTOALL                1

/** Statistics options */
#define LWIP_STATS                      1
#define LWIP_STATS_LARGE                1
#if LWIP_STATS
#define LINK_STATS                      1
#define IP_STATS                        1
#define IPFRAG_STATS                    0
#define ICMP_STATS                      1
#define IGMP_STATS                      1
#define UDP_STATS                       1
#define TCP_STATS                       1
#define MEM_STATS                       1
#define MEMP_STAT                       1
#define SYS_STATS                       1
#define LWIP_STATS_DISPLAY              0
#endif /* STATS */
#define LWIP_PROVIDE_ERRNO              1

/** Debugging options */
#define LWIP_DBG_MIN_LEVEL              LWIP_DBG_LEVEL_ALL
#define LWIP_DBG_TYPES_ON               LWIP_DBG_STATE
#define ETHARP_DEBUG                    LWIP_DBG_ON
#define NETIF_DEBUG                     LWIP_DBG_ON
#define PBUF_DEBUG                      LWIP_DBG_ON
#define API_LIB_DEBUG                   LWIP_DBG_ON
#define API_MSG_DEBUG                   LWIP_DBG_ON
#define SOCKETS_DEBUG                   LWIP_DBG_ON
#define ICMP_DEBUG                      LWIP_DBG_ON
#define IGMP_DEBUG                      LWIP_DBG_ON
#define INET_DEBUG                      LWIP_DBG_ON
#define IP_DEBUG                        LWIP_DBG_ON
#define IP_REASS_DEBUG                  LWIP_DBG_ON
#define RAW_DEBUG                       LWIP_DBG_ON
#define MEM_DEBUG                       LWIP_DBG_ON
#define MEMP_DEBUG                      LWIP_DBG_ON
#define SYS_DEBUG                       LWIP_DBG_ON
#define TIMERS_DEBUG                    LWIP_DBG_ON
#define TCP_DEBUG                       LWIP_DBG_ON
#define TCP_INPUT_DEBUG                 LWIP_DBG_ON
#define TCP_FR_DEBUG                    LWIP_DBG_ON
#define TCP_RTO_DEBUG                   LWIP_DBG_ON
#define TCP_CWND_DEBUG                  LWIP_DBG_ON
#define TCP_WND_DEBUG                   LWIP_DBG_ON
#define TCP_OUTPUT_DEBUG                LWIP_DBG_ON
#define TCP_RST_DEBUG                   LWIP_DBG_ON
#define TCP_QLEN_DEBUG                  LWIP_DBG_ON
#define UDP_DEBUG                       LWIP_DBG_ON
#define TCPIP_DEBUG                     LWIP_DBG_ON
#define PPP_DEBUG                       LWIP_DBG_ON
#define SLIP_DEBUG                      LWIP_DBG_ON
#define DHCP_DEBUG                      LWIP_DBG_ON
#define AUTOIP_DEBUG                    LWIP_DBG_ON
#define SNMP_MSG_DEBUG                  LWIP_DBG_ON
#define SNMP_MIB_DEBUG                  LWIP_DBG_ON
#define DNS_DEBUG                       LWIP_DBG_ON


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

Reply via email to