eCosPro® Reference Manual
Prev |  | Next

# Chapter 3. Port

# Port status

The eCos port of lwIP in eCosPro is based on the lwIP 1.1.1 code base. Due to a large number of identified code problems, performance and footprint inefficiencies, the eCos port was mostly rewritten. Modifications consisting of both bug fixes and feature enhancements were made to the lwIP core code.

The port requires the eCos kernel (CYGPKG_KERNEL) for now. The main reasons for this are because the ethernet driver and serial driver implementations have dependencies on interrupts and non-kernel interrupt support is tricky; and that it is only really feasible in the lwIP core code to avoid a multi-thread OS if solely using the raw API. And when using the raw API, the application would have to be responsible for polling the underlying device driver (e.g. Ethernet) in any case.

Some eCos Ethernet drivers may have alignment constraints on packet data. This is usually not a problem, however it can affect PBUF_ROM packets, whose alignment is dictated by the application. Therefore the application must ensure only appropriately aligned PBUF_ROM packets are passed to lwIP, as appropriate for the hardware-specific Ethernet device driver.

lwIP's BSD sockets compatibility API is completely separate from the socket and file descriptor interface provided by the eCos File I/O (CYGPKG_IO_FILEIO) package. As such, network packages which rely on semantics such as being able to read and write both files and sockets with that API, cannot work with lwIP at the present time. This includes the httpd, DNS, SNTP and FTP client packages. The NET-SNMP package uses BSD stack-specific APIs and so also cannot work with lwIP. Note that an example httpd server written using the lwIP raw API is included in the `tests/` subdirectory of the lwIP eCos package.

C++ users should note that lwIP's own headers are not C++ safe, and so inclusions of these header files should be surrounded by:

    extern "C" {
     #include <lwip/…>
    }

blocks. However for convenience when using the BSD sockets compatibility API, including the `network.h` header file:

    #include <network.h>

allows access to the API and works from C++ as well as C. This also has the benefit of potentially allowing interchangeable application code if switching between the lwIP BSD socket compatibility API and the real BSD stack port in eCos.

lwIP does not attempt to provide a cleanly delineated namespace for lwIP functions. This could make it difficult to port legacy code where there is a chance of conflicting names and symbols, both functions and data. Care is required here.

The serial-based SLIP and PPP protocols should be functional, however they have not been well tested, and so are not supported under the terms of incident support in eCosPro.

There is only convenient configuration for a single SLIP and/or PPP interface. Multiple interface support is planned for some future point.

IPv6 is considered experimental and is at a very early stage, and so is not included. Similarly SNMP support was very recently added to the lwIP code base, but while being promising, it is considered experimental and so is not included.

Prev | Home | Next
Quick Start | Up | Sequential API