Lines Matching refs:spec
78 bool parse_tcp_socket_spec(std::string_view spec, std::string* hostname, int* port, in parse_tcp_socket_spec() argument
80 if (!spec.starts_with("tcp:")) { in parse_tcp_socket_spec()
82 *error += spec; in parse_tcp_socket_spec()
91 if (android::base::ParseInt(&spec[4], &port_value)) { in parse_tcp_socket_spec()
99 std::string addr(spec.substr(4)); in parse_tcp_socket_spec()
120 int get_host_socket_spec_port(std::string_view spec, std::string* error) { in get_host_socket_spec_port() argument
122 if (spec.starts_with("tcp:")) { in get_host_socket_spec_port()
123 if (!parse_tcp_socket_spec(spec, nullptr, &port, nullptr, error)) { in get_host_socket_spec_port()
126 } else if (spec.starts_with("vsock:")) { in get_host_socket_spec_port()
128 std::string spec_str(spec); in get_host_socket_spec_port()
160 bool is_socket_spec(std::string_view spec) { in is_socket_spec() argument
163 if (spec.starts_with(prefix)) { in is_socket_spec()
167 return spec.starts_with("tcp:") || spec.starts_with("acceptfd:") || spec.starts_with("vsock:"); in is_socket_spec()
170 bool is_local_socket_spec(std::string_view spec) { in is_local_socket_spec() argument
173 if (spec.starts_with(prefix)) { in is_local_socket_spec()
180 if (!parse_tcp_socket_spec(spec, &hostname, nullptr, nullptr, &error)) { in is_local_socket_spec()
339 int socket_spec_listen(std::string_view spec, std::string* error, int* resolved_port) { argument
340 if (spec.starts_with("tcp:")) {
343 if (!parse_tcp_socket_spec(spec, &hostname, &port, nullptr, error)) {
368 } else if (spec.starts_with("vsock:")) {
370 std::string spec_str(spec);
417 } else if (ConsumePrefix(&spec, "acceptfd:")) {
426 if (!ParseUint(&fd_u, spec) || fd_u > std::numeric_limits<int>::max()) {
461 if (spec.starts_with(prefix)) {
464 *error += spec;
468 return network_local_server(&spec[prefix.length()], it.second.socket_namespace,
474 *error += spec;