Search in sources :

Example 41 with MappingAddress

use of org.onosproject.mapping.addresses.MappingAddress in project onos by opennetworkinglab.

the class LispAsAddressTest method testConstruction.

@Test
public void testConstruction() {
    LispAsAddress address = address1;
    MappingAddress ma = MappingAddresses.ipv4MappingAddress(IP_ADDRESS_1);
    assertThat(address.getAsNumber(), is(AS_NUMBER_1));
    assertThat(address.getAddress(), is(ma));
}
Also used : MappingAddress(org.onosproject.mapping.addresses.MappingAddress) Test(org.junit.Test)

Example 42 with MappingAddress

use of org.onosproject.mapping.addresses.MappingAddress in project onos by opennetworkinglab.

the class LispListAddressTest method setUp.

@Before
public void setUp() {
    MappingAddress ipv4Addr1 = MappingAddresses.ipv4MappingAddress(IPV4_ADDRESS_1);
    MappingAddress ipv6Addr1 = MappingAddresses.ipv6MappingAddress(IPV6_ADDRESS_1);
    address1 = new LispListAddress.Builder().withIpv4(ipv4Addr1).withIpv6(ipv6Addr1).build();
    sameAsAddress1 = new LispListAddress.Builder().withIpv4(ipv4Addr1).withIpv6(ipv6Addr1).build();
    MappingAddress ipv4Addr2 = MappingAddresses.ipv4MappingAddress(IPV4_ADDRESS_2);
    MappingAddress ipv6Addr2 = MappingAddresses.ipv6MappingAddress(IPV6_ADDRESS_2);
    address2 = new LispListAddress.Builder().withIpv4(ipv4Addr2).withIpv6(ipv6Addr2).build();
}
Also used : MappingAddress(org.onosproject.mapping.addresses.MappingAddress) Before(org.junit.Before)

Example 43 with MappingAddress

use of org.onosproject.mapping.addresses.MappingAddress in project onos by opennetworkinglab.

the class LispNatAddressTest method setUp.

@Before
public void setUp() {
    MappingAddress ma1 = MappingAddresses.ipv4MappingAddress(IP_ADDRESS_1);
    MappingAddress rtr11 = MappingAddresses.ipv4MappingAddress(RTR_ADDRESS_11);
    MappingAddress rtr12 = MappingAddresses.ipv4MappingAddress(RTR_ADDRESS_12);
    List<MappingAddress> rtrRlocs1 = ImmutableList.of(rtr11, rtr12);
    address1 = new LispNatAddress.Builder().withMsUdpPortNumber(MS_UDP_PORT_NUMBER).withEtrUdpPortNumber(ETR_UDP_PORT_NUMBER).withGlobalEtrRlocAddress(ma1).withMsRlocAddress(ma1).withPrivateEtrRlocAddress(ma1).withRtrRlocAddresses(rtrRlocs1).build();
    sameAsAddress1 = new LispNatAddress.Builder().withMsUdpPortNumber(MS_UDP_PORT_NUMBER).withEtrUdpPortNumber(ETR_UDP_PORT_NUMBER).withGlobalEtrRlocAddress(ma1).withMsRlocAddress(ma1).withPrivateEtrRlocAddress(ma1).withRtrRlocAddresses(rtrRlocs1).build();
    MappingAddress ma2 = MappingAddresses.ipv4MappingAddress(IP_ADDRESS_2);
    MappingAddress rtr21 = MappingAddresses.ipv4MappingAddress(RTR_ADDRESS_21);
    MappingAddress rtr22 = MappingAddresses.ipv4MappingAddress(RTR_ADDRESS_22);
    List<MappingAddress> rtrRlocs2 = ImmutableList.of(rtr21, rtr22);
    address2 = new LispNatAddress.Builder().withMsUdpPortNumber(MS_UDP_PORT_NUMBER).withEtrUdpPortNumber(ETR_UDP_PORT_NUMBER).withGlobalEtrRlocAddress(ma2).withMsRlocAddress(ma2).withPrivateEtrRlocAddress(ma2).withRtrRlocAddresses(rtrRlocs2).build();
}
Also used : MappingAddress(org.onosproject.mapping.addresses.MappingAddress) Before(org.junit.Before)

Example 44 with MappingAddress

use of org.onosproject.mapping.addresses.MappingAddress in project onos by opennetworkinglab.

the class LispNonceAddressTest method setUp.

@Before
public void setUp() {
    MappingAddress ma1 = MappingAddresses.ipv4MappingAddress(IP_ADDRESS_1);
    address1 = new LispNonceAddress.Builder().withNonce(NONCE_1).withAddress(ma1).build();
    sameAsAddress1 = new LispNonceAddress.Builder().withNonce(NONCE_1).withAddress(ma1).build();
    MappingAddress ma2 = MappingAddresses.ipv4MappingAddress(IP_ADDRESS_2);
    address2 = new LispNonceAddress.Builder().withNonce(NONCE_2).withAddress(ma2).build();
}
Also used : MappingAddress(org.onosproject.mapping.addresses.MappingAddress) Before(org.junit.Before)

Example 45 with MappingAddress

use of org.onosproject.mapping.addresses.MappingAddress in project onos by opennetworkinglab.

the class LispSegmentAddressTest method testConstruction.

@Test
public void testConstruction() {
    LispSegmentAddress address = address1;
    MappingAddress ma = MappingAddresses.ipv4MappingAddress(IP_ADDRESS_1);
    assertThat(address.getInstanceId(), is(INSTANCE_ID_1));
    assertThat(address.getAddress(), is(ma));
}
Also used : MappingAddress(org.onosproject.mapping.addresses.MappingAddress) Test(org.junit.Test)

Aggregations

MappingAddress (org.onosproject.mapping.addresses.MappingAddress)66 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)34 Test (org.junit.Test)26 Before (org.junit.Before)11 DefaultMappingTreatment (org.onosproject.mapping.DefaultMappingTreatment)7 MappingTreatment (org.onosproject.mapping.MappingTreatment)7 MappingAddressJsonMatcher.matchesMappingAddress (org.onosproject.mapping.codec.MappingAddressJsonMatcher.matchesMappingAddress)7 IpPrefix (org.onlab.packet.IpPrefix)6 MappingInstruction (org.onosproject.mapping.instructions.MappingInstruction)6 DefaultMappingKey (org.onosproject.mapping.DefaultMappingKey)5 MappingKey (org.onosproject.mapping.MappingKey)5 DefaultMappingValue (org.onosproject.mapping.DefaultMappingValue)4 MappingValue (org.onosproject.mapping.MappingValue)4 MappingAction (org.onosproject.mapping.actions.MappingAction)4 JsonNode (com.fasterxml.jackson.databind.JsonNode)3 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)2 EqualsTester (com.google.common.testing.EqualsTester)2 LispNatAddress (org.onosproject.drivers.lisp.extensions.LispNatAddress)2 LispTeRecord (org.onosproject.lisp.msg.types.lcaf.LispTeRecord)2 DefaultMapping (org.onosproject.mapping.DefaultMapping)2