VirtualBox

source: vbox/trunk/src/VBox/NetworkServices/Dhcpd/DHCPD.h@ 78412

Last change on this file since 78412 was 76576, checked in by vboxsync, 6 years ago

NetworkServices: scm header guard alignment.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.6 KB
Line 
1/* $Id: DHCPD.h 76576 2019-01-01 06:05:25Z vboxsync $ */
2/** @file
3 * DHCP server - protocol logic
4 */
5
6/*
7 * Copyright (C) 2017-2019 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef VBOX_INCLUDED_SRC_Dhcpd_DHCPD_h
19#define VBOX_INCLUDED_SRC_Dhcpd_DHCPD_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24#include "Defs.h"
25#include "Config.h"
26#include "DhcpMessage.h"
27#include "Db.h"
28
29
30class DHCPD
31{
32 const Config *m_pConfig;
33 std::string m_strLeasesFileName;
34 Db m_db;
35
36public:
37 DHCPD();
38
39 int init(const Config *);
40
41 DhcpServerMessage *process(const std::unique_ptr<DhcpClientMessage> &req)
42 {
43 if (req.get() == NULL)
44 return NULL;
45
46 return process(*req.get());
47 }
48
49 DhcpServerMessage *process(DhcpClientMessage &req);
50
51private:
52 DhcpServerMessage *doDiscover(DhcpClientMessage &req);
53 DhcpServerMessage *doRequest(DhcpClientMessage &req);
54 DhcpServerMessage *doInform(DhcpClientMessage &req);
55
56 DhcpServerMessage *doDecline(DhcpClientMessage &req);
57 DhcpServerMessage *doRelease(DhcpClientMessage &req);
58
59 DhcpServerMessage *createMessage(int type, DhcpClientMessage &req);
60
61 void loadLeases();
62 void saveLeases();
63};
64
65#endif /* !VBOX_INCLUDED_SRC_Dhcpd_DHCPD_h */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette