/*
*/
/* -*- Mode: C; tab-width: 4 -*-
*
* Copyright (c) 2003-2004, Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Change History (most recent first):
$Log: dnssd_ipc.h,v $
Revision 1.23 2006/08/14 23:05:53 cheshire
Added "tab-width" emacs header line
Revision 1.22 2006/06/28 08:56:26 cheshire
Added "_op" to the end of the operation code enum values,
to differentiate them from the routines with the same names
Revision 1.21 2005/09/29 06:38:13 herscher
Remove #define MSG_WAITALL on Windows. We don't use this macro anymore, and it's presence causes warnings to be emitted when compiling against the latest Microsoft Platform SDK.
Revision 1.20 2005/03/21 00:39:31 shersche
<rdar://problem/4021486> Fix build warnings on Win32 platform
Revision 1.19 2005/02/02 02:25:22 cheshire
Revision 1.18 2005/01/27 22:57:56 cheshire
Fix compile errors on gcc4
Revision 1.17 2004/11/23 03:39:47 cheshire
Let interface name/index mapping capability live directly in JNISupport.c,
instead of having to call through to the daemon via IPC to get this information.
Revision 1.16 2004/11/12 03:21:41 rpantos
rdar://problem/3809541 Add DNSSDMapIfIndexToName, DNSSDMapNameToIfIndex.
Revision 1.15 2004/10/06 02:22:20 cheshire
Changed MacRoman copyright symbol (should have been UTF-8 in any case :-) to ASCII-compatible "(c)"
Revision 1.14 2004/10/01 22:15:55 rpantos
rdar://problem/3824265: Replace APSL in client lib with BSD license.
Revision 1.13 2004/09/16 23:14:25 cheshire
Changes for Windows compatibility
Revision 1.12 2004/09/16 21:46:38 ksekar
<rdar://problem/3665304> Need SPI for LoginWindow to associate a UID with a Wide Area domain
Revision 1.11 2004/08/10 06:24:56 cheshire
Use types with precisely defined sizes for 'op' and 'reg_index', for better
compatibility if the daemon and the client stub are built using different compilers
Revision 1.10 2004/07/07 17:39:25 shersche
Change MDNS_SERVERPORT from 5533 to 5354.
Revision 1.9 2004/06/25 00:26:27 rpantos
Changes to fix the Posix build on Solaris.
Revision 1.8 2004/06/18 04:56:51 rpantos
Add layer for platform code
Revision 1.7 2004/06/12 01:08:14 cheshire
Changes for Windows compatibility
Revision 1.6 2003/08/12 19:56:25 cheshire
Update to APSL 2.0
*/
#ifndef DNSSD_IPC_H
#define DNSSD_IPC_H
#include <paths.h>
#include "dns_sd.h"
//
// Common cross platform services
//
#if defined(WIN32)
# include <winsock2.h>
# define dnssd_socklen_t int
# define dnssd_sockbuf_t const char*
# define ssize_t int
#else
# include <unistd.h>
# include <string.h>
# include <stdio.h>
# include <stdlib.h>
# define dnssd_sock_t int
# define dnssd_socklen_t unsigned int
# define dnssd_sockbuf_t const char*
#endif
#if defined(USE_TCP_LOOPBACK)
#else
# ifndef MDNS_UDS_SERVERPATH
# endif
// longest legal control path length
#endif
//#define UDSDEBUG // verbose debug output
// Compatibility workaround
#ifndef AF_LOCAL
#endif
// General UDS constants
// IPC data encoding constants and types
#define IPC_FLAGS_REUSE_SOCKET 2 // set flag if synchronous errors are to be sent via the primary socket
// (if not set, first string in message buffer must be path to error socket
typedef enum
{
} request_op_t;
typedef enum
{
} reply_op_t;
// client stub callback to process message from server and deliver results to
// client application
typedef void (*process_reply_callback)
(
char *msg
);
// allow 64-bit client to interoperate w/ 32-bit daemon
typedef union
{
void *context;
typedef struct ipc_msg_hdr_struct
{
client_context_t client_context; // context passed from client, returned by server in corresponding reply
// socket connected by DNSServiceConnect(). 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())
// it is advanced to point to the next field, or the end of the message
// routines to write to and extract data from message buffers.
// caller responsible for bounds checking.
// ptr is the address of the pointer to the start of the field.
// it is advanced to point to the next field, or the end of the message
// rdata is not copied from buffer.
#endif // DNSSD_IPC_H