VirtualBox

source: vbox/trunk/src/VBox/Devices/Network/slirp/ctl.h

Last change on this file was 98103, checked in by vboxsync, 17 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.6 KB
RevLine 
[28449]1/* $Id: ctl.h 98103 2023-01-17 14:15:46Z vboxsync $ */
2/** @file
3 * NAT - IP subnet constants.
4 */
5
6/*
[98103]7 * Copyright (C) 2006-2023 Oracle and/or its affiliates.
[28449]8 *
[96407]9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
[28449]26 */
27
[61198]28#ifndef _SLIRP_CTL_H_
29#define _SLIRP_CTL_H_
[28449]30
[15093]31#define CTL_CMD 0
32#define CTL_EXEC 1
33#define CTL_ALIAS 2
34#define CTL_DNS 3
[16213]35#define CTL_TFTP 4
[21112]36#define CTL_GUEST 15
[1796]37#define CTL_BROADCAST 255
[1]38
[61202]39
40#define CTL_CHECK_NETWORK(x) (((x) & RT_H2N_U32(pData->netmask)) == pData->special_addr.s_addr)
41
[41970]42#define CTL_CHECK(x, ctl) ( ((RT_N2H_U32((x)) & ~pData->netmask) == (ctl)) \
[61202]43 && CTL_CHECK_NETWORK(x))
[61198]44
[61202]45#define CTL_CHECK_MINE(x) ( CTL_CHECK(x, CTL_ALIAS) \
46 || CTL_CHECK(x, CTL_DNS) \
47 || CTL_CHECK(x, CTL_TFTP))
48
49#define CTL_CHECK_BROADCAST(x) CTL_CHECK((x), ~pData->netmask)
50
51
[61198]52#endif /* _SLIRP_CTL_H_ */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use