mikroSDK Reference Manual
dhcp_server_misc.h
Go to the documentation of this file.
1
31#ifndef _DHCP_SERVER_MISC_H
32#define _DHCP_SERVER_MISC_H
33
34//Dependencies
35#include "core/net.h"
36#include "dhcp/dhcp_server.h"
37
38//C++ guard
39#ifdef __cplusplus
40extern "C" {
41#endif
42
43//Tick counter to handle periodic operations
44extern systime_t dhcpServerTickCounter;
45
46//DHCP server related functions
47void dhcpServerTick(DhcpServerContext *context);
48
49void dhcpServerProcessMessage(NetInterface *interface,
50 const IpPseudoHeader *pseudoHeader, const UdpHeader *udpHeader,
51 const NetBuffer *buffer, size_t offset, const NetRxAncillary *ancillary,
52 void *param);
53
54void dhcpServerParseDiscover(DhcpServerContext *context,
55 const DhcpMessage *message, size_t length);
56
57void dhcpServerParseRequest(DhcpServerContext *context,
58 const DhcpMessage *message, size_t length);
59
60void dhcpServerParseDecline(DhcpServerContext *context,
61 const DhcpMessage *message, size_t length);
62
63void dhcpServerParseRelease(DhcpServerContext *context,
64 const DhcpMessage *message, size_t length);
65
66void dhcpServerParseInform(DhcpServerContext *context,
67 const DhcpMessage *message, size_t length);
68
69error_t dhcpServerSendReply(DhcpServerContext *context, uint8_t type,
70 Ipv4Addr yourIpAddr, const DhcpMessage *request, size_t requestLen);
71
72DhcpServerBinding *dhcpServerCreateBinding(DhcpServerContext *context);
73
74DhcpServerBinding *dhcpServerFindBindingByMacAddr(DhcpServerContext *context,
75 const MacAddr *macAddr);
76
77DhcpServerBinding *dhcpServerFindBindingByIpAddr(DhcpServerContext *context,
78 Ipv4Addr ipAddr);
79
80error_t dhcpServerGetNextIpAddr(DhcpServerContext *context, Ipv4Addr *ipAddr);
81
82//C++ guard
83#ifdef __cplusplus
84}
85#endif
86
87#endif
DHCP server (Dynamic Host Configuration Protocol)
error_t
Error codes.
Definition error.h:43
uint32_t Ipv4Addr
IPv4 network address.
Definition ipv4.h:267
TCP/IP stack core.
uint32_t systime_t
System time.
Definition os_port_none.h:90
DHCP binding.
Definition dhcp_server.h:112
IP pseudo header.
Definition ip.h:91
Structure describing a buffer that spans multiple chunks.
Definition net_mem.h:89