2011-12-22 15:19:25 +00:00
|
|
|
/*
|
|
|
|
* \brief Genode-specific lwIP API
|
|
|
|
* \author Christian Helmuth
|
|
|
|
* \author Stefan Kalkowski
|
|
|
|
* \date 2010-02-22
|
|
|
|
*
|
|
|
|
* This header is included from C sources.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2017-02-20 12:23:52 +00:00
|
|
|
* Copyright (C) 2010-2017 Genode Labs GmbH
|
2011-12-22 15:19:25 +00:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
2017-02-20 12:23:52 +00:00
|
|
|
* under the terms of the GNU Affero General Public License version 3.
|
2011-12-22 15:19:25 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __LWIP__GENODE_H__
|
|
|
|
#define __LWIP__GENODE_H__
|
|
|
|
|
|
|
|
#include <base/fixed_stdint.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/** Initialize the TCP/IP stack */
|
|
|
|
void lwip_tcpip_init(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize lwIP for NIC session
|
|
|
|
*
|
|
|
|
* \param ip_addr IPv4 address in network byte order, or zero when requesting
|
|
|
|
* DHCP
|
|
|
|
* \param netmask IPv4 network mask in network byte order
|
|
|
|
* \param gateway IPv4 network-gateway address in network byte order
|
2013-09-23 13:58:45 +00:00
|
|
|
* \param tx_buf_size packet stream buffer size for TX direction
|
|
|
|
* \param rx_buf_size packet stream buffer size for RX direction
|
2011-12-22 15:19:25 +00:00
|
|
|
*
|
|
|
|
* \return 0 on success, or 1 if DHCP failed.
|
|
|
|
*
|
|
|
|
* This function initializes Genode's nic_drv and does optionally send DHCP
|
|
|
|
* requests.
|
|
|
|
*/
|
|
|
|
int lwip_nic_init(genode_int32_t ip_addr,
|
2013-09-23 13:58:45 +00:00
|
|
|
genode_int32_t netmask,
|
|
|
|
genode_int32_t gateway,
|
2016-09-15 12:40:37 +00:00
|
|
|
unsigned long tx_buf_size,
|
|
|
|
unsigned long rx_buf_size);
|
2011-12-22 15:19:25 +00:00
|
|
|
|
2015-03-12 19:23:05 +00:00
|
|
|
/**
|
|
|
|
* Pass on link-state changes to lwIP
|
|
|
|
*
|
|
|
|
* \param state current link-state
|
|
|
|
*/
|
|
|
|
void lwip_nic_link_state_changed(int state);
|
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* __LWIP__GENODE_H__ */
|