blob: c9653adafef53f100ba576e8e9fb90164442864e [file] [log] [blame]
Wayne Maa9716ff2022-01-12 10:37:04 +08001/*
2 * Copyright (C) 2022 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18// TODO: deduplicate with the constants in NetdConstants.h.
19#include <aidl/android/net/INetd.h>
Maciej Żenczykowski586cff52022-06-15 02:02:21 -070020#include "clat_mark.h"
Wayne Maa9716ff2022-01-12 10:37:04 +080021
22using aidl::android::net::INetd;
23
Maciej Żenczykowski586cff52022-06-15 02:02:21 -070024static_assert(INetd::CLAT_MARK == CLAT_MARK, "must be 0xDEADC1A7");
25
Wayne Maa9716ff2022-01-12 10:37:04 +080026enum FirewallRule { ALLOW = INetd::FIREWALL_RULE_ALLOW, DENY = INetd::FIREWALL_RULE_DENY };
27
28// ALLOWLIST means the firewall denies all by default, uids must be explicitly ALLOWed
29// DENYLIST means the firewall allows all by default, uids must be explicitly DENYed
30
31enum FirewallType { ALLOWLIST = INetd::FIREWALL_ALLOWLIST, DENYLIST = INetd::FIREWALL_DENYLIST };
32
Robert Horvathd945bf02022-01-27 19:55:16 +010033// LINT.IfChange(firewall_chain)
Wayne Maa9716ff2022-01-12 10:37:04 +080034enum ChildChain {
Robert Horvathd945bf02022-01-27 19:55:16 +010035 NONE = 0,
36 DOZABLE = 1,
37 STANDBY = 2,
38 POWERSAVE = 3,
39 RESTRICTED = 4,
40 LOW_POWER_STANDBY = 5,
Motomu Utsumi966ff7f2022-05-11 05:56:26 +000041 LOCKDOWN = 6,
Motomu Utsumi9cd47262022-06-01 13:57:27 +000042 OEM_DENY_1 = 7,
43 OEM_DENY_2 = 8,
Motomu Utsumi608015f2022-06-06 07:44:05 +000044 OEM_DENY_3 = 9,
Wayne Maa9716ff2022-01-12 10:37:04 +080045 INVALID_CHAIN
46};
Robert Horvathd945bf02022-01-27 19:55:16 +010047// LINT.ThenChange(packages/modules/Connectivity/framework/src/android/net/ConnectivityManager.java)