From b2eb48c23b86cb61504bb0324a94ea11df5653e8 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 2 May 2018 09:01:32 +0200 Subject: dhcpcd: Add hooks --- testsuite/dhcpcd01/test_main.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'testsuite') diff --git a/testsuite/dhcpcd01/test_main.c b/testsuite/dhcpcd01/test_main.c index 181f92ae..358b4ac8 100644 --- a/testsuite/dhcpcd01/test_main.c +++ b/testsuite/dhcpcd01/test_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014 embedded brains GmbH. All rights reserved. + * Copyright (c) 2013, 2018 embedded brains GmbH. All rights reserved. * * embedded brains GmbH * Dornierstr. 4 @@ -30,14 +30,36 @@ */ #include +#include #include +#include #define TEST_NAME "LIBBSD DHCPCD 1" +static void +dhcpcd_hook_handler(rtems_dhcpcd_hook *hook, char *const *env) +{ + + (void)hook; + + while (*env != NULL) { + printf("%s\n", *env); + ++env; + } +} + +static rtems_dhcpcd_hook dhcpcd_hook = { + .name = "test", + .handler = dhcpcd_hook_handler +}; + static void test_main(void) { + + rtems_dhcpcd_add_hook(&dhcpcd_hook); + rtems_task_delete(RTEMS_SELF); assert(0); } -- cgit v1.2.3