network-nack.hpp
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
23 #ifndef NDN_NETWORK_NACK_HPP
24 #define NDN_NETWORK_NACK_HPP
25 
26 #include <ndn-cpp/common.hpp>
27 #include <ndn-cpp/lite/network-nack-lite.hpp>
28 #include <ndn-cpp/lp-packet-header-field.hpp>
29 
30 namespace ndn {
31 
32 class LpPacket;
33 
35 public:
40  : reason_(ndn_NetworkNackReason_NONE),
41  otherReasonCode_(-1)
42  {
43  }
44 
48  virtual ~NetworkNack();
49 
55  ndn_NetworkNackReason
56  getReason() const { return reason_; }
57 
64  int
65  getOtherReasonCode() const { return otherReasonCode_; }
66 
73  static ptr_lib::shared_ptr<NetworkNack>
74  getFirstHeader(LpPacket& lpPacket);
75 
81  void
82  set(const NetworkNackLite& networkNackLite);
83 
84 private:
85  ndn_NetworkNackReason reason_;
86  int otherReasonCode_;
87 };
88 
89 }
90 
91 #endif
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:35
int getOtherReasonCode() const
Get the reason code from the packet which is other than a recognized Reason enum value.
Definition: network-nack.hpp:65
NetworkNack()
Create an NetworkNack where all the values are unspecified.
Definition: network-nack.hpp:39
ndn_NetworkNackReason getReason() const
Get the network Nack reason.
Definition: network-nack.hpp:56
NetworkNackLite represents a network Nack packet and includes a Nack reason.
Definition: network-nack-lite.hpp:35
An LpPacket represents an NDNLPv2 packet including header fields an an optional fragment.
Definition: lp-packet.hpp:39
Definition: network-nack.hpp:34
This is a base class for LP packet header fields like NetworkNack.
Definition: lp-packet-header-field.hpp:31
virtual ~NetworkNack()
Override the virtual destructor.
Definition: network-nack.cpp:27
void set(const NetworkNackLite &networkNackLite)
Clear this NetworkNack, and set the values by copying from networkNackLite.
Definition: network-nack.cpp:43
static ptr_lib::shared_ptr< NetworkNack > getFirstHeader(LpPacket &lpPacket)
Get the first header field in lpPacket which is a NetworkNack.
Definition: network-nack.cpp:30