blob: 1a2f8becfcd2e3c31129b08f2126d86391b642e1 [file] [log] [blame]
Sreeram Ramachandranefbe05d2014-05-21 11:41:39 -07001/*
2 * Copyright (C) 2014 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 NETD_INCLUDE_NETD_CLIENT_H
18#define NETD_INCLUDE_NETD_CLIENT_H
19
20#include <stdbool.h>
21#include <sys/cdefs.h>
22
23__BEGIN_DECLS
24
Sreeram Ramachandran31f42102014-06-20 11:51:48 -070025// All functions below that return an int return 0 on success or an errno value on failure.
26
Sreeram Ramachandran4d4c8b72014-06-20 11:59:40 -070027int getNetworkForSocket(unsigned* netId, int socketFd);
Sreeram Ramachandran31f42102014-06-20 11:51:48 -070028int setNetworkForSocket(unsigned netId, int socketFd);
Sreeram Ramachandranefbe05d2014-05-21 11:41:39 -070029
30unsigned getNetworkForProcess(void);
Sreeram Ramachandran31f42102014-06-20 11:51:48 -070031int setNetworkForProcess(unsigned netId);
Sreeram Ramachandranefbe05d2014-05-21 11:41:39 -070032
Sreeram Ramachandran31f42102014-06-20 11:51:48 -070033int setNetworkForResolv(unsigned netId);
Sreeram Ramachandranefbe05d2014-05-21 11:41:39 -070034
Sreeram Ramachandran31f42102014-06-20 11:51:48 -070035int protectFromVpn(int socketFd);
Sreeram Ramachandrand794e582014-06-19 10:03:07 -070036
Sreeram Ramachandranefbe05d2014-05-21 11:41:39 -070037__END_DECLS
38
39#endif // NETD_INCLUDE_NETD_CLIENT_H