Lines Matching refs:rule

826 Result<void> validateOffloadRule(const TetherOffloadRuleParcel& rule) {  in validateOffloadRule()  argument
829 if (rule.inputInterfaceIndex <= 0) { in validateOffloadRule()
830 return Error(ENODEV) << "Invalid input interface " << rule.inputInterfaceIndex; in validateOffloadRule()
832 if (rule.outputInterfaceIndex <= 0) { in validateOffloadRule()
833 return Error(ENODEV) << "Invalid output interface " << rule.inputInterfaceIndex; in validateOffloadRule()
835 if (rule.prefixLength != 128) { in validateOffloadRule()
836 return Error(EINVAL) << "Prefix length must be 128, not " << rule.prefixLength; in validateOffloadRule()
838 if (rule.destination.size() != sizeof(in6_addr)) { in validateOffloadRule()
839 return Error(EAFNOSUPPORT) << "Invalid IP address length " << rule.destination.size(); in validateOffloadRule()
841 if (rule.srcL2Address.size() != sizeof(hdr.h_source)) { in validateOffloadRule()
842 return Error(ENXIO) << "Invalid L2 src address length " << rule.srcL2Address.size(); in validateOffloadRule()
844 if (rule.dstL2Address.size() != sizeof(hdr.h_dest)) { in validateOffloadRule()
845 return Error(ENXIO) << "Invalid L2 dst address length " << rule.dstL2Address.size(); in validateOffloadRule()
847 if (rule.pmtu < IPV6_MIN_MTU || rule.pmtu > 0xFFFF) { in validateOffloadRule()
848 return Error(EINVAL) << "Invalid IPv6 path mtu " << rule.pmtu; in validateOffloadRule()
854 Result<void> TetherController::addOffloadRule(const TetherOffloadRuleParcel& rule) { in addOffloadRule() argument
855 Result<void> res = validateOffloadRule(rule); in addOffloadRule()
861 memcpy(&hdr.h_dest, rule.dstL2Address.data(), sizeof(hdr.h_dest)); in addOffloadRule()
862 memcpy(&hdr.h_source, rule.srcL2Address.data(), sizeof(hdr.h_source)); in addOffloadRule()
866 .iif = static_cast<uint32_t>(rule.inputInterfaceIndex), in addOffloadRule()
867 .neigh6 = *(const in6_addr*)rule.destination.data(), in addOffloadRule()
871 .oif = static_cast<uint32_t>(rule.outputInterfaceIndex), in addOffloadRule()
873 .pmtu = static_cast<uint16_t>(rule.pmtu), in addOffloadRule()
879 Result<void> TetherController::removeOffloadRule(const TetherOffloadRuleParcel& rule) { in removeOffloadRule() argument
880 Result<void> res = validateOffloadRule(rule); in removeOffloadRule()
884 .iif = static_cast<uint32_t>(rule.inputInterfaceIndex), in removeOffloadRule()
885 .neigh6 = *(const in6_addr*)rule.destination.data(), in removeOffloadRule()