Skip to content

Commit fa45f3b

Browse files
committed
Move template specializations into I_NetVConnection.h
1 parent 5432a17 commit fa45f3b

File tree

8 files changed

+56
-55
lines changed

8 files changed

+56
-55
lines changed

iocore/net/ALPNSupport.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,11 @@
2222
*/
2323

2424
#include "P_ALPNSupport.h"
25-
#include "I_NetVConnection.h"
2625
#include "P_SSLNextProtocolSet.h"
2726
#include "records/I_RecHttp.h"
2827

2928
int ALPNSupport::_ex_data_index = -1;
3029

31-
template <>
32-
ALPNSupport *
33-
NetVConnection::get_service() const
34-
{
35-
return static_cast<ALPNSupport *>(this->_get_service(NetVConnection::Service::TLS_ALPN));
36-
}
37-
3830
void
3931
ALPNSupport::initialize()
4032
{

iocore/net/I_NetVConnection.h

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,3 +574,59 @@ NetVConnection::_set_service(enum NetVConnection::Service service, void *instanc
574574
{
575575
this->_services[static_cast<unsigned int>(service)] = instance;
576576
}
577+
578+
class ALPNSupport;
579+
template <>
580+
inline ALPNSupport *
581+
NetVConnection::get_service() const
582+
{
583+
return static_cast<ALPNSupport *>(this->_get_service(NetVConnection::Service::TLS_ALPN));
584+
}
585+
586+
class TLSBasicSupport;
587+
template <>
588+
inline TLSBasicSupport *
589+
NetVConnection::get_service() const
590+
{
591+
return static_cast<TLSBasicSupport *>(this->_get_service(NetVConnection::Service::TLS_Basic));
592+
}
593+
594+
class TLSEarlyDataSupport;
595+
template <>
596+
inline TLSEarlyDataSupport *
597+
NetVConnection::get_service() const
598+
{
599+
return static_cast<TLSEarlyDataSupport *>(this->_get_service(NetVConnection::Service::TLS_EarlyData));
600+
}
601+
602+
class TLSCertSwitchSupport;
603+
template <>
604+
inline TLSCertSwitchSupport *
605+
NetVConnection::get_service() const
606+
{
607+
return static_cast<TLSCertSwitchSupport *>(this->_get_service(NetVConnection::Service::TLS_CertSwitch));
608+
}
609+
610+
class TLSSNISupport;
611+
template <>
612+
inline TLSSNISupport *
613+
NetVConnection::get_service() const
614+
{
615+
return static_cast<TLSSNISupport *>(this->_get_service(NetVConnection::Service::TLS_SNI));
616+
}
617+
618+
class TLSSessionResumptionSupport;
619+
template <>
620+
inline TLSSessionResumptionSupport *
621+
NetVConnection::get_service() const
622+
{
623+
return static_cast<TLSSessionResumptionSupport *>(this->_get_service(NetVConnection::Service::TLS_SessionResumption));
624+
}
625+
626+
class TLSTunnelSupport;
627+
template <>
628+
inline TLSTunnelSupport *
629+
NetVConnection::get_service() const
630+
{
631+
return static_cast<TLSTunnelSupport *>(this->_get_service(NetVConnection::Service::TLS_Tunnel));
632+
}

iocore/net/TLSBasicSupport.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,10 @@
2323
*/
2424

2525
#include "TLSBasicSupport.h"
26-
#include "I_NetVConnection.h"
2726
#include "SSLStats.h"
2827

2928
int TLSBasicSupport::_ex_data_index = -1;
3029

31-
template <>
32-
TLSBasicSupport *
33-
NetVConnection::get_service() const
34-
{
35-
return static_cast<TLSBasicSupport *>(this->_get_service(NetVConnection::Service::TLS_Basic));
36-
}
37-
3830
void
3931
TLSBasicSupport::initialize()
4032
{

iocore/net/TLSCertSwitchSupport.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,10 @@
2020
*/
2121

2222
#include "TLSCertSwitchSupport.h"
23-
#include "I_NetVConnection.h"
2423
#include "P_SSLCertLookup.h"
2524

2625
int TLSCertSwitchSupport::_ex_data_index = -1;
2726

28-
template <>
29-
TLSCertSwitchSupport *
30-
NetVConnection::get_service() const
31-
{
32-
return static_cast<TLSCertSwitchSupport *>(this->_get_service(NetVConnection::Service::TLS_CertSwitch));
33-
}
34-
3527
void
3628
TLSCertSwitchSupport::initialize()
3729
{

iocore/net/TLSEarlyDataSupport.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,10 @@
2424

2525
#include <openssl/ssl.h>
2626
#include "TLSEarlyDataSupport.h"
27-
#include "I_NetVConnection.h"
2827
#include "tscore/ink_assert.h"
2928

3029
int TLSEarlyDataSupport::_ex_data_index = -1;
3130

32-
template <>
33-
TLSEarlyDataSupport *
34-
NetVConnection::get_service() const
35-
{
36-
return static_cast<TLSEarlyDataSupport *>(this->_get_service(NetVConnection::Service::TLS_EarlyData));
37-
}
38-
3931
void
4032
TLSEarlyDataSupport::initialize()
4133
{

iocore/net/TLSSNISupport.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,12 @@
2323
#include "P_SSLNextProtocolAccept.h"
2424
#include "SSLSNIConfig.h"
2525
#include "TLSSNISupport.h"
26-
#include "I_NetVConnection.h"
2726
#include "tscore/ink_assert.h"
2827
#include "tscore/ink_inet.h"
2928
#include "tscore/Diags.h"
3029

3130
int TLSSNISupport::_ex_data_index = -1;
3231

33-
template <>
34-
TLSSNISupport *
35-
NetVConnection::get_service() const
36-
{
37-
return static_cast<TLSSNISupport *>(this->_get_service(NetVConnection::Service::TLS_SNI));
38-
}
39-
4032
void
4133
TLSSNISupport::initialize()
4234
{

iocore/net/TLSSessionResumptionSupport.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,6 @@ char mac_param_digest[] = "sha256";
4949

5050
int TLSSessionResumptionSupport::_ex_data_index = -1;
5151

52-
template <>
53-
TLSSessionResumptionSupport *
54-
NetVConnection::get_service() const
55-
{
56-
return static_cast<TLSSessionResumptionSupport *>(this->_get_service(NetVConnection::Service::TLS_SessionResumption));
57-
}
58-
5952
static bool
6053
is_ssl_session_timed_out(SSL_SESSION *session)
6154
{

iocore/net/TLSTunnelSupport.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,13 @@
2323
*/
2424

2525
#include "TLSTunnelSupport.h"
26-
#include "I_NetVConnection.h"
2726
#include "tscore/ink_assert.h"
2827
#include "tscore/Diags.h"
2928

3029
#include "swoc/IPEndpoint.h"
3130

3231
int TLSTunnelSupport::_ex_data_index = -1;
3332

34-
template <>
35-
TLSTunnelSupport *
36-
NetVConnection::get_service() const
37-
{
38-
return static_cast<TLSTunnelSupport *>(this->_get_service(NetVConnection::Service::TLS_Tunnel));
39-
}
40-
4133
void
4234
TLSTunnelSupport::initialize()
4335
{

0 commit comments

Comments
 (0)