diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-05-02 09:01:32 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-05-08 07:37:17 +0200 |
commit | b2eb48c23b86cb61504bb0324a94ea11df5653e8 (patch) | |
tree | 4c293be7b280f369f72c7250fd73902d8bc65a79 /rtemsbsd/include/rtems | |
parent | dhcpcd: Add rtems_dhcpcd_start() (diff) | |
download | rtems-libbsd-b2eb48c23b86cb61504bb0324a94ea11df5653e8.tar.bz2 |
dhcpcd: Add hooks
Diffstat (limited to 'rtemsbsd/include/rtems')
-rw-r--r-- | rtemsbsd/include/rtems/dhcpcd.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/rtemsbsd/include/rtems/dhcpcd.h b/rtemsbsd/include/rtems/dhcpcd.h index 324c8a90..da4972d4 100644 --- a/rtemsbsd/include/rtems/dhcpcd.h +++ b/rtemsbsd/include/rtems/dhcpcd.h @@ -40,6 +40,9 @@ #ifndef _RTEMS_DHCPCD_H_ #define _RTEMS_DHCPCD_H_ +#include <sys/cdefs.h> +#include <sys/queue.h> + #include <rtems.h> #ifdef __cplusplus @@ -75,6 +78,29 @@ typedef struct rtems_dhcpcd_config { */ rtems_status_code rtems_dhcpcd_start(const rtems_dhcpcd_config *config); +typedef struct rtems_dhcpcd_hook { + SLIST_ENTRY(rtems_dhcpcd_hook) node; + const char *name; + void (*handler)(struct rtems_dhcpcd_hook *hook, char *const *env); +} rtems_dhcpcd_hook; + +/** + * @brief Adds a DHCP client hook. + * + * The hook handler is invoked with an environment list (NULL terminated) of + * strings ('\0' terminated). Each string of the environment list has usually + * the format "key=value", e.g. "interface=eth0", "reason=BOUND". + * + * The hook handler are called by the DHCP client task. It is safe to + * add/remove hooks in the hook handler. + */ +void rtems_dhcpcd_add_hook(rtems_dhcpcd_hook *hook); + +/** + * @brief Removes a DHCP client hook. + */ +void rtems_dhcpcd_remove_hook(rtems_dhcpcd_hook *hook); + /** @} */ #ifdef __cplusplus |