Home | History | Annotate | Download | only in server

Lines Matching refs:table

174 void addTableName(uint32_t table, const std::string& name, std::string* contents) {
176 snprintf(tableString, sizeof(tableString), "%u", table);
223 // + If |table| is non-zero, the rule points at the specified routing table. Otherwise, the table is
224 // unspecified. An unspecified table is not allowed when creating an FR_ACT_TO_TBL rule.
234 uint32_t table, uint32_t fwmark, uint32_t mask, const char* iif,
265 // Note that here we're implicitly setting rule.table to 0. When we want to specify a
266 // non-zero table, we do this via the FRATTR_TABLE attribute.
269 // Don't ever create a rule that looks up table 0, because table 0 is the local table.
270 // It's OK to specify a table ID of 0 when deleting a rule, because that doesn't actually select
271 // table 0, it's a wildcard that matches anything.
272 if (table == RT_TABLE_UNSPEC && rule.action == FR_ACT_TO_TBL && action != RTM_DELRULE) {
286 { &FRATTR_TABLE, table != RT_TABLE_UNSPEC ? sizeof(FRATTR_TABLE) : 0 },
287 { &table, table != RT_TABLE_UNSPEC ? sizeof(table) : 0 },
319 WARN_UNUSED_RESULT int modifyIpRule(uint16_t action, uint32_t priority, uint32_t table,
322 return modifyIpRule(action, priority, FR_ACT_TO_TBL, table, fwmark, mask, iif, oif, uidStart,
326 WARN_UNUSED_RESULT int modifyIpRule(uint16_t action, uint32_t priority, uint32_t table,
328 return modifyIpRule(action, priority, table, fwmark, mask, IIF_NONE, OIF_NONE, INVALID_UID,
334 WARN_UNUSED_RESULT int modifyIpRoute(uint16_t action, uint32_t table, const char* interface,
365 // the table number. But it's an error to specify an interface ("dev ...") or a nexthop for
408 { &table, sizeof(table) },
422 ALOGE("Error %s route %s -> %s %s to table %u: %s",
423 actionName(action), destination, nexthop, interface, table, strerror(-ret));
472 WARN_UNUSED_RESULT int modifyVpnUidRangeRule(uint32_t table, uid_t uidStart, uid_t uidEnd,
491 return modifyIpRule(add ? RTM_NEWRULE : RTM_DELRULE, priority, table, fwmark.intValue,
500 WARN_UNUSED_RESULT int modifyVpnSystemPermissionRule(unsigned netId, uint32_t table, bool secure,
513 return modifyIpRule(add ? RTM_NEWRULE : RTM_DELRULE, priority, table, fwmark.intValue,
524 WARN_UNUSED_RESULT int modifyExplicitNetworkRule(unsigned netId, uint32_t table,
539 return modifyIpRule(add ? RTM_NEWRULE : RTM_DELRULE, RULE_PRIORITY_EXPLICIT_NETWORK, table,
547 WARN_UNUSED_RESULT int modifyOutputInterfaceRules(const char* interface, uint32_t table,
561 table, FWMARK_NONE, MASK_NONE, IIF_LOOPBACK, interface,
567 return modifyIpRule(add ? RTM_NEWRULE : RTM_DELRULE, RULE_PRIORITY_OUTPUT_INTERFACE, table,
576 WARN_UNUSED_RESULT int modifyImplicitNetworkRule(unsigned netId, uint32_t table, bool add) {
589 return modifyIpRule(add ? RTM_NEWRULE : RTM_DELRULE, RULE_PRIORITY_IMPLICIT_NETWORK, table,
596 // If a packet with a VPN's netId doesn't find a route in the VPN's routing table, it's allowed to
602 uint32_t table = getRouteTableForInterface(physicalInterface);
603 if (table == RT_TABLE_UNSPEC) {
619 return modifyIpRule(action, RULE_PRIORITY_VPN_FALLTHROUGH, table, fwmark.intValue,
669 uint32_t table = getRouteTableForInterface(interface);
670 if (table == RT_TABLE_UNSPEC) {
683 if ((ret = modifyOutputInterfaceRules(interface, table, PERMISSION_NONE,
689 if ((ret = modifyIpRoute(RTM_NEWROUTE, table, interface, "0.0.0.0/0", NULL))) {
693 if ((ret = modifyIpRoute(RTM_NEWROUTE, table, interface, "::/0", NULL))) {
720 uint32_t table = getRouteTableForInterface(interface);
721 if (table == RT_TABLE_UNSPEC) {
728 if (int ret = modifyExplicitNetworkRule(netId, table, permission, INVALID_UID, INVALID_UID,
732 if (int ret = modifyOutputInterfaceRules(interface, table, permission, INVALID_UID, INVALID_UID,
758 return modifyImplicitNetworkRule(netId, table, add);
785 uint32_t table = getRouteTableForInterface(interface);
786 if (table
791 if (int ret = modifyVpnUidRangeRule(table, range.getStart(), range.getStop(), secure, add))
795 if (int ret = modifyExplicitNetworkRule(netId, table, PERMISSION_NONE, range.getStart(),
799 if (int ret = modifyOutputInterfaceRules(interface, table, PERMISSION_NONE,
812 if (int ret = modifyVpnSystemPermissionRule(netId, table, secure, add)) {
815 return modifyExplicitNetworkRule(netId, table, PERMISSION_NONE, UID_ROOT, UID_ROOT, add);
823 uint32_t table = getRouteTableForInterface(interface);
824 if (table == RT_TABLE_UNSPEC) {
837 return modifyIpRule(action, RULE_PRIORITY_DEFAULT_NETWORK, table, fwmark.intValue,
844 uint32_t table = getRouteTableForInterface(outputInterface);
845 if (table == RT_TABLE_UNSPEC) {
849 return modifyIpRule(action, RULE_PRIORITY_TETHERING, table, MARK_UNSET, MARK_UNSET,
853 // Adds or removes an IPv4 or IPv6 route to the specified table.
858 uint32_t table;
861 table = getRouteTableForInterface(interface);
862 if (table == RT_TABLE_UNSPEC) {
868 table = ROUTE_TABLE_LOCAL_NETWORK;
872 table = ROUTE_TABLE_LEGACY_NETWORK;
876 table = ROUTE_TABLE_LEGACY_SYSTEM;
881 int ret = modifyIpRoute(action, table, interface, destination, nexthop);
920 WARN_UNUSED_RESULT int RouteController::flushRoutes(uint32_t table) {
921 NetlinkDumpFilter shouldDelete = [table] (nlmsghdr *nlh) {
922 return getRouteTable(nlh) == table;
932 uint32_t table = getRouteTableForInterfaceLocked(interface);
933 if (table == RT_TABLE_UNSPEC) {
937 int ret = flushRoutes(table);