source: rtems-libbsd/mDNSResponder/mDNSPosix/mDNSPosix.h @ 4a5f546

55-freebsd-126-freebsd-12
Last change on this file since 4a5f546 was 4c086a2, checked in by Sebastian Huber <sebastian.huber@…>, on 09/19/18 at 06:56:09

mDNSResponder: Update to v878.1.1

The sources can be obtained via:

https://opensource.apple.com/tarballs/mDNSResponder/mDNSResponder-878.1.1.tar.gz

Update #3522.

  • Property mode set to 100755
File size: 3.1 KB
Line 
1/* -*- Mode: C; tab-width: 4 -*-
2 *
3 * Copyright (c) 2002-2004 Apple Computer, Inc. All rights reserved.
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#ifndef __mDNSPlatformPosix_h
19#define __mDNSPlatformPosix_h
20
21#include <signal.h>
22#include <sys/time.h>
23#ifdef __rtems__
24#include <pthread.h>
25#endif /* __rtems__ */
26
27#ifdef  __cplusplus
28extern "C" {
29#endif
30
31// PosixNetworkInterface is a record extension of the core NetworkInterfaceInfo
32// type that supports extra fields needed by the Posix platform.
33//
34// IMPORTANT: coreIntf must be the first field in the structure because
35// we cast between pointers to the two different types regularly.
36
37typedef struct PosixNetworkInterface PosixNetworkInterface;
38
39struct PosixNetworkInterface
40{
41    NetworkInterfaceInfo coreIntf;              // MUST be the first element in this structure
42    mDNSs32 LastSeen;
43    const char *            intfName;
44    PosixNetworkInterface * aliasIntf;
45    int index;
46    int multicastSocket4;
47#if HAVE_IPV6
48    int multicastSocket6;
49#endif
50};
51
52// This is a global because debugf_() needs to be able to check its value
53extern int gMDNSPlatformPosixVerboseLevel;
54
55struct mDNS_PlatformSupport_struct
56{
57    int unicastSocket4;
58#if HAVE_IPV6
59    int unicastSocket6;
60#endif
61#ifdef __rtems__
62    pthread_mutex_t mutex;
63#endif /* __rtems__ */
64};
65
66#define uDNS_SERVERS_FILE "/etc/resolv.conf"
67extern int ParseDNSServers(mDNS *m, const char *filePath);
68extern mStatus mDNSPlatformPosixRefreshInterfaceList(mDNS *const m);
69// See comment in implementation.
70
71// Call mDNSPosixGetFDSet before calling select(), to update the parameters
72// as may be necessary to meet the needs of the mDNSCore code.
73// The timeout pointer MUST NOT be NULL.
74// Set timeout->tv_sec to FutureTime if you want to have effectively no timeout
75// After calling mDNSPosixGetFDSet(), call select(nfds, &readfds, NULL, NULL, &timeout); as usual
76// After select() returns, call mDNSPosixProcessFDSet() to let mDNSCore do its work
77extern void mDNSPosixGetFDSet(mDNS *m, int *nfds, fd_set *readfds, struct timeval *timeout);
78extern void mDNSPosixProcessFDSet(mDNS *const m, fd_set *readfds);
79
80typedef void (*mDNSPosixEventCallback)(int fd, short filter, void *context);
81
82extern mStatus mDNSPosixAddFDToEventLoop( int fd, mDNSPosixEventCallback callback, void *context);
83extern mStatus mDNSPosixRemoveFDFromEventLoop( int fd);
84extern mStatus mDNSPosixListenForSignalInEventLoop( int signum);
85extern mStatus mDNSPosixIgnoreSignalInEventLoop( int signum);
86extern mStatus mDNSPosixRunEventLoopOnce( mDNS *m, const struct timeval *pTimeout, sigset_t *pSignalsReceived, mDNSBool *pDataDispatched);
87
88#ifdef  __cplusplus
89}
90#endif
91
92#endif
Note: See TracBrowser for help on using the repository browser.