zephyr/include/net/dhcpv4.h
Kumar Gala 789081673f 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-20 16:07:08 +00:00

72 lines
1.5 KiB
C

/** @file
* @brief DHCPv4 Client Handler
*/
/*
* Copyright (c) 2016 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef __DHCPV4_H
#define __DHCPV4_H
/**
* @brief DHCPv4
* @defgroup dhcpv4 DHCPv4
* @{
*/
#include <misc/slist.h>
#include <zephyr/types.h>
/** 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.
*/
enum net_dhcpv4_state {
NET_DHCPV4_DISABLED,
NET_DHCPV4_INIT,
NET_DHCPV4_SELECTING,
NET_DHCPV4_REQUESTING,
NET_DHCPV4_RENEWING,
NET_DHCPV4_REBINDING,
NET_DHCPV4_BOUND,
};
/**
* @brief Start DHCPv4 client on an iface
*
* @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);
/**
* @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);
/**
* @brief DHCPv4 state name
*
* @internal
*/
const char *net_dhcpv4_state_name(enum net_dhcpv4_state state);
/**
* @}
*/
#endif /* __DHCPV4_H */