| Kea 3.0.2-git

abstract_scen.h
Go to the documentation of this file.
1// Copyright (C) 2019,2021 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef ABSTRACT_SCEN_H
8#define ABSTRACT_SCEN_H
9
10
11#include <perfdhcp/test_control.h>
12
13
14 namespace isc {
15 namespace perfdhcp {
16
17
21 class AbstractScen : public boost::noncopyable {
22 public:
27 AbstractScen(CommandOptions& options, BasePerfSocket &socket) :
28 options_(options),
29 tc_(options, socket)
30 {
31 if (options_.getIpVersion() == 4) {
32 stage1_xchg_ = ExchangeType::DO;
33 stage2_xchg_ = ExchangeType::RA;
34 } else {
35 stage1_xchg_ = ExchangeType::SA;
36 stage2_xchg_ = ExchangeType::RR;
37 }
38 };
39
45 virtual int run() = 0;
46
48 virtual ~AbstractScen() {};
49
50 protected:
51 CommandOptions& options_;
52 TestControl tc_;
53
54 // Helper fields to avoid checking IP version each time an exchange type
55 // is needed.
56 ExchangeType stage1_xchg_;
57 ExchangeType stage2_xchg_;
58};
59
60
61}
62}
63
64#endif // ABSTRACT_SCEN_H
isc::perfdhcp::AbstractScen::tc_
TestControl tc_
Object for controlling sending and receiving packets.
Definition abstract_scen.h:52
isc::perfdhcp::AbstractScen::stage2_xchg_
ExchangeType stage2_xchg_
Definition abstract_scen.h:57
isc::perfdhcp::AbstractScen::run
virtual int run()=0
Run performance test.
isc::perfdhcp::AbstractScen::options_
CommandOptions & options_
Reference to commandline options.
Definition abstract_scen.h:51
isc::perfdhcp::AbstractScen::AbstractScen
AbstractScen(CommandOptions &options, BasePerfSocket &socket)
Default and the only constructor of AbstractScen.
Definition abstract_scen.h:27
isc::perfdhcp::AbstractScen::~AbstractScen
virtual ~AbstractScen()
Trivial virtual destructor.
Definition abstract_scen.h:48
isc::perfdhcp::AbstractScen::stage1_xchg_
ExchangeType stage1_xchg_
Definition abstract_scen.h:56
isc::perfdhcp::BasePerfSocket
Socket wrapper structure.
Definition perf_socket.h:26
isc::perfdhcp::CommandOptions
Command Options.
Definition command_options.h:30
isc::perfdhcp::TestControl
Test Control class.
Definition test_control.h:117
isc::perfdhcp::ExchangeType
ExchangeType
DHCP packet exchange types.
Definition bin/perfdhcp/stats_mgr.h:32
isc
Defines the logger used by the top-level component of kea-lfc.
Definition agent_parser.cc:148
perfdhcp
test_control.h