satellite-arp-cache.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013 Magister Solutions Ltd.
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: Jani Puttonen <jani.puttonen@magister.fi>
19  */
20 
21 #include "satellite-arp-cache.h"
22 
23 #include <ns3/assert.h>
24 #include <ns3/log.h>
25 
26 #include <stdint.h>
27 
28 NS_LOG_COMPONENT_DEFINE("SatArpCache");
29 
30 namespace ns3
31 {
32 
33 NS_OBJECT_ENSURE_REGISTERED(SatArpCache);
34 
35 TypeId
37 {
38  static TypeId tid = TypeId("ns3::SatArpCache").SetParent<ArpCache>();
39  return tid;
40 }
41 
43  : ArpCache()
44 {
45  NS_LOG_FUNCTION(this);
46 }
47 
49 {
50  NS_LOG_FUNCTION(this);
51 }
52 
53 ArpCache::Entry*
54 SatArpCache::Add(Ipv4Address to, Address macAddress)
55 {
56  NS_LOG_FUNCTION(this << to << macAddress);
57 
58  // Add a new entry
59  ArpCache::Entry* entry = ArpCache::Add(to);
60  entry->SetMacAddress(macAddress);
61  entry->MarkPermanent();
62 
63  NS_LOG_INFO("IP: " << to << ", MAC: " << macAddress);
64 
65  return entry;
66 }
67 
68 } // namespace ns3
SatArpCache()
Default constructor.
static TypeId GetTypeId(void)
Get the type ID.
~SatArpCache()
Destructor for SatArpCache.
ArpCache::Entry * Add(Ipv4Address to, Address macAddress)
Add an Ipv4Address - MAC address entry to this ARP cache.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.