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 NS_LOG_COMPONENT_DEFINE("SatArpCache");
27 
28 namespace ns3
29 {
30 
31 NS_OBJECT_ENSURE_REGISTERED(SatArpCache);
32 
33 TypeId
35 {
36  static TypeId tid = TypeId("ns3::SatArpCache").SetParent<ArpCache>();
37  return tid;
38 }
39 
41  : ArpCache()
42 {
43  NS_LOG_FUNCTION(this);
44 }
45 
47 {
48  NS_LOG_FUNCTION(this);
49 }
50 
51 ArpCache::Entry*
52 SatArpCache::Add(Ipv4Address to, Address macAddress)
53 {
54  NS_LOG_FUNCTION(this << to << macAddress);
55 
56  // Add a new entry
57  ArpCache::Entry* entry = ArpCache::Add(to);
58  entry->SetMacAddress(macAddress);
59  entry->MarkPermanent();
60 
61  NS_LOG_INFO("IP: " << to << ", MAC: " << macAddress);
62 
63  return entry;
64 }
65 
66 } // 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.