2023-12-14 21:54:22 +01:00
|
|
|
#ifndef DTLS_SERVER_H
|
|
|
|
#define DTLS_SERVER_H
|
2023-12-17 15:39:29 +01:00
|
|
|
|
2023-12-14 21:54:22 +01:00
|
|
|
/* dtls_server.h */
|
2023-12-17 15:39:29 +01:00
|
|
|
|
2023-12-14 21:54:22 +01:00
|
|
|
|
|
|
|
#include "core/io/net_socket.h"
|
|
|
|
#include "core/io/packet_peer_dtls.h"
|
|
|
|
|
|
|
|
class DTLSServer : public Reference {
|
|
|
|
GDCLASS(DTLSServer, Reference);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
static DTLSServer *(*_create)();
|
|
|
|
static void _bind_methods();
|
|
|
|
|
|
|
|
static bool available;
|
|
|
|
|
|
|
|
public:
|
|
|
|
static bool is_available();
|
|
|
|
static DTLSServer *create();
|
|
|
|
|
|
|
|
virtual Error setup(Ref<CryptoKey> p_key, Ref<X509Certificate> p_cert, Ref<X509Certificate> p_ca_chain = Ref<X509Certificate>()) = 0;
|
|
|
|
virtual void stop() = 0;
|
|
|
|
virtual Ref<PacketPeerDTLS> take_connection(Ref<PacketPeerUDP> p_peer) = 0;
|
|
|
|
|
|
|
|
DTLSServer();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DTLS_SERVER_H
|