-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInterfaceServer.cpp
More file actions
59 lines (48 loc) · 1.3 KB
/
InterfaceServer.cpp
File metadata and controls
59 lines (48 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/**
* @file InterfaceServer.cpp
* @brief An interface for server configuration
*
* Server configuration interface implementation
*
* @author Amine BAGGA (2025)
*/
#include <iostream>
#include "InterfaceServer.h"
using namespace std;
InterfaceServer::InterfaceServer() : m_portModeBridge(true), m_ssh(false), m_dhcp(false), m_ntpServer(""), m_mutex(new mutex()) {
}
InterfaceServer::~InterfaceServer() {
delete m_mutex;
}
void InterfaceServer::setPortModeBridge(const bool bridge) {
lock_guard<mutex> lock(*m_mutex);
m_portModeBridge = bridge;
}
void InterfaceServer::setSsh(const bool ssh) {
lock_guard<mutex> lock(*m_mutex);
m_ssh = ssh;
}
void InterfaceServer::setDhcp(const bool dhcp) {
lock_guard<mutex> lock(*m_mutex);
m_dhcp = dhcp;
}
void InterfaceServer::setNtpServer(const string& ntp) {
lock_guard<mutex> lock(*m_mutex);
m_ntpServer = ntp;
}
bool InterfaceServer::getPortModeBridge() const {
lock_guard<mutex> lock(*m_mutex);
return m_portModeBridge;
}
bool InterfaceServer::getSsh() const {
lock_guard<mutex> lock(*m_mutex);
return m_ssh;
}
bool InterfaceServer::getDhcp() const {
lock_guard<mutex> lock(*m_mutex);
return m_dhcp;
}
string InterfaceServer::getNtpServer() const {
lock_guard<mutex> lock(*m_mutex);
return m_ntpServer;
}