Home | History | Annotate | Download | only in mDNSCore

Lines Matching full:traversal

416 #pragma mark - NAT Traversal
554 mDNSexport mStatus mDNS_StartNATOperation_internal(mDNS *const m, NATTraversalInfo *traversal)
558 LogInfo("mDNS_StartNATOperation_internal %p Protocol %d IntPort %d RequestedPort %d NATLease %d", traversal,
559 traversal->Protocol, mDNSVal16(traversal->IntPort), mDNSVal16(traversal->RequestedPort), traversal->NATLease);
561 // Note: It important that new traversal requests are appended at the *end* of the list, not prepended at the start
564 if (traversal == *n)
566 LogMsg("Error! Tried to add a NAT traversal that's already in the active list: request %p Prot %d Int %d TTL %d",
567 traversal, traversal->Protocol, mDNSVal16(traversal->IntPort), traversal->NATLease);
573 if (traversal->Protocol && traversal->Protocol == (*n)->Protocol && mDNSSameIPPort(traversal->IntPort, (*n)->IntPort) &&
574 !mDNSSameIPPort(traversal->IntPort, SSHPort))
577 traversal, traversal->Protocol, mDNSVal16(traversal->IntPort), traversal->NATLease,
582 traversal->next = mDNSNULL;
583 traversal->ExpiryTime = 0;
584 traversal->retryInterval = NATMAP_INIT_RETRY;
585 traversal->retryPortMap = m->timenow;
586 traversal->NewResult = mStatus_NoError;
587 traversal->ExternalAddress = onesIPv4Addr;
588 traversal->ExternalPort = zeroIPPort;
589 traversal->Lifetime = 0;
590 traversal->Result = mStatus_NoError;
593 if (!traversal->NATLease) traversal->NATLease = NATMAP_DEFAULT_LEASE;
596 mDNSPlatformMemZero(&traversal->tcpInfo, sizeof(traversal->tcpInfo));
607 *n = traversal; // Append new NATTraversalInfo to the end of our list
613 mDNSexport mStatus mDNS_StopNATOperation_internal(mDNS *m, NATTraversalInfo *traversal)
619 while (*ptr && *ptr != traversal) ptr=&(*ptr)->next;
623 LogMsg("mDNS_StopNATOperation_internal: NATTraversalInfo %p not found in list", traversal);
627 LogInfo("mDNS_StopNATOperation_internal %p %d %d %d %d", traversal,
628 traversal->Protocol, mDNSVal16(traversal->IntPort), mDNSVal16(traversal->RequestedPort), traversal->NATLease);
630 if (m->CurrentNATTraversal == traversal)
633 if (traversal->Protocol)
635 if (traversal->Protocol == p->Protocol && mDNSSameIPPort(traversal->IntPort, p->IntPort))
637 if (!mDNSSameIPPort(traversal->IntPort, SSHPort))
640 traversal, traversal->Protocol, mDNSVal16(traversal->IntPort), traversal->NATLease,
645 if (traversal->ExpiryTime && unmap)
647 traversal->NATLease = 0;
648 traversal->retryInterval = 0;
649 uDNS_SendNATMsg(m, traversal);
655 mStatus err = LNT_UnmapPort(m, traversal);
656 if (err) LogMsg("Legacy NAT Traversal - unmap request failed with error %d", err);
663 mDNSexport mStatus mDNS_StartNATOperation(mDNS *const m, NATTraversalInfo *traversal)
667 status = mDNS_StartNATOperation_internal(m, traversal);
672 mDNSexport mStatus mDNS_StopNATOperation(mDNS *const m, NATTraversalInfo *traversal)
676 status = mDNS_StopNATOperation_internal(m, traversal);
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)
1882 // "Error! Tried to add a NAT traversal that's already in the active list"
2099 // register record or begin NAT traversal
3130 rr->state = regState_NoTarget; // NoTarget will allow us to pick up new target OR nat traversal state
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; }
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; }
3359 else { LogMsg("Received NAT Traversal response with version unknown opcode 0x%X", AddrReply->opcode); return; }