本文整理汇总了C++中NetworkManager::handleDhcpReqRequest方法的典型用法代码示例。如果您正苦于以下问题:C++ NetworkManager::handleDhcpReqRequest方法的具体用法?C++ NetworkManager::handleDhcpReqRequest怎么用?C++ NetworkManager::handleDhcpReqRequest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetworkManager
的用法示例。
在下文中一共展示了NetworkManager::handleDhcpReqRequest方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleDhcpMsg
/**
* Handles a DHCP message.
*
* @returns true if handled, false if not.
* @param uMsgType The message type.
* @param pDhcpMsg The DHCP message.
* @param cb The size of the DHCP message.
*/
bool VBoxNetDhcp::handleDhcpMsg(uint8_t uMsgType, PCRTNETBOOTP pDhcpMsg, size_t cb)
{
if (pDhcpMsg->bp_op == RTNETBOOTP_OP_REQUEST)
{
NetworkManager *networkManager = NetworkManager::getNetworkManager();
switch (uMsgType)
{
case RTNET_DHCP_MT_DISCOVER:
return networkManager->handleDhcpReqDiscover(pDhcpMsg, cb);
case RTNET_DHCP_MT_REQUEST:
return networkManager->handleDhcpReqRequest(pDhcpMsg, cb);
case RTNET_DHCP_MT_DECLINE:
return networkManager->handleDhcpReqDecline(pDhcpMsg, cb);
case RTNET_DHCP_MT_RELEASE:
return networkManager->handleDhcpReqRelease(pDhcpMsg, cb);
case RTNET_DHCP_MT_INFORM:
debugPrint(0, true, "Should we handle this?");
break;
default:
debugPrint(0, true, "Unexpected.");
break;
}
}
return false;
}