Skip to content

Split RPL into core and mode related functions. #1167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 4, 2014

Conversation

fabratu
Copy link
Contributor

@fabratu fabratu commented May 14, 2014

With this PR rpl.c only contains the core RPL-functions, which include basic initialization, mutex-management, basic receiving of RPL-messages and calling mode specific functions. Each mode is now moved to its own .c/.h pair. In addition rpl.h finally got documentation.

Note: This PR does not include the by now not acknowledged PRs #1080 and #930. Therefore some code is marked as obsolete and will be altered on merge/rebase of the other PRs.

@OlegHahm OlegHahm added this to the Release NEXT MAJOR milestone May 16, 2014
@OlegHahm OlegHahm self-assigned this May 16, 2014
@fabratu
Copy link
Contributor Author

fabratu commented May 17, 2014

I guess this PR will have to wait until the BBQ? (no prob, just asking)

@OlegHahm
Copy link
Member

Yes, you're right.

@@ -0,0 +1,863 @@
/**
* RPL dodag implementation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RPL Storing mode impl?

@fabratu
Copy link
Contributor Author

fabratu commented May 31, 2014

Fixed.

@OlegHahm OlegHahm added the major label Jun 3, 2014
@mehlis
Copy link
Contributor

mehlis commented Jun 12, 2014

@FabianBrandt please rebase and squash together

@fabratu
Copy link
Contributor Author

fabratu commented Jun 12, 2014

Remind myself - never rebase on friday 13. Took some time - seems to be done.

@Kijewski
Copy link
Contributor

Well, never rebase at 1 o'clock in the morning … ;)

@mehlis
Copy link
Contributor

mehlis commented Jun 14, 2014

@FabianBrandt needs rebase again...

@fabratu
Copy link
Contributor Author

fabratu commented Jun 17, 2014

Successfully rebased and updated refs/heads/rpl_base_split.

@OlegHahm
Copy link
Member

Well, hm, seems to have been a very short-term success...

@Kijewski
Copy link
Contributor

@FabianBrandt, you forgot to push the rebased branch, didn't you? :)

@fabratu
Copy link
Contributor Author

fabratu commented Jun 18, 2014

Nope, pushed it ;) Maybe its about me and git. I will have a look.

Edit: found an error...

@Kijewski
Copy link
Contributor

After your comment

Successfully rebased and updated refs/heads/rpl_base_split.

there is no new commit.

@fabratu
Copy link
Contributor Author

fabratu commented Jun 18, 2014

There it is. Don´t really know what went wrong exactly. However I had to resolve a conflict, which is still stated in the commit but is not present anymore. From what I understand from git, this means, that there was a merge, which involved more than automatic resolving - which is not true actually.

@OlegHahm
Copy link
Member

Maybe rename rpl_sm.c to rpl_storing.c or rpl_mop2.c? I think the current name makes it hard to guess, what's in there.

@@ -31,155 +31,35 @@
#include "sixlowpan.h"
#include "net_help.h"

/* You can only run Storing Mode by now. Other unsupported modes lead to default (Storing Mode) */
#if RPL_DEFAULT_MOP == STORING_MODE_NO_MC
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

STORING_MODE_NO_MC is not defined, right?

I would propose to call it something like RPL_MOP_2 or RPL_STORING_MODE_NO_MC.

@OlegHahm
Copy link
Member

It's partly overlapping with #891, right? Could you review (and ack this) first?

@@ -10,12 +10,17 @@
* @defgroup net_rpl RPL
* @ingroup net
* @brief Routing Protocol for Low power and Lossy Networks
*
* Header which includes all core RPL-functions. This should not be modified if new modes or
* objective functions are implemented.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rephrase so something saying that it shouldn't be necessary to modify something in this file. Now, it sounds like: "Don't touch this file!".

