22 #ifndef NDN_FORWARDING_ENTRY_HPP
23 #define NDN_FORWARDING_ENTRY_HPP
28 #include "publisher-public-key-digest.hpp"
29 #include "forwarding-flags.hpp"
30 #include "encoding/wire-format.hpp"
52 return wireFormat.encodeForwardingEntry(*
this);
58 wireFormat.decodeForwardingEntry(*
this, input, inputLength);
64 wireDecode(&input[0], input.size(), wireFormat);
76 getAction()
const {
return action_; }
79 getPrefix() {
return prefix_; }
82 getPrefix()
const {
return prefix_; }
85 getPublisherPublicKeyDigest() {
return publisherPublicKeyDigest_; }
88 getPublisherPublicKeyDigest()
const {
return publisherPublicKeyDigest_; }
91 getFaceId()
const {
return faceId_; }
94 getForwardingFlags()
const {
return forwardingFlags_; }
97 getFreshnessPeriod()
const {
return freshnessPeriod_; }
105 return freshnessPeriod_ < 0 ? -1 : (int)round(freshnessPeriod_ / 1000.0);
116 setAction(
const std::string& action) { action_ =
action; }
119 setFaceId(
int faceId) { faceId_ =
faceId; }
122 setForwardingFlags(
const ForwardingFlags& forwardingFlags) { forwardingFlags_ = forwardingFlags; }
136 setFreshnessPeriod(freshnessSeconds < 0 ? -1.0 : (
double)freshnessSeconds * 1000.0);
int faceId
-1 for none.
Definition: forwarding-entry.h:52
double Milliseconds
A time interval represented as the number of milliseconds.
Definition: common.hpp:111
Copyright (C) 2013-2015 Regents of the University of California.
Definition: common.hpp:35
An ndn_ForwardingEntry holds fields for a ForwardingEntry which is used to register a prefix with a h...
Definition: forwarding-entry.h:48
A ForwardingEntry holds an action and Name prefix and other fields for a forwarding entry...
Definition: forwarding-entry.hpp:41
ndn_Milliseconds freshnessPeriod
-1 for none.
Definition: forwarding-entry.h:54
A ForwardingFlags object holds the flags which specify how the forwarding daemon should forward an in...
Definition: forwarding-flags.hpp:34
A PublisherPublicKeyDigest holds the publisher public key digest value, if any.
Definition: publisher-public-key-digest.hpp:37
struct ndn_Blob action
A Blob whose value is a pointer to a pre-allocated buffer.
Definition: forwarding-entry.h:49
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:42
A Blob holds a pointer to an immutable byte array implemented as const std::vector.
Definition: blob.hpp:42
void set(const struct ndn_ForwardingEntry &forwardingEntryStruct)
Clear this forwarding entry, and set the values by copying from forwardingEntryStruct.
Definition: forwarding-entry.cpp:54
void DEPRECATED_IN_NDN_CPP setFreshnessSeconds(int freshnessSeconds)
Definition: forwarding-entry.hpp:134
int DEPRECATED_IN_NDN_CPP getFreshnessSeconds() const
Definition: forwarding-entry.hpp:103