// A class representing a network interface. The class provides useful // functionality to configure and query the network interface. class Interface { public:
Interface();
~Interface();
Result init(constchar* interfaceName);
// Returns the interface index indicated by the system unsignedint getIndex() const { return mIndex; } // Get the MAC address of the interface const uint8_t (&getMacAddress() const)[ETH_ALEN] { return mMacAddress; } // Get the name of the interface const std::string& getName() const { return mInterfaceName; }
Result bringUp();
Result bringDown();
Result setMtu(uint16_t mtu);
Result setAddress(in_addr_t address, in_addr_t subnetMask);
private: struct ifreq createRequest() const;
Result populateIndex();
Result populateMacAddress();
Result setInterfaceUp(bool shouldBeUp);
std::string mInterfaceName; int mSocketFd; unsignedint mIndex;
uint8_t mMacAddress[ETH_ALEN];
};
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-06-27)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.