[asterisk-scf-commits] asterisk-scf/integration/slice.git branch "nat-traversal" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Tue Jun 21 09:54:42 CDT 2011
branch "nat-traversal" has been updated
via 676d90f9d66258c8a40af1f82a9d70ce40f388c7 (commit)
via 84e218b44f82dbe769af9c68db21efc21ca636ef (commit)
from adb9cffd39577fe4c31afaf06aafa3b7949e8802 (commit)
Summary of changes:
AsteriskSCF/System/NAT/NATTraversalIf.ice | 368 +++++++++++++++++++++++++++++
1 files changed, 368 insertions(+), 0 deletions(-)
create mode 100644 AsteriskSCF/System/NAT/NATTraversalIf.ice
- Log -----------------------------------------------------------------
commit 676d90f9d66258c8a40af1f82a9d70ce40f388c7
Author: Brent Eagles <beagles at digium.com>
Date: Tue Jun 21 12:22:23 2011 -0230
Added an interface to support interacting with the ICE functionality on an
object. Changed the candidate definition to include the more relevant "base
address" instead of the local address. Also added a foundation field to allow
this to be specified and carried with the candidate.
diff --git a/AsteriskSCF/System/NAT/NATTraversalIf.ice b/AsteriskSCF/System/NAT/NATTraversalIf.ice
index 6481784..7eebb01 100644
--- a/AsteriskSCF/System/NAT/NATTraversalIf.ice
+++ b/AsteriskSCF/System/NAT/NATTraversalIf.ice
@@ -240,18 +240,19 @@ class Candidate
/**
*
- * The local address
+ * The base or local address. For non-turn based candidates, this is the local IP address. For TURN based
+ * candidates, its the address of the TURN server.
*
**/
- string localAddress;
+ string baseAddress;
/**
*
- * The local port.
+ * The base or local port.
*
**/
- int localPort;
+ int basePort;
/**
*
@@ -273,6 +274,92 @@ class Candidate
*
**/
TransportType transport;
+
+ /**
+ *
+ * The candidate's foundation is a non-unique hash value where similar
+ * candidates should result in similar hash values. This field could be blank, and if
+ * so, must be generated if required.
+ *
+ **/
+ string foundation;
+};
+
+sequence<Candidate> CandidateSeq;
+
+exception UnsupportedCandidate
+{
+ string message;
+};
+
+exception NegotiationNotSupported
+{
+};
+
+exception NoValidCandidates
+{
+};
+
+/**
+ *
+ * The InteractiveConnectionAgent defines an interface for components that implement the ICE protocol or
+ * similar to negotiate connections between agents that cannot directly connect to each other. This is
+ * meant to be a fairly lightweight facility, usually added to an existing object as facet, multiple
+ * inheritance, etc.
+ *
+ * Note: the typical details of ICE, TURN, STUN etc are omitted from this interface for the moment as
+ * existing mechanism have been incorporated elsewhere, usually as a component specific detail.
+ *
+ **/
+interface InteractiveConnectionAgent
+{
+ /**
+ *
+ * Return the agent's type.
+ *
+ */
+ idempotent AgentType getAgentType();
+
+ /**
+ *
+ * Return the detected NAT type. This NAT will be the one closest to a
+ * configured STUN server. Information about intermediate NATs will not be
+ * evident.
+ *
+ **/
+ idempotent DetectedNATType getNATType();
+
+ /**
+ *
+ * Retrieves the current role of the agent... this can change over time.
+ *
+ **/
+ idempotent Role getRole();
+
+ /**
+ *
+ * When provided a sequence of candidates from a remote agent, select the best Candidate for communicating
+ * with this agent.
+ *
+ * @parmap proposedCandidates The sequence of candidates from the remote agent.
+ *
+ * @throws UnsupportedCandidate if there something about the provided Candidates that is not supported
+ * by this agent.
+ *
+ * @throws NegotiationNotSupported if the is agent type is ice-lite or not controlling.
+ *
+ * @throws NoValidCandidates if all connection check fail.
+ *
+ **/
+ Candidate negotiate(CandidateSeq proposedCandidates) throws UnsupportedCandidate, NegotiationNotSupported,
+ NoValidCandidates;
+
+ /**
+ *
+ * Return a list of Candidates for the current agent.
+ *
+ **/
+ CandidateSeq getCandidates();
};
}; /* End of module V1 */
commit 84e218b44f82dbe769af9c68db21efc21ca636ef
Author: Brent Eagles <beagles at digium.com>
Date: Mon Jun 20 22:11:54 2011 -0230
Initial add of some slice for transferring details about connection candidates.
diff --git a/AsteriskSCF/System/NAT/NATTraversalIf.ice b/AsteriskSCF/System/NAT/NATTraversalIf.ice
new file mode 100644
index 0000000..6481784
--- /dev/null
+++ b/AsteriskSCF/System/NAT/NATTraversalIf.ice
@@ -0,0 +1,281 @@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2010, Digium, Inc.
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk SCF project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE.txt file
+ * at the top of the source tree.
+ */
+
+#pragma once
+
+module AsteriskSCF
+{
+module System
+{
+module NAT
+{
+module V1
+{
+/**
+ * If NAT detection is in use, this enum provides values for classifications of the different types.
+ **/
+enum DetectedNATType
+{
+ /**
+ *
+ * A placeholder value indicating that detection has not been attempted or
+ * is not yet complete.
+ *
+ **/
+ Unknown,
+
+ /**
+ *
+ * Indicates that the current detection mechanisms were unable to determine
+ * the type of NAT.
+ *
+ **/
+ ErrUnknown,
+
+ /**
+ *
+ * The firewall/NAT is effectively open with no translation.
+ *
+ **/
+ Open,
+
+ /**
+ *
+ * The NAT is blocking the communication scheme being tested/tried.
+ *
+ **/
+ Blocked,
+
+ /**
+ *
+ * UDP can reach external networks, but replies have to come back to the
+ * actual request source (no translation).
+ *
+ **/
+ SymmetricUDP,
+
+ /**
+ *
+ * All outgoing requests from the same internal IP address + port are mapped to
+ * the same external address + port and incoming requests the mapped external
+ * address will be translated and sent to it.
+ *
+ **/
+ FullCone,
+
+ /**
+ *
+ * All outgoing requests form the same internal IP address + port destined
+ * for a single external IP address + port are mapped to the same external
+ * IP address and port. If a request from the aformentioned internal
+ * address + port is sent to a different destination, it will be mapped to
+ * a different external IP address + port. Only external ip addr+ports can
+ * send a reply/request back through the mapping created to communicate
+ * with it.
+ *
+ **/
+ Symmetric,
+
+ /**
+ *
+ * All outgoing requests from an internal IP address + port are mapped to
+ * the same external IP address + port. Packets from external sources can
+ * only be sent if they received a request through that mapping.
+ *
+ **/
+ Restricted,
+
+ /**
+ *
+ * Same as restricted, but external sources can only send to the internal
+ * host if the packets are sent from an IP address *and* port that had
+ * previously received a packet from the mapped address.
+ *
+ **/
+ PortRestricted
+};
+
+/**
+ *
+ * Candidate types qualify ICE candidates according to what kinds of means would be required to access them.
+ *
+ **/
+enum CandidateType
+{
+ /**
+ *
+ * A host candidate is accessible directly.
+ *
+ **/
+ Host,
+
+ /**
+ *
+ * A server reflexive candidate represents a publically mapped address of a
+ * local host address. These are obtained by establishing a binding on a
+ * NAT with STUN.
+ *
+ **/
+ ServerReflexive,
+
+ /**
+ *
+ * A peer reflexive candidate is the apparent address seen by a peer when
+ * performing connectivity checks.
+ *
+ **/
+ PeerReflexive,
+
+ /**
+ *
+ * A relayed address indicates a candidate allocated on a TURN server.
+ *
+ **/
+ Relayed
+};
+
+/**
+ *
+ * ICE "agents" may be in a controlling or controlled role (or unknown!). The
+ * agent with the controlling role gets the final word on which candidate pair
+ * will be used.
+ *
+ **/
+enum Role
+{
+ UndefinedRole,
+ Controlling,
+ Controlled
+};
+
+/**
+ *
+ * Agent implementation type.
+ *
+ **/
+enum AgentType
+{
+ /**
+ *
+ * Lite agents respond to connectivity checks, but they only generate
+ * host candidates and can be directly accessed. Basically they can
+ * participate in ICE negotiation sessions but don't require NAT candidate
+ * mappings. Lite agents are never controlling agents.
+ *
+ **/
+ Lite,
+
+ /**
+ *
+ * Full ICE implementations can be controlling agents but may also simply
+ * be the controlled agent depending on circumstances.
+ *
+ **/
+ Full
+};
+
+/**
+ *
+ * A candidate may use different transport types.
+ *
+ **/
+enum TransportType
+{
+ UDP,
+ TCP
+ /* Others? */
+};
+
+/**
+ *
+ * Candidate class describes a candidate along with its ICE related descriptors.
+ *
+ **/
+class Candidate
+{
+ /**
+ *
+ * The candidate includes a key that can be used to identify the ICE
+ * session to ensure that it can be easily mapped/referred to when being
+ * passed among services.
+ *
+ **/
+ string sessionId;
+
+ /**
+ *
+ * Candidate's in an ICE session are further distinguished from each other by
+ * a component identifier.
+ *
+ **/
+ long componentId;
+
+ /**
+ *
+ * Each candidate has priority!
+ *
+ **/
+ int priority;
+
+ /**
+ *
+ * The CandidateType helps identify the mechanism that can be used
+ * to access a host through the associated address information.
+ *
+ */
+ CandidateType type;
+
+ /**
+ *
+ * The local address
+ *
+ **/
+ string localAddress;
+
+
+ /**
+ *
+ * The local port.
+ *
+ **/
+ int localPort;
+
+ /**
+ *
+ * The mapped address (note that this will be empty for host candidates.
+ *
+ **/
+ string mappedAddress;
+
+ /**
+ *
+ * The mapped port (note that this is only relevant if the mappedAddress is not empty.
+ *
+ **/
+ int mappedPort;
+
+ /**
+ *
+ * The type of transport that this candidate
+ *
+ **/
+ TransportType transport;
+};
+
+}; /* End of module V1 */
+}; /* End of module NAT */
+}; /* End of module System */
+}; /* End of module AsteriskSCF */
-----------------------------------------------------------------------
--
asterisk-scf/integration/slice.git
More information about the asterisk-scf-commits
mailing list