David Garcia Quintas | 9885bff | 2016-04-07 17:31:29 -0700 | [diff] [blame] | 1 | /* |
| 2 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame^] | 3 | * Copyright 2015 gRPC authors. |
David Garcia Quintas | 9885bff | 2016-04-07 17:31:29 -0700 | [diff] [blame] | 4 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame^] | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at |
David Garcia Quintas | 9885bff | 2016-04-07 17:31:29 -0700 | [diff] [blame] | 8 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame^] | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
David Garcia Quintas | 9885bff | 2016-04-07 17:31:29 -0700 | [diff] [blame] | 10 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame^] | 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
David Garcia Quintas | 9885bff | 2016-04-07 17:31:29 -0700 | [diff] [blame] | 16 | * |
| 17 | */ |
| 18 | |
Craig Tiller | d608cd6 | 2017-04-02 16:23:17 -0700 | [diff] [blame] | 19 | #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PARSE_ADDRESS_H |
| 20 | #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PARSE_ADDRESS_H |
David Garcia Quintas | 9885bff | 2016-04-07 17:31:29 -0700 | [diff] [blame] | 21 | |
| 22 | #include <stddef.h> |
| 23 | |
Craig Tiller | 9eb0fde | 2017-03-31 16:59:30 -0700 | [diff] [blame] | 24 | #include "src/core/ext/filters/client_channel/uri_parser.h" |
murgatroid99 | 7871f73 | 2016-09-23 13:49:05 -0700 | [diff] [blame] | 25 | #include "src/core/lib/iomgr/resolve_address.h" |
David Garcia Quintas | 9885bff | 2016-04-07 17:31:29 -0700 | [diff] [blame] | 26 | |
David Garcia Quintas | 53af23c | 2017-04-15 10:29:46 -0700 | [diff] [blame] | 27 | /** Populate \a resolved_addr from \a uri, whose path is expected to contain a |
David Garcia Quintas | 9885bff | 2016-04-07 17:31:29 -0700 | [diff] [blame] | 28 | * unix socket path. Returns true upon success. */ |
David Garcia Quintas | 53af23c | 2017-04-15 10:29:46 -0700 | [diff] [blame] | 29 | bool grpc_parse_unix(const grpc_uri *uri, grpc_resolved_address *resolved_addr); |
David Garcia Quintas | 9885bff | 2016-04-07 17:31:29 -0700 | [diff] [blame] | 30 | |
David Garcia Quintas | 53af23c | 2017-04-15 10:29:46 -0700 | [diff] [blame] | 31 | /** Populate \a resolved_addr from \a uri, whose path is expected to contain an |
| 32 | * IPv4 host:port pair. Returns true upon success. */ |
| 33 | bool grpc_parse_ipv4(const grpc_uri *uri, grpc_resolved_address *resolved_addr); |
David Garcia Quintas | 9885bff | 2016-04-07 17:31:29 -0700 | [diff] [blame] | 34 | |
David Garcia Quintas | 53af23c | 2017-04-15 10:29:46 -0700 | [diff] [blame] | 35 | /** Populate \a resolved_addr from \a uri, whose path is expected to contain an |
| 36 | * IPv6 host:port pair. Returns true upon success. */ |
| 37 | bool grpc_parse_ipv6(const grpc_uri *uri, grpc_resolved_address *resolved_addr); |
| 38 | |
| 39 | /** Populate \a resolved_addr from \a uri. Returns true upon success. */ |
| 40 | bool grpc_parse_uri(const grpc_uri *uri, grpc_resolved_address *resolved_addr); |
David Garcia Quintas | 9885bff | 2016-04-07 17:31:29 -0700 | [diff] [blame] | 41 | |
Mark D. Roth | 96fc54c | 2017-05-18 14:33:07 -0700 | [diff] [blame] | 42 | /** Parse bare IPv4 or IPv6 "IP:port" strings. */ |
| 43 | bool grpc_parse_ipv4_hostport(const char *hostport, grpc_resolved_address *addr, |
| 44 | bool log_errors); |
| 45 | bool grpc_parse_ipv6_hostport(const char *hostport, grpc_resolved_address *addr, |
| 46 | bool log_errors); |
| 47 | |
Craig Tiller | d608cd6 | 2017-04-02 16:23:17 -0700 | [diff] [blame] | 48 | #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PARSE_ADDRESS_H */ |