mDNSexport void mDNS_Lock_(mDNS *const m, const char * const functionname)
{
+ LogInfo("mDNS_Lock_: locked from %s", functionname);
// MUST grab the platform lock FIRST!
mDNSPlatformLock(m);
mDNSexport void mDNS_Unlock_(mDNS *const m, const char *const functionname)
{
+ LogInfo("mDNS_Unlock_: unlocked from %s", functionname);
// Decrement mDNS_busy
m->mDNS_busy--;
// restart the probe/announce cycle for multicast record
mDNSexport void mDNSCoreRestartRegistration(mDNS *const m, AuthRecord *rr, int announceCount)
{
+ LogInfo("mDNSCoreRestartRegistration: enter");
if (!AuthRecord_uDNS(rr))
{
if (rr->resrec.RecordType == kDNSRecordTypeVerified && !rr->DependentOn) rr->resrec.RecordType = kDNSRecordTypeUnique;
rr->SendNSECNow = mDNSNULL;
InitializeLastAPTime(m, rr);
}
+ LogInfo("mDNSCoreRestartRegistration: exit");
}
// ***************************************************************************
mDNSexport void mDNS_UpdateAllowSleep(mDNS *const m)
{
#ifndef IDLESLEEPCONTROL_DISABLED
+ LogInfo("mDNS_UpdateAllowSleep: enter");
mDNSBool allowSleep = mDNStrue;
char reason[128];
// Disallow sleep if there is no sleep proxy server
const CacheRecord *cr = FindSPSInCache1(m, &intf->NetWakeBrowse, mDNSNULL, mDNSNULL);
if ( cr == mDNSNULL)
- {
+ {
allowSleep = mDNSfalse;
mDNS_snprintf(reason, sizeof(reason), "No sleep proxy server on %s", intf->ifname);
LogInfo("mDNS_UpdateAllowSleep: Sleep disabled because %s has no sleep proxy server", intf->ifname);
// Call the platform code to enable/disable sleep
mDNSPlatformSetAllowSleep(allowSleep, reason);
+ LogInfo("mDNS_UpdateAllowSleep: exit");
#else
(void) m;
#endif /* !defined(IDLESLEEPCONTROL_DISABLED) */
mDNSBool FirstOfType = mDNStrue;
NetworkInterfaceInfo **p = &m->HostInterfaces;
+ LogInfo("mDNS_RegisterInterface: enter");
if (!set->InterfaceID)
{ LogMsg("mDNS_RegisterInterface: Error! Tried to register a NetworkInterfaceInfo %#a with zero InterfaceID", &set->ip); return(mStatus_Invalid); }
}
}
}
+ LogInfo("mDNS_RegisterInterface: finished scanning the list of questions.");
// For all our non-specific authoritative resource records (and any dormant records specific to this interface)
// we now need them to re-probe if necessary, and then re-announce.
mDNS_UpdateAllowSleep(m);
mDNS_Unlock(m);
+
+ LogInfo("mDNS_RegisterInterface: exit");
+
return(mStatus_NoError);
}
JAVACFLAGS_OS = -fPIC -shared -ldns_sd
# Set up diverging paths for debug vs. prod builds
-DEBUG=0
+DEBUG=1
ifeq ($(DEBUG),1)
CFLAGS_DEBUG = -g -DMDNS_DEBUGMSGS=2
OBJDIR = objects/debug
int numOfServers = 0;
FILE *fp = fopen(filePath, "r");
if (fp == NULL) return -1;
+
+ LogInfo("ParseDNSServers: enter");
while (fgets(line,sizeof(line),fp))
{
struct in_addr ina;
}
}
fclose(fp);
+ LogInfo("ParseDNSServers: exit");
return (numOfServers > 0) ? 0 : -1;
}
assert(intfName != NULL);
assert(intfMask != NULL);
+ LogInfo("SetupOneInterface: enter %s", intfName);
+
// Allocate the interface structure itself.
intf = (PosixNetworkInterface*)calloc(1, sizeof(*intf));
if (intf == NULL) { assert(0); err = ENOMEM; }
assert((err == 0) == (intf != NULL));
+ LogInfo("SetupOneInterface: exit %s", intfName);
+
return err;
}
// Temporary workaround: Multicast loopback on IPv6 interfaces appears not to work.
// In the interim, we skip loopback interface only if we found at least one v4 interface to use
// if ((m->HostInterfaces == NULL) && (firstLoopback != NULL))
- if (!foundav4 && firstLoopback)
+ if (!foundav4 && firstLoopback) {
+ LogInfo("SetupInterfaceList: setup for loopback.");
(void) SetupOneInterface(m, firstLoopback->ifi_addr, firstLoopback->ifi_netmask, firstLoopback->ifi_name, firstLoopback->ifi_index);
+ }
}
// Clean up.
if (utc - pi->LastSeen < 60) ri = (PosixNetworkInterface **)&pi->coreIntf.next;
else { *ri = (PosixNetworkInterface *)pi->coreIntf.next; free(pi); }
}
-
+ LogInfo("SetupInterfaceList: exit");
return err;
}
int sock;
int ret;
+ LogInfo("OpenIfNotifySocket: enter");
+
sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
if (sock < 0)
return errno;
else
err = errno;
+ LogInfo("OpenIfNotifySocket: exit");
return err;
}
struct sockaddr sa;
assert(m != NULL);
+ LogInfo("mDNSPlatformInit: enter");
if (mDNSPlatformInit_CanReceiveUnicast()) m->CanReceiveUnicastOn5353 = mDNStrue;
// Tell mDNS core the names of this machine.
if (err == mStatus_NoError)
mDNSCoreInitComplete(m, mStatus_NoError);
+ LogInfo("mDNSPlatformInit: exit");
return PosixErrorToStatus(err);
}
if (setsockopt(skt, SOL_SOCKET, SO_NP_EXTENSIONS, &sonpx, optlen) < 0)
my_perror("WARNING: could not set sockopt - SO_NP_EXTENSIONS");
#endif
+ LogInfo("uds_socket_setup: enter");
#if defined(_WIN32)
// SEH: do we even need to do this on windows?
// This socket will be given to WSAEventSelect which will automatically set it to non-blocking
LogOperation("%3d: Listening for incoming Unix Domain Socket client requests", skt);
mDNSStorage.uds_listener_skt = skt;
}
+ LogInfo("uds_socket_setup: exit");
return mDNStrue;
}