ahedberg | 80d6b12 | 2016-03-17 17:37:35 -0400 | [diff] [blame] | 1 | /* |
| 2 | * |
ahedberg | 8afb88d | 2016-03-22 13:57:47 -0400 | [diff] [blame] | 3 | * Copyright 2016, Google Inc. |
ahedberg | 80d6b12 | 2016-03-17 17:37:35 -0400 | [diff] [blame] | 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 | 9533d04 | 2016-03-25 17:11:06 -0700 | [diff] [blame] | 34 | #include "src/core/lib/iomgr/unix_sockets_posix.h" |
ahedberg | 80d6b12 | 2016-03-17 17:37:35 -0400 | [diff] [blame] | 35 | |
murgatroid99 | 623dd4f | 2016-08-08 17:31:27 -0700 | [diff] [blame] | 36 | #ifndef GRPC_HAVE_UNIX_SOCKET |
ahedberg | 43df295 | 2016-03-18 10:46:38 -0400 | [diff] [blame] | 37 | |
Craig Tiller | 12445ee | 2016-04-06 10:25:04 -0700 | [diff] [blame] | 38 | #include <grpc/support/log.h> |
| 39 | |
Vijay Pai | 81dbf84 | 2016-03-24 10:34:27 -0700 | [diff] [blame] | 40 | void grpc_create_socketpair_if_unix(int sv[2]) { |
Vijay Pai | 761f7bc | 2016-03-24 11:05:48 -0700 | [diff] [blame] | 41 | // TODO: Either implement this for the non-Unix socket case or make |
| 42 | // sure that it is never called in any such case. Until then, leave an |
| 43 | // assertion to notify if this gets called inadvertently |
Vijay Pai | 81dbf84 | 2016-03-24 10:34:27 -0700 | [diff] [blame] | 44 | GPR_ASSERT(0); |
| 45 | } |
ahedberg | 80d6b12 | 2016-03-17 17:37:35 -0400 | [diff] [blame] | 46 | |
Craig Tiller | 3e149f3 | 2016-05-17 16:11:04 -0700 | [diff] [blame] | 47 | grpc_error *grpc_resolve_unix_domain_address( |
| 48 | const char *name, grpc_resolved_addresses **addresses) { |
Craig Tiller | a41ac57 | 2016-05-17 16:08:17 -0700 | [diff] [blame] | 49 | *addresses = NULL; |
| 50 | return GRPC_ERROR_CREATE("Unix domain sockets are not supported on Windows"); |
ahedberg | 80d6b12 | 2016-03-17 17:37:35 -0400 | [diff] [blame] | 51 | } |
| 52 | |
murgatroid99 | 7871f73 | 2016-09-23 13:49:05 -0700 | [diff] [blame] | 53 | int grpc_is_unix_socket(const grpc_resolved_address *addr) { return false; } |
ahedberg | 80d6b12 | 2016-03-17 17:37:35 -0400 | [diff] [blame] | 54 | |
murgatroid99 | 7871f73 | 2016-09-23 13:49:05 -0700 | [diff] [blame] | 55 | void grpc_unlink_if_unix_domain_socket(const grpc_resolved_address *addr) {} |
ahedberg | 80d6b12 | 2016-03-17 17:37:35 -0400 | [diff] [blame] | 56 | |
murgatroid99 | 7871f73 | 2016-09-23 13:49:05 -0700 | [diff] [blame] | 57 | char *grpc_sockaddr_to_uri_unix_if_possible(const grpc_resolved_address *addr) { |
ahedberg | 43df295 | 2016-03-18 10:46:38 -0400 | [diff] [blame] | 58 | return NULL; |
ahedberg | 80d6b12 | 2016-03-17 17:37:35 -0400 | [diff] [blame] | 59 | } |
| 60 | |
| 61 | #endif |