42 lines
717 B
C++
42 lines
717 B
C++
#pragma once
|
|
#include <iostream>
|
|
#include <functional>
|
|
#include <vector>
|
|
|
|
#include "VrCommon.h"
|
|
|
|
#ifdef _WIN32
|
|
#pragma comment(lib, "EthMonitor")
|
|
#endif // _WIN32
|
|
|
|
enum NetStatus
|
|
{
|
|
NET_STATUS_UNKOWN,
|
|
NET_STATUS_UP,
|
|
NET_STATUS_DOWN,
|
|
NET_STATUS_ROUTE_ADD,
|
|
NET_STATUS_ROUTE_DEL,
|
|
NET_STATUS_STATUS_CHANGE,
|
|
};
|
|
|
|
typedef std::function<void(std::string sDevName, NetStatus eStatus, void* pParam)> NetNotify;
|
|
|
|
|
|
class IVrEthMonitor
|
|
{
|
|
public:
|
|
/// @name 构造函数
|
|
virtual ~IVrEthMonitor() = default;
|
|
|
|
/// 开始监控
|
|
/// @return 成功返回TRUE
|
|
virtual int StartMonitor(NetNotify func, void* pParam) = 0;
|
|
|
|
/// @brief
|
|
/// 停止监控
|
|
virtual void StopMonitor() = 0;
|
|
|
|
};
|
|
|
|
bool VrCreateEthMonitor(IVrEthMonitor** ppEthMonitor);
|