2021-10-23 04:26:47 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
|
|
#ifndef IPUTILSMACOS_H
|
|
|
|
|
#define IPUTILSMACOS_H
|
|
|
|
|
|
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
|
|
2023-07-15 14:19:48 -07:00
|
|
|
#include "daemon/iputils.h"
|
|
|
|
|
|
2021-10-23 04:26:47 -07:00
|
|
|
class IPUtilsMacos final : public IPUtils {
|
|
|
|
|
public:
|
|
|
|
|
IPUtilsMacos(QObject* parent);
|
|
|
|
|
~IPUtilsMacos();
|
|
|
|
|
bool addInterfaceIPs(const InterfaceConfig& config) override;
|
|
|
|
|
bool setMTUAndUp(const InterfaceConfig& config) override;
|
|
|
|
|
void setIfname(const QString& ifname) { m_ifname = ifname; }
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
bool addIP4AddressToDevice(const InterfaceConfig& config);
|
|
|
|
|
bool addIP6AddressToDevice(const InterfaceConfig& config);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QString m_ifname;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // IPUTILSMACOS_H
|