diff options
author | Peter Dufault <dufault@hda.com> | 2014-12-23 22:14:50 -0500 |
---|---|---|
committer | Gedare Bloom <gedare@rtems.org> | 2014-12-23 22:14:50 -0500 |
commit | da10694a489a51534ba189417defbea4162cfd8f (patch) | |
tree | 53ad024101d22ca0523c6428af8bc518b4814b66 /cpukit/libnetworking/rtems/rtems_dhcp_failsafe.h | |
parent | doc: add some red-black tree documentation (diff) | |
download | rtems-da10694a489a51534ba189417defbea4162cfd8f.tar.bz2 |
libnetworking: Make rtems_dhcp_failsafe() run time configurable
rtems_dhcp_failsafe() can be configured at compile time with
various options. This change makes it possible to instead configure
it at runtime.
This will make it marginally larger. I haven't measured the difference
but I'll guess it's in the lower hundreds of bytes. The change could be
modified to leave it either compile time or run time configurable,
I prefer the simplicity of a single method.
closes #1905
Diffstat (limited to '')
-rw-r--r-- | cpukit/libnetworking/rtems/rtems_dhcp_failsafe.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/cpukit/libnetworking/rtems/rtems_dhcp_failsafe.h b/cpukit/libnetworking/rtems/rtems_dhcp_failsafe.h index 7ed131aa77..3c5a59fcb0 100644 --- a/cpukit/libnetworking/rtems/rtems_dhcp_failsafe.h +++ b/cpukit/libnetworking/rtems/rtems_dhcp_failsafe.h @@ -18,8 +18,45 @@ extern "C" { #endif +/* Default settings for the DHCP failsafe. They can be overridden + * using rtems_bsdnet_dhcp_failsafe_config(); see that for descriptions. + */ +#ifndef RTEMS_DHCP_FAILSAFE_NETWORK_FAIL_TIMEOUT +#define RTEMS_DHCP_FAILSAFE_NETWORK_FAIL_TIMEOUT 5 +#endif + +#ifndef RTEMS_DHCP_FAILSAFE_NETWORK_DOWN_TIME +#define RTEMS_DHCP_FAILSAFE_NETWORK_DOWN_TIME 30 +#endif + +#ifndef RTEMS_DHCP_FAILSAFE_BROADCAST_DELAY +#define RTEMS_DHCP_FAILSAFE_BROADCAST_DELAY 0 +#endif + +#ifndef RTEMS_DHCP_FAILSAFE_DHCP_MONITOR_PRIORITY +#define RTEMS_DHCP_FAILSAFE_DHCP_MONITOR_PRIORITY 250 +#endif + + void rtems_bsdnet_do_dhcp_failsafe (void); +/** Set the DHCP fallback options. See the commentary at the top of the + * implementation. + @note Some of these options can be compile-time disabled - see the code. + */ +void rtems_bsdnet_dhcp_failsafe_config( + int network_fail_timeout, /**< The number of seconds before the interface is + * considered disconnected + */ + int network_down_time, /**< The number of seconds the interface + * remains down. + */ + int broadcast_delay, /**< The delay in seconds before broadcasts + * are sent. + */ + int dhcp_monitor_priority /**< The monitor priority.*/ +); + #ifdef __cplusplus } #endif |