Search in sources :

Example 31 with LispIpv4Address

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

the class LispNatLcafAddressTest method testConstruction.

@Test
public void testConstruction() {
    LispNatLcafAddress natLcafAddress = address1;
    LispIpv4Address globalEtrRlocAddress1 = new LispIpv4Address(IpAddress.valueOf("192.168.1.1"));
    LispIpv4Address msRlocAddress1 = new LispIpv4Address(IpAddress.valueOf("192.168.1.2"));
    LispIpv4Address privateEtrRlocAddress1 = new LispIpv4Address(IpAddress.valueOf("192.168.1.3"));
    assertThat(natLcafAddress.getLength(), is((short) 0));
    assertThat(natLcafAddress.getMsUdpPortNumber(), is((short) 80));
    assertThat(natLcafAddress.getEtrUdpPortNumber(), is((short) 100));
    assertThat(natLcafAddress.getGlobalEtrRlocAddress(), is(globalEtrRlocAddress1));
    assertThat(natLcafAddress.getMsRlocAddress(), is(msRlocAddress1));
    assertThat(natLcafAddress.getPrivateEtrRlocAddress(), is(privateEtrRlocAddress1));
}
Also used : LispIpv4Address(org.onosproject.lisp.msg.types.LispIpv4Address) Test(org.junit.Test)

Example 32 with LispIpv4Address

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

the class LispNatLcafAddressTest method setup.

@Before
public void setup() {
    NatAddressBuilder builder1 = new NatAddressBuilder();
    short msUdpPortNumber1 = 80;
    short etrUdpPortNumber1 = 100;
    LispIpv4Address globalEtrRlocAddress1 = new LispIpv4Address(IpAddress.valueOf("192.168.1.1"));
    LispIpv4Address msRlocAddress1 = new LispIpv4Address(IpAddress.valueOf("192.168.1.2"));
    LispIpv4Address privateEtrRlocAddress1 = new LispIpv4Address(IpAddress.valueOf("192.168.1.3"));
    LispIpv4Address rtrRloc11 = new LispIpv4Address(IpAddress.valueOf("10.1.1.1"));
    LispIpv4Address rtrRloc12 = new LispIpv4Address(IpAddress.valueOf("10.1.1.2"));
    List<LispAfiAddress> rtrRlocs1 = ImmutableList.of(rtrRloc11, rtrRloc12);
    address1 = builder1.withLength((short) 0).withMsUdpPortNumber(msUdpPortNumber1).withEtrUdpPortNumber(etrUdpPortNumber1).withGlobalEtrRlocAddress(globalEtrRlocAddress1).withMsRlocAddress(msRlocAddress1).withPrivateEtrRlocAddress(privateEtrRlocAddress1).withRtrRlocAddresses(rtrRlocs1).build();
    NatAddressBuilder builder2 = new NatAddressBuilder();
    sameAsAddress1 = builder2.withLength((short) 0).withMsUdpPortNumber(msUdpPortNumber1).withEtrUdpPortNumber(etrUdpPortNumber1).withGlobalEtrRlocAddress(globalEtrRlocAddress1).withMsRlocAddress(msRlocAddress1).withPrivateEtrRlocAddress(privateEtrRlocAddress1).withRtrRlocAddresses(rtrRlocs1).build();
    NatAddressBuilder builder3 = new NatAddressBuilder();
    short msUdpPortNumber2 = 81;
    short etrUdpPortNumber2 = 101;
    LispIpv4Address globalEtrRlocAddress2 = new LispIpv4Address(IpAddress.valueOf("192.168.2.1"));
    LispIpv4Address msRlocAddress2 = new LispIpv4Address(IpAddress.valueOf("192.168.2.2"));
    LispIpv4Address privateEtrRlocAddress2 = new LispIpv4Address(IpAddress.valueOf("192.168.2.3"));
    LispIpv4Address rtrRloc21 = new LispIpv4Address(IpAddress.valueOf("10.1.2.1"));
    LispIpv4Address rtrRloc22 = new LispIpv4Address(IpAddress.valueOf("10.1.2.2"));
    List<LispAfiAddress> rtrRlocs2 = ImmutableList.of(rtrRloc21, rtrRloc22);
    address2 = builder3.withLength((short) 0).withMsUdpPortNumber(msUdpPortNumber2).withEtrUdpPortNumber(etrUdpPortNumber2).withGlobalEtrRlocAddress(globalEtrRlocAddress2).withMsRlocAddress(msRlocAddress2).withPrivateEtrRlocAddress(privateEtrRlocAddress2).withRtrRlocAddresses(rtrRlocs2).build();
}
Also used : NatAddressBuilder(org.onosproject.lisp.msg.types.lcaf.LispNatLcafAddress.NatAddressBuilder) LispIpv4Address(org.onosproject.lisp.msg.types.LispIpv4Address) LispAfiAddress(org.onosproject.lisp.msg.types.LispAfiAddress) Before(org.junit.Before)

