Ilya Moiseenko | 08a98a4 | 2011-08-02 16:06:51 -0700 | [diff] [blame] | 1 | // |
| 2 | // ndn_interestpacket.h |
| 3 | // Abstraction |
| 4 | // |
| 5 | // Copyright 2011 UCLA. All rights reserved. |
| 6 | // |
| 7 | |
| 8 | #ifndef ndn_interestpacket_h |
| 9 | #define ndn_interestpacket_h |
| 10 | |
| 11 | //#define CCN_INTEREST_LIFETIME_SEC 4 |
| 12 | //#define CCN_INTEREST_LIFETIME_MICROSEC (CCN_INTEREST_LIFETIME_SEC * 1000000) |
| 13 | |
| 14 | #include "ns3/header.h" |
| 15 | #include <ns3/packet.h> |
Ilya Moiseenko | 5881eb1 | 2011-08-04 19:05:26 -0700 | [diff] [blame] | 16 | #include <string> |
| 17 | #include "ndn_timeoutheader.h" |
| 18 | #include "ndn_nonceheader.h" |
Ilya Moiseenko | 08a98a4 | 2011-08-02 16:06:51 -0700 | [diff] [blame] | 19 | |
| 20 | namespace ns3 |
| 21 | { |
Ilya Moiseenko | 5881eb1 | 2011-08-04 19:05:26 -0700 | [diff] [blame] | 22 | namespace NDNabstraction |
| 23 | { |
Ilya Moiseenko | 08a98a4 | 2011-08-02 16:06:51 -0700 | [diff] [blame] | 24 | class InterestPacket : public Packet |
| 25 | { |
Ilya Moiseenko | 5881eb1 | 2011-08-04 19:05:26 -0700 | [diff] [blame] | 26 | public: |
| 27 | InterestPacket(unsigned char *name, uint32_t size); |
| 28 | |
| 29 | uint32_t GetName(unsigned char *name); |
Ilya Moiseenko | 08a98a4 | 2011-08-02 16:06:51 -0700 | [diff] [blame] | 30 | |
Ilya Moiseenko | 5881eb1 | 2011-08-04 19:05:26 -0700 | [diff] [blame] | 31 | void AddTimeout(uint32_t milliseconds); |
| 32 | uint32_t GetTimeout(void); |
| 33 | void RemoveTimeout(void); |
| 34 | |
| 35 | void AddNonce(uint32_t nonce); |
| 36 | uint32_t GetNonce(void); |
| 37 | void RemoveNonce(void); |
| 38 | |
| 39 | uint32_t maxNameLength; |
Ilya Moiseenko | 08a98a4 | 2011-08-02 16:06:51 -0700 | [diff] [blame] | 40 | }; |
| 41 | } |
Ilya Moiseenko | 5881eb1 | 2011-08-04 19:05:26 -0700 | [diff] [blame] | 42 | } |
Ilya Moiseenko | 08a98a4 | 2011-08-02 16:06:51 -0700 | [diff] [blame] | 43 | |
| 44 | #endif |