sys/shell/commands: add static qualifier where appropriate#18179
Merged
benpicco merged 3 commits intoRIOT-OS:masterfrom Jun 14, 2022
Merged
sys/shell/commands: add static qualifier where appropriate#18179benpicco merged 3 commits intoRIOT-OS:masterfrom
benpicco merged 3 commits intoRIOT-OS:masterfrom
Conversation
d7cabbc to
e7c58a5
Compare
Member
Author
|
I had to remove the @miri64: I think that something like this would allow diff --git a/tests/gnrc_dhcpv6_client/main.c b/tests/gnrc_dhcpv6_client/main.c
index 19741e5752..f51ae66328 100644
--- a/tests/gnrc_dhcpv6_client/main.c
+++ b/tests/gnrc_dhcpv6_client/main.c
@@ -20,13 +20,13 @@
#include <stddef.h>
#include "net/gnrc/netif.h"
+#include "net/gnrc/ipv6/nib.h"
#include "net/dhcpv6/client.h"
#include "net/sock.h"
#include "xtimer.h"
static char _dhcpv6_client_stack[DHCPV6_CLIENT_STACK_SIZE];
-extern int _gnrc_netif_config(int argc, char **argv);
extern int _gnrc_ipv6_nib(int argc, char **argv);
void *_dhcpv6_client_thread(void *args)
@@ -55,15 +55,25 @@ void *_dhcpv6_client_thread(void *args)
int main(void)
{
- char *pl[] = { "nib", "prefix" };
-
- _gnrc_netif_config(0, NULL);
+ /* print all IPv6 addresses */
+ printf("At start: {\"IPv6 addresses\": [\"");
+ netifs_print_ipv6("\", \"");
+ puts("\"]}");
thread_create(_dhcpv6_client_stack, DHCPV6_CLIENT_STACK_SIZE,
DHCPV6_CLIENT_PRIORITY, THREAD_CREATE_STACKTEST,
_dhcpv6_client_thread, NULL, "dhcpv6-client");
xtimer_sleep(5);
/* global address should now be configured */
- _gnrc_netif_config(0, NULL);
- _gnrc_ipv6_nib(2, pl);
+ printf("After 5 seconds: {\"IPv6 addresses\": [\"");
+ netifs_print_ipv6("\", \"");
+ puts("\"]}");
+ gnrc_ipv6_nib_nc_t entry;
+ void *state = NULL;
+ unsigned iface = 0U;
+
+ while (gnrc_ipv6_nib_nc_iter(iface, &state, &entry)) {
+ gnrc_ipv6_nib_nc_print(&entry);
+ }
+
return 0;
}But the python test script needs to be adapted as well. The test script doesn't run on my machine, so I would rather leave this to someone else. |
Rather than abusing _ps_handler() to call ps(), just call it directly.
e7c58a5 to
aed2117
Compare
To allow marking the shell command static, add a trivial _show_blockers() function that lists the current pm layered blocker state.
Due to the conversion to XFA based SHELL_COMMAND() much fewer function need to expose a symbol. Hence, spray `static` all over the place.
aed2117 to
4f769c2
Compare
Member
Author
|
All green. 9b0cf39 got added post ACK |
benpicco
approved these changes
Jun 14, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contribution description
Due to the conversion to XFA based
SHELL_COMMAND()much fewer function need to expose a symbol. Hence, spraystaticall over the place.Testing procedure
One could search for missing
staticusing this regex:Murdock will check that I didn't add a
staticwhere it shouldn't be.Issues/PRs references
Follow up to #18152