(args []ref.Val, result ref.Val)
| 776 | } |
| 777 | |
| 778 | func trackNetworkContainsCIDRStringCost(args []ref.Val, result ref.Val) *uint64 { |
| 779 | cidrSize := cost.ActualSize(args[0]) |
| 780 | otherSize := cost.ActualSize(args[1]) |
| 781 | total := cost.SafeMultiplyByFactor(cost.SafeAdd(cidrSize, cidrSize), cost.StringCostFactor) |
| 782 | total = cost.SafeAdd(total, cost.SafeMultiplyByFactor(cidrSize, cost.StringCostFactor), 1) |
| 783 | total = cost.SafeAdd(total, cost.SafeMultiplyByFactor(otherSize, cost.StringCostFactor)) |
| 784 | return &total |
| 785 | } |
| 786 | |
| 787 | // networkParseCostModel models ip(string) and cidr(string): an IP's length is its address bytes |
| 788 | // (4 or 16) and a CIDR's is the bytes of its prefix (0 to 16); both strategies size them by that |
nothing calls this directly
no test coverage detected