blob: 51f2a9ab3368fd8e2e1b429274b60b28a2d4772a [file] [log] [blame]
Alexander Afanasyev6b997c52011-08-08 12:55:25 -07001/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2011 University of California, Los Angeles
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Ilya Moiseenko <iliamo@cs.ucla.edu>
19 */
Ilya Moiseenko08a98a42011-08-02 16:06:51 -070020
21#ifndef ndn_interestpacket_h
22#define ndn_interestpacket_h
23
24//#define CCN_INTEREST_LIFETIME_SEC 4
25//#define CCN_INTEREST_LIFETIME_MICROSEC (CCN_INTEREST_LIFETIME_SEC * 1000000)
26
27#include "ns3/header.h"
28#include <ns3/packet.h>
Ilya Moiseenko5881eb12011-08-04 19:05:26 -070029#include <string>
30#include "ndn_timeoutheader.h"
31#include "ndn_nonceheader.h"
Ilya Moiseenko08a98a42011-08-02 16:06:51 -070032
33namespace ns3
34{
Ilya Moiseenko5881eb12011-08-04 19:05:26 -070035namespace NDNabstraction
36{
Alexander Afanasyevf583ef22011-08-08 19:05:28 -070037
38 class InterestPacket : public Packet
39 {
40 public:
41 InterestPacket(const unsigned char *name, uint32_t size);
Ilya Moiseenko5881eb12011-08-04 19:05:26 -070042
Alexander Afanasyevf583ef22011-08-08 19:05:28 -070043 uint32_t GetName(unsigned char *name);
Ilya Moiseenko08a98a42011-08-02 16:06:51 -070044
Alexander Afanasyevf583ef22011-08-08 19:05:28 -070045 void AddTimeout(uint32_t milliseconds);
46 uint32_t GetTimeout(void);
47 void RemoveTimeout(void);
Ilya Moiseenko5881eb12011-08-04 19:05:26 -070048
Alexander Afanasyevf583ef22011-08-08 19:05:28 -070049 void AddNonce(uint32_t nonce);
50 uint32_t GetNonce(void);
51 void RemoveNonce(void);
Ilya Moiseenko5881eb12011-08-04 19:05:26 -070052
Alexander Afanasyevf583ef22011-08-08 19:05:28 -070053 uint32_t maxNameLength;
54 };
55
Ilya Moiseenko08a98a42011-08-02 16:06:51 -070056}
Ilya Moiseenko5881eb12011-08-04 19:05:26 -070057}
Ilya Moiseenko08a98a42011-08-02 16:06:51 -070058
Alexander Afanasyev6b997c52011-08-08 12:55:25 -070059#endif