AnCH Framework 0.2
Another C++ Hack: C++23 utility libraries
Loading...
Searching...
No Matches
networkInterface.hpp
1/*
2 ANCH Framework: ANother C++ Hack is a C++ framework based on C++23 standard
3 Copyright (C) 2012 Vincent Lachenal
4
5 This file is part of ANCH Framework.
6
7 ANCH Framework is free software: you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 ANCH Framework is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public License
18 along with ANCH Framework. If not, see <https://www.gnu.org/licenses/>.
19*/
20#pragma once
21
22#include "anch-device-export.hpp"
23
24#include <string>
25#include <vector>
26
27
28namespace anch::device {
29
30 class Network;
31
41 class ANCH_DEVICE_EXPORT NetworkInterface {
42 friend class anch::device::Network;
43
44 private:
45 // Attributes +
47 std::string _name;
48
50 std::string _ipAddress;
51
53 std::vector<std::string> _ipv6Addresses;
54
56 std::string _macAddress;
57
59 std::string _broadcastAddress;
60
62 std::string _netmask;
63
65 int _mtu;
66
68 int _metric;
69
71 bool _up;
72
74 bool _localhost;
75 // Attributes -
76
77 private:
78 // Constructors +
84 explicit NetworkInterface(const std::string& name);
85 // Constructors -
86
87 public:
88 // Accessors +
94 inline const std::string& getName() const;
95
101 inline const std::string& getIpAddress() const;
102
110 inline const std::vector<std::string>& getIpv6Addresses() const;
111
117 inline const std::string& getMacAddress() const;
118
124 inline const std::string& getBroadcastAddress() const;
125
131 inline const std::string& getNetmask() const;
132
138 inline int getMtu() const;
139
145 inline int getMetric() const;
146
154 inline bool isUp() const;
155
161 inline bool isLocalhost() const;
162 // Accessors -
163
164 };
165
166} // anch::device
167
168#include "device/impl/networkInterface.hpp"
Network interfaces.
Definition network.hpp:45
const std::string & getMacAddress() const
const std::string & getIpAddress() const
const std::string & getBroadcastAddress() const
const std::string & getName() const
const std::string & getNetmask() const
const std::vector< std::string > & getIpv6Addresses() const
Device management namespace.
Definition cpu.hpp:31