Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/apache2/mDNSResponder merge conflicts



details:   https://anonhg.NetBSD.org/src/rev/4d43886dda1e
branches:  trunk
changeset: 358713:4d43886dda1e
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Jan 14 19:37:35 2018 +0000

description:
merge conflicts

diffstat:

 external/apache2/mDNSResponder/dist/Clients/dns-sd.c              |   2505 +-
 external/apache2/mDNSResponder/dist/mDNSCore/DNSCommon.c          |   6497 +-
 external/apache2/mDNSResponder/dist/mDNSCore/DNSDigest.c          |   1772 +-
 external/apache2/mDNSResponder/dist/mDNSCore/mDNS.c               |  24459 +++++----
 external/apache2/mDNSResponder/dist/mDNSCore/mDNSEmbeddedAPI.h    |   3545 +-
 external/apache2/mDNSResponder/dist/mDNSCore/uDNS.c               |      2 +
 external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c       |    365 +-
 external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c         |   2617 +-
 external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.c           |    505 +-
 external/apache2/mDNSResponder/dist/mDNSShared/PlatformCommon.c   |    303 +-
 external/apache2/mDNSResponder/dist/mDNSShared/dns-sd.1           |    100 +-
 external/apache2/mDNSResponder/dist/mDNSShared/dns_sd.h           |   1008 +-
 external/apache2/mDNSResponder/dist/mDNSShared/dnssd_clientlib.c  |    544 +-
 external/apache2/mDNSResponder/dist/mDNSShared/dnssd_clientstub.c |   3611 +-
 external/apache2/mDNSResponder/dist/mDNSShared/dnssd_ipc.h        |    174 +-
 external/apache2/mDNSResponder/dist/mDNSShared/uds_daemon.c       |   9894 ++-
 external/apache2/mDNSResponder/prepare-import.sh                  |     36 +-
 external/apache2/mDNSResponder/usr.sbin/mdnsd/Makefile            |      4 +-
 18 files changed, 33079 insertions(+), 24862 deletions(-)

diffs (truncated from 63244 to 300 lines):

diff -r ea63f108de9e -r 4d43886dda1e external/apache2/mDNSResponder/dist/Clients/dns-sd.c
--- a/external/apache2/mDNSResponder/dist/Clients/dns-sd.c      Sun Jan 14 18:43:01 2018 +0000
+++ b/external/apache2/mDNSResponder/dist/Clients/dns-sd.c      Sun Jan 14 19:37:35 2018 +0000
@@ -1,6 +1,6 @@
 /* -*- Mode: C; tab-width: 4 -*-
  *
- * Copyright (c) 2002-2008 Apple Inc. All rights reserved.
+ * Copyright (c) 2002-2013 Apple Inc. All rights reserved.
  *
  * Disclaimer: IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc.
  * ("Apple") in consideration of your agreement to the following terms, and your
@@ -37,31 +37,18 @@
  * (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * Formatting notes:
- * This code follows the "Whitesmiths style" C indentation rules. Plenty of discussion
- * on C indentation can be found on the web, such as <http://www.kafejo.com/komp/1tbs.htm>,
- * but for the sake of brevity here I will say just this: Curly braces are not syntactially
- * part of an "if" statement; they are the beginning and ending markers of a compound statement;
- * therefore common sense dictates that if they are part of a compound statement then they
- * should be indented to the same level as everything else in that compound statement.
- * Indenting curly braces at the same level as the "if" implies that curly braces are
- * part of the "if", which is false. (This is as misleading as people who write "char* x,y;"
- * thinking that variables x and y are both of type "char*" -- and anyone who doesn't
- * understand why variable y is not of type "char*" just proves the point that poor code
- * layout leads people to unfortunate misunderstandings about how the C language really works.)
+   To build this tool, copy and paste the following into a command line:
+
+   OS X:
+   gcc dns-sd.c -o dns-sd
 
-To build this tool, copy and paste the following into a command line:
-
-OS X:
-gcc dns-sd.c -o dns-sd
+   POSIX systems:
+   gcc dns-sd.c -o dns-sd -I../mDNSShared -ldns_sd
 
-POSIX systems:
-gcc dns-sd.c -o dns-sd -I../mDNSShared -ldns_sd
-
-Windows:
-cl dns-sd.c -I../mDNSShared -DNOT_HAVE_GETOPT ws2_32.lib ..\mDNSWindows\DLL\Release\dnssd.lib
-(may require that you run a Visual Studio script such as vsvars32.bat first)
-*/
+   Windows:
+   cl dns-sd.c -I../mDNSShared -DNOT_HAVE_GETOPT ws2_32.lib ..\mDNSWindows\DLL\Release\dnssd.lib
+   (may require that you run a Visual Studio script such as vsvars32.bat first)
+ */
 
 // For testing changes to dnssd_clientstub.c, uncomment this line and the code will be compiled
 // with an embedded copy of the client stub instead of linking the system library version at runtime.
@@ -79,98 +66,102 @@
 #endif
 
 #include <ctype.h>
-#include <stdio.h>                     // For stdout, stderr
-#include <stdlib.h>                    // For exit()
-#include <string.h>                    // For strlen(), strcpy()
-#include <errno.h>                     // For errno, EINTR
+#include <stdio.h>          // For stdout, stderr
+#include <stdlib.h>         // For exit()
+#include <string.h>         // For strlen(), strcpy()
+#include <errno.h>          // For errno, EINTR
 #include <time.h>
-#include <sys/types.h>         // For u_char
+#include <sys/types.h>      // For u_char
 
 #ifdef _WIN32
-       #include <winsock2.h>
-       #include <ws2tcpip.h>
-       #include <Iphlpapi.h>
-       #include <process.h>
-       typedef int        pid_t;
-       #define getpid     _getpid
-       #define strcasecmp _stricmp
-       #define snprintf   _snprintf
-       static const char kFilePathSep = '\\';
-       #ifndef HeapEnableTerminationOnCorruption
-       #     define HeapEnableTerminationOnCorruption (HEAP_INFORMATION_CLASS)1
-       #endif
-       #if !defined(IFNAMSIZ)
-        #define IFNAMSIZ 16
+    #include <winsock2.h>
+    #include <ws2tcpip.h>
+    #include <Iphlpapi.h>
+    #include <process.h>
+typedef int pid_t;
+    #define getpid     _getpid
+    #define strcasecmp _stricmp
+    #define snprintf   _snprintf
+static const char kFilePathSep = '\\';
+    #ifndef HeapEnableTerminationOnCorruption
+    #     define HeapEnableTerminationOnCorruption (HEAP_INFORMATION_CLASS)1
+    #endif
+    #if !defined(IFNAMSIZ)
+     #define IFNAMSIZ 16
     #endif
-       #define if_nametoindex if_nametoindex_win
-       #define if_indextoname if_indextoname_win
+    #define if_nametoindex if_nametoindex_win
+    #define if_indextoname if_indextoname_win
 
-       typedef PCHAR (WINAPI * if_indextoname_funcptr_t)(ULONG index, PCHAR name);
-       typedef ULONG (WINAPI * if_nametoindex_funcptr_t)(PCSTR name);
+typedef PCHAR (WINAPI * if_indextoname_funcptr_t)(ULONG index, PCHAR name);
+typedef ULONG (WINAPI * if_nametoindex_funcptr_t)(PCSTR name);
 
-       unsigned if_nametoindex_win(const char *ifname)
-               {
-               HMODULE library;
-               unsigned index = 0;
+unsigned if_nametoindex_win(const char *ifname)
+{
+    HMODULE library;
+    unsigned index = 0;
 
-               // Try and load the IP helper library dll
-               if ((library = LoadLibrary(TEXT("Iphlpapi")) ) != NULL )
-                       {
-                       if_nametoindex_funcptr_t if_nametoindex_funcptr;
+    // Try and load the IP helper library dll
+    if ((library = LoadLibrary(TEXT("Iphlpapi")) ) != NULL )
+    {
+        if_nametoindex_funcptr_t if_nametoindex_funcptr;
 
-                       // On Vista and above there is a Posix like implementation of if_nametoindex
-                       if ((if_nametoindex_funcptr = (if_nametoindex_funcptr_t) GetProcAddress(library, "if_nametoindex")) != NULL )
-                               {
-                               index = if_nametoindex_funcptr(ifname);
-                               }
+        // On Vista and above there is a Posix like implementation of if_nametoindex
+        if ((if_nametoindex_funcptr = (if_nametoindex_funcptr_t) GetProcAddress(library, "if_nametoindex")) != NULL )
+        {
+            index = if_nametoindex_funcptr(ifname);
+        }
 
-                       FreeLibrary(library);
-                       }
+        FreeLibrary(library);
+    }
 
-               return index;
-               }
+    return index;
+}
 
-       char * if_indextoname_win( unsigned ifindex, char *ifname)
-               {
-               HMODULE library;
-               char * name = NULL;
+char * if_indextoname_win( unsigned ifindex, char *ifname)
+{
+    HMODULE library;
+    char * name = NULL;
 
-               // Try and load the IP helper library dll
-               if ((library = LoadLibrary(TEXT("Iphlpapi")) ) != NULL )
-                       {
-                       if_indextoname_funcptr_t if_indextoname_funcptr;
+    // Try and load the IP helper library dll
+    if ((library = LoadLibrary(TEXT("Iphlpapi")) ) != NULL )
+    {
+        if_indextoname_funcptr_t if_indextoname_funcptr;
 
-                       // On Vista and above there is a Posix like implementation of if_indextoname
-                       if ((if_indextoname_funcptr = (if_indextoname_funcptr_t) GetProcAddress(library, "if_indextoname")) != NULL )
-                               {
-                               name = if_indextoname_funcptr(ifindex, ifname);
-                               }
+        // On Vista and above there is a Posix like implementation of if_indextoname
+        if ((if_indextoname_funcptr = (if_indextoname_funcptr_t) GetProcAddress(library, "if_indextoname")) != NULL )
+        {
+            name = if_indextoname_funcptr(ifindex, ifname);
+        }
 
-                       FreeLibrary(library);
-                       }
+        FreeLibrary(library);
+    }
 
-               return name;
-               }
+    return name;
+}
 
