RPL: support for run-time selection of the OF. RPL_OF_OCP defines the OF to be advertised at the root, while RPL_SUPPORTED_OFS defines the set of supported OFs
This commit is contained in:
parent
c5cf8608e9
commit
cd76b4b1c2
4 changed files with 60 additions and 26 deletions
|
@ -45,12 +45,38 @@
|
|||
#define RPL_CONF_STATS 0
|
||||
#endif /* RPL_CONF_STATS */
|
||||
|
||||
/*
|
||||
* Select routing metric supported at runtime. This must be a valid
|
||||
* DAG Metric Container Object Type (see below). Currently, we only
|
||||
* support RPL_DAG_MC_ETX and RPL_DAG_MC_ENERGY.
|
||||
* When MRHOF (RFC6719) is used with ETX, no metric container must
|
||||
* be used; instead the rank carries ETX directly.
|
||||
/*
|
||||
* The objective function (OF) used by a RPL root is configurable through
|
||||
* the RPL_CONF_OF_OCP parameter. This is defined as the objective code
|
||||
* point (OCP) of the OF, RPL_OCP_OF0 or RPL_OCP_MRHOF. This flag is of
|
||||
* no relevance to non-root nodes, which run the OF advertised in the
|
||||
* instance they join.
|
||||
* Make sure the selected of is inRPL_SUPPORTED_OFS.
|
||||
*/
|
||||
#ifdef RPL_CONF_OF_OCP
|
||||
#define RPL_OF_OCP RPL_CONF_OF_OCP
|
||||
#else /* RPL_CONF_OF_OCP */
|
||||
#define RPL_OF_OCP RPL_OCP_MRHOF
|
||||
#endif /* RPL_CONF_OF_OCP */
|
||||
|
||||
/*
|
||||
* The set of objective functions supported at runtime. Nodes are only
|
||||
* able to join instances that advertise an OF in this set. To include
|
||||
* both OF0 and MRHOF, use {&rpl_of0, &rpl_mrhof}.
|
||||
*/
|
||||
#ifdef RPL_CONF_SUPPORTED_OFS
|
||||
#define RPL_SUPPORTED_OFS RPL_CONF_SUPPORTED_OFS
|
||||
#else /* RPL_CONF_SUPPORTED_OFS */
|
||||
#define RPL_SUPPORTED_OFS {&rpl_of0, &rpl_mrhof}
|
||||
#endif /* RPL_CONF_SUPPORTED_OFS */
|
||||
|
||||
/*
|
||||
* Enable/disable RPL Metric Containers (MC). The actual MC in use
|
||||
* for a given DODAG is decided at runtime, when joining. Note that
|
||||
* OF0 (RFC6552) operates without MC, and so does MRHOF (RFC6719) when
|
||||
* used with ETX as a metric (the rank is the metric). We disable MC
|
||||
* by default, but note it must be enabled to support joining a DODAG
|
||||
* that requires MC (e.g., MRHOF with a metric other than ETX).
|
||||
*/
|
||||
#ifdef RPL_CONF_WITH_MC
|
||||
#define RPL_WITH_MC RPL_CONF_WITH_MC
|
||||
|
@ -65,18 +91,6 @@
|
|||
#define RPL_DAG_MC RPL_DAG_MC_NONE
|
||||
#endif /* RPL_CONF_DAG_MC */
|
||||
|
||||
/*
|
||||
* The objective function used by RPL is configurable through the
|
||||
* RPL_CONF_OF parameter. This should be defined to be the name of an
|
||||
* rpl_of object linked into the system image, e.g., rpl_of0.
|
||||
*/
|
||||
#ifdef RPL_CONF_OF
|
||||
#define RPL_OF RPL_CONF_OF
|
||||
#else
|
||||
/* ETX is the default objective function. */
|
||||
#define RPL_OF rpl_mrhof
|
||||
#endif /* RPL_CONF_OF */
|
||||
|
||||
/* This value decides which DAG instance we should participate in by default. */
|
||||
#ifdef RPL_CONF_DEFAULT_INSTANCE
|
||||
#define RPL_DEFAULT_INSTANCE RPL_CONF_DEFAULT_INSTANCE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue