#ifndef _aplmt_networking_lwip_etherifapi_h_
#define _aplmt_networking_lwip_etherifapi_h_
/*----------------------------------------------------------------------------
** SUMMARY: APLMT Ethernet Network Interface for LWIP  (LWIPETHER)
**
** DESCRIPTION:
**  This file defines the network interface for ethernet network adapters.
**  See the ./startapi.h header file for example on how to use this interface
**  when adding network interface(s) to lwIP.
**
**  LOW-LEVEL ETHERNET DRIVER
**  -------------------------
**  The low-level, platform specific device driver is specified by the
**  the struct AplmtLwipEtherDev. Each driver is required to extended the
**  the AplmtLwipEtherDev structure with any additional information it 
**  needs and to implement three methods: deviceInit, deviceInput, and 
**  deviceOutput.  
**
**  See src/aplmt/hardware/unix/tapdev/lwip/ethdev.h for an example.
**  
**      
** CONFIGURATION 
** -------------
**  COMPILE:      none.
**
**  APPLICATION:  none.
**
**  PLATFORM:     See your platform documentation.
**
**
**  NOTES:
**  1. Unless explicitly stated otherwise, NONE of the following methods may be 
**     called from interrupt service routines.
**  2. Unless explicitly stated otherwise, NONE of the following methods may be 
**     called before the platform's kernel is running.
**  3. Unless explicitly stated otherwise, all of the following methods assume
**     that interrupts are enabled at the time of the call.
----------------------------------------------------------------------------*/


#include "lwip/opt.h"
#include "lwip/ip.h"
#include "lwip/ip_addr.h"   
#include "lwip/sys.h"
#include "lwip/netif.h"
#include "lwip/tcpip.h"
#include "netif/etharp.h"
#include "apl/types/types.h"            /* For: basic types */


#ifdef __cplusplus
extern "C" {
#endif


/*-------------- TYPES -----------------------------------------------------*/
/** This is a device-less Ethernet Network Adapater descriptor structure.
    Every Ethernet Adapter has the following structure.  In addition, every
    adapter may extended the structure with platform/hardware specific
    fields as long as they are APPENDED to this structure.
 */
struct AplmtLwipEtherDev
    {
    void           (* _devInit)  (struct netif*);
    err_t          (* _devOutput)(struct netif*, struct pbuf*);
    struct pbuf *  (* _devInput) (struct AplmtLwipEtherDev*);
    struct eth_addr*  _ethaddrInit;
    };


/*-------------- INLINE IMPLEMENTATION -------------------------------------*/
#include "platform/etherifapi.h"        /* For: platform specific support */


/*-------------- PUBLIC/PUBLISHED API --------------------------------------*/
/** This method is called by lwIP everytime a ethernet network adapter is
    added via netif_add().  The application uses this funciton as the 'init'
    function (6th arg) to netif_add().
 */
err_t AplmtLWIP_etherifInit( struct netif* netif );

/** This method starts the RX-Input processes for the specified network
    interface.
 */
void AplmtLWIP_cbEtherifInput( struct netif* netif );



#ifdef __cplusplus
}
#endif
/*--------------------------------------------------------------------------*/
#endif  /* end _aplmt_networking_lwip_etherifapi_h_ */

