blob: 025613220894e4a8e8b35f2cec91e0dfdeb980d3 [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{
Ilya Moiseenko08a98a42011-08-02 16:06:51 -070037 class InterestPacket : public Packet
38 {
Ilya Moiseenko5881eb12011-08-04 19:05:26 -070039 public:
40 InterestPacket(unsigned char *name, uint32_t size);
41
42 uint32_t GetName(unsigned char *name);
Ilya Moiseenko08a98a42011-08-02 16:06:51 -070043
Ilya Moiseenko5881eb12011-08-04 19:05:26 -070044 void AddTimeout(uint32_t milliseconds);
45 uint32_t GetTimeout(void);
46 void RemoveTimeout(void);
47
48 void AddNonce(uint32_t nonce);
49 uint32_t GetNonce(void);
50 void RemoveNonce(void);
51
52 uint32_t maxNameLength;
Ilya Moiseenko08a98a42011-08-02 16:06:51 -070053 };
54}
Ilya Moiseenko5881eb12011-08-04 19:05:26 -070055}
Ilya Moiseenko08a98a42011-08-02 16:06:51 -070056
Alexander Afanasyev6b997c52011-08-08 12:55:25 -070057#endif