blob: 2ba16e172887e849cc8923d9d3b7309492bb827e [file] [log] [blame]
Maciej Żenczykowskib70da762019-01-28 15:20:48 -08001/*
2 * Copyright (C) 2019 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#ifndef _CLAT_UTILS_H
18#define _CLAT_UTILS_H
19
Maciej Żenczykowski0a7dce82019-01-28 15:31:55 -080020#include <string>
21
Maciej Żenczykowskib70da762019-01-28 15:20:48 -080022namespace android {
23namespace net {
24
Maciej Żenczykowski0a7dce82019-01-28 15:31:55 -080025int hardwareAddressType(const std::string& interface);
26
Maciej Żenczykowski4e36f132019-12-15 13:20:15 -080027int getClatEgressMapFd(void);
28
Maciej Żenczykowskie870a872019-12-15 13:56:13 -080029int getClatEgressProgFd(bool with_ethernet_header);
30
Maciej Żenczykowski4fe857e2019-03-29 23:29:17 -070031int getClatIngressMapFd(void);
Maciej Żenczykowski88d28ff2019-03-25 11:54:32 -070032
Maciej Żenczykowski4fe857e2019-03-29 23:29:17 -070033int getClatIngressProgFd(bool with_ethernet_header);
Maciej Żenczykowski949d84a2019-01-28 17:22:30 -080034
Maciej Żenczykowski7330b022019-01-28 17:30:24 -080035int openNetlinkSocket(void);
36
Maciej Żenczykowski992a51d2019-02-11 18:06:56 -080037int processNetlinkResponse(int fd);
38
Maciej Żenczykowskiff3308d2019-02-12 19:10:55 -080039int tcQdiscAddDevClsact(int fd, int ifIndex);
40int tcQdiscReplaceDevClsact(int fd, int ifIndex);
41int tcQdiscDelDevClsact(int fd, int ifIndex);
42
Maciej Żenczykowskib140a3a2019-12-15 11:53:46 -080043int tcFilterAddDevIngressBpf(int fd, int ifIndex, int bpfFd, bool ethernet);
Maciej Żenczykowskia06943c2019-12-15 11:57:42 -080044int tcFilterAddDevEgressBpf(int fd, int ifIndex, int bpfFd, bool ethernet);
Maciej Żenczykowski2f8ff892019-03-25 13:57:20 -070045
Maciej Żenczykowskib70da762019-01-28 15:20:48 -080046} // namespace net
47} // namespace android
48
49#endif