ndn-embeds 0.1.0
Lightweight NDN protocol stack for embedded systems
Loading...
Searching...
No Matches
ndn.hpp
Go to the documentation of this file.
1
33#pragma once
34
35#include "ndn/certificate.hpp"
36#include "ndn/common.hpp"
37#include "ndn/crypto.hpp"
38#include "ndn/cs.hpp"
39#include "ndn/data.hpp"
40#include "ndn/face.hpp"
41#include "ndn/fib.hpp"
42#include "ndn/forwarder.hpp"
43#include "ndn/interest.hpp"
44#include "ndn/link.hpp"
45#include "ndn/name.hpp"
46#include "ndn/pit.hpp"
47#include "ndn/signature.hpp"
48#include "ndn/tlv.hpp"
49
50namespace ndn {
51
60Forwarder& getForwarder();
61
69void setForwarder(Forwarder& fw);
70
80
98inline Error expressInterest(const Interest& interest, DataCallback onData,
99 TimeoutCallback onTimeout = nullptr) {
100 return getForwarder().expressInterest(interest, onData, onTimeout);
101}
102
112inline Error registerPrefix(std::string_view prefix, InterestCallback callback) {
113 return getForwarder().registerPrefix(prefix, callback);
114}
115
124inline Error putData(const Data& data) {
125 return getForwarder().putData(data);
126}
127
135inline void processEvents() {
137}
140} // namespace ndn
NDN Certificate.
NDN Data packet.
Definition data.hpp:49
Error registerPrefix(const Name &prefix, InterestCallback callback)
Register a prefix.
Error expressInterest(const Interest &interest, DataCallback onData, TimeoutCallback onTimeout=nullptr)
Send an Interest and wait for Data.
Definition forwarder.cpp:81
Error putData(const Data &data)
Send Data.
void processEvents()
Process events.
NDN Interest packet.
Definition interest.hpp:50
Common definitions for the NDN protocol stack.
Error
Error codes.
Definition common.hpp:24
NDN cryptographic utilities.
Content Store (CS)
NDN Data packet.
NDN Face interface.
Forwarding Information Base (FIB)
NDN Forwarder.
std::function< void(const Interest &, FaceId)> InterestCallback
Interest receive callback.
Definition forwarder.hpp:32
std::function< void(const Interest &)> TimeoutCallback
Timeout callback.
Definition forwarder.hpp:50
std::function< void(const Data &)> DataCallback
Data receive callback.
Definition forwarder.hpp:41
NDN Interest packet.
NDN Name class.
void setForwarder(Forwarder &fw)
Register the application's Forwarder for convenience APIs.
Definition api.cpp:11
Error expressInterest(const Interest &interest, DataCallback onData, TimeoutCallback onTimeout=nullptr)
Send an Interest and wait for Data.
Definition ndn.hpp:98
void processEvents()
Process events.
Definition ndn.hpp:135
Error registerPrefix(std::string_view prefix, InterestCallback callback)
Register a prefix.
Definition ndn.hpp:112
Error putData(const Data &data)
Send Data.
Definition ndn.hpp:124
Forwarder & getForwarder()
Get the global Forwarder instance.
Definition api.cpp:15
Error initialize()
Initialize the NDN protocol stack.
Definition api.cpp:19
Pending Interest Table (PIT)
NDN signature types and constants.
NDN TLV (Type-Length-Value) encoding.