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
 
#define DhcpServerContext   struct _DhcpServerContext
 

Typedefs

typedef void(* DhcpServerAddOptionsCallback) (DhcpServerContext *context, DhcpMessage *message, size_t *length, DhcpMessageType type)
 Add DHCP options callback. More...
 
typedef error_t(* DhcpServerParseOptionsCallback) (DhcpServerContext *context, const DhcpMessage *message, size_t length, DhcpMessageType type)
 Parse DHCP options callback. More...
 

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

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.

◆ DhcpServerContext

#define DhcpServerContext   struct _DhcpServerContext

Definition at line 79 of file dhcp_server.h.

Typedef Documentation

◆ DhcpServerAddOptionsCallback

typedef void(* DhcpServerAddOptionsCallback) (DhcpServerContext *context, DhcpMessage *message, size_t *length, DhcpMessageType type)

Add DHCP options callback.

Definition at line 91 of file dhcp_server.h.

◆ DhcpServerParseOptionsCallback

typedef error_t(* DhcpServerParseOptionsCallback) (DhcpServerContext *context, const DhcpMessage *message, size_t length, DhcpMessageType type)

Parse DHCP options callback.

Definition at line 99 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 244 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 102 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 151 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 204 of file dhcp_server.c.