Search in sources :

Example 46 with LispIpv4Address

use of org.onosproject.lisp.msg.types.LispIpv4Address in project onos by opennetworkinglab.

the class LispNonceLcafAddressTest method testConstruction.

@Test
public void testConstruction() {
    LispNonceLcafAddress nonceLcafAddress = address1;
    LispIpv4Address ipv4Address = new LispIpv4Address(IpAddress.valueOf(IP_ADDRESS_1));
    assertThat(nonceLcafAddress.getNonce(), is(NONCE_1));
    assertThat(nonceLcafAddress.getAddress(), is(ipv4Address));
}
Also used : LispIpv4Address(org.onosproject.lisp.msg.types.LispIpv4Address) Test(org.junit.Test)

Example 47 with LispIpv4Address

use of org.onosproject.lisp.msg.types.LispIpv4Address in project onos by opennetworkinglab.

the class LispNonceLcafAddressTest method setup.

@Before
public void setup() {
    NonceAddressBuilder builder1 = new NonceAddressBuilder();
    LispIpv4Address ipv4Address1 = new LispIpv4Address(IpAddress.valueOf(IP_ADDRESS_1));
    address1 = builder1.withNonce(NONCE_1).withAddress(ipv4Address1).build();
    NonceAddressBuilder builder2 = new NonceAddressBuilder();
    sameAsAddress1 = builder2.withNonce(NONCE_1).withAddress(ipv4Address1).build();
    NonceAddressBuilder builder3 = new NonceAddressBuilder();
    LispIpv4Address ipv4Address2 = new LispIpv4Address(IpAddress.valueOf(IP_ADDRESS_2));
    address2 = builder3.withNonce(NONCE_2).withAddress(ipv4Address2).build();
}
Also used : LispIpv4Address(org.onosproject.lisp.msg.types.LispIpv4Address) NonceAddressBuilder(org.onosproject.lisp.msg.types.lcaf.LispNonceLcafAddress.NonceAddressBuilder) Before(org.junit.Before)

Example 48 with LispIpv4Address

use of org.onosproject.lisp.msg.types.LispIpv4Address in project onos by opennetworkinglab.

the class DefaultLispReferralTest method setup.

@Before
public void setup() {
    ReferralBuilder builder1 = new DefaultReferralBuilder();
    LispIpv4Address ipv4Address1 = new LispIpv4Address(IpAddress.valueOf(IP_ADDRESS1));
    referral1 = builder1.withPriority((byte) 0x01).withWeight((byte) 0x01).withMulticastPriority((byte) 0x01).withMulticastWeight((byte) 0x01).withLocalLocator(true).withRlocProbed(false).withRouted(true).withLocatorAfi(ipv4Address1).build();
    ReferralBuilder builder2 = new DefaultReferralBuilder();
    sameAsReferral1 = builder2.withPriority((byte) 0x01).withWeight((byte) 0x01).withMulticastPriority((byte) 0x01).withMulticastWeight((byte) 0x01).withLocalLocator(true).withRlocProbed(false).withRouted(true).withLocatorAfi(ipv4Address1).build();
    ReferralBuilder builder3 = new DefaultReferralBuilder();
    LispIpv4Address ipv4Address2 = new LispIpv4Address(IpAddress.valueOf(IP_ADDRESS2));
    referral2 = builder3.withPriority((byte) 0x02).withWeight((byte) 0x02).withMulticastPriority((byte) 0x02).withMulticastWeight((byte) 0x02).withLocalLocator(false).withRlocProbed(true).withRouted(false).withLocatorAfi(ipv4Address2).build();
}
Also used : LispIpv4Address(org.onosproject.lisp.msg.types.LispIpv4Address) ReferralBuilder(org.onosproject.lisp.msg.protocols.LispReferral.ReferralBuilder) DefaultReferralBuilder(org.onosproject.lisp.msg.protocols.DefaultLispReferral.DefaultReferralBuilder) DefaultReferralBuilder(org.onosproject.lisp.msg.protocols.DefaultLispReferral.DefaultReferralBuilder) Before(org.junit.Before)

Example 49 with LispIpv4Address

use of org.onosproject.lisp.msg.types.LispIpv4Address in project onos by opennetworkinglab.

the class DefaultLispReferralTest method testConstruction.

@Test
public void testConstruction() {
    LispReferral referral = referral1;
    LispIpv4Address ipv4Address = new LispIpv4Address(IpAddress.valueOf(IP_ADDRESS1));
    assertThat(referral.getPriority(), is((byte) 0x01));
    assertThat(referral.getWeight(), is((byte) 0x01));
    assertThat(referral.getMulticastPriority(), is((byte) 0x01));
    assertThat(referral.getMulticastWeight(), is((byte) 0x01));
    assertThat(referral.isLocalLocator(), is(true));
    assertThat(referral.isRlocProbed(), is(false));
    assertThat(referral.isRouted(), is(true));
    assertThat(referral.getLocatorAfi(), is(ipv4Address));
}
Also used : LispIpv4Address(org.onosproject.lisp.msg.types.LispIpv4Address) Test(org.junit.Test)

Aggregations

LispIpv4Address (org.onosproject.lisp.msg.types.LispIpv4Address)49 Test (org.junit.Test)19 Before (org.junit.Before)18 LispAfiAddress (org.onosproject.lisp.msg.types.LispAfiAddress)10 DefaultMapRecordBuilder (org.onosproject.lisp.msg.protocols.DefaultLispMapRecord.DefaultMapRecordBuilder)8 MapRecordBuilder (org.onosproject.lisp.msg.protocols.LispMapRecord.MapRecordBuilder)8 LispIpv6Address (org.onosproject.lisp.msg.types.LispIpv6Address)6 LispEidRecord (org.onosproject.lisp.msg.protocols.LispEidRecord)4 LispMapRecord (org.onosproject.lisp.msg.protocols.LispMapRecord)4 NatAddressBuilder (org.onosproject.lisp.msg.types.lcaf.LispNatLcafAddress.NatAddressBuilder)4 IpAddress (org.onlab.packet.IpAddress)3 DefaultLocatorBuilder (org.onosproject.lisp.msg.protocols.DefaultLispLocator.DefaultLocatorBuilder)3 UnknownHostException (java.net.UnknownHostException)2 IpPrefix (org.onlab.packet.IpPrefix)2 DefaultInfoReplyBuilder (org.onosproject.lisp.msg.protocols.DefaultLispInfoReply.DefaultInfoReplyBuilder)2 DefaultInfoRequestBuilder (org.onosproject.lisp.msg.protocols.DefaultLispInfoRequest.DefaultInfoRequestBuilder)2 DefaultRequestBuilder (org.onosproject.lisp.msg.protocols.DefaultLispMapRequest.DefaultRequestBuilder)2 DefaultReferralRecordBuilder (org.onosproject.lisp.msg.protocols.DefaultLispReferralRecord.DefaultReferralRecordBuilder)2 InfoReplyBuilder (org.onosproject.lisp.msg.protocols.LispInfoReply.InfoReplyBuilder)2 InfoRequestBuilder (org.onosproject.lisp.msg.protocols.LispInfoRequest.InfoRequestBuilder)2