Lines Matching refs:NAT
416 #pragma mark - NAT Traversal
481 LogInfo("Received external IP address %.4a from NAT", &ExtAddr);
483 LogMsg("Double NAT (external NAT gateway address %.4a is also a private RFC 1918 address)", &ExtAddr);
566 LogMsg("Error! Tried to add a NAT traversal that's already in the active list: request %p Prot %d Int %d TTL %d",
599 if (!m->NATTraversals) // If this is our first NAT request, kick off an address request too
656 if (err) LogMsg("Legacy NAT Traversal - unmap request failed with error %d", err);
733 // Normally, after going through the NAT gateway, the source address of our outgoing TCP connection is the same as ExternalAddress,
736 // LLQ server to send events to us directly at port 5353 on that address, instead of at our mapped external NAT port.
880 // we are in polling state because of NAT-PMP disabled or DoubleNAT, next LLQNATCallback
883 // If we have a good NAT (neither NAT-PMP disabled nor Double-NAT), then we should not be
888 // all ones. In that case, we would set it in LLQ_InitialRequest as it overrides the NAT-PMP or
889 // Double-NAT state.
1002 // If we have a NAT port mapping, ExternalPort is the external port
1004 // If we need a NAT port mapping but can't get one, then ExternalPort is zero
1290 LogInfo("startLLQHandshake: waiting for NAT status for %##s (%s)", q->qname.c, DNSTypeName(q->qtype));
1297 // Either we don't have NAT-PMP support (ExternalPort is zero) or behind a Double NAT that may or
1298 // may not have NAT-PMP support (NATResult is non-zero)
1301 LogInfo("startLLQHandshake: Cannot receive inbound packets; will poll for %##s (%s) External Port %d, NAT Result %d",
1328 // switch networks, we might end up "Polling" the network e.g., we are behind a Double NAT.
1330 // PrivateQueryGotZoneData). The NAT callback (LLQNATCallback) may happen soon after that. If we
1331 // are still behind Double NAT, we would have returned early in this function. But we could
1409 // If this AutoTunnel is not yet active, start it now (which entails activating its NAT Traversal request,
1410 // which will subsequently advertise the appropriate records when the NAT Traversal returns a result)
1741 // Currently only supports SRV records for nat mapping
1759 // we need to restart the get zone data and nat mapping request to get the latest mapping result as we can't handle it
1882 // "Error! Tried to add a NAT traversal that's already in the active list"
1900 // Temporary workaround to cancel any active NAT mapping operation
1943 // Nat state change if:
1944 // We were behind a NAT, and now we are behind a new NAT, or
1945 // We're not behind a NAT but our port was previously mapped to a different external port
1946 // We were not behind a NAT and now we are
1967 // If we are deregistering the record, then ignore any NAT/Target change.
1988 // We are getting a Target change/NAT change while the SRV record is being updated ?
1994 // if nat changed, register if we have a target (below)
2006 // a NAT/Target change before and sent the deregistration below. There are a few race conditions
2009 // 1. We are handling a second NAT/Target change while the first dereg is in progress. It is possible
2015 // 2. While we sent the dereg during a previous NAT/Target change, uDNS_DeregisterRecord gets
2017 // CompleteDeregistration rather than handle NAT/Target change because the record is in
2021 // here in this function to avoid handling NAT/Target change and in hndlRecordUpdateReply to call
2022 // CompleteDeregistration instead of handling NAT/Target change. Hence, we are not concerned
2029 // target or nat changed. deregister service. upon completion, we'll look for a new target
2085 LogInfo("Updating hostname %p %##s IPv4 from %.4a to %.4a (NAT gateway's external address)",n,
2091 LogInfo("Advertising hostname %##s IPv4 %.4a (NAT gateway's external address)", h->arv4.resrec.name->c, &n->ExternalAddress);
2099 // register record or begin NAT traversal
2110 // If we already have a NAT query active, stop it and restart it to make sure we get another callback
2359 // setting router to zero indicates that nat mappings must be reestablished when router is reset
2394 // If we have a non-zero IPv4 address, we should try immediately to see if we have a NAT gateway
3086 // Reevaluate the target always as NAT/Target could have changed while
3130 rr->state = regState_NoTarget; // NoTarget will allow us to pick up new target OR nat traversal state
3170 // of Double NAT, we want all the records to be in one update. Some BTMM records like
3171 // _autotunnel6 and host records are registered/deregistered when NAT state changes.
3188 // If we are deregistering the record, then complete the deregistration. Ignore any NAT/SRV change
3296 if (!AddrReply->err && len < 8) { LogMsg("NAT Traversal message too short (%d bytes)", len); return; }
3297 if (AddrReply->vers != NATMAP_VERS) { LogMsg("Received NAT Traversal response with version %d (expected %d)", pkt[0], NATMAP_VERS); return; }
3307 // We compute a conservative estimate of how much the NAT gateways's clock should have advanced
3308 // 1. We subtract 12.5% from our own measured elapsed time, to allow for NAT gateways that have an inacurate clock that runs slowly
3310 // -- if NAT gateway sends a packet at t=2.000 seconds, then one at t=7.999, that's approximately 6 real seconds,
3318 { LogMsg("NAT gateway %#a rebooted", &m->Router); RecreateNATMappings(m); }
3333 if (!AddrReply->err && len < sizeof(NATAddrReply)) { LogMsg("NAT Traversal AddrResponse message too short (%d bytes)", len); return; }
3346 if (len < sizeof(NATPortMapReply)) { LogMsg("NAT Traversal PortMapReply message too short (%d bytes)", len); return; }
3350 // Since some NAT
3359 else { LogMsg("Received NAT Traversal response with version unknown opcode 0x%X", AddrReply->opcode); return; }
3361 // Don't need an SSDP socket if we get a NAT-PMP packet
3365 // <rdar://problem/3925163> Shorten DNS-SD queries to avoid NAT bugs
3366 // <rdar://problem/4288449> Add check to avoid crashing NAT gateways that have buggy DNS relay code
3368 // We know of bugs in home NAT gateways that cause them to crash if they receive certain DNS queries.
3842 // Reevaluate the target always as NAT/Target could have changed while
3862 // then initiate a NAT mapping request. On completion it will do SendRecordRegistration() for us
3880 // During network transitions, we are called multiple times in different states. Setup NAT
3982 // It is also possible to reenter the NoTarget state when we move to a network with a NAT that has
3983 // no NAT-PMP/UPnP support. In that case before we entered NoTarget, we already deregistered with
4376 if (m->NATTraversals && rfc1918) // Do we need to open NAT-PMP socket to receive multicast announcements from router?
4378 if (m->NATMcastRecvskt == mDNSNULL) // If we are behind a NAT and the socket hasn't been opened yet, open it
4387 LogMsg("CheckNATMappings: Failed to allocate port 5350 UDP multicast socket for NAT-PMP announcements");
4484 //LogMsg("NAT callback %d %d %d", cur->Protocol, cur->ExpiryTime, cur->retryInterval);
4488 LogInfo("CheckNATMapping: Failed to obtain NAT port mapping %p from router %#a external address %.4a internal port %5d interval %d error %d",
4491 LogMsg("CheckNATMapping: Failed to obtain NAT port mapping %p from router %#a external address %.4a internal port %5d interval %d error %d",