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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
7 */
8
9#include "ns3/lollipop-counter.h"
10
11using namespace ns3;
12
13int
14main(int argc, char* argv[])
15{
16 LollipopCounter8 counterA;
17 LollipopCounter8 counterB;
18
19 // counterA.SetSequenceWindowSize (5);
20 // counterB.SetSequenceWindowSize (5);
21
22 for (uint8_t i = 0; i < std::numeric_limits<uint8_t>::max(); i++)
23 {
24 std::cout << +i << " -- ";
25 for (uint8_t j = 0; j < std::numeric_limits<uint8_t>::max(); j++)
26 {
27 counterA = i;
28 counterB = j;
29 if (counterA < counterB)
30 {
31 std::cout << "<";
32 }
33 else if (counterA == counterB)
34 {
35 std::cout << "=";
36 }
37 else if (counterA > counterB)
38 {
39 std::cout << ">";
40 }
41 else
42 {
43 std::cout << ".";
44 }
45 }
46 std::cout << std::endl;
47 }
48
49 return 0;
50}
Template class implementing a Lollipop counter as defined in RFC 8505 , RFC 6550 ,...
Every class exported by the ns3 library is enclosed in the ns3 namespace.