/system/netd/server/ |
D | NetworkController.cpp | 168 int NetworkController::setDefaultNetwork(unsigned netId) { in setDefaultNetwork() argument 171 if (netId == mDefaultNetId) { in setDefaultNetwork() 175 if (netId != NETID_UNSET) { in setDefaultNetwork() 176 Network* network = getNetworkLocked(netId); in setDefaultNetwork() 178 ALOGE("no such netId %u", netId); in setDefaultNetwork() 182 ALOGE("cannot set default to non-physical network with netId %u", netId); in setDefaultNetwork() 201 mDefaultNetId = netId; in setDefaultNetwork() 205 uint32_t NetworkController::getNetworkForDnsLocked(unsigned* netId, uid_t uid) const { in getNetworkForDnsLocked() argument 215 if (*netId == NETID_UNSET && getVirtualNetworkForUserLocked(uid) == nullptr) { in getNetworkForDnsLocked() 216 *netId = mDefaultNetId; in getNetworkForDnsLocked() [all …]
|
D | NetdHwService.cpp | 66 unsigned netId; in createOemNetwork() local 69 int ret = gCtls->netCtrl.createPhysicalOemNetwork(permission, &netId); in createOemNetwork() 72 fwmark.netId = netId; in createOemNetwork() 76 _hidl_cb(netIdToNetHandle(netId), fwmark.intValue, toHalStatus(ret)); in createOemNetwork() 82 #define RETURN_IF_NOT_OEM_NETWORK(netId) \ argument 83 if (((netId) < NetworkController::MIN_OEM_ID) || \ 84 ((netId) > NetworkController::MAX_OEM_ID)) { \ 89 unsigned netId = netHandleToNetId(netHandle); in destroyOemNetwork() local 90 RETURN_IF_NOT_OEM_NETWORK(netId); in destroyOemNetwork() 92 return toHalStatus(gCtls->netCtrl.destroyNetwork(netId)); in destroyOemNetwork() [all …]
|
D | NetworkController.h | 97 [[nodiscard]] int setDefaultNetwork(unsigned netId); 101 void getNetworkContext(unsigned netId, uid_t uid, struct android_net_context* netcontext) const; 103 bool isVirtualNetwork(unsigned netId) const; 105 [[nodiscard]] int createPhysicalNetwork(unsigned netId, Permission permission); 106 [[nodiscard]] int createPhysicalOemNetwork(Permission permission, unsigned* netId); 107 [[nodiscard]] int createVirtualNetwork(unsigned netId, bool secure); 108 [[nodiscard]] int destroyNetwork(unsigned netId); 110 [[nodiscard]] int addInterfaceToNetwork(unsigned netId, const char* interface); 111 [[nodiscard]] int removeInterfaceFromNetwork(unsigned netId, const char* interface); 115 int checkUserNetworkAccess(uid_t uid, unsigned netId) const; [all …]
|
D | RouteController.h | 58 [[nodiscard]] static int addInterfaceToLocalNetwork(unsigned netId, const char* interface); 59 [[nodiscard]] static int removeInterfaceFromLocalNetwork(unsigned netId, const char* interface); 61 [[nodiscard]] static int addInterfaceToPhysicalNetwork(unsigned netId, const char* interface, 63 [[nodiscard]] static int removeInterfaceFromPhysicalNetwork(unsigned netId, 67 [[nodiscard]] static int addInterfaceToVirtualNetwork(unsigned netId, const char* interface, 69 [[nodiscard]] static int removeInterfaceFromVirtualNetwork(unsigned netId, 73 [[nodiscard]] static int modifyPhysicalNetworkPermission(unsigned netId, const char* interface, 77 [[nodiscard]] static int addUsersToVirtualNetwork(unsigned netId, const char* interface, 79 [[nodiscard]] static int removeUsersFromVirtualNetwork(unsigned netId, const char* interface, 128 static int modifyPhysicalNetwork(unsigned netId, const char* interface, Permission permission, [all …]
|
D | RouteController.cpp | 472 int modifyIncomingPacketMark(unsigned netId, const char* interface, Permission permission, in modifyIncomingPacketMark() argument 476 fwmark.netId = netId; in modifyIncomingPacketMark() 537 [[nodiscard]] static int modifyVpnSystemPermissionRule(unsigned netId, uint32_t table, bool secure, in modifyVpnSystemPermissionRule() argument 542 fwmark.netId = netId; in modifyVpnSystemPermissionRule() 543 mask.netId = FWMARK_NET_ID_MASK; in modifyVpnSystemPermissionRule() 561 [[nodiscard]] static int modifyExplicitNetworkRule(unsigned netId, uint32_t table, in modifyExplicitNetworkRule() argument 567 fwmark.netId = netId; in modifyExplicitNetworkRule() 568 mask.netId = FWMARK_NET_ID_MASK; in modifyExplicitNetworkRule() 613 [[nodiscard]] static int modifyImplicitNetworkRule(unsigned netId, uint32_t table, bool add) { in modifyImplicitNetworkRule() argument 617 fwmark.netId = netId; in modifyImplicitNetworkRule() [all …]
|
D | FwmarkServer.cpp | 134 return mNetworkController->checkUserNetworkAccess(command.uid, command.netId); in processClient() 214 fwmark.netId = mNetworkController->getNetworkForConnect(client->getUid()); in processClient() 215 } else if (!mNetworkController->isVirtualNetwork(fwmark.netId)) { in processClient() 216 fwmark.netId = mNetworkController->getDefaultNetwork(); in processClient() 245 netdEventListener->onConnectEvent(fwmark.netId, connectInfo.error, in processClient() 260 fwmark.netId = command.netId; in processClient() 261 if (command.netId == NETID_UNSET) { in processClient() 267 command.netId)) { in processClient() 286 if (!fwmark.explicitlySelected && mNetworkController->isVirtualNetwork(fwmark.netId)) { in processClient() 287 fwmark.netId = mNetworkController->getDefaultNetwork(); in processClient() [all …]
|
D | NetdNativeService.h | 65 binder::Status networkCreatePhysical(int32_t netId, int32_t permission) override; 66 binder::Status networkCreateVpn(int32_t netId, bool secure) override; 67 binder::Status networkDestroy(int32_t netId) override; 69 binder::Status networkAddInterface(int32_t netId, const std::string& iface) override; 70 binder::Status networkRemoveInterface(int32_t netId, const std::string& iface) override; 72 binder::Status networkAddUidRanges(int32_t netId, 74 binder::Status networkRemoveUidRanges(int32_t netId, 78 binder::Status networkAddRouteParcel(int32_t netId, const RouteInfoParcel& route) override; 79 binder::Status networkUpdateRouteParcel(int32_t netId, const RouteInfoParcel& route) override; 80 binder::Status networkRemoveRouteParcel(int32_t netId, const RouteInfoParcel& route) override; [all …]
|
D | PhysicalNetwork.cpp | 30 [[nodiscard]] int addToDefault(unsigned netId, const std::string& interface, Permission permission, in addToDefault() argument 33 ALOGE("failed to add interface %s to default netId %u", interface.c_str(), netId); in addToDefault() 42 [[nodiscard]] int removeFromDefault(unsigned netId, const std::string& interface, in removeFromDefault() argument 46 ALOGE("failed to remove interface %s from default netId %u", interface.c_str(), netId); in removeFromDefault() 59 PhysicalNetwork::PhysicalNetwork(unsigned netId, PhysicalNetwork::Delegate* delegate) : in PhysicalNetwork() argument 60 Network(netId), mDelegate(delegate), mPermission(PERMISSION_NONE), mIsDefault(false) { in PhysicalNetwork()
|
D | DummyNetwork.cpp | 30 DummyNetwork::DummyNetwork(unsigned netId) : Network(netId) { in DummyNetwork() argument
|
D | NetdNativeService.cpp | 347 binder::Status NetdNativeService::networkCreatePhysical(int32_t netId, int32_t permission) { in networkCreatePhysical() argument 349 int ret = gCtls->netCtrl.createPhysicalNetwork(netId, convertPermission(permission)); in networkCreatePhysical() 353 binder::Status NetdNativeService::networkCreateVpn(int32_t netId, bool secure) { in networkCreateVpn() argument 355 int ret = gCtls->netCtrl.createVirtualNetwork(netId, secure); in networkCreateVpn() 359 binder::Status NetdNativeService::networkDestroy(int32_t netId) { in networkDestroy() argument 362 const int ret = gCtls->netCtrl.destroyNetwork(netId); in networkDestroy() 366 binder::Status NetdNativeService::networkAddInterface(int32_t netId, const std::string& iface) { in networkAddInterface() argument 368 int ret = gCtls->netCtrl.addInterfaceToNetwork(netId, iface.c_str()); in networkAddInterface() 372 binder::Status NetdNativeService::networkRemoveInterface(int32_t netId, const std::string& iface) { in networkRemoveInterface() argument 374 int ret = gCtls->netCtrl.removeInterfaceFromNetwork(netId, iface.c_str()); in networkRemoveInterface() [all …]
|
D | LocalNetwork.cpp | 27 LocalNetwork::LocalNetwork(unsigned netId) : Network(netId) { in LocalNetwork() argument
|
D | NdcDispatcher.cpp | 473 unsigned netId = stringToNetId(argv[3]); in runCommand() local 477 status = mNetd->tetherDnsSet(netId, tetherDnsAddrs); in runCommand() 992 unsigned netId = stringToNetId(argv[nextArg++]); in runCommand() local 999 status = add ? mNetd->networkAddLegacyRoute(netId, interface, destination, nexthop, uid) in runCommand() 1001 : mNetd->networkRemoveLegacyRoute(netId, interface, destination, nexthop, in runCommand() 1004 status = add ? mNetd->networkAddRoute(netId, interface, destination, nexthop) in runCommand() 1005 : mNetd->networkRemoveRoute(netId, interface, destination, nexthop); in runCommand() 1023 unsigned netId = stringToNetId(argv[3]); in runCommand() local 1025 if (Status status = mNetd->networkAddInterface(netId, argv[4]); !status.isOk()) { in runCommand() 1030 if (Status status = mNetd->networkRemoveInterface(netId, argv[4]); !status.isOk()) { in runCommand() [all …]
|
D | Network.cpp | 90 Network::Network(unsigned netId) : mNetId(netId) { in Network() argument
|
D | VirtualNetwork.cpp | 31 VirtualNetwork::VirtualNetwork(unsigned netId, bool secure) : Network(netId), mSecure(secure) {} in VirtualNetwork() argument
|
/system/netd/include/ |
D | NetdClient.h | 28 int getNetworkForSocket(unsigned* netId, int socketFd); 29 int setNetworkForSocket(unsigned netId, int socketFd); 33 int setNetworkForProcess(unsigned netId); 35 int setNetworkForResolv(unsigned netId); 41 int queryUserAccess(uid_t uid, unsigned netId); 53 int resNetworkQuery(unsigned netId, const char* dname, int ns_class, int ns_type, uint32_t flags); 57 int resNetworkSend(unsigned netId, const uint8_t* msg, size_t msglen, uint32_t flags);
|
/system/netd/client/ |
D | NetdClient.cpp | 195 unsigned netId = netIdForProcess & ~NETID_USE_LOCAL_NAMESERVERS; in netdClientSocket() local 196 if (netId != NETID_UNSET && FwmarkClient::shouldSetFwmark(domain)) { in netdClientSocket() 197 if (int error = setNetworkForSocket(netId, socketFd)) { in netdClientSocket() 246 unsigned getNetworkForResolv(unsigned netId) { in getNetworkForResolv() argument 247 if (netId != NETID_UNSET) { in getNetworkForResolv() 248 return netId; in getNetworkForResolv() 254 netId = netIdForProcess; in getNetworkForResolv() 255 if (netId != NETID_UNSET) { in getNetworkForResolv() 256 return netId; in getNetworkForResolv() 261 int setNetworkForTarget(unsigned netId, std::atomic_uint* target) { in setNetworkForTarget() argument [all …]
|
/system/netd/server/aidl_api/netd_aidl_interface/3/android/net/ |
D | INetd.aidl | 24 void networkCreatePhysical(int netId, int permission); in networkCreatePhysical() argument 25 void networkCreateVpn(int netId, boolean secure); in networkCreateVpn() argument 26 void networkDestroy(int netId); in networkDestroy() argument 27 void networkAddInterface(int netId, in @utf8InCpp String iface); in networkAddInterface() argument 28 void networkRemoveInterface(int netId, in @utf8InCpp String iface); in networkRemoveInterface() argument 29 void networkAddUidRanges(int netId, in android.net.UidRangeParcel[] uidRanges); in networkAddUidRanges() argument 30 void networkRemoveUidRanges(int netId, in android.net.UidRangeParcel[] uidRanges); in networkRemoveUidRanges() argument 80 void tetherDnsSet(int netId, in @utf8InCpp String[] dnsAddrs); in tetherDnsSet() argument 82 …void networkAddRoute(int netId, in @utf8InCpp String ifName, in @utf8InCpp String destination, in … in networkAddRoute() argument 83 …void networkRemoveRoute(int netId, in @utf8InCpp String ifName, in @utf8InCpp String destination, … in networkRemoveRoute() argument [all …]
|
/system/netd/server/binder/android/net/metrics/ |
D | INetdEventListener.aidl | 51 void onDnsEvent(int netId, int eventType, int returnCode, int latencyMs, in onDnsEvent() argument 63 void onPrivateDnsValidationEvent(int netId, String ipAddress, String hostname, in onPrivateDnsValidationEvent() argument 76 void onConnectEvent(int netId, int error, int latencyMs, String ipAddr, int port, int uid); in onConnectEvent() argument 126 void onNat64PrefixEvent(int netId, boolean added, @utf8InCpp String prefixString, in onNat64PrefixEvent() argument
|
/system/netd/server/aidl_api/netd_aidl_interface/current/android/net/ |
D | INetd.aidl | 24 void networkCreatePhysical(int netId, int permission); in networkCreatePhysical() argument 25 void networkCreateVpn(int netId, boolean secure); in networkCreateVpn() argument 26 void networkDestroy(int netId); in networkDestroy() argument 27 void networkAddInterface(int netId, in @utf8InCpp String iface); in networkAddInterface() argument 28 void networkRemoveInterface(int netId, in @utf8InCpp String iface); in networkRemoveInterface() argument 29 void networkAddUidRanges(int netId, in android.net.UidRangeParcel[] uidRanges); in networkAddUidRanges() argument 30 void networkRemoveUidRanges(int netId, in android.net.UidRangeParcel[] uidRanges); in networkRemoveUidRanges() argument 80 void tetherDnsSet(int netId, in @utf8InCpp String[] dnsAddrs); in tetherDnsSet() argument 82 …void networkAddRoute(int netId, in @utf8InCpp String ifName, in @utf8InCpp String destination, in … in networkAddRoute() argument 83 …void networkRemoveRoute(int netId, in @utf8InCpp String ifName, in @utf8InCpp String destination, … in networkRemoveRoute() argument [all …]
|
/system/netd/server/binder/android/net/ |
D | INetd.aidl | 80 void networkCreatePhysical(int netId, int permission); in networkCreatePhysical() argument 91 void networkCreateVpn(int netId, boolean secure); in networkCreateVpn() argument 102 void networkDestroy(int netId); in networkDestroy() argument 114 void networkAddInterface(int netId, in @utf8InCpp String iface); in networkAddInterface() argument 125 void networkRemoveInterface(int netId, in @utf8InCpp String iface); in networkRemoveInterface() argument 138 void networkAddUidRanges(int netId, in UidRangeParcel[] uidRanges); in networkAddUidRanges() argument 151 void networkRemoveUidRanges(int netId, in UidRangeParcel[] uidRanges); in networkRemoveUidRanges() argument 763 void tetherDnsSet(int netId, in @utf8InCpp String[] dnsAddrs); in tetherDnsSet() argument 794 int netId, in networkAddRoute() argument 812 int netId, in networkRemoveRoute() argument [all …]
|
/system/netd/server/aidl_api/netd_aidl_interface/4/android/net/ |
D | INetd.aidl | 24 void networkCreatePhysical(int netId, int permission); in networkCreatePhysical() argument 25 void networkCreateVpn(int netId, boolean secure); in networkCreateVpn() argument 26 void networkDestroy(int netId); in networkDestroy() argument 27 void networkAddInterface(int netId, in @utf8InCpp String iface); in networkAddInterface() argument 28 void networkRemoveInterface(int netId, in @utf8InCpp String iface); in networkRemoveInterface() argument 29 void networkAddUidRanges(int netId, in android.net.UidRangeParcel[] uidRanges); in networkAddUidRanges() argument 30 void networkRemoveUidRanges(int netId, in android.net.UidRangeParcel[] uidRanges); in networkRemoveUidRanges() argument 80 void tetherDnsSet(int netId, in @utf8InCpp String[] dnsAddrs); in tetherDnsSet() argument 82 …void networkAddRoute(int netId, in @utf8InCpp String ifName, in @utf8InCpp String destination, in … in networkAddRoute() argument 83 …void networkRemoveRoute(int netId, in @utf8InCpp String ifName, in @utf8InCpp String destination, … in networkRemoveRoute() argument [all …]
|
/system/netd/server/aidl_api/netd_event_listener_interface/1/android/net/metrics/ |
D | INetdEventListener.aidl | 20 …oneway void onDnsEvent(int netId, int eventType, int returnCode, int latencyMs, @utf8InCpp String … in onDnsEvent() argument 21 …oneway void onPrivateDnsValidationEvent(int netId, String ipAddress, String hostname, boolean vali… in onPrivateDnsValidationEvent() argument 22 oneway void onConnectEvent(int netId, int error, int latencyMs, String ipAddr, int port, int uid); in onConnectEvent() argument 25 …oneway void onNat64PrefixEvent(int netId, boolean added, @utf8InCpp String prefixString, int prefi… in onNat64PrefixEvent() argument
|
/system/netd/server/aidl_api/netd_event_listener_interface/current/android/net/metrics/ |
D | INetdEventListener.aidl | 21 …oneway void onDnsEvent(int netId, int eventType, int returnCode, int latencyMs, @utf8InCpp String … in onDnsEvent() argument 22 …oneway void onPrivateDnsValidationEvent(int netId, String ipAddress, String hostname, boolean vali… in onPrivateDnsValidationEvent() argument 23 oneway void onConnectEvent(int netId, int error, int latencyMs, String ipAddr, int port, int uid); in onConnectEvent() argument 26 …oneway void onNat64PrefixEvent(int netId, boolean added, @utf8InCpp String prefixString, int prefi… in onNat64PrefixEvent() argument
|
/system/netd/server/aidl_api/netd_aidl_interface/1/android/net/ |
D | INetd.aidl | 6 void networkCreatePhysical(int netId, int permission); in networkCreatePhysical() argument 7 void networkCreateVpn(int netId, boolean secure); in networkCreateVpn() argument 8 void networkDestroy(int netId); in networkDestroy() argument 9 void networkAddInterface(int netId, in @utf8InCpp String iface); in networkAddInterface() argument 10 void networkRemoveInterface(int netId, in @utf8InCpp String iface); in networkRemoveInterface() argument 11 void networkAddUidRanges(int netId, in android.net.UidRangeParcel[] uidRanges); in networkAddUidRanges() argument 12 void networkRemoveUidRanges(int netId, in android.net.UidRangeParcel[] uidRanges); in networkRemoveUidRanges() argument 62 void tetherDnsSet(int netId, in @utf8InCpp String[] dnsAddrs); in tetherDnsSet() argument 64 …void networkAddRoute(int netId, in @utf8InCpp String ifName, in @utf8InCpp String destination, in … in networkAddRoute() argument 65 …void networkRemoveRoute(int netId, in @utf8InCpp String ifName, in @utf8InCpp String destination, … in networkRemoveRoute() argument [all …]
|
/system/netd/server/aidl_api/netd_aidl_interface/2/android/net/ |
D | INetd.aidl | 23 void networkCreatePhysical(int netId, int permission); in networkCreatePhysical() argument 24 void networkCreateVpn(int netId, boolean secure); in networkCreateVpn() argument 25 void networkDestroy(int netId); in networkDestroy() argument 26 void networkAddInterface(int netId, in @utf8InCpp String iface); in networkAddInterface() argument 27 void networkRemoveInterface(int netId, in @utf8InCpp String iface); in networkRemoveInterface() argument 28 void networkAddUidRanges(int netId, in android.net.UidRangeParcel[] uidRanges); in networkAddUidRanges() argument 29 void networkRemoveUidRanges(int netId, in android.net.UidRangeParcel[] uidRanges); in networkRemoveUidRanges() argument 79 void tetherDnsSet(int netId, in @utf8InCpp String[] dnsAddrs); in tetherDnsSet() argument 81 …void networkAddRoute(int netId, in @utf8InCpp String ifName, in @utf8InCpp String destination, in … in networkAddRoute() argument 82 …void networkRemoveRoute(int netId, in @utf8InCpp String ifName, in @utf8InCpp String destination, … in networkRemoveRoute() argument [all …]
|