A Discrete-Event Network Simulator
API
lollipop-comparisions.cc
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2020 Universita' di Firenze, Italy
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: Tommaso Pecorella <tommaso.pecorella@unifi.it>
19 */
20
21#include "ns3/lollipop-counter.h"
22
23using namespace ns3;
24
25int
26main (int argc, char *argv[])
27{
28 LollipopCounter8 counterA;
29 LollipopCounter8 counterB;
30
31// counterA.SetSequenceWindowSize (5);
32// counterB.SetSequenceWindowSize (5);
33
34 for (uint8_t i = 0; i < std::numeric_limits<uint8_t>::max (); i++)
35 {
36 std::cout << +i << " -- ";
37 for (uint8_t j = 0; j < std::numeric_limits<uint8_t>::max (); j++)
38 {
39 counterA = i;
40 counterB = j;
41 if (counterA < counterB)
42 {
43 std::cout << "<";
44 }
45 else if (counterA == counterB)
46 {
47 std::cout << "=";
48 }
49 else if (counterA > counterB)
50 {
51 std::cout << ">";
52 }
53 else
54 {
55 std::cout << ".";
56 }
57 }
58 std::cout << std::endl;
59 }
60}
#define max(a, b)
Definition: 80211b.c:43
Template class implementing a Lollipop counter as defined in RFC 8505, RFC 6550, and [Perlman83].
Every class exported by the ns3 library is enclosed in the ns3 namespace.