1 /* -*- Mode: C; tab-width: 4; c-file-style: "bsd"; c-basic-offset: 4; fill-column: 108; indent-tabs-mode: nil; -*- 2 * 3 * Copyright (c) 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 __PLATFORM_COMMON_H 19 #define __PLATFORM_COMMON_H 20 21 #ifndef NSEC_PER_SEC 22 #define NSEC_PER_SEC 1000000000ull 23 #endif 24 #ifndef USEC_PER_SEC 25 #define USEC_PER_SEC 1000000ull 26 #endif 27 #ifndef MSEC_PER_SEC 28 #define MSEC_PER_SEC 1000ull 29 #endif 30 #ifndef NSEC_PER_USEC 31 #define NSEC_PER_USEC 1000ull 32 #endif 33 #ifndef NSEC_PER_MSEC 34 #define NSEC_PER_MSEC 1000000ull 35 #endif 36 #ifndef USEC_PER_MSEC 37 #define USEC_PER_MSEC (NSEC_PER_MSEC / NSEC_PER_USEC) 38 #endif 39 40 extern void ReadDDNSSettingsFromConfFile(mDNS *const m, const char *const filename, 41 domainname *const hostname, domainname *const domain, 42 mDNSBool *DomainDiscoveryDisabled); 43 extern mDNSBool mDNSPosixTCPSocketSetup(int *fd, mDNSAddr_Type addrType, mDNSIPPort *port, mDNSIPPort *outTcpPort); 44 extern TCPSocket *mDNSPosixDoTCPListenCallback(int fd, mDNSAddr_Type addressType, TCPSocketFlags socketFlags, 45 TCPAcceptedCallback callback, void *context); 46 extern mDNSBool mDNSPosixTCPListen(int *fd, mDNSAddr_Type addrtype, mDNSIPPort *port, mDNSAddr *addr, 47 mDNSBool reuseAddr, int queueLength); 48 extern long mDNSPosixReadTCP(int fd, void *buf, unsigned long buflen, mDNSBool *closed); 49 extern long mDNSPosixWriteTCP(int fd, const char *msg, unsigned long len); 50 #endif 51