Search in sources :

Example 6 with LispIpv4Address

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

the class LispAppDataLcafAddressTest method testConstruction.

@Test
public void testConstruction() {
    LispAppDataLcafAddress appDataLcafAddress = address1;
    LispAfiAddress ipv4Address = new LispIpv4Address(IpAddress.valueOf("192.168.1.1"));
    assertThat(appDataLcafAddress.getProtocol(), is((byte) 0x01));
    assertThat(appDataLcafAddress.getIpTos(), is(10));
    assertThat(appDataLcafAddress.getLocalPortLow(), is((short) 1));
    assertThat(appDataLcafAddress.getLocalPortHigh(), is((short) 255));
    assertThat(appDataLcafAddress.getRemotePortLow(), is((short) 2));
    assertThat(appDataLcafAddress.getRemotePortHigh(), is((short) 254));
    assertThat(appDataLcafAddress.getAddress(), is(ipv4Address));
}
Also used : LispIpv4Address(org.onosproject.lisp.msg.types.LispIpv4Address) LispAfiAddress(org.onosproject.lisp.msg.types.LispAfiAddress) Test(org.junit.Test)

Example 7 with LispIpv4Address

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

the class LispAppDataLcafAddressTest method setup.

@Before
public void setup() {
    AppDataAddressBuilder builder1 = new AppDataAddressBuilder();
    LispAfiAddress ipv4Address1 = new LispIpv4Address(IpAddress.valueOf("192.168.1.1"));
    address1 = builder1.withProtocol((byte) 0x01).withIpTos((short) 10).withLocalPortLow((short) 1).withLocalPortHigh((short) 255).withRemotePortLow((short) 2).withRemotePortHigh((short) 254).withAddress(ipv4Address1).build();
    AppDataAddressBuilder builder2 = new AppDataAddressBuilder();
    sameAsAddress1 = builder2.withProtocol((byte) 0x01).withIpTos((short) 10).withLocalPortLow((short) 1).withLocalPortHigh((short) 255).withRemotePortLow((short) 2).withRemotePortHigh((short) 254).withAddress(ipv4Address1).build();
    AppDataAddressBuilder builder3 = new AppDataAddressBuilder();
    LispAfiAddress ipv4Address2 = new LispIpv4Address(IpAddress.valueOf("192.168.2.1"));
    address2 = builder3.withProtocol((byte) 0x02).withIpTos((short) 20).withLocalPortLow((short) 1).withLocalPortHigh((short) 255).withRemotePortLow((short) 2).withRemotePortHigh((short) 254).withAddress(ipv4Address2).build();
}
Also used : LispIpv4Address(org.onosproject.lisp.msg.types.LispIpv4Address) LispAfiAddress(org.onosproject.lisp.msg.types.LispAfiAddress) AppDataAddressBuilder(org.onosproject.lisp.msg.types.lcaf.LispAppDataLcafAddress.AppDataAddressBuilder) Before(org.junit.Before)

Example 8 with LispIpv4Address

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

the class LispSegmentLcafAddressTest method testConstruction.

@Test
public void testConstruction() {
    LispSegmentLcafAddress segmentLcafAddress = address1;
    LispIpv4Address ipv4Address = new LispIpv4Address(IpAddress.valueOf("192.168.1.1"));
    assertThat(segmentLcafAddress.getIdMaskLength(), is((byte) 0x01));
    assertThat(segmentLcafAddress.getInstanceId(), is(1));
    assertThat(segmentLcafAddress.getAddress(), is(ipv4Address));
}
Also used : LispIpv4Address(org.onosproject.lisp.msg.types.LispIpv4Address) Test(org.junit.Test)

Example 9 with LispIpv4Address

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

the class LispSegmentLcafAddressTest method setup.

@Before
public void setup() {
    SegmentAddressBuilder builder1 = new SegmentAddressBuilder();
    LispIpv4Address ipv4Address1 = new LispIpv4Address(IpAddress.valueOf("192.168.1.1"));
    address1 = builder1.withIdMaskLength((byte) 0x01).withInstanceId(1).withAddress(ipv4Address1).build();
    SegmentAddressBuilder builder2 = new SegmentAddressBuilder();
    sameAsAddress1 = builder2.withIdMaskLength((byte) 0x01).withInstanceId(1).withAddress(ipv4Address1).build();
    SegmentAddressBuilder builder3 = new SegmentAddressBuilder();
    LispIpv4Address ipv4Address2 = new LispIpv4Address(IpAddress.valueOf("192.168.2.1"));
    address2 = builder3.withIdMaskLength((byte) 0x02).withInstanceId(2).withAddress(ipv4Address2).build();
}
Also used : SegmentAddressBuilder(org.onosproject.lisp.msg.types.lcaf.LispSegmentLcafAddress.SegmentAddressBuilder) LispIpv4Address(org.onosproject.lisp.msg.types.LispIpv4Address) Before(org.junit.Before)

Example 10 with LispIpv4Address

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

the class DefaultLispEncapsulatedControlTest method getMapRecord.

private LispMapRecord getMapRecord() {
    MapRecordBuilder builder1 = new DefaultMapRecordBuilder();
    LispIpv4Address ipv4Locator1 = new LispIpv4Address(IpAddress.valueOf(RECORD_EID));
    return builder1.withRecordTtl(100).withIsAuthoritative(true).withMapVersionNumber((short) 1).withMaskLength((byte) 0x01).withAction(LispMapReplyAction.NativelyForward).withEidPrefixAfi(ipv4Locator1).build();
}
Also used : MapRecordBuilder(org.onosproject.lisp.msg.protocols.LispMapRecord.MapRecordBuilder) DefaultMapRecordBuilder(org.onosproject.lisp.msg.protocols.DefaultLispMapRecord.DefaultMapRecordBuilder) LispIpv4Address(org.onosproject.lisp.msg.types.LispIpv4Address) DefaultMapRecordBuilder(org.onosproject.lisp.msg.protocols.DefaultLispMapRecord.DefaultMapRecordBuilder)

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