A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lollipop-comparisons.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Universita' di Firenze, Italy
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
18 */
19
20#include "ns3/lollipop-counter.h"
21
22using namespace ns3;
23
24int
25main(int argc, char* argv[])
26{
27 LollipopCounter8 counterA;
28 LollipopCounter8 counterB;
29
30 // counterA.SetSequenceWindowSize (5);
31 // counterB.SetSequenceWindowSize (5);
32
33 for (uint8_t i = 0; i < std::numeric_limits<uint8_t>::max(); i++)
34 {
35 std::cout << +i << " -- ";
36 for (uint8_t j = 0; j < std::numeric_limits<uint8_t>::max(); j++)
37 {
38 counterA = i;
39 counterB = j;
40 if (counterA < counterB)
41 {
42 std::cout << "<";
43 }
44 else if (counterA == counterB)
45 {
46 std::cout << "=";
47 }
48 else if (counterA > counterB)
49 {
50 std::cout << ">";
51 }
52 else
53 {
54 std::cout << ".";
55 }
56 }
57 std::cout << std::endl;
58 }
59
60 return 0;
61}
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.