2015-02-06 19:03:35 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2015 Freie Universität Berlin
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2015-02-13 12:07:13 +01:00
|
|
|
* @defgroup net_ng_netconf Configuration options for network APIs
|
2015-02-06 19:03:35 +01:00
|
|
|
* @ingroup net
|
2015-02-13 12:07:13 +01:00
|
|
|
* @brief List of available configuration options for the
|
2015-02-13 12:40:14 +01:00
|
|
|
* @ref net_ng_netdev and the @ref net_ng_netapi
|
2015-02-06 19:03:35 +01:00
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
2015-02-13 12:07:13 +01:00
|
|
|
* @brief Definition of global configuration options
|
2015-02-06 19:03:35 +01:00
|
|
|
*
|
|
|
|
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef NG_NET_CONF_H_
|
|
|
|
#define NG_NET_CONF_H_
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Global list of configuration options available throughout the
|
|
|
|
* network stack, e.g. by netdev and netapi
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
NETCONF_OPT_CHANNEL, /**< get/set channel as uint16_t in host
|
2015-02-13 12:07:13 +01:00
|
|
|
* byte order */
|
2015-02-06 19:03:35 +01:00
|
|
|
NETCONF_OPT_IS_CHANNEL_CLR, /**< check if channel is clear */
|
2015-02-13 12:07:13 +01:00
|
|
|
NETCONF_OPT_ADDRESS, /**< get/set address in host byte order */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief get/set long address in host byte order
|
|
|
|
*
|
|
|
|
* Examples for this include the EUI-64 in IEEE 802.15.4
|
|
|
|
*/
|
|
|
|
NETCONF_OPT_ADDRESS_LONG,
|
2015-02-06 19:03:35 +01:00
|
|
|
NETCONF_OPT_ADDR_LEN, /**< get the default address length a
|
2015-02-13 12:07:13 +01:00
|
|
|
* network device expects as uint16_t in
|
|
|
|
* host byte order */
|
2015-03-11 21:06:01 +01:00
|
|
|
NETCONF_OPT_SRC_LEN, /**< get/set the address length to choose
|
|
|
|
* for the network device's source address
|
|
|
|
* as uint16_t in host byte order */
|
2015-02-13 12:07:13 +01:00
|
|
|
/**
|
|
|
|
* @brief get/set the network ID as uint16_t in host byte order
|
|
|
|
*
|
|
|
|
* Examples for this include the PAN ID in IEEE 802.15.4
|
|
|
|
*/
|
|
|
|
NETCONF_OPT_NID,
|
2015-02-06 19:03:35 +01:00
|
|
|
NETCONF_OPT_TX_POWER, /**< get/set the output power for radio
|
2015-02-13 12:07:13 +01:00
|
|
|
* devices in dBm as int16_t in host byte
|
|
|
|
* order */
|
2015-02-06 19:03:35 +01:00
|
|
|
NETCONF_OPT_MAX_PACKET_SIZE, /**< get/set the maximum packet size a
|
2015-02-13 12:07:13 +01:00
|
|
|
* network module can handle as uint16_t
|
|
|
|
* in host byte order */
|
|
|
|
/**
|
|
|
|
* @brief en/disable preloading or read the current state.
|
|
|
|
*
|
|
|
|
* Preload using ng_netdev_driver_t::send_data() or ng_netapi_send()
|
|
|
|
* respectively, send setting state to @ref NETCONF_STATE_TX
|
|
|
|
*/
|
|
|
|
NETCONF_OPT_PRELOADING,
|
2015-02-06 19:03:35 +01:00
|
|
|
NETCONF_OPT_PROMISCUOUSMODE, /**< en/disable promiscuous mode or read
|
2015-02-13 12:07:13 +01:00
|
|
|
* the current state */
|
2015-02-06 19:03:35 +01:00
|
|
|
NETCONF_OPT_AUTOACK, /**< en/disable link layer auto ACKs or read
|
2015-02-13 12:07:13 +01:00
|
|
|
* the current state */
|
2015-02-06 19:03:35 +01:00
|
|
|
NETCONF_OPT_PROTO, /**< get/set the protocol for the layer
|
2015-02-13 12:07:13 +01:00
|
|
|
* as type ng_nettype_t. */
|
2015-02-06 19:03:35 +01:00
|
|
|
NETCONF_OPT_STATE, /**< get/set the state of network devices as
|
2015-02-13 12:07:13 +01:00
|
|
|
* type ng_netconf_state_t */
|
2015-02-06 19:03:35 +01:00
|
|
|
/* add more options if needed */
|
|
|
|
} ng_netconf_opt_t;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Binary parameter for enabling and disabling options
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
NETCONF_DISABLE = 0, /**< disable a given option */
|
|
|
|
NETCONF_ENABLE = 1, /**< enable a given option */
|
|
|
|
} ng_netconf_enable_t;
|
|
|
|
|
|
|
|
/**
|
2015-02-13 12:07:13 +01:00
|
|
|
* @brief Option parameter to be used with @ref NETCONF_OPT_STATE to set or get
|
2015-02-06 19:03:35 +01:00
|
|
|
* the state of a network device or protocol implementation
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
NETCONF_STATE_OFF = 0, /**< powered off */
|
|
|
|
NETCONF_STATE_SLEEP, /**< sleep mode */
|
2015-02-12 14:39:17 +01:00
|
|
|
NETCONF_STATE_IDLE, /**< idle mode,
|
|
|
|
* the device listens to receive packets */
|
|
|
|
NETCONF_STATE_RX, /**< receive mode,
|
|
|
|
* the device currently receives a packet */
|
|
|
|
NETCONF_STATE_TX, /**< transmit mode,
|
|
|
|
* set: triggers transmission of a preloaded packet
|
|
|
|
* (see *NETCONF_OPT_PRELOADING*). The resulting
|
|
|
|
* state of the network device is *NETCONF_STATE_IDLE*
|
|
|
|
* get: the network device is in the process of
|
|
|
|
* transmitting a packet */
|
|
|
|
NETCONF_STATE_RESET, /**< triggers a hardware reset. The resulting
|
|
|
|
* state of the network device is *NETCONF_STATE_IDLE* */
|
2015-02-06 19:03:35 +01:00
|
|
|
/* add other states if needed */
|
|
|
|
} ng_netconf_state_t;
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* NG_NET_CONF_H_ */
|
|
|
|
/** @} */
|