2016-11-12 06:13:24 +08:00
|
|
|
/** @file
|
|
|
|
* @brief DHCPv4 Client Handler
|
|
|
|
*/
|
|
|
|
|
2016-09-12 22:12:47 +08:00
|
|
|
/*
|
2016-11-12 06:13:24 +08:00
|
|
|
* Copyright (c) 2016 Intel Corporation
|
2016-09-12 22:12:47 +08:00
|
|
|
*
|
2017-01-19 09:01:01 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2016-09-12 22:12:47 +08:00
|
|
|
*/
|
|
|
|
|
2016-11-12 06:13:24 +08:00
|
|
|
#ifndef __DHCPV4_H
|
|
|
|
#define __DHCPV4_H
|
|
|
|
|
2017-07-24 21:23:14 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2017-01-06 21:10:06 +08:00
|
|
|
/**
|
|
|
|
* @brief DHCPv4
|
|
|
|
* @defgroup dhcpv4 DHCPv4
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2016-11-12 06:13:24 +08:00
|
|
|
#include <misc/slist.h>
|
Introduce new sized integer typedefs
This is a start to move away from the C99 {u}int{8,16,32,64}_t types to
Zephyr defined u{8,16,32,64}_t and s{8,16,32,64}_t. This allows Zephyr
to define the sized types in a consistent manor across all the
architectures we support and not conflict with what various compilers
and libc might do with regards to the C99 types.
We introduce <zephyr/types.h> as part of this and have it include
<stdint.h> for now until we transition all the code away from the C99
types.
We go with u{8,16,32,64}_t and s{8,16,32,64}_t as there are some
existing variables defined u8 & u16 as well as to be consistent with
Zephyr naming conventions.
Jira: ZEP-2051
Change-Id: I451fed0623b029d65866622e478225dfab2c0ca8
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-19 23:32:08 +08:00
|
|
|
#include <zephyr/types.h>
|
2016-11-12 06:13:24 +08:00
|
|
|
|
2016-12-22 04:36:13 +08:00
|
|
|
/** Current state of DHCPv4 client address negotiation.
|
|
|
|
*
|
|
|
|
* Additions removals and reorders in this definition must be
|
|
|
|
* reflected within corresponding changes to net_dhcpv4_state_name.
|
|
|
|
*/
|
2016-11-12 06:13:24 +08:00
|
|
|
enum net_dhcpv4_state {
|
2017-02-12 01:45:17 +08:00
|
|
|
NET_DHCPV4_DISABLED,
|
2016-11-12 06:13:24 +08:00
|
|
|
NET_DHCPV4_INIT,
|
2017-02-12 00:40:34 +08:00
|
|
|
NET_DHCPV4_SELECTING,
|
|
|
|
NET_DHCPV4_REQUESTING,
|
|
|
|
NET_DHCPV4_RENEWING,
|
2017-02-11 20:16:04 +08:00
|
|
|
NET_DHCPV4_REBINDING,
|
2017-02-12 00:40:34 +08:00
|
|
|
NET_DHCPV4_BOUND,
|
2016-11-12 06:13:24 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2017-02-12 01:45:17 +08:00
|
|
|
* @brief Start DHCPv4 client on an iface
|
2016-11-12 06:13:24 +08:00
|
|
|
*
|
|
|
|
* @details Start DHCPv4 client on a given interface. DHCPv4 client
|
|
|
|
* will start negotiation for IPv4 address. Once the negotiation is
|
|
|
|
* success IPv4 address details will be added to interface.
|
|
|
|
*
|
|
|
|
* @param iface A valid pointer on an interface
|
|
|
|
*/
|
|
|
|
void net_dhcpv4_start(struct net_if *iface);
|
|
|
|
|
2017-02-12 01:45:17 +08:00
|
|
|
/**
|
|
|
|
* @brief Stop DHCPv4 client on an iface
|
|
|
|
*
|
|
|
|
* @details Stop DHCPv4 client on a given interface. DHCPv4 client
|
|
|
|
* will remove all configuration obtained from a DHCP server from the
|
|
|
|
* interface and stop any further negotiation with the server.
|
|
|
|
*
|
|
|
|
* @param iface A valid pointer on an interface
|
|
|
|
*/
|
|
|
|
void net_dhcpv4_stop(struct net_if *iface);
|
|
|
|
|
2017-02-12 00:46:23 +08:00
|
|
|
/**
|
|
|
|
* @brief DHCPv4 state name
|
|
|
|
*
|
|
|
|
* @internal
|
|
|
|
*/
|
|
|
|
const char *net_dhcpv4_state_name(enum net_dhcpv4_state state);
|
|
|
|
|
2017-01-06 21:10:06 +08:00
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
2017-07-24 21:23:14 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2016-11-12 06:13:24 +08:00
|
|
|
#endif /* __DHCPV4_H */
|