working commit

This commit is contained in:
Олег Бородин
2026-05-06 15:10:19 +02:00
parent eda9b8986b
commit 9540ac05d4
17 changed files with 849 additions and 228 deletions
+32
View File
@@ -0,0 +1,32 @@
#ifndef INTERFACE_HPP
#define INTERFACE_HPP
class Interface {
private:
int tunfd;
std::string ifname;
int mtu;
public:
std::expected<void, std::string> Create(const std::string name);
std::string Name(void);
//int TunDescr(void);
int MTU();
std::expected<void, std::string> SetMTU(int mtu);
std::expected<int, std::string> GetMTU(void);
std::expected<void, std::string> SetIP4Address(std::string ipaddr);
std::expected<void, std::string> SetIP4Netmask(int netmask);
std::expected<std::string, std::string> GetIP4Address(void);
std::expected<void, std::string> Up(void);
std::expected<void, std::string> Down(void);
std::expected<void, std::string> UpN(void);
std::expected<void, std::string> SetIP4AddrMask(const std::string address, const int prefix);
std::expected<std::string, std::string> Read(void);
~Interface();
};
#endif