Changeset b2eb48c in rtems-libbsd for testsuite/dhcpcd01/test_main.c


Ignore:
Timestamp:
May 2, 2018, 7:01:32 AM (14 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
eeb3fd5d9b07ac9a2e280cff60a1b762bd273a8d, 1e989998de954bef51e6c19cc3d64d39f32100aa
Children:
e1d62e8
Parents:
8bd38d6
git-author:
Sebastian Huber <sebastian.huber@…> (05/02/18 07:01:32)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/08/18 05:37:17)
Message:

dhcpcd: Add hooks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuite/dhcpcd01/test_main.c

    r8bd38d6 rb2eb48c  
    11/*
    2  * Copyright (c) 2013-2014 embedded brains GmbH.  All rights reserved.
     2 * Copyright (c) 2013, 2018 embedded brains GmbH.  All rights reserved.
    33 *
    44 *  embedded brains GmbH
     
    3131
    3232#include <assert.h>
     33#include <stdio.h>
    3334
    3435#include <rtems.h>
     36#include <rtems/dhcpcd.h>
    3537
    3638#define TEST_NAME "LIBBSD DHCPCD 1"
    3739
    3840static void
     41dhcpcd_hook_handler(rtems_dhcpcd_hook *hook, char *const *env)
     42{
     43
     44        (void)hook;
     45
     46        while (*env != NULL) {
     47                printf("%s\n", *env);
     48                ++env;
     49        }
     50}
     51
     52static rtems_dhcpcd_hook dhcpcd_hook = {
     53        .name = "test",
     54        .handler = dhcpcd_hook_handler
     55};
     56
     57static void
    3958test_main(void)
    4059{
     60
     61        rtems_dhcpcd_add_hook(&dhcpcd_hook);
     62
    4163        rtems_task_delete(RTEMS_SELF);
    4264        assert(0);
Note: See TracChangeset for help on using the changeset viewer.