Project

General

Profile

Actions

Feature #3913

closed

Add DummyForwarder to utils

Added by Zhiyi Zhang over 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Utils
Target version:
Start date:
01/07/2017
Due date:
% Done:

100%

Estimated time:

Description

In many test cases, we want to test packet exchange between faces. Though we have DummyClientFace, we do not have a DummyForwarder which can forward packets among faces.
This DummyForwarder was first designed for Name-based Access Control protocol tests: https://gerrit.named-data.net/#/c/2599/12.
We move the DummyForwarder to ndn-cxx.

To add Face to DummyForwarder, the steps is like:

DummyForwarder forwarder(io_service);
auto face = make_shared<DummyClientFace>(io_service, keychain, {true, true});
size_t faceID = forwarder.addFace(face);
forwarder.registerPrefix("/face", faceID);

To pass the packets, the steps is like:

do {
  advanceClocks(time::milliseconds(10), 20);
} while (forwarder.passInterest() || forwarder.passData());
Actions

Also available in: Atom PDF