VirtualBox

source: vbox/trunk/src/VBox/NetworkServices/Dhcpd/DhcpdInternal.h@ 79622

最後變更 在這個檔案從79622是 79622,由 vboxsync 提交於 6 年 前

Dhcpd: DHCP_LOG_MSG_ERROR. bugref:9288

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 2.5 KB
 
1/* $Id: DhcpdInternal.h 79622 2019-07-09 01:21:16Z vboxsync $ */
2/** @file
3 * DHCP server - Internal header.
4 */
5
6/*
7 * Copyright (C) 2017-2019 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.alldomusa.eu.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef VBOX_INCLUDED_SRC_Dhcpd_DhcpdInternal_h
19#define VBOX_INCLUDED_SRC_Dhcpd_DhcpdInternal_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24#define LOG_GROUP LOG_GROUP_NET_DHCPD
25#include <iprt/stdint.h>
26#include <iprt/string.h>
27#include <VBox/log.h>
28
29#include <map>
30#include <vector>
31
32#if __cplusplus >= 199711
33#include <memory>
34using std::shared_ptr;
35#else
36# include <tr1/memory>
37using std::tr1::shared_ptr;
38#endif
39
40
41/** Byte vector. */
42typedef std::vector<uint8_t> octets_t;
43
44/** Raw DHCP option map (keyed by option number, byte vector value). */
45typedef std::map<uint8_t, octets_t> rawopts_t;
46
47class DhcpOption;
48/** DHCP option map (keyed by option number, DhcpOption value). */
49typedef std::map<uint8_t, std::shared_ptr<DhcpOption> > optmap_t;
50
51
52/** Equal compare operator for mac address. */
53DECLINLINE(bool) operator==(const RTMAC &l, const RTMAC &r)
54{
55 return memcmp(&l, &r, sizeof(RTMAC)) == 0;
56}
57
58/** Less-than compare operator for mac address. */
59DECLINLINE(bool) operator<(const RTMAC &l, const RTMAC &r)
60{
61 return memcmp(&l, &r, sizeof(RTMAC)) < 0;
62}
63
64
65/** @name LogXRel + return NULL helpers
66 * @{ */
67#define DHCP_LOG_RET_NULL(a_MsgArgs) do { LogRel(a_MsgArgs); return NULL; } while (0)
68#define DHCP_LOG2_RET_NULL(a_MsgArgs) do { LogRel2(a_MsgArgs); return NULL; } while (0)
69#define DHCP_LOG3_RET_NULL(a_MsgArgs) do { LogRel3(a_MsgArgs); return NULL; } while (0)
70/** @} */
71
72
73/** @name LogXRel + return a_rcRet helpers
74 * @{ */
75#define DHCP_LOG_RET(a_rcRet, a_MsgArgs) do { LogRel(a_MsgArgs); return (a_rcRet); } while (0)
76#define DHCP_LOG2_RET(a_rcRet, a_MsgArgs) do { LogRel2(a_MsgArgs); return (a_rcRet); } while (0)
77#define DHCP_LOG3_RET(a_rcRet, a_MsgArgs) do { LogRel3(a_MsgArgs); return (a_rcRet); } while (0)
78/** @} */
79
80/** LogRel + RTMsgError helper. */
81#define DHCP_LOG_MSG_ERROR(a_MsgArgs) do { LogRel(a_MsgArgs); RTMsgError a_MsgArgs; } while (0)
82
83#endif /* !VBOX_INCLUDED_SRC_Dhcpd_DhcpdInternal_h */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette