ahedberg | 80d6b12 | 2016-03-17 17:37:35 -0400 | [diff] [blame] | 1 | /* |
| 2 | * |
| 3 | * Copyright 2016, Google Inc. |
| 4 | * All rights reserved. |
| 5 | * |
| 6 | * Redistribution and use in source and binary forms, with or without |
| 7 | * modification, are permitted provided that the following conditions are |
| 8 | * met: |
| 9 | * |
| 10 | * * Redistributions of source code must retain the above copyright |
| 11 | * notice, this list of conditions and the following disclaimer. |
| 12 | * * Redistributions in binary form must reproduce the above |
| 13 | * copyright notice, this list of conditions and the following disclaimer |
| 14 | * in the documentation and/or other materials provided with the |
| 15 | * distribution. |
| 16 | * * Neither the name of Google Inc. nor the names of its |
| 17 | * contributors may be used to endorse or promote products derived from |
| 18 | * this software without specific prior written permission. |
| 19 | * |
| 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 24 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 31 | * |
| 32 | */ |
| 33 | |
Craig Tiller | 9a4dddd | 2016-03-25 17:08:13 -0700 | [diff] [blame] | 34 | #ifndef GRPC_CORE_LIB_IOMGR_UNIX_SOCKETS_POSIX_H |
| 35 | #define GRPC_CORE_LIB_IOMGR_UNIX_SOCKETS_POSIX_H |
ahedberg | 80d6b12 | 2016-03-17 17:37:35 -0400 | [diff] [blame] | 36 | |
| 37 | #include <grpc/support/port_platform.h> |
| 38 | |
ahedberg | 80d6b12 | 2016-03-17 17:37:35 -0400 | [diff] [blame] | 39 | #include <grpc/support/string_util.h> |
| 40 | |
| 41 | #include "src/core/client_config/resolver_factory.h" |
ahedberg | 43df295 | 2016-03-18 10:46:38 -0400 | [diff] [blame] | 42 | #include "src/core/client_config/uri_parser.h" |
ahedberg | 80d6b12 | 2016-03-17 17:37:35 -0400 | [diff] [blame] | 43 | #include "src/core/iomgr/resolve_address.h" |
ahedberg | 879ce77 | 2016-03-22 16:18:15 -0400 | [diff] [blame] | 44 | #include "src/core/iomgr/sockaddr.h" |
ahedberg | 80d6b12 | 2016-03-17 17:37:35 -0400 | [diff] [blame] | 45 | |
| 46 | void grpc_create_socketpair_if_unix(int sv[2]); |
| 47 | |
ahedberg | 8afb88d | 2016-03-22 13:57:47 -0400 | [diff] [blame] | 48 | grpc_resolved_addresses *grpc_resolve_unix_domain_address(const char *name); |
ahedberg | 80d6b12 | 2016-03-17 17:37:35 -0400 | [diff] [blame] | 49 | |
ahedberg | 43df295 | 2016-03-18 10:46:38 -0400 | [diff] [blame] | 50 | int grpc_is_unix_socket(const struct sockaddr *addr); |
ahedberg | 80d6b12 | 2016-03-17 17:37:35 -0400 | [diff] [blame] | 51 | |
ahedberg | fcbcbff | 2016-03-22 13:23:47 -0400 | [diff] [blame] | 52 | void grpc_unlink_if_unix_domain_socket(const struct sockaddr *addr); |
ahedberg | 80d6b12 | 2016-03-17 17:37:35 -0400 | [diff] [blame] | 53 | |
ahedberg | fcbcbff | 2016-03-22 13:23:47 -0400 | [diff] [blame] | 54 | int grpc_parse_unix(grpc_uri *uri, struct sockaddr_storage *addr, size_t *len); |
ahedberg | 80d6b12 | 2016-03-17 17:37:35 -0400 | [diff] [blame] | 55 | |
ahedberg | fcbcbff | 2016-03-22 13:23:47 -0400 | [diff] [blame] | 56 | char *grpc_unix_get_default_authority(grpc_resolver_factory *factory, |
| 57 | grpc_uri *uri); |
ahedberg | 80d6b12 | 2016-03-17 17:37:35 -0400 | [diff] [blame] | 58 | |
ahedberg | 43df295 | 2016-03-18 10:46:38 -0400 | [diff] [blame] | 59 | char *grpc_sockaddr_to_uri_unix_if_possible(const struct sockaddr *addr); |
ahedberg | 80d6b12 | 2016-03-17 17:37:35 -0400 | [diff] [blame] | 60 | |
Craig Tiller | 9a4dddd | 2016-03-25 17:08:13 -0700 | [diff] [blame] | 61 | #endif /* GRPC_CORE_LIB_IOMGR_UNIX_SOCKETS_POSIX_H */ |