macdhcp.h
来自「linux下更改网卡mac地址」· C头文件 代码 · 共 47 行
H
47 行
#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 + =
减小字号Ctrl + -
显示快捷键?