dnssd_ipc.h revision 5ffb0c9b03b5149ff4f5821a62be4a52408ada2a
52a38c0fe76475c93300961068ea9332cb9854d6Brendan Mmiller/* -*- Mode: C; tab-width: 4 -*-
52a38c0fe76475c93300961068ea9332cb9854d6Brendan Mmiller * Copyright (c) 2003-2004, Apple Computer, Inc. All rights reserved.
52a38c0fe76475c93300961068ea9332cb9854d6Brendan Mmiller * Redistribution and use in source and binary forms, with or without
52a38c0fe76475c93300961068ea9332cb9854d6Brendan Mmiller * modification, are permitted provided that the following conditions are met:
52a38c0fe76475c93300961068ea9332cb9854d6Brendan Mmiller * 1. Redistributions of source code must retain the above copyright notice,
52a38c0fe76475c93300961068ea9332cb9854d6Brendan Mmiller * this list of conditions and the following disclaimer.
52a38c0fe76475c93300961068ea9332cb9854d6Brendan Mmiller * 2. Redistributions in binary form must reproduce the above copyright notice,
52a38c0fe76475c93300961068ea9332cb9854d6Brendan Mmiller * this list of conditions and the following disclaimer in the documentation
52a38c0fe76475c93300961068ea9332cb9854d6Brendan Mmiller * and/or other materials provided with the distribution.
52a38c0fe76475c93300961068ea9332cb9854d6Brendan Mmiller * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of its
52a38c0fe76475c93300961068ea9332cb9854d6Brendan Mmiller * contributors may be used to endorse or promote products derived from this
52a38c0fe76475c93300961068ea9332cb9854d6Brendan Mmiller * software without specific prior written permission.
52a38c0fe76475c93300961068ea9332cb9854d6Brendan Mmiller * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
52a38c0fe76475c93300961068ea9332cb9854d6Brendan Mmiller * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
52a38c0fe76475c93300961068ea9332cb9854d6Brendan Mmiller * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21dcdac963f79c098a5ea1a2c5c5e109429c9786Brendan Miller * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
80a21b2f138c5017c1d929d4879bfc686d6841ebBrendan Miller * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
52a38c0fe76475c93300961068ea9332cb9854d6Brendan Mmiller * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
52a38c0fe76475c93300961068ea9332cb9854d6Brendan Mmiller * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
52a38c0fe76475c93300961068ea9332cb9854d6Brendan Mmiller * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
52a38c0fe76475c93300961068ea9332cb9854d6Brendan Mmiller * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
52a38c0fe76475c93300961068ea9332cb9854d6Brendan Mmiller * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
52a38c0fe76475c93300961068ea9332cb9854d6Brendan Mmiller// Common cross platform services
52a38c0fe76475c93300961068ea9332cb9854d6Brendan Mmiller# define dnssd_SocketValid(s) ((s) != INVALID_SOCKET)
# include <unistd.h>
# include <string.h>
# include <stdio.h>
# include <stdlib.h>
# define dnssd_SocketValid(s) ((s) >= 0)
# define dnssd_sock_t int
# define dnssd_socklen_t unsigned int
#if defined(USE_TCP_LOOPBACK)
# ifndef MDNS_UDS_SERVERPATH
#ifndef AF_LOCAL
// Structure packing macro. If we're not using GNUC, it's not fatal. Most compilers naturally pack the on-the-wire
// structures correctly anyway, so a plain "struct" is usually fine. In the event that structures are not packed
// correctly, our compile-time assertion checks will catch it and prevent inadvertent generation of non-working code.
#ifndef packedstruct
#define packedstruct struct
#define packedunion union
} request_op_t;
} reply_op_t;
#if defined(_WIN64)
typedef packedunion
void *context;
typedef packedstruct
client_context_t client_context; // context passed from client, returned by server in corresponding reply
// socket connected by DNSServiceCreateConnection(). Must be unique in the scope of the connection, such that and
// index/socket pair uniquely identifies a record. (Used to select records for removal by DNSServiceRemoveRecord())
} ipc_msg_hdr;
#if defined(_WIN64)
# pragma pack()