⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 macdhcp.h

📁 linux下更改网卡mac地址
💻 H
字号:
#include "qobject.h"#include "qhostaddress.h"#include <stdio.h>#include <stdlib.h>#include <sys/types.h>#include <sys/param.h>#include <sys/ioctl.h>#include <sys/socket.h>#include <net/if.h>#include <net/route.h>#include <netinet/in.h>#define MAXINTERFACES   16class macdhcp : public QObject{    Q_OBJECTpublic:    macdhcp();    ~macdhcp();    int fd, interfaceNum;    struct ifreq buf[MAXINTERFACES];    struct ifreq bufnew[MAXINTERFACES];    struct ifconf ifc;    struct rtentry rt;	unsigned int intNetmask;	unsigned int intIp;    QString getMacAddress(int);    QString getIPAddress(int);    QString getNetMask(int);    QString getDNS();    QString getGateway();    QString getNetwork();    QString getBroadcast();    QString getIfName(int);    QString setMacAddress(int,QString);    QString setIPAddress(int,QString);    QString setNetMask(int,QString);    QString setDNS(QString);    QString setGateway(QString);    int getIfNum(void);	QString checkIP(QString IP);};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -