Example #1
0
        public static ServiceError DNSServiceRegister(out ServiceRef sdRef,
                                                      ServiceFlags flags,
                                                      uint interfaceIndex,
                                                      byte[] name,
                                                      string regtype,
                                                      string domain,
                                                      string host,
                                                      ushort port,
                                                      ushort txtLen,
                                                      byte[] txtRecord,
                                                      DNSServiceRegisterReply callBack,
                                                      IntPtr context)
        {
            switch (Native.GetCurrentOperatingSystem())
            {
            case OperatingSystem.Windows:
                return(NativeWindows.DNSServiceRegister(out sdRef, flags, interfaceIndex, name, regtype, domain, host, port, txtLen, txtRecord, callBack, context));

            case OperatingSystem.OSX:
                return(NativeOSX.DNSServiceRegister(out sdRef, flags, interfaceIndex, name, regtype, domain, host, port, txtLen, txtRecord, callBack, context));

            default:
                throw new InvalidOperationException("The current OS is unsupported");
            }
        }
Example #2
0
        public static ushort TXTRecordGetCount(ushort txtLen, IntPtr txtRecord)
        {
            switch (Native.GetCurrentOperatingSystem())
            {
            case OperatingSystem.Windows:
                return(NativeWindows.TXTRecordGetCount(txtLen, txtRecord));

            case OperatingSystem.OSX:
                return(NativeOSX.TXTRecordGetCount(txtLen, txtRecord));

            default:
                throw new InvalidOperationException("The current OS is unsupported");
            }
        }
Example #3
0
        public static ServiceError TXTRecordRemoveValue(IntPtr txtRecord, byte[] key)
        {
            switch (Native.GetCurrentOperatingSystem())
            {
            case OperatingSystem.Windows:
                return(NativeWindows.TXTRecordRemoveValue(txtRecord, key));

            case OperatingSystem.OSX:
                return(NativeOSX.TXTRecordRemoveValue(txtRecord, key));

            default:
                throw new InvalidOperationException("The current OS is unsupported");
            }
        }
Example #4
0
        public static ServiceError DNSServiceCreateConnection(out ServiceRef sdRef)
        {
            switch (Native.GetCurrentOperatingSystem())
            {
            case OperatingSystem.Windows:
                return(NativeWindows.DNSServiceCreateConnection(out sdRef));

            case OperatingSystem.OSX:
                return(NativeOSX.DNSServiceCreateConnection(out sdRef));

            default:
                throw new InvalidOperationException("The current OS is unsupported");
            }
        }
Example #5
0
        public static int DNSServiceRefSockFD(IntPtr sdRef)
        {
            switch (Native.GetCurrentOperatingSystem())
            {
            case OperatingSystem.Windows:
                return(NativeWindows.DNSServiceRefSockFD(sdRef));

            case OperatingSystem.OSX:
                return(NativeOSX.DNSServiceRefSockFD(sdRef));

            default:
                throw new InvalidOperationException("The current OS is unsupported");
            }
        }
Example #6
0
        public static void DNSServiceRefDeallocate(IntPtr sdRef)
        {
            switch (GetCurrentOperatingSystem())
            {
            case OperatingSystem.Windows:
                NativeWindows.DNSServiceRefDeallocate(sdRef);
                return;

            case OperatingSystem.OSX:
                NativeOSX.DNSServiceRefDeallocate(sdRef);
                return;

            default:
                throw new InvalidOperationException("The current OS is unsupported");
            }
        }
Example #7
0
        public static void TXTRecordDeallocate(IntPtr txtRecord)
        {
            switch (Native.GetCurrentOperatingSystem())
            {
            case OperatingSystem.Windows:
                NativeWindows.TXTRecordDeallocate(txtRecord);
                return;

            case OperatingSystem.OSX:
                NativeOSX.TXTRecordDeallocate(txtRecord);
                return;

            default:
                throw new InvalidOperationException("The current OS is unsupported");
            }
        }
Example #8
0
        public static ServiceError TXTRecordGetItemAtIndex(ushort txtLen,
                                                           IntPtr txtRecord,
                                                           ushort index,
                                                           ushort keyBufLen,
                                                           byte[] key,
                                                           out byte valueLen,
                                                           out IntPtr value)
        {
            switch (Native.GetCurrentOperatingSystem())
            {
            case OperatingSystem.Windows:
                return(NativeWindows.TXTRecordGetItemAtIndex(txtLen, txtRecord, index, keyBufLen, key, out valueLen, out value));

            case OperatingSystem.OSX:
                return(NativeOSX.TXTRecordGetItemAtIndex(txtLen, txtRecord, index, keyBufLen, key, out valueLen, out value));

            default:
                throw new InvalidOperationException("The current OS is unsupported");
            }
        }
Example #9
0
        public static ServiceError DNSServiceBrowse(out ServiceRef sdRef,
                                                    ServiceFlags flags,
                                                    uint interfaceIndex,
                                                    string regtype,
                                                    string domain,
                                                    DNSServiceBrowseReply callBack,
                                                    IntPtr context)
        {
            switch (Native.GetCurrentOperatingSystem())
            {
            case OperatingSystem.Windows:
                return(NativeWindows.DNSServiceBrowse(out sdRef, flags, interfaceIndex, regtype, domain, callBack, context));

            case OperatingSystem.OSX:
                return(NativeOSX.DNSServiceBrowse(out sdRef, flags, interfaceIndex, regtype, domain, callBack, context));

            default:
                throw new InvalidOperationException("The current OS is unsupported");
            }
        }
Example #10
0
        public static ServiceError DNSServiceQueryRecord(out ServiceRef sdRef,
                                                         ServiceFlags flags,
                                                         uint interfaceIndex,
                                                         string fullname,
                                                         ServiceType rrtype,
                                                         ServiceClass rrclass,
                                                         DNSServiceQueryRecordReply callBack,
                                                         IntPtr context)
        {
            switch (Native.GetCurrentOperatingSystem())
            {
            case OperatingSystem.Windows:
                return(NativeWindows.DNSServiceQueryRecord(out sdRef, flags, interfaceIndex, fullname, rrtype, rrclass, callBack, context));

            case OperatingSystem.OSX:
                return(NativeOSX.DNSServiceQueryRecord(out sdRef, flags, interfaceIndex, fullname, rrtype, rrclass, callBack, context));

            default:
                throw new InvalidOperationException("The current OS is unsupported");
            }
        }