Home | History | Annotate | Download | only in server

Lines Matching full:network

125         if (entry.second->getType() == Network::VIRTUAL) {
153 Network* network = getNetworkLocked(netId);
154 if (!network) {
158 if (network->getType() != Network::PHYSICAL) {
159 ALOGE("cannot set default to non-physical network with netId %u", netId);
162 if (int ret = static_cast<PhysicalNetwork*>(network)->addAsDefault()) {
168 Network* network = getNetworkLocked(mDefaultNetId);
169 if (!network || network->getType() != Network::PHYSICAL) {
170 ALOGE("cannot find previously set default network with netId %u", mDefaultNetId);
173 if (int ret = static_cast<PhysicalNetwork*>(network)->removeAsDefault()) {
189 // network, use that network's DNS servers. Do not fall through to the default network even
190 // if the explicitly selected network is a split tunnel VPN or a VPN without DNS servers.
194 // (possibly falling through to the default network if the VPN doesn't provide a route to
195 // them). Otherwise, use the default network's DNS servers.
207 // Returns the NetId that a given UID would use if no network is explicitly selected. Specifically,
208 // the VPN that applies to the UID if any; otherwise, the default network.
218 // applies to the user if any; otherwise, the default network.
220 // In general, we prefer to always set the default network's NetId in connect(), so that if the VPN
221 // is a split-tunnel and disappears later, the socket continues working (since the default network's
228 // traffic to the default network. But it does mean that if the bypassable VPN goes away (and thus
229 // the fallthrough rules also go away), the socket that used to fallthrough to the default network
276 Network* network = getNetworkLocked(netId);
277 return network && network->getType() == Network::VIRTUAL;
294 ALOGE("inconceivable! setPermission cannot fail on an empty network");
325 ALOGE("cannot destroy local network");
333 // TODO: ioctl(SIOCKILLADDR, ...) to kill all sockets on the old network.
336 Network* network = getNetworkLocked(netId);
338 // If we fail to destroy a network, things will get stuck badly. Therefore, unlike most of the
339 // other network code, ignore failures and attempt to clear out as much state as possible, even
341 int ret = network->clearInterfaces();
344 if (int err = static_cast<PhysicalNetwork*>(network)->removeAsDefault()) {
345 ALOGE("inconceivable! removeAsDefault cannot fail on an empty network");
351 } else if (network->getType() == Network::VIRTUAL) {
359 delete network;
412 Network* network = getNetworkLocked(netId);
413 if (!network) {
417 if (network->getType() != Network::PHYSICAL) {
418 ALOGE("cannot set permissions on non-physical network with netId %u", netId);
422 // TODO: ioctl(SIOCKILLADDR, ...) to kill socets on the network that don't have permission.
424 if (int ret = static_cast<PhysicalNetwork*>(network)->setPermission(permission)) {
433 Network* network = getNetworkLocked(netId);
434 network) {
438 if (network->getType() != Network::VIRTUAL) {
439 ALOGE("cannot add users to non-virtual network with netId %u", netId);
442 if (int ret = static_cast<VirtualNetwork*>(network)->addUsers(uidRanges)) {
450 Network* network = getNetworkLocked(netId);
451 if (!network) {
455 if (network->getType() != Network::VIRTUAL) {
456 ALOGE("cannot remove users from non-virtual network with netId %u", netId);
459 if (int ret = static_cast<VirtualNetwork*>(network)->removeUsers(uidRanges)) {
498 Network* NetworkController::getNetworkLocked(unsigned netId) const {
505 if (entry.second->getType() == Network::VIRTUAL) {
524 Network* network = getNetworkLocked(netId);
525 if (!network) {
530 // (using SO_PEERCRED). Be safe and deny access to the network, even if it's valid.
538 if (network->getType() == Network::VIRTUAL) {
539 return static_cast<VirtualNetwork*>(network)->appliesToUser(uid) ? 0 : -EPERM;
546 Permission networkPermission = static_cast<PhysicalNetwork*>(network)->getPermission();
587 Network* network = getNetworkLocked(mDefaultNetId);
588 if (!network) {
589 ALOGE("cannot find previously set default network with netId %u", mDefaultNetId);
592 if (network->getType() != Network::PHYSICAL) {
593 ALOGE("inconceivable! default network must be a physical network");
596 Permission permission = static_cast<PhysicalNetwork*>(network)->getPermission();
597 for (const auto& physicalInterface : network->getInterfaces()) {