summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSreeram Ramachandran <sreeram@google.com>2014-05-21 08:54:07 -0700
committerSreeram Ramachandran <sreeram@google.com>2014-05-21 09:03:35 -0700
commitf4cfad361175a7f9ccf4d41e76a9b289c3c3da22 (patch)
treeadef9c2f736b8a566b0edd9ff83f92493c367f34
parent5ff58d494a5ddf7e544adc77590300f04daf8e31 (diff)
downloadnetd-f4cfad361175a7f9ccf4d41e76a9b289c3c3da22.tar.gz
Move netd_client into netd.
Change-Id: Ie4b6b303225c93f2448a503d6ea9cebb552cbad5
-rw-r--r--client/Android.mk23
-rw-r--r--client/FwmarkClient.cpp96
-rw-r--r--client/FwmarkClient.h38
-rw-r--r--client/NetdClient.cpp84
-rw-r--r--include/FwmarkCommand.h29
-rw-r--r--server/Android.mk (renamed from Android.mk)1
-rw-r--r--server/BandwidthController.cpp (renamed from BandwidthController.cpp)0
-rw-r--r--server/BandwidthController.h (renamed from BandwidthController.h)0
-rw-r--r--server/ClatdController.cpp (renamed from ClatdController.cpp)0
-rw-r--r--server/ClatdController.h (renamed from ClatdController.h)0
-rw-r--r--server/CleanSpec.mk (renamed from CleanSpec.mk)0
-rw-r--r--server/CommandListener.cpp (renamed from CommandListener.cpp)0
-rw-r--r--server/CommandListener.h (renamed from CommandListener.h)0
-rw-r--r--server/DnsProxyListener.cpp (renamed from DnsProxyListener.cpp)0
-rw-r--r--server/DnsProxyListener.h (renamed from DnsProxyListener.h)0
-rw-r--r--server/FirewallController.cpp (renamed from FirewallController.cpp)0
-rw-r--r--server/FirewallController.h (renamed from FirewallController.h)0
-rw-r--r--server/Fwmark.h (renamed from Fwmark.h)6
-rw-r--r--server/FwmarkServer.cpp (renamed from FwmarkServer.cpp)2
-rw-r--r--server/FwmarkServer.h (renamed from FwmarkServer.h)6
-rw-r--r--server/IdletimerController.cpp (renamed from IdletimerController.cpp)0
-rw-r--r--server/IdletimerController.h (renamed from IdletimerController.h)0
-rw-r--r--server/InterfaceController.cpp (renamed from InterfaceController.cpp)0
-rw-r--r--server/InterfaceController.h (renamed from InterfaceController.h)0
-rw-r--r--server/List.h (renamed from List.h)0
-rw-r--r--server/MDnsSdListener.cpp (renamed from MDnsSdListener.cpp)0
-rw-r--r--server/MDnsSdListener.h (renamed from MDnsSdListener.h)0
-rw-r--r--server/NatController.cpp (renamed from NatController.cpp)0
-rw-r--r--server/NatController.h (renamed from NatController.h)0
-rw-r--r--server/NetdCommand.cpp (renamed from NetdCommand.cpp)0
-rw-r--r--server/NetdCommand.h (renamed from NetdCommand.h)0
-rw-r--r--server/NetdConstants.cpp (renamed from NetdConstants.cpp)0
-rw-r--r--server/NetdConstants.h (renamed from NetdConstants.h)0
-rw-r--r--server/NetlinkHandler.cpp (renamed from NetlinkHandler.cpp)0
-rw-r--r--server/NetlinkHandler.h (renamed from NetlinkHandler.h)0
-rw-r--r--server/NetlinkManager.cpp (renamed from NetlinkManager.cpp)0
-rw-r--r--server/NetlinkManager.h (renamed from NetlinkManager.h)0
-rw-r--r--server/NetworkController.cpp (renamed from NetworkController.cpp)0
-rw-r--r--server/NetworkController.h (renamed from NetworkController.h)0
-rw-r--r--server/Permission.cpp (renamed from Permission.cpp)0
-rw-r--r--server/Permission.h (renamed from Permission.h)6
-rw-r--r--server/PermissionsController.cpp (renamed from PermissionsController.cpp)0
-rw-r--r--server/PermissionsController.h (renamed from PermissionsController.h)6
-rw-r--r--server/PppController.cpp (renamed from PppController.cpp)0
-rw-r--r--server/PppController.h (renamed from PppController.h)0
-rw-r--r--server/ResolverController.cpp (renamed from ResolverController.cpp)0
-rw-r--r--server/ResolverController.h (renamed from ResolverController.h)0
-rw-r--r--server/ResponseCode.h (renamed from ResponseCode.h)0
-rw-r--r--server/RouteController.cpp (renamed from RouteController.cpp)0
-rw-r--r--server/RouteController.h (renamed from RouteController.h)6
-rw-r--r--server/SecondaryTableController.cpp (renamed from SecondaryTableController.cpp)0
-rw-r--r--server/SecondaryTableController.h (renamed from SecondaryTableController.h)0
-rw-r--r--server/SoftapController.cpp (renamed from SoftapController.cpp)0
-rw-r--r--server/SoftapController.h (renamed from SoftapController.h)0
-rw-r--r--server/TetherController.cpp (renamed from TetherController.cpp)0
-rw-r--r--server/TetherController.h (renamed from TetherController.h)0
-rw-r--r--server/main.cpp (renamed from main.cpp)0
-rw-r--r--server/ndc.c (renamed from ndc.c)0
-rw-r--r--server/oem_iptables_hook.cpp (renamed from oem_iptables_hook.cpp)0
-rw-r--r--server/oem_iptables_hook.h (renamed from oem_iptables_hook.h)0
60 files changed, 287 insertions, 16 deletions
diff --git a/client/Android.mk b/client/Android.mk
new file mode 100644
index 00000000..2a4878c4
--- /dev/null
+++ b/client/Android.mk
@@ -0,0 +1,23 @@
+# Copyright (C) 2014 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_C_INCLUDES := system/netd/include
+LOCAL_MODULE := libnetd_client
+LOCAL_SRC_FILES := FwmarkClient.cpp NetdClient.cpp
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/client/FwmarkClient.cpp b/client/FwmarkClient.cpp
new file mode 100644
index 00000000..e360b4e1
--- /dev/null
+++ b/client/FwmarkClient.cpp
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "FwmarkClient.h"
+
+#include <stdlib.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <unistd.h>
+
+namespace {
+
+const sockaddr_un FWMARK_SERVER_PATH = {AF_UNIX, "/dev/socket/fwmarkd"};
+
+} // namespace
+
+bool FwmarkClient::shouldSetFwmark(int sockfd, const sockaddr* addr) {
+ return sockfd >= 0 && addr && (addr->sa_family == AF_INET || addr->sa_family == AF_INET6) &&
+ !getenv("ANDROID_NO_USE_FWMARK_CLIENT");
+}
+
+FwmarkClient::FwmarkClient() : mChannel(-1) {
+}
+
+FwmarkClient::~FwmarkClient() {
+ if (mChannel >= 0) {
+ // We don't care about errors while closing the channel, so restore any previous error.
+ int error = errno;
+ close(mChannel);
+ errno = error;
+ }
+}
+
+bool FwmarkClient::send(void* data, size_t len, int fd) {
+ mChannel = socket(AF_UNIX, SOCK_STREAM, 0);
+ if (mChannel == -1) {
+ return false;
+ }
+
+ if (TEMP_FAILURE_RETRY(connect(mChannel, reinterpret_cast<const sockaddr*>(&FWMARK_SERVER_PATH),
+ sizeof(FWMARK_SERVER_PATH))) == -1) {
+ // If we are unable to connect to the fwmark server, assume there's no error. This protects
+ // against future changes if the fwmark server goes away.
+ errno = 0;
+ return true;
+ }
+
+ iovec iov;
+ iov.iov_base = data;
+ iov.iov_len = len;
+
+ msghdr message;
+ memset(&message, 0, sizeof(message));
+ message.msg_iov = &iov;
+ message.msg_iovlen = 1;
+
+ union {
+ cmsghdr cmh;
+ char cmsg[CMSG_SPACE(sizeof(fd))];
+ } cmsgu;
+
+ memset(cmsgu.cmsg, 0, sizeof(cmsgu.cmsg));
+ message.msg_control = cmsgu.cmsg;
+ message.msg_controllen = sizeof(cmsgu.cmsg);
+
+ cmsghdr* const cmsgh = CMSG_FIRSTHDR(&message);
+ cmsgh->cmsg_len = CMSG_LEN(sizeof(fd));
+ cmsgh->cmsg_level = SOL_SOCKET;
+ cmsgh->cmsg_type = SCM_RIGHTS;
+ memcpy(CMSG_DATA(cmsgh), &fd, sizeof(fd));
+
+ if (TEMP_FAILURE_RETRY(sendmsg(mChannel, &message, 0)) == -1) {
+ return false;
+ }
+
+ int error = 0;
+ if (TEMP_FAILURE_RETRY(recv(mChannel, &error, sizeof(error), 0)) == -1) {
+ return false;
+ }
+
+ errno = error;
+ return !error;
+}
diff --git a/client/FwmarkClient.h b/client/FwmarkClient.h
new file mode 100644
index 00000000..f53de1c5
--- /dev/null
+++ b/client/FwmarkClient.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef NETD_CLIENT_FWMARK_CLIENT_H
+#define NETD_CLIENT_FWMARK_CLIENT_H
+
+#include <sys/socket.h>
+
+class FwmarkClient {
+public:
+ // Returns true if |sockfd| should be sent to the fwmark server to have its SO_MARK set.
+ static bool shouldSetFwmark(int sockfd, const sockaddr* addr);
+
+ FwmarkClient();
+ ~FwmarkClient();
+
+ // Sends |data| to the fwmark server, along with |fd| as ancillary data using cmsg(3).
+ // Returns true on success.
+ bool send(void* data, size_t len, int fd);
+
+private:
+ int mChannel;
+};
+
+#endif // NETD_CLIENT_FWMARK_CLIENT_H
diff --git a/client/NetdClient.cpp b/client/NetdClient.cpp
new file mode 100644
index 00000000..2e8390c8
--- /dev/null
+++ b/client/NetdClient.cpp
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "FwmarkClient.h"
+#include "FwmarkCommand.h"
+
+#include <sys/socket.h>
+#include <unistd.h>
+
+namespace {
+
+int closeFdAndRestoreErrno(int fd) {
+ int error = errno;
+ close(fd);
+ errno = error;
+ return -1;
+}
+
+typedef int (*ConnectFunctionType)(int, const sockaddr*, socklen_t);
+typedef int (*AcceptFunctionType)(int, sockaddr*, socklen_t*);
+
+ConnectFunctionType libcConnect = 0;
+AcceptFunctionType libcAccept = 0;
+
+int netdClientConnect(int sockfd, const sockaddr* addr, socklen_t addrlen) {
+ if (FwmarkClient::shouldSetFwmark(sockfd, addr)) {
+ char data[] = {FWMARK_COMMAND_ON_CONNECT};
+ if (!FwmarkClient().send(data, sizeof(data), sockfd)) {
+ return -1;
+ }
+ }
+ return libcConnect(sockfd, addr, addrlen);
+}
+
+int netdClientAccept(int sockfd, sockaddr* addr, socklen_t* addrlen) {
+ int acceptedSocket = libcAccept(sockfd, addr, addrlen);
+ if (acceptedSocket == -1) {
+ return -1;
+ }
+ sockaddr socketAddress;
+ if (!addr) {
+ socklen_t socketAddressLen = sizeof(socketAddress);
+ if (getsockname(acceptedSocket, &socketAddress, &socketAddressLen) == -1) {
+ return closeFdAndRestoreErrno(acceptedSocket);
+ }
+ addr = &socketAddress;
+ }
+ if (FwmarkClient::shouldSetFwmark(acceptedSocket, addr)) {
+ char data[] = {FWMARK_COMMAND_ON_ACCEPT};
+ if (!FwmarkClient().send(data, sizeof(data), acceptedSocket)) {
+ return closeFdAndRestoreErrno(acceptedSocket);
+ }
+ }
+ return acceptedSocket;
+}
+
+} // namespace
+
+extern "C" void netdClientInitConnect(ConnectFunctionType* function) {
+ if (function && *function) {
+ libcConnect = *function;
+ *function = netdClientConnect;
+ }
+}
+
+extern "C" void netdClientInitAccept(AcceptFunctionType* function) {
+ if (function && *function) {
+ libcAccept = *function;
+ *function = netdClientAccept;
+ }
+}
diff --git a/include/FwmarkCommand.h b/include/FwmarkCommand.h
new file mode 100644
index 00000000..5854a816
--- /dev/null
+++ b/include/FwmarkCommand.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef NETD_INCLUDE_FWMARK_COMMAND_H
+#define NETD_INCLUDE_FWMARK_COMMAND_H
+
+#include <stdint.h>
+
+// Commands sent from clients to the fwmark server to mark sockets (i.e., set their SO_MARK).
+const uint8_t FWMARK_COMMAND_ON_CREATE = 0;
+const uint8_t FWMARK_COMMAND_ON_CONNECT = 1;
+const uint8_t FWMARK_COMMAND_ON_ACCEPT = 2;
+const uint8_t FWMARK_COMMAND_SELECT_NETWORK = 3;
+const uint8_t FWMARK_COMMAND_PROTECT_FROM_VPN = 4;
+
+#endif // NETD_INCLUDE_FWMARK_COMMAND_H
diff --git a/Android.mk b/server/Android.mk
index 8e131306..f2c9c4b7 100644
--- a/Android.mk
+++ b/server/Android.mk
@@ -38,6 +38,7 @@ LOCAL_C_INCLUDES := \
external/stlport/stlport \
bionic \
bionic/libc/dns/include \
+ system/netd/include \
$(call include-path-for, libhardware_legacy)/hardware_legacy
LOCAL_CFLAGS := -Werror=format
diff --git a/BandwidthController.cpp b/server/BandwidthController.cpp
index a7c2c2ca..a7c2c2ca 100644
--- a/BandwidthController.cpp
+++ b/server/BandwidthController.cpp
diff --git a/BandwidthController.h b/server/BandwidthController.h
index 6b7b5d32..6b7b5d32 100644
--- a/BandwidthController.h
+++ b/server/BandwidthController.h
diff --git a/ClatdController.cpp b/server/ClatdController.cpp
index ba4ca271..ba4ca271 100644
--- a/ClatdController.cpp
+++ b/server/ClatdController.cpp
diff --git a/ClatdController.h b/server/ClatdController.h
index f059c318..f059c318 100644
--- a/ClatdController.h
+++ b/server/ClatdController.h
diff --git a/CleanSpec.mk b/server/CleanSpec.mk
index b84e1b65..b84e1b65 100644
--- a/CleanSpec.mk
+++ b/server/CleanSpec.mk
diff --git a/CommandListener.cpp b/server/CommandListener.cpp
index 5455a8ed..5455a8ed 100644
--- a/CommandListener.cpp
+++ b/server/CommandListener.cpp
diff --git a/CommandListener.h b/server/CommandListener.h
index ada79ebf..ada79ebf 100644
--- a/CommandListener.h
+++ b/server/CommandListener.h
diff --git a/DnsProxyListener.cpp b/server/DnsProxyListener.cpp
index 3a8e4753..3a8e4753 100644
--- a/DnsProxyListener.cpp
+++ b/server/DnsProxyListener.cpp
diff --git a/DnsProxyListener.h b/server/DnsProxyListener.h
index 936d6aaf..936d6aaf 100644
--- a/DnsProxyListener.h
+++ b/server/DnsProxyListener.h
diff --git a/FirewallController.cpp b/server/FirewallController.cpp
index 07463165..07463165 100644
--- a/FirewallController.cpp
+++ b/server/FirewallController.cpp
diff --git a/FirewallController.h b/server/FirewallController.h
index 158e0fa0..158e0fa0 100644
--- a/FirewallController.h
+++ b/server/FirewallController.h
diff --git a/Fwmark.h b/server/Fwmark.h
index d358f81a..4ff2a371 100644
--- a/Fwmark.h
+++ b/server/Fwmark.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef SYSTEM_NETD_FWMARK_H
-#define SYSTEM_NETD_FWMARK_H
+#ifndef NETD_SERVER_FWMARK_H
+#define NETD_SERVER_FWMARK_H
#include "Permission.h"
@@ -42,4 +42,4 @@ COMPILE_TIME_ASSERT(sizeof(Fwmark) == sizeof(uint32_t));
} // namespace android
-#endif // SYSTEM_NETD_FWMARK_H
+#endif // NETD_SERVER_FWMARK_H
diff --git a/FwmarkServer.cpp b/server/FwmarkServer.cpp
index ea997bad..187d4bfb 100644
--- a/FwmarkServer.cpp
+++ b/server/FwmarkServer.cpp
@@ -17,10 +17,10 @@
#include "FwmarkServer.h"
#include "Fwmark.h"
+#include "FwmarkCommand.h"
#include "NetworkController.h"
#include "PermissionsController.h"
-#include "netd_client/FwmarkCommands.h"
#include <sys/socket.h>
#include <unistd.h>
diff --git a/FwmarkServer.h b/server/FwmarkServer.h
index 4d58fd52..5629bf94 100644
--- a/FwmarkServer.h
+++ b/server/FwmarkServer.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef SYSTEM_NETD_FWMARK_SERVER_H
-#define SYSTEM_NETD_FWMARK_SERVER_H
+#ifndef NETD_SERVER_FWMARK_SERVER_H
+#define NETD_SERVER_FWMARK_SERVER_H
#include <sysutils/SocketListener.h>
@@ -38,4 +38,4 @@ private:
PermissionsController* const mPermissionsController;
};
-#endif // SYSTEM_NETD_FWMARK_SERVER_H
+#endif // NETD_SERVER_FWMARK_SERVER_H
diff --git a/IdletimerController.cpp b/server/IdletimerController.cpp
index 76b79a79..76b79a79 100644
--- a/IdletimerController.cpp
+++ b/server/IdletimerController.cpp
diff --git a/IdletimerController.h b/server/IdletimerController.h
index 98a312ed..98a312ed 100644
--- a/IdletimerController.h
+++ b/server/IdletimerController.h
diff --git a/InterfaceController.cpp b/server/InterfaceController.cpp
index e55114f4..e55114f4 100644
--- a/InterfaceController.cpp
+++ b/server/InterfaceController.cpp
diff --git a/InterfaceController.h b/server/InterfaceController.h
index 72ff1b6e..72ff1b6e 100644
--- a/InterfaceController.h
+++ b/server/InterfaceController.h
diff --git a/List.h b/server/List.h
index 856ce26b..856ce26b 100644
--- a/List.h
+++ b/server/List.h
diff --git a/MDnsSdListener.cpp b/server/MDnsSdListener.cpp
index 71600282..71600282 100644
--- a/MDnsSdListener.cpp
+++ b/server/MDnsSdListener.cpp
diff --git a/MDnsSdListener.h b/server/MDnsSdListener.h
index a3b14ad8..a3b14ad8 100644
--- a/MDnsSdListener.h
+++ b/server/MDnsSdListener.h
diff --git a/NatController.cpp b/server/NatController.cpp
index fbf5f8a0..fbf5f8a0 100644
--- a/NatController.cpp
+++ b/server/NatController.cpp
diff --git a/NatController.h b/server/NatController.h
index 2912e4b1..2912e4b1 100644
--- a/NatController.h
+++ b/server/NatController.h
diff --git a/NetdCommand.cpp b/server/NetdCommand.cpp
index 3bd9322f..3bd9322f 100644
--- a/NetdCommand.cpp
+++ b/server/NetdCommand.cpp
diff --git a/NetdCommand.h b/server/NetdCommand.h
index 4f731bb4..4f731bb4 100644
--- a/NetdCommand.h
+++ b/server/NetdCommand.h
diff --git a/NetdConstants.cpp b/server/NetdConstants.cpp
index c3c16eb9..c3c16eb9 100644
--- a/NetdConstants.cpp
+++ b/server/NetdConstants.cpp
diff --git a/NetdConstants.h b/server/NetdConstants.h
index e93347c9..e93347c9 100644
--- a/NetdConstants.h
+++ b/server/NetdConstants.h
diff --git a/NetlinkHandler.cpp b/server/NetlinkHandler.cpp
index 9c2984f7..9c2984f7 100644
--- a/NetlinkHandler.cpp
+++ b/server/NetlinkHandler.cpp
diff --git a/NetlinkHandler.h b/server/NetlinkHandler.h
index a5c5b6b8..a5c5b6b8 100644
--- a/NetlinkHandler.h
+++ b/server/NetlinkHandler.h
diff --git a/NetlinkManager.cpp b/server/NetlinkManager.cpp
index 32578a1d..32578a1d 100644
--- a/NetlinkManager.cpp
+++ b/server/NetlinkManager.cpp
diff --git a/NetlinkManager.h b/server/NetlinkManager.h
index b7f011eb..b7f011eb 100644
--- a/NetlinkManager.h
+++ b/server/NetlinkManager.h
diff --git a/NetworkController.cpp b/server/NetworkController.cpp
index a11fae8a..a11fae8a 100644
--- a/NetworkController.cpp
+++ b/server/NetworkController.cpp
diff --git a/NetworkController.h b/server/NetworkController.h
index fff32899..fff32899 100644
--- a/NetworkController.h
+++ b/server/NetworkController.h
diff --git a/Permission.cpp b/server/Permission.cpp
index c5bf6773..c5bf6773 100644
--- a/Permission.cpp
+++ b/server/Permission.cpp
diff --git a/Permission.h b/server/Permission.h
index 8cb6b8f9..38f946b9 100644
--- a/Permission.h
+++ b/server/Permission.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef SYSTEM_NETD_PERMISSION_H
-#define SYSTEM_NETD_PERMISSION_H
+#ifndef NETD_SERVER_PERMISSION_H
+#define NETD_SERVER_PERMISSION_H
// This enum represents the permissions we care about for networking. When applied to an app, it's
// the permission the app (UID) has been granted. When applied to a network, it's the permission an
@@ -37,4 +37,4 @@ enum Permission {
Permission permissionFromString(const char* permission);
-#endif // SYSTEM_NETD_PERMISSION_H
+#endif // NETD_SERVER_PERMISSION_H
diff --git a/PermissionsController.cpp b/server/PermissionsController.cpp
index a747efc4..a747efc4 100644
--- a/PermissionsController.cpp
+++ b/server/PermissionsController.cpp
diff --git a/PermissionsController.h b/server/PermissionsController.h
index 29ae7313..e259e6df 100644
--- a/PermissionsController.h
+++ b/server/PermissionsController.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef SYSTEM_NETD_PERMISSIONS_CONTROLLER_H
-#define SYSTEM_NETD_PERMISSIONS_CONTROLLER_H
+#ifndef NETD_SERVER_PERMISSIONS_CONTROLLER_H
+#define NETD_SERVER_PERMISSIONS_CONTROLLER_H
#include "Permission.h"
@@ -36,4 +36,4 @@ private:
std::map<unsigned, Permission> mNetworks;
};
-#endif // SYSTEM_NETD_PERMISSIONS_CONTROLLER_H
+#endif // NETD_SERVER_PERMISSIONS_CONTROLLER_H
diff --git a/PppController.cpp b/server/PppController.cpp
index 6b54c31b..6b54c31b 100644
--- a/PppController.cpp
+++ b/server/PppController.cpp
diff --git a/PppController.h b/server/PppController.h
index cc74c8ce..cc74c8ce 100644
--- a/PppController.h
+++ b/server/PppController.h
diff --git a/ResolverController.cpp b/server/ResolverController.cpp
index a5d69ae9..a5d69ae9 100644
--- a/ResolverController.cpp
+++ b/server/ResolverController.cpp
diff --git a/ResolverController.h b/server/ResolverController.h
index 0c245d73..0c245d73 100644
--- a/ResolverController.h
+++ b/server/ResolverController.h
diff --git a/ResponseCode.h b/server/ResponseCode.h
index d8fafbb0..d8fafbb0 100644
--- a/ResponseCode.h
+++ b/server/ResponseCode.h
diff --git a/RouteController.cpp b/server/RouteController.cpp
index a58f02df..a58f02df 100644
--- a/RouteController.cpp
+++ b/server/RouteController.cpp
diff --git a/RouteController.h b/server/RouteController.h
index 77b7eea5..2769a319 100644
--- a/RouteController.h
+++ b/server/RouteController.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef SYSTEM_NETD_ROUTE_CONTROLLER_H
-#define SYSTEM_NETD_ROUTE_CONTROLLER_H
+#ifndef NETD_SERVER_ROUTE_CONTROLLER_H
+#define NETD_SERVER_ROUTE_CONTROLLER_H
#include "Permission.h"
@@ -38,4 +38,4 @@ public:
static bool removeRoute(const char* interface, const char* destination, const char* nexthop);
};
-#endif // SYSTEM_NETD_ROUTE_CONTROLLER_H
+#endif // NETD_SERVER_ROUTE_CONTROLLER_H
diff --git a/SecondaryTableController.cpp b/server/SecondaryTableController.cpp
index 849a7aed..849a7aed 100644
--- a/SecondaryTableController.cpp
+++ b/server/SecondaryTableController.cpp
diff --git a/SecondaryTableController.h b/server/SecondaryTableController.h
index 9278bb3d..9278bb3d 100644
--- a/SecondaryTableController.h
+++ b/server/SecondaryTableController.h
diff --git a/SoftapController.cpp b/server/SoftapController.cpp
index 7d5da953..7d5da953 100644
--- a/SoftapController.cpp
+++ b/server/SoftapController.cpp
diff --git a/SoftapController.h b/server/SoftapController.h
index 7063067b..7063067b 100644
--- a/SoftapController.h
+++ b/server/SoftapController.h
diff --git a/TetherController.cpp b/server/TetherController.cpp
index 32a0b435..32a0b435 100644
--- a/TetherController.cpp
+++ b/server/TetherController.cpp
diff --git a/TetherController.h b/server/TetherController.h
index 4da10b07..4da10b07 100644
--- a/TetherController.h
+++ b/server/TetherController.h
diff --git a/main.cpp b/server/main.cpp
index e09019d1..e09019d1 100644
--- a/main.cpp
+++ b/server/main.cpp
diff --git a/ndc.c b/server/ndc.c
index 1f76c2ab..1f76c2ab 100644
--- a/ndc.c
+++ b/server/ndc.c
diff --git a/oem_iptables_hook.cpp b/server/oem_iptables_hook.cpp
index 70260f3f..70260f3f 100644
--- a/oem_iptables_hook.cpp
+++ b/server/oem_iptables_hook.cpp
diff --git a/oem_iptables_hook.h b/server/oem_iptables_hook.h
index bc996383..bc996383 100644
--- a/oem_iptables_hook.h
+++ b/server/oem_iptables_hook.h