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));
}
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();
}
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));
}
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();
}
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();
}
Aggregations