[riot-notifications] [RIOT-OS/RIOT] RPL: API update suggestions (#11560)

benpicco notifications at github.com
Tue May 28 15:07:45 CEST 2019


benpicco commented on this pull request.



> @@ -259,8 +259,17 @@ struct gnrc_rpl_parent {
  */
 typedef struct {
     uint16_t ocp;   /**< objective code point */
-    uint16_t (*calc_rank)(gnrc_rpl_parent_t *parent, uint16_t base_rank); /**< calculate the rank */
-    gnrc_rpl_parent_t *(*which_parent)(gnrc_rpl_parent_t *, gnrc_rpl_parent_t *); /**< retrieve the better parent */
+
+    /**
+     * @brief Calculate the rank of this node.
+     *
+     * @param[in]   dodag       RPL DODAG to calculate rank from.
+     * @param[in]   base_rank   BASE_RANK parameter as in rfc6550
+     *
+     * @return      RPL Rank of this node.
+     * @return      GNRC_RPL_INFINITE_RANK, if no rank calculation is possible.
+     */
+    uint16_t (*calc_rank)(gnrc_rpl_dodag_t *dodag, uint16_t base_rank);

I think the idea was that now that #7468 is merged, dodag->parent already points to the preferred parent. (And RPL calls `calc_rank(dodag->parents, 0);`).

The OF Implementations only make use of `parent->dodag`, the special case in https://github.com/RIOT-OS/RIOT/blob/d18ca58905a6a493cb790aa025116f167929d297/sys/net/gnrc/routing/rpl/mrhof.c#L210 where `parent` is used directly should be obsolete now with  #7468.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11560#discussion_r288093442
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190528/66074303/attachment.html>


More information about the notifications mailing list