Home | History | Annotate | Download | only in net

Lines Matching refs:IP

20 func sortByRFC6724withSrcs(addrs []IPAddr, srcs []IP) {
27 addrAttr[i] = ipAttrOf(v.IP)
41 func srcAddrs(addrs []IPAddr) []IP {
42 srcs := make([]IP, len(addrs))
45 dst.IP = addrs[i].IP
50 srcs[i] = src.IP
64 func ipAttrOf(ip IP) ipAttr {
65 if ip == nil {
68 match := rfc6724policyTable.Classify(ip)
70 Scope: classifyScope(ip),
79 srcs []IP // or nil if unreachable
97 DA := s.addrs[i].IP
98 DB := s.addrs[j].IP
295 ip, ipNet, err := ParseCIDR(s)
299 if len(ip) != IPv6len {
300 panic("unexpected IP length")
306 // matching prefix that contains ip.
308 func (t policyTable) Classify(ip IP) policyTableEntry {
310 if ent.Prefix.Contains(ip) {
329 func classifyScope(ip IP) scope {
330 if ip.IsLoopback() || ip.IsLinkLocalUnicast() {
333 ipv6 := len(ip) == IPv6len && ip.To4() == nil
334 if ipv6 && ip.IsMulticast() {
335 return scope(ip[1] & 0xf)
339 if ipv6 && ip[0] == 0xfe && ip[1]&0xc0 == 0xc0 {
352 // If a and b are different IP versions, 0 is returned.
355 func commonPrefixLen(a, b IP) (cpl int) {