use of org.onosproject.lisp.msg.types.LispIpv4Address in project onos by opennetworkinglab.
the class DefaultLispInfoRequestTest method setup.
@Before
public void setup() {
InfoRequestBuilder builder1 = new DefaultInfoRequestBuilder();
LispIpv4Address address1 = new LispIpv4Address(IpAddress.valueOf("192.168.1.1"));
request1 = builder1.withNonce(1L).withKeyId((short) 1).withAuthKey(AUTH_KEY).withIsInfoReply(false).withMaskLength((byte) 1).withEidPrefix(address1).build();
InfoRequestBuilder builder2 = new DefaultInfoRequestBuilder();
sameAsRequest1 = builder2.withNonce(1L).withKeyId((short) 1).withAuthKey(AUTH_KEY).withIsInfoReply(false).withMaskLength((byte) 1).withEidPrefix(address1).build();
InfoRequestBuilder builder3 = new DefaultInfoRequestBuilder();
LispIpv4Address address2 = new LispIpv4Address(IpAddress.valueOf("192.168.2.1"));
request2 = builder3.withNonce(2L).withKeyId((short) 2).withAuthKey(AUTH_KEY).withIsInfoReply(true).withMaskLength((byte) 1).withEidPrefix(address2).build();
}
use of org.onosproject.lisp.msg.types.LispIpv4Address in project onos by opennetworkinglab.
the class DefaultLispLocatorTest method testConstruction.
@Test
public void testConstruction() {
DefaultLispLocator record = (DefaultLispLocator) record1;
LispIpv4Address ipv4Locator = new LispIpv4Address(IpAddress.valueOf(IP_ADDRESS_1));
assertThat(record.getPriority(), is((byte) 0x01));
assertThat(record.getWeight(), is((byte) 0x01));
assertThat(record.getMulticastPriority(), is((byte) 0x01));
assertThat(record.getMulticastWeight(), is((byte) 0x01));
assertThat(record.isLocalLocator(), is(true));
assertThat(record.isRlocProbed(), is(false));
assertThat(record.isRouted(), is(true));
assertThat(record.getLocatorAfi(), is(ipv4Locator));
}
use of org.onosproject.lisp.msg.types.LispIpv4Address in project onos by opennetworkinglab.
the class DefaultLispLocatorTest method setup.
@Before
public void setup() {
LispLocator.LocatorBuilder builder1 = new DefaultLocatorBuilder();
LispIpv4Address ipv4Locator1 = new LispIpv4Address(IpAddress.valueOf(IP_ADDRESS_1));
record1 = builder1.withPriority((byte) 0x01).withWeight((byte) 0x01).withMulticastPriority((byte) 0x01).withMulticastWeight((byte) 0x01).withLocalLocator(true).withRlocProbed(false).withRouted(true).withLocatorAfi(ipv4Locator1).build();
LocatorBuilder builder2 = new DefaultLocatorBuilder();
sameAsRecord1 = builder2.withPriority((byte) 0x01).withWeight((byte) 0x01).withMulticastPriority((byte) 0x01).withMulticastWeight((byte) 0x01).withLocalLocator(true).withRlocProbed(false).withRouted(true).withLocatorAfi(ipv4Locator1).build();
LispLocator.LocatorBuilder builder3 = new DefaultLocatorBuilder();
LispIpv4Address ipv4Locator2 = new LispIpv4Address(IpAddress.valueOf(IP_ADDRESS_2));
record2 = builder3.withPriority((byte) 0x02).withWeight((byte) 0x02).withMulticastPriority((byte) 0x02).withMulticastWeight((byte) 0x02).withLocalLocator(false).withRlocProbed(true).withRouted(false).withLocatorAfi(ipv4Locator2).build();
}
use of org.onosproject.lisp.msg.types.LispIpv4Address in project onos by opennetworkinglab.
the class DefaultLispMapNotifyTest method getMapRecord.
private LispMapRecord getMapRecord() {
MapRecordBuilder builder1 = new DefaultMapRecordBuilder();
LispIpv4Address ipv4Locator1 = new LispIpv4Address(IpAddress.valueOf(IP_ADDRESS));
return builder1.withRecordTtl(100).withIsAuthoritative(true).withMapVersionNumber((short) 1).withMaskLength((byte) 0x01).withAction(LispMapReplyAction.NativelyForward).withEidPrefixAfi(ipv4Locator1).build();
}
use of org.onosproject.lisp.msg.types.LispIpv4Address in project onos by opennetworkinglab.
the class DefaultLispMapRecordTest method testConstruction.
@Test
public void testConstruction() {
DefaultLispMapRecord record = (DefaultLispMapRecord) record1;
LispIpv4Address ipv4Locator = new LispIpv4Address(IpAddress.valueOf(IP_ADDRESS_1));
assertThat(record.getRecordTtl(), is(100));
assertThat(record.isAuthoritative(), is(true));
assertThat(record.getMapVersionNumber(), is((short) 1));
assertThat(record.getMaskLength(), is((byte) 0x01));
assertThat(record.getAction(), is(LispMapReplyAction.NativelyForward));
assertThat(record.getEidPrefixAfi(), is(ipv4Locator));
}
Aggregations