use of org.onosproject.lisp.msg.types.LispIpv4Address in project onos by opennetworkinglab.
the class DefaultLispInfoReplyTest method testConstruction.
@Test
public void testConstruction() {
DefaultLispInfoReply reply = (DefaultLispInfoReply) reply1;
LispIpv4Address address = new LispIpv4Address(IpAddress.valueOf("192.168.1.4"));
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"));
LispNatLcafAddress natLcafAddress = new NatAddressBuilder().withLength((short) 0).withMsUdpPortNumber(msUdpPortNumber1).withEtrUdpPortNumber(etrUdpPortNumber1).withGlobalEtrRlocAddress(globalEtrRlocAddress1).withMsRlocAddress(msRlocAddress1).withPrivateEtrRlocAddress(privateEtrRlocAddress1).build();
assertThat(reply.isInfoReply(), is(true));
assertThat(reply.getNonce(), is(1L));
assertThat(reply.getKeyId(), is((short) 1));
assertThat(reply.getMaskLength(), is((byte) 1));
assertThat(reply.getPrefix(), is(address));
assertThat(reply.getNatLcafAddress(), is(natLcafAddress));
}
use of org.onosproject.lisp.msg.types.LispIpv4Address in project onos by opennetworkinglab.
the class DefaultLispInfoRequestTest method testConstruction.
@Test
public void testConstruction() {
DefaultLispInfoRequest request = (DefaultLispInfoRequest) request1;
LispIpv4Address address = new LispIpv4Address(IpAddress.valueOf("192.168.1.1"));
assertThat(request.isInfoReply(), is(false));
assertThat(request.getNonce(), is(1L));
assertThat(request.getKeyId(), is((short) 1));
assertThat(request.getMaskLength(), is((byte) 1));
assertThat(request.getPrefix(), is(address));
}
use of org.onosproject.lisp.msg.types.LispIpv4Address in project onos by opennetworkinglab.
the class LispSourceDestLcafAddressTest method setup.
@Before
public void setup() {
SourceDestAddressBuilder builder1 = new SourceDestAddressBuilder();
LispIpv4Address srcAddress1 = new LispIpv4Address(IpAddress.valueOf("192.168.1.1"));
LispIpv4Address dstAddress1 = new LispIpv4Address(IpAddress.valueOf("192.168.1.2"));
address1 = builder1.withReserved((short) 1).withSrcMaskLength((byte) 0x01).withDstMaskLength((byte) 0x01).withSrcPrefix(srcAddress1).withDstPrefix(dstAddress1).build();
SourceDestAddressBuilder builder2 = new SourceDestAddressBuilder();
sameAsAddress1 = builder2.withReserved((short) 1).withSrcMaskLength((byte) 0x01).withDstMaskLength((byte) 0x01).withSrcPrefix(srcAddress1).withDstPrefix(dstAddress1).build();
SourceDestAddressBuilder builder3 = new SourceDestAddressBuilder();
LispIpv4Address srcAddress2 = new LispIpv4Address(IpAddress.valueOf("192.168.2.1"));
LispIpv4Address dstAddress2 = new LispIpv4Address(IpAddress.valueOf("192.168.2.2"));
address2 = builder3.withReserved((short) 2).withSrcMaskLength((byte) 0x02).withDstMaskLength((byte) 0x02).withSrcPrefix(srcAddress2).withDstPrefix(dstAddress2).build();
}
use of org.onosproject.lisp.msg.types.LispIpv4Address in project onos by opennetworkinglab.
the class LispSourceDestLcafAddressTest method testConstruction.
@Test
public void testConstruction() {
LispSourceDestLcafAddress sourceDestLcafAddress = address1;
LispIpv4Address srcAddress = new LispIpv4Address(IpAddress.valueOf("192.168.1.1"));
LispIpv4Address dstAddress = new LispIpv4Address(IpAddress.valueOf("192.168.1.2"));
assertThat(sourceDestLcafAddress.getReserved(), is((short) 1));
assertThat(sourceDestLcafAddress.getSrcMaskLength(), is((byte) 0x01));
assertThat(sourceDestLcafAddress.getDstMaskLength(), is((byte) 0x01));
assertThat(sourceDestLcafAddress.getSrcPrefix(), is(srcAddress));
assertThat(sourceDestLcafAddress.getDstPrefix(), is(dstAddress));
}
use of org.onosproject.lisp.msg.types.LispIpv4Address in project onos by opennetworkinglab.
the class LispTeLcafAddressTest method testConstruction.
@Test
public void testConstruction() {
LispTeLcafAddress teLcafAddress = address1;
LispIpv4Address rtrRloc1 = new LispIpv4Address(IpAddress.valueOf("192.168.1.1"));
LispIpv4Address rtrRloc2 = new LispIpv4Address(IpAddress.valueOf("192.168.1.2"));
assertThat("lookup flag value in TeRecord is not correct", teLcafAddress.getTeRecords().get(0).isLookup(), is(false));
assertThat("RLOC probe flag value in TeRecord is not correct", teLcafAddress.getTeRecords().get(0).isRlocProbe(), is(false));
assertThat("strict flag value in TeRecord is not correct", teLcafAddress.getTeRecords().get(0).isStrict(), is(false));
assertThat("RTR RLOC address in TeRecord is not correct", teLcafAddress.getTeRecords().get(0).getRtrRlocAddress(), is(rtrRloc1));
assertThat("lookup flag value in TeRecord in not correct", teLcafAddress.getTeRecords().get(1).isLookup(), is(false));
assertThat("RLOC probe flag value in TeRecord is not correct", teLcafAddress.getTeRecords().get(1).isRlocProbe(), is(true));
assertThat("strict flag value in TeRecord is not correct", teLcafAddress.getTeRecords().get(1).isStrict(), is(false));
assertThat("RTR RLOC address in TeRecord is not correct", teLcafAddress.getTeRecords().get(1).getRtrRlocAddress(), is(rtrRloc2));
}
Aggregations