dhcp_server.h File Reference

DHCP server (Dynamic Host Configuration Protocol) More...

#include "core/net.h"

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...
 

Macros

#define DHCP_SERVER_SUPPORT   DISABLED
 
#define DHCP_SERVER_TICK_INTERVAL   1000
 
#define DHCP_SERVER_MAX_CLIENTS   16
 
#define DHCP_SERVER_DEFAULT_LEASE_TIME   86400
 
#define DHCP_SERVER_MAX_DNS_SERVERS   2
 
#define DHCP_SERVER_PRIVATE_CONTEXT
 

Functions

void dhcpServerGetDefaultSettings (DhcpServerSettings *settings)
 Initialize settings with default values. More...
 
error_t dhcpServerInit (DhcpServerContext *context, const DhcpServerSettings *settings)
 DHCP server initialization. More...
 
error_t dhcpServerStart (DhcpServerContext *context)
 Start DHCP server. More...
 
error_t dhcpServerStop (DhcpServerContext *context)
 Stop DHCP server. More...
 
void dhcpServerDeinit (DhcpServerContext *context)
 Release DHCP server context. More...
 

Detailed Description

DHCP server (Dynamic Host Configuration Protocol)

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2022 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.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.2.0

Definition in file dhcp_server.h.

Macro Definition Documentation

◆ DHCP_SERVER_DEFAULT_LEASE_TIME

#define DHCP_SERVER_DEFAULT_LEASE_TIME   86400

Definition at line 60 of file dhcp_server.h.

◆ DHCP_SERVER_MAX_CLIENTS

#define DHCP_SERVER_MAX_CLIENTS   16

Definition at line 53 of file dhcp_server.h.

◆ DHCP_SERVER_MAX_DNS_SERVERS

#define DHCP_SERVER_MAX_DNS_SERVERS   2

Definition at line 67 of file dhcp_server.h.

◆ DHCP_SERVER_PRIVATE_CONTEXT

#define DHCP_SERVER_PRIVATE_CONTEXT

Definition at line 74 of file dhcp_server.h.

◆ DHCP_SERVER_SUPPORT

#define DHCP_SERVER_SUPPORT   DISABLED

Definition at line 39 of file dhcp_server.h.

◆ DHCP_SERVER_TICK_INTERVAL

#define DHCP_SERVER_TICK_INTERVAL   1000

Definition at line 46 of file dhcp_server.h.

Function Documentation

◆ dhcpServerDeinit()

void dhcpServerDeinit ( DhcpServerContext context)

Release DHCP server context.

Parameters
[in]contextPointer to the DHCP server context

Definition at line 237 of file dhcp_server.c.

◆ dhcpServerGetDefaultSettings()

void dhcpServerGetDefaultSettings ( DhcpServerSettings settings)

Initialize settings with default values.

Parameters
[out]settingsStructure that contains DHCP server settings

Definition at line 58 of file dhcp_server.c.

◆ dhcpServerInit()

error_t dhcpServerInit ( DhcpServerContext context,
const DhcpServerSettings settings 
)

DHCP server initialization.

Parameters
[in]contextPointer to the DHCP server context
[in]settingsDHCP server specific settings
Returns
Error code

Definition at line 95 of file dhcp_server.c.

◆ dhcpServerStart()

error_t dhcpServerStart ( DhcpServerContext context)

Start DHCP server.

Parameters
[in]contextPointer to the DHCP server context
Returns
Error code

Definition at line 144 of file dhcp_server.c.

◆ dhcpServerStop()

error_t dhcpServerStop ( DhcpServerContext context)

Stop DHCP server.

Parameters
[in]contextPointer to the DHCP server context
Returns
Error code

Definition at line 197 of file dhcp_server.c.