/**
* @defgroup net_rpl RPL
* @ingroup net
* @brief Routing Protocol for Low power and Lossy Networks
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy and paste from rpl.h?

@OlegHahm
Copy link
Member

As far as I can see all function declarations in rpl_sm.h would be the same for all other modes (apart from documentation). Maybe move these declarations to something like rpl_mode.h?

@fabratu
Copy link
Contributor Author

fabratu commented Jun 18, 2014

That are really some comments ... I try to look into all of it until tomorrow.

@fabratu
Copy link
Contributor Author

fabratu commented Jun 18, 2014

As far as I can see all function declarations in rpl_sm.h would be the same for all other modes (apart from documentation)

@OlegHahm Depends - P2P should have other + there maybe some alterations in future. I would agree, that a certain amount of functions are common for storing/non-storing. Maybe thats a idea to split them into another file and future additions can than lead to a special rpl_[mode-name].h file.

@fabratu
Copy link
Contributor Author

fabratu commented Jun 18, 2014

Based on the comments I´ve done the following:

  • renaming of rpl_sm.* to rpl_storing.*
  • several spelling and date fixes
  • documentation fixes
  • added [in] and [out] for doxygen
  • global variables from rpl.c got rpl_ as prefix and their declaration moved to rpl.h
  • added functionality from net: some debug code #891 from rpl.c and rpl.h to their new homes in rpl.c, rpl.h and rpl_storing.c for easy merging after net: some debug code #891 gets acked.

What is not done:

Functions from rpl_storing.h former rpl_sm.h are not moved into a new common mode-headerfile because the initialization in rpl.c relies on different file names for different modes. Therefore it at least needs a rpl_storing.h-headerfile. However when moving all general functions this file would be empty and only lead to confusion. After implementation of non-storing mode is finished, I will look again into this.


mutex_lock(&rpl_send_mutex);
send_DIO_mode(destination);
mutex_unlock(&rpl_send_mutex);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could elaborate/document why these mutexes are necessary?

@mehlis
Copy link
Contributor

mehlis commented Jun 24, 2014

@FabianBrandt PR needs rebase

@fabratu
Copy link
Contributor Author

fabratu commented Jun 25, 2014

Fixed - suggestions inserted.

@mehlis
Copy link
Contributor

mehlis commented Jun 25, 2014

@OlegHahm can you elaborate , I think @FabianBrandt next steps are based on this PR...

@OlegHahm
Copy link
Member

Elaborate on what?

I would say ACK.

@OlegHahm OlegHahm assigned emmanuelsearch and unassigned OlegHahm Jun 25, 2014
@fabratu
Copy link
Contributor Author

fabratu commented Jun 27, 2014

Don´t ACK. I just recognized a problem with the buffers. I´m making a new commit this weekend.

@fabratu
Copy link
Contributor Author

fabratu commented Jul 2, 2014

Buffer issue fixed. If ACK, I will rebase/squash.

@OlegHahm
Copy link
Member

OlegHahm commented Jul 2, 2014

Can you rebase first?

@fabratu
Copy link
Contributor Author

fabratu commented Jul 2, 2014

Sure. Sorry wrong button -.-

@fabratu fabratu closed this Jul 2, 2014
@fabratu fabratu reopened this Jul 2, 2014
#include "sixlowpan.h"
#include "net_help.h"

#define ENABLE_DEBUG (1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug should be disabled by default.

@OlegHahm
Copy link
Member

OlegHahm commented Jul 2, 2014

Apart from the ENABLE_DEBUG setting: ACK - ready to be merged.

@fabratu
Copy link
Contributor Author

fabratu commented Jul 3, 2014

Of course this should be zero. Also packet_length is no more.

@OlegHahm
Copy link
Member

OlegHahm commented Jul 4, 2014

Then let's go!

OlegHahm added a commit that referenced this pull request Jul 4, 2014
Split RPL into core and mode related functions.
@OlegHahm OlegHahm merged commit 53f7bea into RIOT-OS:master Jul 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking Impact: major The PR changes a significant part of the code base. It should be reviewed carefully Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants