GRPC Core  9.0.0
parse_address.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2015 gRPC authors.
4  *
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
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
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.
16  *
17  */
18 
19 #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PARSE_ADDRESS_H
20 #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PARSE_ADDRESS_H
21 
23 
24 #include <stddef.h>
25 
28 
31 bool grpc_parse_unix(const grpc_uri* uri, grpc_resolved_address* resolved_addr);
32 
35 bool grpc_parse_ipv4(const grpc_uri* uri, grpc_resolved_address* resolved_addr);
36 
39 bool grpc_parse_ipv6(const grpc_uri* uri, grpc_resolved_address* resolved_addr);
40 
42 bool grpc_parse_uri(const grpc_uri* uri, grpc_resolved_address* resolved_addr);
43 
45 bool grpc_parse_ipv4_hostport(const char* hostport, grpc_resolved_address* addr,
46  bool log_errors);
47 bool grpc_parse_ipv6_hostport(const char* hostport, grpc_resolved_address* addr,
48  bool log_errors);
49 
50 /* Converts named or numeric port to a uint16 suitable for use in a sockaddr. */
51 uint16_t grpc_strhtons(const char* port);
52 
53 #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PARSE_ADDRESS_H */
bool grpc_parse_ipv6_hostport(const char *hostport, grpc_resolved_address *addr, bool log_errors)
Definition: parse_address.cc:124
bool grpc_parse_ipv6(const grpc_uri *uri, grpc_resolved_address *resolved_addr)
Populate resolved_addr from uri, whose path is expected to contain an IPv6 host:port pair.
Definition: parse_address.cc:206
bool grpc_parse_ipv4(const grpc_uri *uri, grpc_resolved_address *resolved_addr)
Populate resolved_addr from uri, whose path is expected to contain an IPv4 host:port pair.
Definition: parse_address.cc:112
uint16_t grpc_strhtons(const char *port)
Definition: parse_address.cc:230
bool grpc_parse_unix(const grpc_uri *uri, grpc_resolved_address *resolved_addr)
Populate resolved_addr from uri, whose path is expected to contain a unix socket path.
Definition: parse_address.cc:65
bool grpc_parse_ipv4_hostport(const char *hostport, grpc_resolved_address *addr, bool log_errors)
Parse bare IPv4 or IPv6 "IP:port" strings.
Definition: parse_address.cc:72
bool grpc_parse_uri(const grpc_uri *uri, grpc_resolved_address *resolved_addr)
Populate resolved_addr from uri.
Definition: parse_address.cc:218
Definition: resolve_address.h:44
Definition: uri_parser.h:26