Cleaning old .h :
- Delete unimplemented function and unused structures - Remove misleading configuration options - Transfer some comments from 6lowmac to framer-802154 (doc/uip6-doc.txt should be cleaned as well)
This commit is contained in:
parent
c699ccbe30
commit
b0907f0344
4 changed files with 67 additions and 240 deletions
|
@ -54,9 +54,24 @@
|
|||
#define PRINTADDR(addr)
|
||||
#endif
|
||||
|
||||
/** \brief The sequence number (0x00 - 0xff) added to the transmitted
|
||||
* data or MAC command frame. The default is a random value within
|
||||
* the range.
|
||||
*/
|
||||
static uint8_t mac_dsn;
|
||||
|
||||
static uint8_t initialized = 0;
|
||||
|
||||
/** \brief The 16-bit identifier of the PAN on which the device is
|
||||
* sending to. If this value is 0xffff, the device is not
|
||||
* associated.
|
||||
*/
|
||||
static const uint16_t mac_dst_pan_id = IEEE802154_PANID;
|
||||
|
||||
/** \brief The 16-bit identifier of the PAN on which the device is
|
||||
* operating. If this value is 0xffff, the device is not
|
||||
* associated.
|
||||
*/
|
||||
static const uint16_t mac_src_pan_id = IEEE802154_PANID;
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
@ -477,9 +477,9 @@ eventhandler(process_event_t ev, process_data_t data)
|
|||
* check the different timers for neighbor discovery and
|
||||
* stateless autoconfiguration
|
||||
*/
|
||||
/*if(data == &uip_nd6_timer_periodic &&
|
||||
etimer_expired(&uip_nd6_timer_periodic)) {
|
||||
uip_nd6_periodic();
|
||||
/*if(data == &uip_ds6_timer_periodic &&
|
||||
etimer_expired(&uip_ds6_timer_periodic)) {
|
||||
uip_ds6_periodic();
|
||||
tcpip_ipv6_output();
|
||||
}*/
|
||||
#if !UIP_CONF_ROUTER
|
||||
|
|
|
@ -59,23 +59,6 @@
|
|||
|
||||
#define UIP_ND6_DEF_MAXDADNS 1
|
||||
|
||||
/** \name Configuration options */
|
||||
/** @{ */
|
||||
#ifndef UIP_CONF_ND6_MAX_NEIGHBORS
|
||||
/** \brief max number of entries in the neighbor cache */
|
||||
#define UIP_CONF_ND6_MAX_NEIGHBORS 4
|
||||
#endif /*UIP_CONF_ND6_MAX_NEIGHBORS*/
|
||||
#ifndef UIP_CONF_ND6_MAX_DEFROUTERS
|
||||
/** \brief max number of entries in the default router cache */
|
||||
#define UIP_CONF_ND6_MAX_DEFROUTERS 2
|
||||
#endif /*UIP_CONF_ND6_MAX_DEFROUTERS*/
|
||||
#ifndef UIP_CONF_ND6_MAX_PREFIXES
|
||||
/** \brief max number of entries in the prefix list */
|
||||
#define UIP_CONF_ND6_MAX_PREFIXES 2
|
||||
#endif /*UIP_CONF_ND6_MAX_PREFIXES*/
|
||||
/** @} */
|
||||
|
||||
|
||||
/** \name RFC 4861 Host constant */
|
||||
/** @{ */
|
||||
#define UIP_ND6_MAX_RTR_SOLICITATION_DELAY 1
|
||||
|
@ -183,81 +166,6 @@
|
|||
#define UIP_ND6_RA_FLAG_AUTONOMOUS 0x40
|
||||
/** @} */
|
||||
|
||||
|
||||
/**
|
||||
* \brief Possible states for the neighbor cache entries
|
||||
*
|
||||
* NO_STATE is for implementation purposes: a router entry contains a pointer
|
||||
* to a neighbor entry, which holds its ip address. If we do not know the LL
|
||||
* address of the router, we do not have to create a neighbor entry as per
|
||||
* RFC 4861. However, we still need to have the IP of the router stored in a
|
||||
* neighbor entry, hence we create an entry in the NO_STATE state
|
||||
*/
|
||||
typedef enum {
|
||||
INCOMPLETE = 0,
|
||||
REACHABLE = 1,
|
||||
STALE = 2,
|
||||
DELAY = 3,
|
||||
PROBE = 4,
|
||||
NO_STATE = 5
|
||||
} uip_neighbor_state;
|
||||
|
||||
/**
|
||||
* \name ND structures
|
||||
* @{
|
||||
*/
|
||||
/** \brief An entry in the neighbor cache */
|
||||
struct uip_nd6_neighbor {
|
||||
uip_ipaddr_t ipaddr;
|
||||
uip_lladdr_t lladdr;
|
||||
u8_t isrouter;
|
||||
uip_neighbor_state state;
|
||||
struct stimer reachable;
|
||||
struct stimer last_send; /**< last time a ND message was sent */
|
||||
u8_t count_send; /**< how many ND message were already sent */
|
||||
u8_t used; /**< brief is this neighbor currently used */
|
||||
#if UIP_CONF_IPV6_QUEUE_PKT
|
||||
u8_t queue_buf[UIP_BUFSIZE - UIP_LLH_LEN];
|
||||
/**< buffer to hold one packet during address resolution */
|
||||
u8_t queue_buf_len;
|
||||
/**< length of the pkt in buffer, used as "boolean" as well*/
|
||||
#endif /*UIP_CONF_QUEUE_PKT*/
|
||||
};
|
||||
|
||||
|
||||
/** \brief An entry in the default router list */
|
||||
struct uip_nd6_defrouter {
|
||||
struct uip_nd6_neighbor *nb;
|
||||
struct stimer lifetime;
|
||||
/**< the lifetime contained in RA corresponds to the interval field
|
||||
* of the timer
|
||||
*/
|
||||
u8_t used; /**< Is this default router entry currently used */
|
||||
};
|
||||
|
||||
/** \brief A prefix list entry */
|
||||
struct uip_nd6_prefix {
|
||||
uip_ipaddr_t ipaddr;
|
||||
u8_t length;
|
||||
/**< we do not use preferred lifetime, which is always smaller than
|
||||
* valid lifetime (for addr, preferred->deprecated)
|
||||
*/
|
||||
struct stimer vlifetime;
|
||||
u8_t is_infinite; /**< Is the prefix lifetime INFINITE */
|
||||
u8_t used; /**< Is this prefix entry currently used */
|
||||
};
|
||||
/** @} */
|
||||
|
||||
extern struct etimer uip_nd6_timer_periodic;
|
||||
|
||||
/**
|
||||
* \note
|
||||
* We do not use a destination cache, do next-hop determination each time
|
||||
* a packet needs to be sent. (info such as rtt, path mtu could be stored
|
||||
* in uip_conn)
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* \name ND message structures
|
||||
* @{
|
||||
|
@ -357,102 +265,6 @@ typedef struct uip_nd6_opt_redirected_hdr {
|
|||
} uip_nd6_opt_redirected_hdr;
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* \name ND Neighbor Cache, Router List and Prefix List handling functions
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* \brief Initialize Neighbor Discovery structures
|
||||
*/
|
||||
void uip_nd6_init(void);
|
||||
|
||||
/**
|
||||
* \brief Periodic processing of Neighbor Discovery Structures
|
||||
*/
|
||||
void uip_nd6_periodic(void);
|
||||
|
||||
/**
|
||||
* \brief Look for a neighbor cache entry corresponding to a specific IP
|
||||
* address
|
||||
* \param ipaddr the specific IP address
|
||||
* \return the corresponding neighbor cache entry
|
||||
*/
|
||||
struct uip_nd6_neighbor *uip_nd6_nbrcache_lookup(uip_ipaddr_t *ipaddr);
|
||||
|
||||
/**
|
||||
* \brief Add a neighbor cache entry
|
||||
* \param ipaddr the IP address of the entry
|
||||
* \param lladdr the layer 2 address of the entry
|
||||
* \param isrouter true is the entry is a router
|
||||
* \param state the state of the entry
|
||||
* \return the new neighbor or updated cache entry
|
||||
*/
|
||||
struct uip_nd6_neighbor * uip_nd6_nbrcache_add(uip_ipaddr_t *ipaddr,
|
||||
uip_lladdr_t *lladdr,
|
||||
u8_t isrouter,
|
||||
uip_neighbor_state state);
|
||||
/**
|
||||
* \brief Returns a default router
|
||||
*/
|
||||
struct uip_nd6_defrouter * uip_nd6_choose_defrouter(void);
|
||||
|
||||
/**
|
||||
* \brief Find a default router corresponding to a given neighbor cache entry
|
||||
* \param neighbor the neighbor cache entry
|
||||
* \return the corresponding router if any
|
||||
*/
|
||||
struct uip_nd6_defrouter *
|
||||
uip_nd6_defrouter_lookup(struct uip_nd6_neighbor *neighbor);
|
||||
|
||||
/**
|
||||
* \brief Remove a default router
|
||||
* \param router to be removed
|
||||
*/
|
||||
void uip_nd6_defrouter_rm(struct uip_nd6_defrouter *router);
|
||||
|
||||
/**
|
||||
* \brief Add a default router
|
||||
* \param neighbor the corresponding neighbor cache entry
|
||||
* \param interval the lifetime of the router
|
||||
* \return the new or updated defrouter entry
|
||||
*/
|
||||
struct uip_nd6_defrouter *
|
||||
uip_nd6_defrouter_add(struct uip_nd6_neighbor *neighbor, unsigned long interval);
|
||||
|
||||
/**
|
||||
* \brief Check if an IP address in on-link by looking at prefix list
|
||||
* \param ipaddr an IP address
|
||||
* \return true if on-link
|
||||
*/
|
||||
u8_t uip_nd6_is_addr_onlink(uip_ipaddr_t *ipaddr);
|
||||
|
||||
/**
|
||||
* \brief Find a given prefix
|
||||
* \param ipaddr an IP address
|
||||
* \return the corresponding prefix if any
|
||||
*/
|
||||
struct uip_nd6_prefix *
|
||||
uip_nd6_prefix_lookup(uip_ipaddr_t *ipaddr);
|
||||
|
||||
/**
|
||||
* \brief Add a prefix
|
||||
* \param ipaddr the IP address of the prefix
|
||||
* \param length the length of the prefix
|
||||
* \param interval the lifetime of the prefix
|
||||
* \return the new or updated prefix entry
|
||||
*/
|
||||
struct uip_nd6_prefix *
|
||||
uip_nd6_prefix_add(uip_ipaddr_t *ipaddr, u8_t length, unsigned long interval);
|
||||
|
||||
/**
|
||||
* \brief Remove a prefix from th eprefix list
|
||||
* \param prefix pointer to the prefix to be removed
|
||||
*/
|
||||
void
|
||||
uip_nd6_prefix_rm(struct uip_nd6_prefix *prefix);
|
||||
/** @} */
|
||||
|
||||
|
||||
/**
|
||||
* \name ND Messages Processing and Generation
|
||||
* @{
|
||||
|
|
|
@ -209,19 +209,19 @@
|
|||
#define UIP_CONF_NETIF_MAX_ADDRESSES 3
|
||||
#endif
|
||||
|
||||
#ifndef UIP_CONF_ND6_MAX_PREFIXES
|
||||
#ifndef UIP_CONF_DS6_PREFIX_NBU
|
||||
/** Default number of IPv6 prefixes associated to the node's interface */
|
||||
#define UIP_CONF_ND6_MAX_PREFIXES 3
|
||||
#define UIP_CONF_DS6_PREFIX_NBU 2
|
||||
#endif
|
||||
|
||||
#ifndef UIP_CONF_ND6_MAX_NEIGHBORS
|
||||
#ifndef UIP_CONF_DS6_NBR_NBU
|
||||
/** Default number of neighbors that can be stored in the %neighbor cache */
|
||||
#define UIP_CONF_ND6_MAX_NEIGHBORS 4
|
||||
#define UIP_CONF_DS6_NBR_NBU 4
|
||||
#endif
|
||||
|
||||
#ifndef UIP_CONF_ND6_MAX_DEFROUTERS
|
||||
#ifndef UIP_CONF_DS6_DEFRT_NBU
|
||||
/** Minimum number of default routers */
|
||||
#define UIP_CONF_ND6_MAX_DEFROUTERS 2
|
||||
#define UIP_CONF_DS6_DEFRT_NBU 2
|
||||
#endif
|
||||
/** @} */
|
||||
|
||||
|
|
Loading…
Reference in a new issue