Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
dhcp_server.h File Reference
DHCP server (Dynamic Host Configuration Protocol) More...
Go to the source code of this file.
Data Structures | |
| struct | DhcpServerBinding |
| DHCP binding. More... | |
| struct | DhcpServerSettings |
| DHCP server settings. More... | |
| struct | DhcpServerContext |
| DHCP server context. More... | |
Functions | |
| void | dhcpServerGetDefaultSettings (DhcpServerSettings *settings) |
| Initialize settings with default values. | |
| error_t | dhcpServerInit (DhcpServerContext *context, const DhcpServerSettings *settings) |
| DHCP server initialization. | |
| error_t | dhcpServerStart (DhcpServerContext *context) |
| Start DHCP server. | |
| error_t | dhcpServerStop (DhcpServerContext *context) |
| Stop DHCP server. | |
| void | dhcpServerTick (DhcpServerContext *context) |
| DHCP server timer handler. | |
| void | dhcpServerProcessMessage (NetInterface *interface, const IpPseudoHeader *pseudoHeader, const UdpHeader *udpHeader, const NetBuffer *buffer, size_t offset, void *params) |
| Process incoming DHCP message. | |
| void | dhcpServerParseDiscover (DhcpServerContext *context, const DhcpMessage *message, size_t length) |
| Parse DHCPDISCOVER message. | |
| void | dhcpServerParseRequest (DhcpServerContext *context, const DhcpMessage *message, size_t length) |
| Parse DHCPREQUEST message. | |
| void | dhcpServerParseDecline (DhcpServerContext *context, const DhcpMessage *message, size_t length) |
| Parse DHCPDECLINE message. | |
| void | dhcpServerParseRelease (DhcpServerContext *context, const DhcpMessage *message, size_t length) |
| Parse DHCPRELEASE message. | |
| void | dhcpServerParseInform (DhcpServerContext *context, const DhcpMessage *message, size_t length) |
| Parse DHCPINFORM message. | |
| error_t | dhcpServerSendReply (DhcpServerContext *context, uint8_t type, Ipv4Addr yourIpAddr, const DhcpMessage *request, size_t length) |
| Send DHCP reply message. | |
| DhcpServerBinding * | dhcpServerCreateBinding (DhcpServerContext *context) |
| Create a new binding. | |
| DhcpServerBinding * | dhcpServerFindBindingByMacAddr (DhcpServerContext *context, const MacAddr *macAddr) |
| Search the list of bindings for a given MAC address. | |
| DhcpServerBinding * | dhcpServerFindBindingByIpAddr (DhcpServerContext *context, Ipv4Addr ipAddr) |
| Search the list of bindings for a given IP address. | |
| error_t | dhcpServerGetNextIpAddr (DhcpServerContext *context, Ipv4Addr *ipAddr) |
| Retrieve the next IP address to be used. | |
Detailed Description
DHCP server (Dynamic Host Configuration Protocol)
License
Copyright (C) 2010-2017 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneTCP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version:
- 1.7.6
Definition in file dhcp_server.h.
Function Documentation
| DhcpServerBinding* dhcpServerCreateBinding | ( | DhcpServerContext * | context ) |
Create a new binding.
- Parameters:
-
[in] context Pointer to the DHCP server context
- Returns:
- Pointer to the newly created binding
Definition at line 864 of file dhcp_server.c.
| DhcpServerBinding* dhcpServerFindBindingByIpAddr | ( | DhcpServerContext * | context, |
| Ipv4Addr | ipAddr | ||
| ) |
Search the list of bindings for a given IP address.
- Parameters:
-
[in] context Pointer to the DHCP server context [in] ipAddr IP address
- Returns:
- Pointer to the corresponding DHCP binding
Definition at line 961 of file dhcp_server.c.
| DhcpServerBinding* dhcpServerFindBindingByMacAddr | ( | DhcpServerContext * | context, |
| const MacAddr * | macAddr | ||
| ) |
Search the list of bindings for a given MAC address.
- Parameters:
-
[in] context Pointer to the DHCP server context [in] macAddr MAC address
- Returns:
- Pointer to the corresponding DHCP binding
Definition at line 925 of file dhcp_server.c.
| void dhcpServerGetDefaultSettings | ( | DhcpServerSettings * | settings ) |
Initialize settings with default values.
- Parameters:
-
[out] settings Structure that contains DHCP server settings
Definition at line 52 of file dhcp_server.c.
| error_t dhcpServerGetNextIpAddr | ( | DhcpServerContext * | context, |
| Ipv4Addr * | ipAddr | ||
| ) |
Retrieve the next IP address to be used.
- Parameters:
-
[in] context Pointer to the DHCP server context [out] ipAddr Next IP address to be used
- Returns:
- Error code
Definition at line 997 of file dhcp_server.c.
| error_t dhcpServerInit | ( | DhcpServerContext * | context, |
| const DhcpServerSettings * | settings | ||
| ) |
DHCP server initialization.
- Parameters:
-
[in] context Pointer to the DHCP server context [in] settings DHCP server specific settings
- Returns:
- Error code
Definition at line 87 of file dhcp_server.c.
| void dhcpServerParseDecline | ( | DhcpServerContext * | context, |
| const DhcpMessage * | message, | ||
| size_t | length | ||
| ) |
Parse DHCPDECLINE message.
- Parameters:
-
[in] context Pointer to the DHCP server context [in] message Pointer to the incoming DHCP message [in] length Length of the incoming message to parse
Definition at line 590 of file dhcp_server.c.
| void dhcpServerParseDiscover | ( | DhcpServerContext * | context, |
| const DhcpMessage * | message, | ||
| size_t | length | ||
| ) |
Parse DHCPDISCOVER message.
- Parameters:
-
[in] context Pointer to the DHCP server context [in] message Pointer to the incoming DHCP message [in] length Length of the incoming message to parse
Definition at line 346 of file dhcp_server.c.
| void dhcpServerParseInform | ( | DhcpServerContext * | context, |
| const DhcpMessage * | message, | ||
| size_t | length | ||
| ) |
Parse DHCPINFORM message.
- Parameters:
-
[in] context Pointer to the DHCP server context [in] message Pointer to the incoming DHCP message [in] length Length of the incoming message to parse
Definition at line 658 of file dhcp_server.c.
| void dhcpServerParseRelease | ( | DhcpServerContext * | context, |
| const DhcpMessage * | message, | ||
| size_t | length | ||
| ) |
Parse DHCPRELEASE message.
- Parameters:
-
[in] context Pointer to the DHCP server context [in] message Pointer to the incoming DHCP message [in] length Length of the incoming message to parse
Definition at line 630 of file dhcp_server.c.
| void dhcpServerParseRequest | ( | DhcpServerContext * | context, |
| const DhcpMessage * | message, | ||
| size_t | length | ||
| ) |
Parse DHCPREQUEST message.
- Parameters:
-
[in] context Pointer to the DHCP server context [in] message Pointer to the incoming DHCP message [in] length Length of the incoming message to parse
Definition at line 473 of file dhcp_server.c.
| void dhcpServerProcessMessage | ( | NetInterface * | interface, |
| const IpPseudoHeader * | pseudoHeader, | ||
| const UdpHeader * | udpHeader, | ||
| const NetBuffer * | buffer, | ||
| size_t | offset, | ||
| void * | params | ||
| ) |
Process incoming DHCP message.
- Parameters:
-
[in] interface Underlying network interface [in] pseudoHeader UDP pseudo header [in] udpHeader UDP header [in] buffer Multi-part buffer containing the incoming DHCP message [in] offset Offset to the first byte of the DHCP message [in] params Pointer to the DHCP server context
Definition at line 255 of file dhcp_server.c.
| error_t dhcpServerSendReply | ( | DhcpServerContext * | context, |
| uint8_t | type, | ||
| Ipv4Addr | yourIpAddr, | ||
| const DhcpMessage * | request, | ||
| size_t | length | ||
| ) |
Send DHCP reply message.
- Parameters:
-
[in] context Pointer to the DHCP server context [in] type DHCP message type (DHCPOFFER, DHCPACK or DHCPNAK) [in] yourIpAddr The IP address to be placed in the 'yiaddr' field [in] request Pointer to DHCP message received from the client [in] length Length of the DHCP message received from the client
- Returns:
- Error code
Definition at line 682 of file dhcp_server.c.
| error_t dhcpServerStart | ( | DhcpServerContext * | context ) |
Start DHCP server.
- Parameters:
-
[in] context Pointer to the DHCP server context
- Returns:
- Error code
Definition at line 144 of file dhcp_server.c.
| error_t dhcpServerStop | ( | DhcpServerContext * | context ) |
Stop DHCP server.
- Parameters:
-
[in] context Pointer to the DHCP server context
- Returns:
- Error code
Definition at line 171 of file dhcp_server.c.
| void dhcpServerTick | ( | DhcpServerContext * | context ) |
DHCP server timer handler.
This routine must be periodically called by the TCP/IP stack to manage DHCP server operation
- Parameters:
-
[in] context Pointer to the DHCP server context
Definition at line 201 of file dhcp_server.c.
Generated on Tue Jul 12 2022 17:10:19 by
1.7.2