reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
TurnAsyncSocketHandler.hxx
Go to the documentation of this file.
1#ifndef TURNASYNCSOCKETHANDLER_HXX
2#define TURNASYNCSOCKETHANDLER_HXX
3
4#include <rutil/compat.hxx>
5#include <asio.hpp>
6#ifdef USE_SSL
7#include <asio/ssl.hpp>
8#endif
10#include "reTurn/DataBuffer.hxx"
11#include "reTurn/StunTuple.hxx"
12
13#include <memory>
14
15namespace reTurn {
16
18{
19public:
22
23 virtual void onConnectSuccess(unsigned int socketDesc, const asio::ip::address& address, unsigned short port) = 0;
24 virtual void onConnectFailure(unsigned int socketDesc, const asio::error_code& e) = 0;
25
26 virtual void onSharedSecretSuccess(unsigned int socketDesc, const char* username, unsigned int usernameSize, const char* password, unsigned int passwordSize) = 0;
27 virtual void onSharedSecretFailure(unsigned int socketDesc, const asio::error_code& e) = 0;
28
29 virtual void onBindSuccess(unsigned int socketDesc, const StunTuple& reflexiveTuple, const StunTuple& stunServerTuple) = 0;
30 virtual void onBindFailure(unsigned int socketDesc, const asio::error_code& e, const StunTuple& stunServerTuple) = 0;
31
32 virtual void onAllocationSuccess(unsigned int socketDesc, const StunTuple& reflexiveTuple, const StunTuple& relayTuple, unsigned int lifetimeSecs, unsigned int bandwidth, uint64_t reservationToken) = 0;
33 virtual void onAllocationFailure(unsigned int socketDesc, const asio::error_code& e) = 0;
34
35 virtual void onRefreshSuccess(unsigned int socketDesc, unsigned int lifetimeSecs) = 0;
36 virtual void onRefreshFailure(unsigned int socketDesc, const asio::error_code& e) = 0;
37
38 virtual void onSetActiveDestinationSuccess(unsigned int socketDesc) = 0;
39 virtual void onSetActiveDestinationFailure(unsigned int socketDesc, const asio::error_code &e) = 0;
40 virtual void onClearActiveDestinationSuccess(unsigned int socketDesc) = 0;
41 virtual void onClearActiveDestinationFailure(unsigned int socketDesc, const asio::error_code &e) = 0;
42
43 virtual void onChannelBindRequestSent(unsigned int socketDesc, unsigned short channelNumber) = 0;
44 virtual void onChannelBindSuccess(unsigned int socketDesc, unsigned short channelNumber) = 0;
45 virtual void onChannelBindFailure(unsigned int socketDesc, const asio::error_code& e) = 0;
46
47 //virtual void onReceiveSuccess(unsigned int socketDesc, const asio::ip::address& address, unsigned short port, const char* buffer, unsigned int size) = 0;
48 virtual void onReceiveSuccess(unsigned int socketDesc, const asio::ip::address& address, unsigned short port, const std::shared_ptr<DataBuffer>& data) = 0;
49 virtual void onReceiveFailure(unsigned int socketDesc, const asio::error_code& e) = 0;
50
51 virtual void onSendSuccess(unsigned int socketDesc) = 0;
52 virtual void onSendFailure(unsigned int socketDesc, const asio::error_code& e) = 0;
53
54 virtual void onIncomingBindRequestProcessed(unsigned int socketDesc, const StunTuple& sourceTuple) = 0;
55
56private:
57};
58
59}
60
61#endif
62
63
64/* ====================================================================
65
66 Copyright (c) 2024 SIP Spectrum, Inc http://www.sipspectrum.com
67 Copyright (c) 2007-2008, Plantronics, Inc.
68 All rights reserved.
69
70 Redistribution and use in source and binary forms, with or without
71 modification, are permitted provided that the following conditions are
72 met:
73
74 1. Redistributions of source code must retain the above copyright
75 notice, this list of conditions and the following disclaimer.
76
77 2. Redistributions in binary form must reproduce the above copyright
78 notice, this list of conditions and the following disclaimer in the
79 documentation and/or other materials provided with the distribution.
80
81 3. Neither the name of Plantronics nor the names of its contributors
82 may be used to endorse or promote products derived from this
83 software without specific prior written permission.
84
85 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
86 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
87 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
88 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
89 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
90 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
91 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
92 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
93 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
94 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
95 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
96
97 ==================================================================== */
virtual void onRefreshSuccess(unsigned int socketDesc, unsigned int lifetimeSecs)=0
virtual void onReceiveFailure(unsigned int socketDesc, const asio::error_code &e)=0
virtual void onBindSuccess(unsigned int socketDesc, const StunTuple &reflexiveTuple, const StunTuple &stunServerTuple)=0
virtual void onSharedSecretFailure(unsigned int socketDesc, const asio::error_code &e)=0
virtual void onClearActiveDestinationFailure(unsigned int socketDesc, const asio::error_code &e)=0
virtual void onBindFailure(unsigned int socketDesc, const asio::error_code &e, const StunTuple &stunServerTuple)=0
virtual void onAllocationSuccess(unsigned int socketDesc, const StunTuple &reflexiveTuple, const StunTuple &relayTuple, unsigned int lifetimeSecs, unsigned int bandwidth, uint64_t reservationToken)=0
virtual void onSendSuccess(unsigned int socketDesc)=0
virtual void onIncomingBindRequestProcessed(unsigned int socketDesc, const StunTuple &sourceTuple)=0
virtual void onSetActiveDestinationFailure(unsigned int socketDesc, const asio::error_code &e)=0
virtual void onChannelBindRequestSent(unsigned int socketDesc, unsigned short channelNumber)=0
virtual void onChannelBindSuccess(unsigned int socketDesc, unsigned short channelNumber)=0
virtual void onSendFailure(unsigned int socketDesc, const asio::error_code &e)=0
virtual void onSharedSecretSuccess(unsigned int socketDesc, const char *username, unsigned int usernameSize, const char *password, unsigned int passwordSize)=0
virtual void onChannelBindFailure(unsigned int socketDesc, const asio::error_code &e)=0
virtual void onConnectFailure(unsigned int socketDesc, const asio::error_code &e)=0
virtual void onRefreshFailure(unsigned int socketDesc, const asio::error_code &e)=0
virtual void onSetActiveDestinationSuccess(unsigned int socketDesc)=0
virtual void onAllocationFailure(unsigned int socketDesc, const asio::error_code &e)=0
virtual void onConnectSuccess(unsigned int socketDesc, const asio::ip::address &address, unsigned short port)=0
virtual void onClearActiveDestinationSuccess(unsigned int socketDesc)=0
virtual void onReceiveSuccess(unsigned int socketDesc, const asio::ip::address &address, unsigned short port, const std::shared_ptr< DataBuffer > &data)=0
This file is used to handle compatibility fixes/tweaks so reSIProcate can function on multiple platfo...
unsigned __int64 uint64_t
Definition stdint.h:95
void list()
Definition userAdmin.cxx:66