]> WPIA git - cassiopeia.git/blob - src/io/recordHandler.h
Merge remote-tracking branch 'origin/libs/detectcoll/local'
[cassiopeia.git] / src / io / recordHandler.h
1 #pragma once
2
3 #include <memory>
4 #include <string>
5
6 #include <openssl/ssl.h>
7 #include <openssl/bio.h>
8
9 #include "crypto/signer.h"
10 #include "io/record.h"
11
12 class RecordHandler {
13 public:
14     virtual void handle( std::string data ) = 0;
15     virtual void reset() = 0;
16 };
17
18 class RecordHandlerSession;
19
20 class DefaultRecordHandler {
21 private:
22     std::shared_ptr<BIO> bio;
23     std::shared_ptr<SSL_CTX> ctx;
24     std::shared_ptr<Signer> signer;
25     std::shared_ptr<RecordHandlerSession> currentSession;
26 public:
27     DefaultRecordHandler( std::shared_ptr<Signer> signer, std::shared_ptr<BIO> bio );
28     void handle();
29     void reset();
30 };