21 #ifndef NDN_FORWARDING_ENTRY_H
22 #define NDN_FORWARDING_ENTRY_H
25 #include <ndn-cpp/c/common.h>
26 #include "forwarding-flags-impl.h"
28 #include "publisher-public-key-digest.h"
35 ndn_ForwardingEntryFlags_ACTIVE = 1,
36 ndn_ForwardingEntryFlags_CHILD_INHERIT = 2,
37 ndn_ForwardingEntryFlags_ADVERTISE = 4,
38 ndn_ForwardingEntryFlags_LAST = 8,
39 ndn_ForwardingEntryFlags_CAPTURE = 16,
40 ndn_ForwardingEntryFlags_LOCAL = 32,
41 ndn_ForwardingEntryFlags_TAP = 64,
42 ndn_ForwardingEntryFlags_CAPTURE_OK = 128
43 } ndn_ForwardingEntryFlags;
64 static __inline
void ndn_ForwardingEntry_initialize
67 ndn_Blob_initialize(&self->action, 0, 0);
68 ndn_Name_initialize(&self->prefix, prefixNameComponents, maxPrefixNameComponents);
69 ndn_PublisherPublicKeyDigest_initialize(&self->publisherPublicKeyDigest);
71 ndn_ForwardingFlags_initialize(&self->forwardingFlags);
72 self->freshnessPeriod = -1.0;
78 static __inline
int ndn_ForwardingEntry_getFreshnessSeconds
81 return self->freshnessPeriod < 0 ? -1 : (int)round(self->freshnessPeriod / 1000.0);
87 static __inline
void ndn_ForwardingEntry_setFreshnessSeconds
90 self->freshnessPeriod = freshnessSeconds < 0 ? -1.0 : (double)freshnessSeconds * 1000.0;
struct ndn_Blob publisherPublicKeyDigest
A Blob whose value is a pointer to pre-allocated buffer.
Definition: publisher-public-key-digest-types.h:35
int faceId
-1 for none.
Definition: forwarding-entry.h:52
An ndn_ForwardingEntry holds fields for a ForwardingEntry which is used to register a prefix with a h...
Definition: forwarding-entry.h:48
ndn_Milliseconds freshnessPeriod
-1 for none.
Definition: forwarding-entry.h:54
Copyright (C) 2013-2015 Regents of the University of California.
Definition: forwarding-flags.h:38
struct ndn_Blob action
A Blob whose value is a pointer to a pre-allocated buffer.
Definition: forwarding-entry.h:49
Copyright (C) 2015 Regents of the University of California.
Definition: publisher-public-key-digest-types.h:34
Copyright (C) 2015 Regents of the University of California.
Definition: name-types.h:33
An ndn_Name holds an array of ndn_NameComponent.
Definition: name-types.h:40
Copyright (C) 2015 Regents of the University of California.
Definition: blob-types.h:33