From 14be6345be1a8f1fc0a4644d678022204561d98a Mon Sep 17 00:00:00 2001 From: emcho Date: Tue, 16 Feb 2010 08:15:58 +0000 Subject: [PATCH] Adds support for use of IPv6 STUN servers --- .../ice4j/attribute/AddressAttributeTest.java | 20 +++++++++---------- test/test/Ice.java | 7 ++++++- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/test/org/ice4j/attribute/AddressAttributeTest.java b/test/org/ice4j/attribute/AddressAttributeTest.java index 6cd5399..fbe76bd 100644 --- a/test/org/ice4j/attribute/AddressAttributeTest.java +++ b/test/org/ice4j/attribute/AddressAttributeTest.java @@ -215,7 +215,7 @@ public class AddressAttributeTest extends TestCase { addressAttribute.setAddress(testAddress); //do a xor with an id equal to the v4 address itself so that we get 0000.., - TransportAddress xorredAddr = addressAttribute.applyXor( + TransportAddress xorredAddr = addressAttribute.getAddress( new byte[]{(byte)130,79,95,53,0,0,0,0,0,0,0,0,0,0,0,0,0}); assertTrue("Xorring the address with itself didn't return 00000...", @@ -226,11 +226,11 @@ public class AddressAttributeTest extends TestCase { //Test xor-ing the original with the xored - should get the xor code addressAttribute.setAddress(testAddress); - xorredAddr = addressAttribute.applyXor( + xorredAddr = addressAttribute.getAddress( new byte[]{21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36}); xorredAddr = - addressAttribute.applyXor(xorredAddr.getAddressBytes()); + addressAttribute.getAddress(xorredAddr.getAddressBytes()); assertTrue("Xorring the original with the xor-ed didn't " +"return the code..", @@ -242,11 +242,11 @@ public class AddressAttributeTest extends TestCase { //Test double xor-ing - should get the original addressAttribute.setAddress(testAddress); - xorredAddr = addressAttribute.applyXor( + xorredAddr = addressAttribute.getAddress( new byte[]{21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36}); addressAttribute.setAddress(xorredAddr); - xorredAddr = addressAttribute.applyXor( + xorredAddr = addressAttribute.getAddress( new byte[]{21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36}); assertEquals("Double xorring didn't give the original ...", @@ -267,7 +267,7 @@ public class AddressAttributeTest extends TestCase { //do a xor with an id equal to the v4 address itself so that we get 0000.., TransportAddress xorredAddr = - addressAttribute.applyXor( + addressAttribute.getAddress( new byte[]{(byte)0x20, (byte)0x01, (byte)0x06, (byte)0x60, (byte)0x47, (byte)0x01, (byte)0x10, (byte)0x01, (byte)0x02, (byte)0x02, (byte)0x8a, (byte)0xff, @@ -285,10 +285,10 @@ public class AddressAttributeTest extends TestCase { //Test xor-ing the original with the xored - should get the xor code addressAttribute.setAddress(testAddress); - xorredAddr = addressAttribute.applyXor( + xorredAddr = addressAttribute.getAddress( new byte[]{21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36}); - xorredAddr = addressAttribute.applyXor(xorredAddr.getAddressBytes()); + xorredAddr = addressAttribute.getAddress(xorredAddr.getAddressBytes()); assertTrue("Xorring the original with the xor-ed didn't return the code..", Arrays.equals( @@ -300,11 +300,11 @@ public class AddressAttributeTest extends TestCase { //Test double xor-ing - should get the original addressAttribute.setAddress(testAddress); - xorredAddr = addressAttribute.applyXor( + xorredAddr = addressAttribute.getAddress( new byte[]{21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36}); addressAttribute.setAddress(xorredAddr); - xorredAddr = addressAttribute.applyXor( + xorredAddr = addressAttribute.getAddress( new byte[]{21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36}); assertEquals("Double xorring didn't give the original ...", diff --git a/test/test/Ice.java b/test/test/Ice.java index f07b9ae..1c6d975 100644 --- a/test/test/Ice.java +++ b/test/test/Ice.java @@ -33,8 +33,13 @@ public class Ice Agent agent = new Agent(); StunCandidateHarvester stunHarv = new StunCandidateHarvester( - new TransportAddress("130.79.90.150", 3478, Transport.UDP)); + new TransportAddress("sip-communicator.net", 3478, Transport.UDP)); + StunCandidateHarvester stun6Harv = new StunCandidateHarvester( + new TransportAddress("ipv6.sip-communicator.net", + 3478, Transport.UDP)); + agent.addCandidateHarvester(stunHarv); + agent.addCandidateHarvester(stun6Harv); IceMediaStream stream = agent.createMediaStream("audio");