source: rtems/cpukit/libnetworking/rtems/rtems_dhcp_failsafe.h @ 2573e69

4.115
Last change on this file since 2573e69 was da10694, checked in by Peter Dufault <dufault@…>, on 12/24/14 at 03:14:50

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

  • Property mode set to 100644
File size: 1.9 KB
Line 
1/*
2  Description: Wrapper around DHCP client to restart it when the interface
3               moves to another network.
4
5  Authors: Arnout Vandecappelle <arnout@mind.be>, Essensium/Mind
6           Maarten Van Es <maarten@mind.be>, Essensium/Mind
7  (C) Septentrio 2008
8
9  The license and distribution terms for this file may be
10  found in the file LICENSE in this distribution or at
11  http://www.rtems.org/license/LICENSE.
12*/
13
14#ifndef _RTEMS_DHCP_FAILSAFE_H_
15#define _RTEMS_DHCP_FAILSAFE_H_
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21/* Default settings for the DHCP failsafe.  They can be overridden
22 * using rtems_bsdnet_dhcp_failsafe_config(); see that for descriptions.
23 */
24#ifndef RTEMS_DHCP_FAILSAFE_NETWORK_FAIL_TIMEOUT
25#define RTEMS_DHCP_FAILSAFE_NETWORK_FAIL_TIMEOUT 5
26#endif
27
28#ifndef RTEMS_DHCP_FAILSAFE_NETWORK_DOWN_TIME
29#define RTEMS_DHCP_FAILSAFE_NETWORK_DOWN_TIME 30
30#endif
31
32#ifndef RTEMS_DHCP_FAILSAFE_BROADCAST_DELAY
33#define RTEMS_DHCP_FAILSAFE_BROADCAST_DELAY 0
34#endif
35
36#ifndef RTEMS_DHCP_FAILSAFE_DHCP_MONITOR_PRIORITY
37#define RTEMS_DHCP_FAILSAFE_DHCP_MONITOR_PRIORITY 250
38#endif
39
40
41void rtems_bsdnet_do_dhcp_failsafe (void);
42
43/** Set the DHCP fallback options.  See the commentary at the top of the
44 * implementation.
45 @note Some of these options can be compile-time disabled - see the code.
46 */
47void rtems_bsdnet_dhcp_failsafe_config(
48  int network_fail_timeout, /**< The number of seconds before the interface is
49                              *  considered disconnected
50                              */
51  int network_down_time,    /**< The number of seconds the interface
52                              *  remains down.
53                              */
54  int broadcast_delay,      /**< The delay in seconds before broadcasts
55                              * are sent.
56                              */
57  int dhcp_monitor_priority /**< The monitor priority.*/
58);
59
60#ifdef __cplusplus
61}
62#endif
63
64#endif
Note: See TracBrowser for help on using the repository browser.