use of org.onosproject.lisp.msg.protocols.LispLocator.LocatorBuilder in project onos by opennetworkinglab.
the class MappingEntryBuilderTest method getMapRecord.
/**
* Obtains a MapRecord instance.
*
* @param afiType AFI address type
* @param lcafType LCAF address type
* @return a MapRecord instance
*/
private LispMapRecord getMapRecord(AddressFamilyIdentifierEnum afiType, LispCanonicalAddressFormatEnum lcafType) {
MapRecordBuilder recordBuilder = new DefaultMapRecordBuilder();
LispIpv4Address recordAddress = new LispIpv4Address(IpAddress.valueOf(IP_RECORD_ADDRESS));
LocatorBuilder locatorBuilder = new DefaultLocatorBuilder();
LispAfiAddress locatorAddress = getAfiAddress(afiType, lcafType);
LispLocator locator = locatorBuilder.withPriority(UNIQUE_BYTE).withWeight(UNIQUE_BYTE).withMulticastPriority(UNIQUE_BYTE).withMulticastWeight(UNIQUE_BYTE).withLocalLocator(true).withRlocProbed(false).withRouted(true).withLocatorAfi(locatorAddress).build();
return recordBuilder.withRecordTtl(UNIQUE_INT).withIsAuthoritative(true).withMapVersionNumber(UNIQUE_SHORT).withMaskLength((byte) IP_RECORD_MASK_LENGTH).withAction(LispMapReplyAction.NativelyForward).withEidPrefixAfi(recordAddress).withLocators(ImmutableList.of(locator)).build();
}
use of org.onosproject.lisp.msg.protocols.LispLocator.LocatorBuilder 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();
}
Aggregations