(endpoint string)
| 132 | } |
| 133 | |
| 134 | func parseAddressPort(endpoint string) (*addressPort, error) { |
| 135 | name, sport, err := net.SplitHostPort(endpoint) |
| 136 | if err != nil { |
| 137 | return nil, err |
| 138 | } |
| 139 | |
| 140 | port, err := strconv.Atoi(sport) |
| 141 | if err != nil || port < 0 || port > 65535 { |
| 142 | return nil, &net.OpError{Op: "dial", Err: errors.New("port must be numeric")} |
| 143 | } |
| 144 | |
| 145 | return &addressPort{address: name, port: uint16(port)}, nil |
| 146 | } |
| 147 | |
| 148 | func (d VirtualTun) resolveToAddrPort(endpoint *addressPort) (*netip.AddrPort, error) { |
| 149 | addr, err := d.ResolveAddrWithContext(context.Background(), endpoint.address) |
no outgoing calls
no test coverage detected