Search in sources :

Example 1 with DefaultReplyBuilder

use of org.onosproject.lisp.msg.protocols.DefaultLispMapReply.DefaultReplyBuilder in project onos by opennetworkinglab.

the class DefaultLispMapReplyTest method setup.

@Before
public void setup() {
    ReplyBuilder builder1 = new DefaultReplyBuilder();
    List<LispMapRecord> records1 = ImmutableList.of(getMapRecord(), getMapRecord());
    reply1 = builder1.withIsEtr(true).withIsProbe(false).withIsSecurity(true).withNonce(1L).withMapRecords(records1).build();
    ReplyBuilder builder2 = new DefaultReplyBuilder();
    List<LispMapRecord> records2 = ImmutableList.of(getMapRecord(), getMapRecord());
    sameAsReply1 = builder2.withIsEtr(true).withIsProbe(false).withIsSecurity(true).withNonce(1L).withMapRecords(records2).build();
    ReplyBuilder builder3 = new DefaultReplyBuilder();
    reply2 = builder3.withIsEtr(false).withIsProbe(true).withIsSecurity(false).withNonce(2L).build();
}
Also used : DefaultReplyBuilder(org.onosproject.lisp.msg.protocols.DefaultLispMapReply.DefaultReplyBuilder) ReplyBuilder(org.onosproject.lisp.msg.protocols.LispMapReply.ReplyBuilder) DefaultReplyBuilder(org.onosproject.lisp.msg.protocols.DefaultLispMapReply.DefaultReplyBuilder) Before(org.junit.Before)

Example 2 with DefaultReplyBuilder

use of org.onosproject.lisp.msg.protocols.DefaultLispMapReply.DefaultReplyBuilder in project onos by opennetworkinglab.

the class LispMapResolver method initMapReplyBuilder.

/**
 * Initializes MapReply builder without specifying map records.
 *
 * @param request received map request from ITR
 * @return initialized MapReply builder
 */
private ReplyBuilder initMapReplyBuilder(LispMapRequest request) {
    ReplyBuilder replyBuilder = new DefaultReplyBuilder();
    replyBuilder.withNonce(request.getNonce());
    replyBuilder.withIsEtr(false);
    replyBuilder.withIsSecurity(false);
    replyBuilder.withIsProbe(request.isProbe());
    return replyBuilder;
}
Also used : DefaultReplyBuilder(org.onosproject.lisp.msg.protocols.DefaultLispMapReply.DefaultReplyBuilder) DefaultReplyBuilder(org.onosproject.lisp.msg.protocols.DefaultLispMapReply.DefaultReplyBuilder) ReplyBuilder(org.onosproject.lisp.msg.protocols.LispMapReply.ReplyBuilder)

Example 3 with DefaultReplyBuilder

use of org.onosproject.lisp.msg.protocols.DefaultLispMapReply.DefaultReplyBuilder in project onos by opennetworkinglab.

the class MappingEntryBuilderTest method testMapReplyConversion.

@Test
public void testMapReplyConversion() {
    ReplyBuilder replyBuilder = new DefaultReplyBuilder();
    List<LispMapRecord> records = ImmutableList.of(getMapRecord(IP4, UNKNOWN));
    LispMapReply mapReply = replyBuilder.withIsEtr(true).withIsProbe(false).withIsSecurity(true).withNonce(UNIQUE_LONG).withMapRecords(records).build();
    List<LispMapRecord> replyRecords = mapReply.getMapRecords();
    assertThat(replyRecords.size(), is(1));
    testMapRecordConversion(replyRecords.get(0));
}
Also used : DefaultReplyBuilder(org.onosproject.lisp.msg.protocols.DefaultLispMapReply.DefaultReplyBuilder) LispMapReply(org.onosproject.lisp.msg.protocols.LispMapReply) ReplyBuilder(org.onosproject.lisp.msg.protocols.LispMapReply.ReplyBuilder) DefaultReplyBuilder(org.onosproject.lisp.msg.protocols.DefaultLispMapReply.DefaultReplyBuilder) LispMapRecord(org.onosproject.lisp.msg.protocols.LispMapRecord) Test(org.junit.Test)

Aggregations

DefaultReplyBuilder (org.onosproject.lisp.msg.protocols.DefaultLispMapReply.DefaultReplyBuilder)3 ReplyBuilder (org.onosproject.lisp.msg.protocols.LispMapReply.ReplyBuilder)3 Before (org.junit.Before)1 Test (org.junit.Test)1 LispMapRecord (org.onosproject.lisp.msg.protocols.LispMapRecord)1 LispMapReply (org.onosproject.lisp.msg.protocols.LispMapReply)1