public class NFD extends Object
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_TIMEOUT |
static int |
OK_STATUS |
Constructor and Description |
---|
NFD() |
Modifier and Type | Method and Description |
---|---|
static void |
addNextHop(net.named_data.jndn.Face forwarder,
int faceId,
net.named_data.jndn.Name prefix)
Helper method to register a new face on the forwarder; as mentioned at
http://named-data.net/doc/NFD/current/manpages/nfdc.html,
this is more for debugging; use 'register' instead
|
static int |
createFace(net.named_data.jndn.Face forwarder,
String uri)
Create a new face on the given forwarder.
|
static void |
destroyFace(net.named_data.jndn.Face forwarder,
int faceId)
Destroy a face on given forwarder.
|
static void |
disableLocalControlHeader(net.named_data.jndn.Face forwarder,
LocalControlHeader header)
Disable a local control feature on the given forwarder.
|
static void |
enableLocalControlHeader(net.named_data.jndn.Face forwarder,
LocalControlHeader header)
Enable a local control feature on the given forwarder.
|
static List<FaceStatus> |
getFaceList(net.named_data.jndn.Face forwarder)
Retrieve a list of faces and their status from the given forwarder; calls
/localhost/nfd/faces/list which requires a local Face (all non-local
packets are dropped)
|
static List<FibEntry> |
getFibList(net.named_data.jndn.Face forwarder)
Retrieve a list of FIB entries and their NextHopRecords from the given
forwarder; calls /localhost/nfd/fib/list which requires a local Face (all
non-local packets are dropped).
|
static ForwarderStatus |
getForwarderStatus(net.named_data.jndn.Face forwarder)
Retrieve the status of the given forwarder; calls /localhost/nfd/status
which requires a local Face (all non-local packets are dropped)
|
static net.named_data.jndn.KeyLocator |
getKeyLocator(net.named_data.jndn.Face forwarder)
Retrieve the
KeyLocator for an NFD. |
static List<RibEntry> |
getRouteList(net.named_data.jndn.Face forwarder)
Retrieve a list of routing entries from the RIB; calls
/localhost/nfd/rib/list which requires a local Face (all non-local packets
are dropped).
|
static List<StrategyChoice> |
getStrategyList(net.named_data.jndn.Face forwarder)
Retrieve the list of strategy choice entries from the NFD; calls
/localhost/nfd/rib/list which requires a local Face (all non-local packets
are dropped).
|
static boolean |
ping(net.named_data.jndn.Face face,
net.named_data.jndn.Name name)
Request a name on an existing face to verify the forwarder is working and
responding to requests.
|
static boolean |
pingLocal(net.named_data.jndn.Face face)
Ping a forwarder on an existing face to verify that the forwarder is
working and responding to requests; this version sends a discovery packet
to /localhost/nfd which should always respond if the requestor is on the
same machine as the NDN forwarding daemon.
|
static void |
register(net.named_data.jndn.Face forwarder,
net.named_data.jndn.ControlParameters controlParameters)
Register a route on the forwarder; see
http://named-data.net/doc/NFD/current/manpages/nfdc.html
for command-line usage and
http://redmine.named-data.net/projects/nfd/wiki/RibMgmt
for protocol documentation.
|
static void |
register(net.named_data.jndn.Face forwarder,
int faceId,
net.named_data.jndn.Name route,
int cost)
Register a route on a forwarder; this will not create a new face since it
is provided a faceId.
|
static void |
register(net.named_data.jndn.Face forwarder,
String uri,
net.named_data.jndn.Name route,
int cost)
Register a route on a forwarder; this will create a new face on the
forwarder to the given URI/route pair.
|
static net.named_data.jndn.Data |
retrieveDataSet(net.named_data.jndn.Face forwarder,
net.named_data.jndn.Name datasetName)
Build an interest to retrieve a segmented data set from the NFD; for
details on the DataSet, see
http://redmine.named-data.net/projects/nfd/wiki/StatusDataset
|
static ControlResponse |
sendCommand(net.named_data.jndn.Face forwarder,
net.named_data.jndn.Interest interest)
Send an interest as a command to the forwarder; this method will convert
the interest to a command interest and block until a response is received
from the forwarder.
|
static void |
setStrategy(net.named_data.jndn.Face forwarder,
net.named_data.jndn.Name prefix,
net.named_data.jndn.Name strategy)
Set a strategy on the forwarder; see
http://named-data.net/doc/NFD/current/manpages/nfdc.html
for command-line usage and
http://redmine.named-data.net/projects/nfd/wiki/StrategyChoice
for protocol documentation.
|
static void |
unregister(net.named_data.jndn.Face forwarder,
net.named_data.jndn.ControlParameters controlParameters)
Unregister a route on a forwarder; see
http://named-data.net/doc/NFD/current/manpages/nfdc.html
for command-line usage and
http://redmine.named-data.net/projects/nfd/wiki/RibMgmt
for protocol documentation.
|
static void |
unregister(net.named_data.jndn.Face forwarder,
net.named_data.jndn.Name route)
Unregister a route on a forwarder; see
http://named-data.net/doc/NFD/current/manpages/nfdc.html
for command-line usage and
http://redmine.named-data.net/projects/nfd/wiki/RibMgmt
for protocol documentation.
|
static void |
unregister(net.named_data.jndn.Face forwarder,
net.named_data.jndn.Name route,
int faceId)
Unregister a route on a forwarder; see
http://named-data.net/doc/NFD/current/manpages/nfdc.html
for command-line usage and
http://redmine.named-data.net/projects/nfd/wiki/RibMgmt
for protocol documentation.
|
static void |
unregister(net.named_data.jndn.Face forwarder,
net.named_data.jndn.Name route,
String uri)
Unregister a route on a forwarder; see
http://named-data.net/doc/NFD/current/manpages/nfdc.html
for command-line usage and
http://redmine.named-data.net/projects/nfd/wiki/RibMgmt
for protocol documentation.
|
static void |
unsetStrategy(net.named_data.jndn.Face forwarder,
net.named_data.jndn.Name prefix)
Set a strategy on the forwarder; see
setStrategy(net.named_data.jndn.Face, net.named_data.jndn.Name, net.named_data.jndn.Name)
for more information. |
public static final long DEFAULT_TIMEOUT
public static final int OK_STATUS
public static boolean pingLocal(net.named_data.jndn.Face face)
face
- only a localhost Facepublic static boolean ping(net.named_data.jndn.Face face, net.named_data.jndn.Name name)
face
- name
- public static ForwarderStatus getForwarderStatus(net.named_data.jndn.Face forwarder) throws Exception
forwarder
- only a localhost FaceException
public static List<FaceStatus> getFaceList(net.named_data.jndn.Face forwarder) throws Exception
forwarder
- only a localhost FaceException
public static List<FibEntry> getFibList(net.named_data.jndn.Face forwarder) throws Exception
forwarder
- only a localhost FaceException
public static List<RibEntry> getRouteList(net.named_data.jndn.Face forwarder) throws Exception
forwarder
- only a localhost FaceException
public static List<StrategyChoice> getStrategyList(net.named_data.jndn.Face forwarder) throws Exception
forwarder
- only a localhost FaceException
public static net.named_data.jndn.KeyLocator getKeyLocator(net.named_data.jndn.Face forwarder) throws ManagementException, IOException
KeyLocator
for an NFD.forwarder
- only a localhost Face
KeyLocator
of the NFD's keyManagementException
- if the key is not availableIOException
- if the request failspublic static void addNextHop(net.named_data.jndn.Face forwarder, int faceId, net.named_data.jndn.Name prefix) throws Exception
forwarder
- only a localhost FacefaceId
- prefix
- Exception
public static int createFace(net.named_data.jndn.Face forwarder, String uri) throws Exception
forwarder
- only a localhost Faceuri
- Exception
public static void destroyFace(net.named_data.jndn.Face forwarder, int faceId) throws Exception
forwarder
- only a localhost FacefaceId
- Exception
public static void enableLocalControlHeader(net.named_data.jndn.Face forwarder, LocalControlHeader header) throws Exception
forwarder
- header
- Exception
public static void disableLocalControlHeader(net.named_data.jndn.Face forwarder, LocalControlHeader header) throws Exception
forwarder
- header
- Exception
public static void register(net.named_data.jndn.Face forwarder, net.named_data.jndn.ControlParameters controlParameters) throws Exception
forwarder
- only a localhost FacecontrolParameters
- Exception
public static void register(net.named_data.jndn.Face forwarder, String uri, net.named_data.jndn.Name route, int cost) throws Exception
forwarder
- only a localhost Faceuri
- cost
- route
- Exception
public static void register(net.named_data.jndn.Face forwarder, int faceId, net.named_data.jndn.Name route, int cost) throws Exception
forwarder
- only a localhost FacefaceId
- route
- cost
- Exception
public static void unregister(net.named_data.jndn.Face forwarder, net.named_data.jndn.ControlParameters controlParameters) throws Exception
forwarder
- controlParameters
- Exception
public static void unregister(net.named_data.jndn.Face forwarder, net.named_data.jndn.Name route) throws Exception
forwarder
- route
- Exception
public static void unregister(net.named_data.jndn.Face forwarder, net.named_data.jndn.Name route, int faceId) throws Exception
forwarder
- route
- faceId
- Exception
public static void unregister(net.named_data.jndn.Face forwarder, net.named_data.jndn.Name route, String uri) throws Exception
forwarder
- route
- uri
- Exception
public static void setStrategy(net.named_data.jndn.Face forwarder, net.named_data.jndn.Name prefix, net.named_data.jndn.Name strategy) throws Exception
forwarder
- only a localhost Faceprefix
- the Name
prefixstrategy
- the Name
of the strategy to set, e.g.
/localhost/nfd/strategy/broadcastException
- if the command failspublic static void unsetStrategy(net.named_data.jndn.Face forwarder, net.named_data.jndn.Name prefix) throws Exception
setStrategy(net.named_data.jndn.Face, net.named_data.jndn.Name, net.named_data.jndn.Name)
for more information. Ensure the forwarding face is on the local machine
(management requests are to /localhost/...) and that command signing has
been set up (e.g. forwarder.setCommandSigningInfo()).forwarder
- only a localhost Face
prefix
- the Name
prefixException
- if the command failspublic static net.named_data.jndn.Data retrieveDataSet(net.named_data.jndn.Face forwarder, net.named_data.jndn.Name datasetName) throws IOException, ManagementException
forwarder
- the Face
to an NFDdatasetName
- the Name
of the dataset to retrieveData
packetIOException
- if the request failsManagementException
- if the returned TLV is not the expected typepublic static ControlResponse sendCommand(net.named_data.jndn.Face forwarder, net.named_data.jndn.Interest interest) throws IOException, net.named_data.jndn.encoding.EncodingException, ManagementException
forwarder
- only a localhost Face, command signing info must be setinterest
- As described at
http://redmine.named-data.net/projects/nfd/wiki/ControlCommand,
the requested interest must have encoded ControlParameters appended to the
interest nameControlResponse
IOException
net.named_data.jndn.encoding.EncodingException
ManagementException
Copyright © 2015. All rights reserved.