Home | History | Annotate | Download | only in server

Lines Matching refs:table

159 void addTableName(uint32_t table, const std::string& name, std::string* contents) {
161 snprintf(tableString, sizeof(tableString), "%u", table);
207 // + If |table| is non-zero, the rule points at the specified routing table. Otherwise, the table is
208 // unspecified. An unspecified table is not allowed when creating an FR_ACT_TO_TBL rule.
218 uint32_t table, uint32_t fwmark, uint32_t mask, const char* iif,
249 // Note that here we're implicitly setting rule.table to 0. When we want to specify a
250 // non-zero table, we do this via the FRATTR_TABLE attribute.
253 // Don't ever create a rule that looks up table 0, because table 0 is the local table.
254 // It's OK to specify a table ID of 0 when deleting a rule, because that doesn't actually select
255 // table 0, it's a wildcard that matches anything.
256 if (table == RT_TABLE_UNSPEC && rule.action == FR_ACT_TO_TBL && action != RTM_DELRULE) {
270 { &FRATTR_TABLE, table != RT_TABLE_UNSPEC ? sizeof(FRATTR_TABLE) : 0 },
271 { &table, table != RT_TABLE_UNSPEC ? sizeof(table) : 0 },
303 WARN_UNUSED_RESULT int modifyIpRule(uint16_t action, uint32_t priority, uint32_t table,
306 return modifyIpRule(action, priority, FR_ACT_TO_TBL, table, fwmark, mask, iif, oif, uidStart,
310 WARN_UNUSED_RESULT int modifyIpRule(uint16_t action, uint32_t priority, uint32_t table,
312 return modifyIpRule(action, priority, table, fwmark, mask, IIF_NONE, OIF_NONE, INVALID_UID,
318 WARN_UNUSED_RESULT int modifyIpRoute(uint16_t action, uint32_t table, const char* interface,
349 // the table number. But it's an error to specify an interface ("dev ...") or a nexthop for
390 { &table, sizeof(table) },
403 ALOGE("Error %s route %s -> %s %s to table %u: %s",
404 actionName(action), destination, nexthop, interface, table, strerror(-ret));
450 WARN_UNUSED_RESULT int modifyVpnUidRangeRule(uint32_t table, uid_t uidStart, uid_t uidEnd,
469 return modifyIpRule(add ? RTM_NEWRULE : RTM_DELRULE, priority, table, fwmark.intValue,
478 WARN_UNUSED_RESULT int modifyVpnSystemPermissionRule(unsigned netId, uint32_t table, bool secure,
491 return modifyIpRule(add ? RTM_NEWRULE : RTM_DELRULE, priority, table, fwmark.intValue,
502 WARN_UNUSED_RESULT int modifyExplicitNetworkRule(unsigned netId, uint32_t table,
517 return modifyIpRule(add ? RTM_NEWRULE : RTM_DELRULE, RULE_PRIORITY_EXPLICIT_NETWORK, table,
525 WARN_UNUSED_RESULT int modifyOutputInterfaceRules(const char* interface, uint32_t table,
538 table, fwmark.intValue, mask.intValue, IIF_NONE, interface,
544 return modifyIpRule(add ? RTM_NEWRULE : RTM_DELRULE, RULE_PRIORITY_OUTPUT_INTERFACE, table,
553 WARN_UNUSED_RESULT int modifyImplicitNetworkRule(unsigned netId, uint32_t table,
567 return modifyIpRule(add ? RTM_NEWRULE : RTM_DELRULE, RULE_PRIORITY_IMPLICIT_NETWORK, table,
573 // If a packet with a VPN's netId doesn't find a route in the VPN's routing table, it's allowed to
579 uint32_t table = getRouteTableForInterface(physicalInterface);
580 if (table == RT_TABLE_UNSPEC) {
596 return modifyIpRule(action, RULE_PRIORITY_VPN_FALLTHROUGH, table, fwmark.intValue,
645 uint32_t table = getRouteTableForInterface(interface);
646 if (table == RT_TABLE_UNSPEC) {
659 if ((ret = modifyOutputInterfaceRules(interface, table, PERMISSION_NONE,
665 if ((ret = modifyIpRoute(RTM_NEWROUTE, table, interface, "0.0.0.0/0", NULL))) {
669 if ((ret = modifyIpRoute(RTM_NEWROUTE, table, interface, "::/0", NULL))) {
676 // Add a new rule to look up the 'main' table, with the same selectors as the "default network"
677 // rule, but with a lower priority. We will never create routes in the main table; it should only be
711 uint32_t table = getRouteTableForInterface(interface);
712 if (table == RT_TABLE_UNSPEC) {
719 if (int ret = modifyExplicitNetworkRule(netId, table, permission, INVALID_UID, INVALID_UID,
723 if (int ret = modifyOutputInterfaceRules(interface, table, permission, INVALID_UID, INVALID_UID,
727 return modifyImplicitNetworkRule(netId, table, permission, add);
751 uint32_t table = getRouteTableForInterface(interface);
752 if (table == RT_TABLE_UNSPEC) {
757 if (int ret = modifyVpnUidRangeRule(table, range.getStart(), range.getStop(), secure, add))
761 if (int ret = modifyExplicitNetworkRule(netId, table, PERMISSION_NONE, range.getStart(),
765 if (int ret = modifyOutputInterfaceRules(interface, table, PERMISSION_NONE,
778 if (int ret = modifyVpnSystemPermissionRule(netId, table, secure, add)) {
781 return modifyExplicitNetworkRule(netId, table, PERMISSION_NONE, UID_ROOT, UID_ROOT, add);
789 uint32_t table = getRouteTableForInterface(interface);
790 if (table == RT_TABLE_UNSPEC) {
803 return modifyIpRule(action, RULE_PRIORITY_DEFAULT_NETWORK, table, fwmark.intValue,
809 uint32_t table = getRouteTableForInterface(outputInterface);
810 if (table == RT_TABLE_UNSPEC) {
814 return modifyIpRule(action, RULE_PRIORITY_TETHERING, table, MARK_UNSET, MARK_UNSET,
818 // Adds or removes an IPv4 or IPv6 route to the specified table and, if it's a directly-connected
819 // route, to the main table as well.
823 uint32_t table;
826 table = getRouteTableForInterface(interface);
827 if (table == RT_TABLE_UNSPEC) {
833 table = ROUTE_TABLE_LOCAL_NETWORK;
837 table = ROUTE_TABLE_LEGACY_NETWORK;
841 table = ROUTE_TABLE_LEGACY_SYSTEM;
846 int ret = modifyIpRoute(action, table, interface, destination, nexthop);
885 WARN_UNUSED_RESULT int flushRoutes(uint32_t table) {
886 NetlinkDumpFilter shouldDelete = [table] (nlmsghdr *nlh) {
887 return getRouteTable(nlh) == table;
895 uint32_t table = getRouteTableForInterface(interface);
896 if (table == RT_TABLE_UNSPEC) {
900 int ret = flushRoutes(table);