-       static size_t _sa_len(const struct sockaddr *addr)
-               {
-               if (addr->sa_family == AF_INET) return (sizeof(struct sockaddr_in));
-               else if (addr->sa_family == AF_INET6) return (sizeof(struct sockaddr_in6));
-               else return (sizeof(struct sockaddr));
-               }
+static size_t _sa_len(const struct sockaddr *addr)
+{
+    if (addr->sa_family == AF_INET) return (sizeof(struct sockaddr_in));
+    else if (addr->sa_family == AF_INET6) return (sizeof(struct sockaddr_in6));
+    else return (sizeof(struct sockaddr));
+}
 
 #   define SA_LEN(addr) (_sa_len(addr))
 
 #else
-       #include <unistd.h>                     // For getopt() and optind
-       #include <netdb.h>                      // For getaddrinfo()
-       #include <sys/time.h>           // For struct timeval
-       #include <sys/socket.h>         // For AF_INET
-       #include <netinet/in.h>         // For struct sockaddr_in()
-       #include <arpa/inet.h>          // For inet_addr()
-       #include <net/if.h>                     // For if_nametoindex()
-       static const char kFilePathSep = '/';
-       #define SA_LEN(addr) ((addr)->sa_len)
+    #include <unistd.h>         // For getopt() and optind
+    #include <netdb.h>          // For getaddrinfo()
+    #include <sys/time.h>       // For struct timeval
+    #include <sys/socket.h>     // For AF_INET
+    #include <netinet/in.h>     // For struct sockaddr_in()
+    #include <arpa/inet.h>      // For inet_addr()
+    #include <net/if.h>         // For if_nametoindex()
+static const char kFilePathSep = '/';
+// #ifndef NOT_HAVE_SA_LEN
+//  #define SA_LEN(addr) ((addr)->sa_len)
+// #else
+    #define SA_LEN(addr) (((addr)->sa_family == AF_INET6) ? sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in))
+// #endif
 #endif
 
 #if (TEST_NEW_CLIENTSTUB && !defined(__APPLE_API_PRIVATE))
@@ -178,7 +169,7 @@
 #endif
 
 // DNSServiceSetDispatchQueue is not supported on 10.6 & prior
-#if ! TEST_NEW_CLIENTSTUB && defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ - (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ % 10) <= 1060)
+#if !TEST_NEW_CLIENTSTUB && defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ - (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ % 10) <= 1060)
 #undef _DNS_SD_LIBDISPATCH
 #endif
 #include "dns_sd.h"
@@ -190,6 +181,10 @@
 #include "../mDNSShared/dnssd_clientstub.c"
 #endif
 
+#if _DNS_SD_LIBDISPATCH
+#include <dispatch/private.h>
+#endif
+
 // The "+0" is to cope with the case where _DNS_SD_H is defined but empty (e.g. on Mac OS X 10.4 and earlier)
 #if _DNS_SD_H+0 >= 116
 #define HAS_NAT_PMP_API 1
@@ -201,13 +196,48 @@
 //*************************************************************************************************************
 // Globals
 
+#define DS_FIXED_SIZE   4
+typedef struct
+{
+    unsigned short keyTag;
+    unsigned char alg; 
+    unsigned char digestType;
+    unsigned char  *digest;
+} rdataDS;
+
+#define DNSKEY_FIXED_SIZE    4
+typedef struct
+{
+    unsigned short flags;
+    unsigned char proto;
+    unsigned char alg;
+    unsigned char *data;
+} rdataDNSKey;
+
+//size of rdataRRSIG excluding signerName and signature (which are variable fields) 
+#define RRSIG_FIXED_SIZE      18
+typedef struct
+{
+    unsigned short typeCovered;
+    unsigned char alg; 
+    unsigned char labels;
+    unsigned int origTTL;
+    unsigned int sigExpireTime;
+    unsigned int sigInceptTime;
+    unsigned short keyTag;
+    char signerName[256];
+    //unsigned char *signature
+} rdataRRSig;
+
+#define RR_TYPE_SIZE 16
+
 typedef union { unsigned char b[2]; unsigned short NotAnInteger; } Opaque16;
 
 static int operation;
 static uint32_t opinterface = kDNSServiceInterfaceIndexAny;
 static DNSServiceRef client    = NULL;
-static DNSServiceRef client_pa = NULL; // DNSServiceRef for RegisterProxyAddressRecord
-static DNSServiceRef sc1, sc2, sc3;            // DNSServiceRefs for kDNSServiceFlagsShareConnection testing
+static DNSServiceRef client_pa = NULL;  // DNSServiceRef for RegisterProxyAddressRecord
+static DNSServiceRef sc1, sc2, sc3;     // DNSServiceRefs for kDNSServiceFlagsShareConnection testing
 
 static int num_printed;
 static char addtest = 0;
@@ -215,7 +245,7 @@



Home | Main Index | Thread Index | Old Index