Aktualizr
C++ SOTA Client
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
Enumerations
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
Functions
a
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
Variables
Enumerations
Files
File List
File Members
All
Functions
Enumerations
•
All
Classes
Namespaces
Files
Functions
Variables
Enumerations
Enumerator
Pages
src
aktualizr_secondary
secondary_tcp_server.h
1
#ifndef AKTUALIZR_SECONDARY_TCP_SERVER_H_
2
#define AKTUALIZR_SECONDARY_TCP_SERVER_H_
3
4
#include "utilities/utils.h"
5
6
#include <atomic>
7
8
namespace
Uptane
{
9
class
SecondaryInterface
;
10
}
// namespace Uptane
11
/**
12
* Listens on a socket, decodes calls (ASN.1) and forwards them to an Uptane Secondary
13
* implementation
14
*/
15
class
SecondaryTcpServer
{
16
public
:
17
SecondaryTcpServer
(
Uptane::SecondaryInterface
& secondary,
const
std::string& primary_ip, in_port_t primary_port,
18
in_port_t port = 0);
19
20
SecondaryTcpServer
(
Uptane::SecondaryInterface
& secondary, in_port_t port = 0)
21
: keep_running_(
true
), impl_(secondary), listen_socket_(port) {}
22
23
SecondaryTcpServer
(
const
SecondaryTcpServer
&) =
delete
;
24
SecondaryTcpServer
& operator=(
const
SecondaryTcpServer
&) =
delete
;
25
26
public
:
27
/**
28
* Accept connections on the socket, decode requests and respond using the secondary implementation
29
*/
30
void
run
();
31
void
stop();
32
33
in_port_t port()
const
;
34
35
private
:
36
void
HandleOneConnection(
int
socket);
37
38
private
:
39
std::atomic<bool> keep_running_;
40
Uptane::SecondaryInterface
& impl_;
41
ListenSocket
listen_socket_;
42
};
43
44
#endif // AKTUALIZR_SECONDARY_TCP_SERVER_H_
SecondaryTcpServer
Listens on a socket, decodes calls (ASN.1) and forwards them to an Uptane Secondary implementation.
Definition:
secondary_tcp_server.h:15
SecondaryTcpServer::run
void run()
Accept connections on the socket, decode requests and respond using the secondary implementation.
Definition:
secondary_tcp_server.cc:23
Uptane
Base data types that are used in The Update Framework (TUF), part of UPTANE.
Definition:
secondary_tcp_server.h:8
Uptane::SecondaryInterface
Definition:
secondaryinterface.h:12
ListenSocket
Definition:
utils.h:157
Generated by
1.8.16