Loading...
Searching...
No Matches
satellite-isl-arbiter.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 * Copyright (c) 2018 CNES
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation;
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * Inspired and adapted from Hypatia: https://github.com/snkas/hypatia
20 *
21 * Author: Bastien Tauran <bastien.tauran@viveris.fr>
22 */
23
25
26#include "satellite-id-mapper.h"
27#include "satellite-topology.h"
28
29#include "ns3/singleton.h"
30
31NS_LOG_COMPONENT_DEFINE("SatIslArbiter");
32
33namespace ns3
34{
35
36NS_OBJECT_ENSURE_REGISTERED(SatIslArbiter);
37
38TypeId
40{
41 static TypeId tid = TypeId("ns3::SatIslArbiter").SetParent<Object>();
42 return tid;
43}
44
46{
47 NS_LOG_FUNCTION(this);
48
49 NS_FATAL_ERROR("Default constructor not in use");
50}
51
53{
54 NS_LOG_FUNCTION(this << node);
55
56 m_nodeId = node->GetId();
57}
58
59int32_t
60SatIslArbiter::BaseDecide(Ptr<Packet> pkt, Mac48Address destination)
61{
62 NS_LOG_FUNCTION(this << pkt << destination);
63
64 int32_t targetId = Singleton<SatIdMapper>::Get()->GetSatIdWithMacIsl(destination);
65
66 if (targetId == -1)
67 {
68 NS_FATAL_ERROR("Cannot resolve target node ID");
69 }
70
71 return Decide(m_nodeId, targetId, pkt);
72}
73
74} // namespace ns3
virtual int32_t Decide(int32_t sourceSatId, int32_t targetSatId, Ptr< Packet > pkt)=0
Decide how to forward.
static TypeId GetTypeId(void)
int32_t BaseDecide(Ptr< Packet > pkt, Mac48Address destination)
Base decide how to forward.
SatIslArbiter()
Default constructor.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.