Example 33 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 34 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 35 with LispIpv4Address

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

the class DefaultLispInfoReplyTest method setup.

@Before
public void setup() {
    InfoReplyBuilder builder1 = new DefaultInfoReplyBuilder();
    short msUdpPortNumber1 = 80;
    short etrUdpPortNumber1 = 100;
    LispIpv4Address globalEtrRlocAddress1 = new LispIpv4Address(IpAddress.valueOf("192.168.1.1"));
    LispIpv4Address msRlocAddress1 = new LispIpv4Address(IpAddress.valueOf("192.168.1.2"));
    LispIpv4Address privateEtrRlocAddress1 = new LispIpv4Address(IpAddress.valueOf("192.168.1.3"));
    LispIpv4Address address1 = new LispIpv4Address(IpAddress.valueOf("192.168.1.4"));
    LispNatLcafAddress natLcafAddress1 = new NatAddressBuilder().withLength((short) 0).withMsUdpPortNumber(msUdpPortNumber1).withEtrUdpPortNumber(etrUdpPortNumber1).withGlobalEtrRlocAddress(globalEtrRlocAddress1).withMsRlocAddress(msRlocAddress1).withPrivateEtrRlocAddress(privateEtrRlocAddress1).build();
    reply1 = builder1.withNonce(1L).withKeyId((short) 1).withAuthKey(AUTH_KEY).withIsInfoReply(true).withMaskLength((byte) 1).withEidPrefix(address1).withNatLcafAddress(natLcafAddress1).build();
    InfoReplyBuilder builder2 = new DefaultInfoReplyBuilder();
    sameAsReply1 = builder2.withNonce(1L).withKeyId((short) 1).withAuthKey(AUTH_KEY).withIsInfoReply(true).withMaskLength((byte) 1).withEidPrefix(address1).withNatLcafAddress(natLcafAddress1).build();
    InfoReplyBuilder builder3 = new DefaultInfoReplyBuilder();
    short msUdpPortNumber2 = 81;
    short etrUdpPortNumber2 = 101;
    LispIpv4Address globalEtrRlocAddress2 = new LispIpv4Address(IpAddress.valueOf("192.168.2.1"));
    LispIpv4Address msRlocAddress2 = new LispIpv4Address(IpAddress.valueOf("192.168.2.2"));
    LispIpv4Address privateEtrRlocAddress2 = new LispIpv4Address(IpAddress.valueOf("192.168.2.3"));
    LispIpv4Address address2 = new LispIpv4Address(IpAddress.valueOf("192.168.2.4"));
    LispNatLcafAddress natLcafAddress2 = new NatAddressBuilder().withLength((short) 0).withMsUdpPortNumber(msUdpPortNumber2).withEtrUdpPortNumber(etrUdpPortNumber2).withGlobalEtrRlocAddress(globalEtrRlocAddress2).withMsRlocAddress(msRlocAddress2).withPrivateEtrRlocAddress(privateEtrRlocAddress2).build();
    reply2 = builder3.withNonce(2L).withKeyId((short) 2).withAuthKey(AUTH_KEY).withIsInfoReply(true).withMaskLength((byte) 1).withEidPrefix(address2).withNatLcafAddress(natLcafAddress2).build();
}
Also used : DefaultInfoReplyBuilder(org.onosproject.lisp.msg.protocols.DefaultLispInfoReply.DefaultInfoReplyBuilder) NatAddressBuilder(org.onosproject.lisp.msg.types.lcaf.LispNatLcafAddress.NatAddressBuilder) DefaultInfoReplyBuilder(org.onosproject.lisp.msg.protocols.DefaultLispInfoReply.DefaultInfoReplyBuilder) InfoReplyBuilder(org.onosproject.lisp.msg.protocols.LispInfoReply.InfoReplyBuilder) LispIpv4Address(org.onosproject.lisp.msg.types.LispIpv4Address) LispNatLcafAddress(org.onosproject.lisp.msg.types.lcaf.LispNatLcafAddress) Before(org.junit.Before)

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