Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*!
* \file params.hh
* \brief Header file for the parameter dictionary.
* \author ETSI STF525
* \copyright ETSI Copyright Notification
* No part may be reproduced except as authorized by written permission.
* The copyright and the foregoing restriction extend to reproduction in all media.
* All rights reserved.
* \version 0.1
*/
#pragma once
#include <vector>
#include <map>
/*!
* \class params
* \brief This class provides basic functionalities for an ITS dictionary
* \implements std::map
*/
class params : public std::map<std::string, std::string> {
public: //! \publicsection
// TODO Use static constexpr (see commsignia_layer.hh)
static const std::string& debug; //! Set to 1 to enable the debug mode
static const std::string& loopback;
static const std::string& mac_src; //! Source MAC address parameter name
static const std::string& mac_dst; //! Destination MAC address parameter name
static const std::string& mac_bc; //! Broadcast MAC address parameter name
static const std::string& eth_type; //! Ethernet type parameter name
static const std::string& nic; //! Network Interface Card parameter name
static const std::string& latitude; //! Test system Latitude parameter name
static const std::string& longitude; //! Test system Longitude parameter name
static const std::string& device_mode; //! To indicate to the lower layer to act as a standalone device
static const std::string& server; //! HTTP server address (e.g. www.etsi.org)
static const std::string& port; //! HTTP server port. Default: 80
static const std::string& use_ssl; //! Set to 1 to use SSL to communicate with the HTTP server. Default: false
static const std::string& server_mode; //! Does the test sytem acting as a server. Default: 0
static const std::string& local_port; //! Local listener port. Default: 80
static const std::string& method; //! HTTP method type. Default: POST
static const std::string& uri; //! HTTP URI value. Default: /
static const std::string& host; //! HTTP Host value. Default: 127.0.0.1
static const std::string& content_type; //! HTTP Content-type value. Default: application/text
static const std::string& sip_url;
static const std::string& sip_version;
static const std::string& payload; //! UpperLayer Payload parameter name
static const std::string& codecs; //! List of codecs to use for HTTP application layers
/*!
* \brief Default constructor
* Create a new instance of the params class
*/
params() : std::map<std::string, std::string>() {};
/*!
* \brief Copy constructor
* Clone an existing instance of a params object
* \param[in] p_params An existing instance of a params object
*/
explicit params(const params& p_params) : std::map<std::string, std::string>(p_params.begin(), p_params.end()) { };
/*!
* \brief Default destructor
*/
virtual ~params() { };
/*!
* \fn void log() const;
* \brief Provides a dump of the content of this instance
*/
void log() const;
/*!
* \fn void log() const;
* \brief Provides a dump of the content of this instance
*/
void log();
/*!
* \fn void reset();
* \brief Reset the content of this instance
*/
void reset();
/*!
* \static
* \fn void convert(params& p_param, const std::string p_parameters);
* \brief Create a new instance of a params object by converting a list of ITS parameters in string format (t1=v1,T2=(v0,v1v2)...)
* \return a new instance of a params object
*/
static void convert(params& p_param, const std::string p_parameters);
}; // End of class params