"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/h460/h460_std22.cxx" between
h323plus-1_27_0.tar.gz and h323plus-1_27_1.tar.gz

About: H.323 Plus offers libraries for voice (VoIP) and videoconferencing using H.323.

h460_std22.cxx  (h323plus-1_27_0):h460_std22.cxx  (h323plus-1_27_1)
skipping to change at line 66 skipping to change at line 66
#define Std22_TLS 1 #define Std22_TLS 1
#define Std22_IPSec 2 #define Std22_IPSec 2
#define Std22_Priority 1 #define Std22_Priority 1
#define Std22_Address 2 #define Std22_Address 2
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// Construction/Destruction // Construction/Destruction
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
H460_FeatureStd22::H460_FeatureStd22() H460_FeatureStd22::H460_FeatureStd22()
: H460_FeatureStd(22), EP(NULL), CON(NULL), isEnabled(false) : H460_FeatureStd(22), m_ep(NULL), m_con(NULL), m_isEnabled(false)
{ {
PTRACE(6,"Std22\tInstance Created"); PTRACE(6, "Std22\tInstance Created");
FeatureCategory = FeatureSupported; FeatureCategory = FeatureSupported;
} }
H460_FeatureStd22::~H460_FeatureStd22() H460_FeatureStd22::~H460_FeatureStd22()
{ {
} }
void H460_FeatureStd22::AttachEndPoint(H323EndPoint * _ep) void H460_FeatureStd22::AttachEndPoint(H323EndPoint * _ep)
{ {
PTRACE(6,"Std22\tEndpoint Attached"); PTRACE(6, "Std22\tEndpoint Attached");
EP = _ep; m_ep = _ep;
} }
void H460_FeatureStd22::AttachConnection(H323Connection * _con) void H460_FeatureStd22::AttachConnection(H323Connection * _con)
{ {
CON = _con; m_con = _con;
} }
int H460_FeatureStd22::GetPurpose() int H460_FeatureStd22::GetPurpose()
{ {
return FeatureBaseClone; return FeatureBaseClone;
} }
PObject * H460_FeatureStd22::Clone() const PObject * H460_FeatureStd22::Clone() const
{ {
return new H460_FeatureStd22(*this); return new H460_FeatureStd22(*this);
skipping to change at line 113 skipping to change at line 113
case H460_MessageType::e_registrationRequest: case H460_MessageType::e_registrationRequest:
case H460_MessageType::e_registrationConfirm: case H460_MessageType::e_registrationConfirm:
case H460_MessageType::e_admissionRequest: case H460_MessageType::e_admissionRequest:
case H460_MessageType::e_admissionConfirm: case H460_MessageType::e_admissionConfirm:
return true; return true;
default: default:
return false; return false;
} }
} }
void BuildFeature(H323TransportSecurity * transec, H323EndPoint * ep, H460_Featu reStd & feat, PBoolean address = true) void BuildFeature(H323TransportSecurity * transec, H323EndPoint * ep, H460_Featu reStd & feat, PBoolean include_params = true)
{ {
if (transec->IsTLSEnabled()) { if (transec->IsTLSEnabled()) {
const H323Listener * tls = ep->GetListeners().GetTLSListener(); const H323Listener * tls = ep->GetListeners().GetTLSListener();
if (tls) { if (tls && include_params) {
H460_FeatureStd sets; H460_FeatureStd sets;
sets.Add(Std22_Priority,H460_FeatureContent(1,8)); // Priority 1 sets.Add(Std22_Priority, H460_FeatureContent(1, 8)); // Priority 1
if (address) sets.Add(Std22_Address, H460_FeatureContent(tls->GetTransportAddress
sets.Add(Std22_Address,H460_FeatureContent(tls->GetTransportAddr ()));
ess())); feat.Add(Std22_TLS, H460_FeatureContent(sets.GetCurrentTable()));
feat.Add(Std22_TLS,H460_FeatureContent(sets.GetCurrentTable()));
} }
} }
// NOT YET Supported...Disabled in H323TransportSecurity. // NOT YET Supported...Disabled in H323TransportSecurity.
if (transec->IsIPSecEnabled()) { if (transec->IsIPSecEnabled()) {
H460_FeatureStd sets; H460_FeatureStd sets;
sets.Add(Std22_Priority,H460_FeatureContent(2,8)); // Priority 2 if (include_params) {
feat.Add(Std22_IPSec,H460_FeatureContent(sets.GetCurrentTable())); sets.Add(Std22_Priority, H460_FeatureContent(2, 8)); // Priority 2
feat.Add(Std22_IPSec, H460_FeatureContent(sets.GetCurrentTable()));
}
} }
} }
void ReadFeature(H323TransportSecurity * transec, H460_FeatureStd * feat) void ReadFeature(H323TransportSecurity * transec, H460_FeatureStd * feat)
{ {
if (feat->Contains(Std22_TLS)) { if (feat->Contains(Std22_TLS)) {
H460_FeatureParameter tlsparam = feat->Value(Std22_TLS); H460_FeatureParameter tlsparam = feat->Value(Std22_TLS);
transec->EnableTLS(true); transec->EnableTLS(true);
H460_FeatureStd settings; H460_FeatureStd settings;
settings.SetCurrentTable(tlsparam); settings.SetCurrentTable(tlsparam);
skipping to change at line 153 skipping to change at line 153
transec->SetRemoteTLSAddress(settings.Value(Std22_Address)); transec->SetRemoteTLSAddress(settings.Value(Std22_Address));
} }
// NOT YET Supported...Disabled in H323TransportSecurity. // NOT YET Supported...Disabled in H323TransportSecurity.
if (feat->Contains(Std22_IPSec)) if (feat->Contains(Std22_IPSec))
transec->EnableIPSec(true); transec->EnableIPSec(true);
} }
PBoolean H460_FeatureStd22::OnSendGatekeeperRequest(H225_FeatureDescriptor & pdu ) PBoolean H460_FeatureStd22::OnSendGatekeeperRequest(H225_FeatureDescriptor & pdu )
{ {
if (!EP || !EP->GetTransportSecurity()->HasSecurity()) if (!m_ep || !m_ep->GetTransportSecurity()->HasSecurity())
return false; return false;
#ifdef H323_H46017 #ifdef H323_H46017
// H.460.22 is incompatible with H.460.17 // H.460.22 is incompatible with H.460.17
if (EP->TryingWithH46017() || EP->RegisteredWithH46017()) if (m_ep->TryingWithH46017() || m_ep->RegisteredWithH46017())
return false; return false;
#endif #endif
isEnabled = false; m_isEnabled = false;
H460_FeatureStd feat = H460_FeatureStd(22); H460_FeatureStd feat = H460_FeatureStd(22);
BuildFeature(EP->GetTransportSecurity(), EP, feat, false); BuildFeature(m_ep->GetTransportSecurity(), m_ep, feat, false);
pdu = feat; pdu = feat;
return true; return true;
} }
void H460_FeatureStd22::OnReceiveGatekeeperConfirm(const H225_FeatureDescriptor & pdu) void H460_FeatureStd22::OnReceiveGatekeeperConfirm(const H225_FeatureDescriptor & pdu)
{ {
// Do nothing // Do nothing
} }
PBoolean H460_FeatureStd22::OnSendRegistrationRequest(H225_FeatureDescriptor & p du) PBoolean H460_FeatureStd22::OnSendRegistrationRequest(H225_FeatureDescriptor & p du)
{ {
if (!EP || !EP->GetTransportSecurity()->HasSecurity()) if (!m_ep || !m_ep->GetTransportSecurity()->HasSecurity())
return false; return false;
#ifdef H323_H46017 #ifdef H323_H46017
// H.460.22 is incompatible with H.460.17 // H.460.22 is incompatible with H.460.17
if (EP->TryingWithH46017() || EP->RegisteredWithH46017()) if (m_ep->TryingWithH46017() || m_ep->RegisteredWithH46017())
return false; return false;
#endif #endif
isEnabled = false; m_isEnabled = false;
H460_FeatureStd feat = H460_FeatureStd(22); H460_FeatureStd feat = H460_FeatureStd(22);
BuildFeature(EP->GetTransportSecurity(), EP, feat); // TODO: omit parameters on lightweight RRQ
BuildFeature(m_ep->GetTransportSecurity(), m_ep, feat);
pdu = feat; pdu = feat;
return true; return true;
} }
void H460_FeatureStd22::OnReceiveRegistrationConfirm(const H225_FeatureDescripto r & pdu) void H460_FeatureStd22::OnReceiveRegistrationConfirm(const H225_FeatureDescripto r & pdu)
{ {
isEnabled = true; m_isEnabled = true;
} }
PBoolean H460_FeatureStd22::OnSendAdmissionRequest(H225_FeatureDescriptor & pdu) PBoolean H460_FeatureStd22::OnSendAdmissionRequest(H225_FeatureDescriptor & pdu)
{ {
if (!isEnabled) if (!m_isEnabled)
return false; return false;
H460_FeatureStd feat = H460_FeatureStd(22); H460_FeatureStd feat = H460_FeatureStd(22);
BuildFeature(EP->GetTransportSecurity(), EP, feat, false); BuildFeature(m_ep->GetTransportSecurity(), m_ep, feat, false);
pdu = feat; pdu = feat;
return true; return true;
} }
void H460_FeatureStd22::OnReceiveAdmissionConfirm(const H225_FeatureDescriptor & pdu) void H460_FeatureStd22::OnReceiveAdmissionConfirm(const H225_FeatureDescriptor & pdu)
{ {
H460_FeatureStd * feat = PRemoveConst(H460_FeatureStd,&(const H460_FeatureStd &)pdu); H460_FeatureStd * feat = PRemoveConst(H460_FeatureStd,&(const H460_FeatureStd &)pdu);
H323TransportSecurity m_callSecurity(EP); H323TransportSecurity m_callSecurity(m_ep);
ReadFeature(&m_callSecurity,feat); ReadFeature(&m_callSecurity, feat);
if (CON) if (m_con)
CON->SetTransportSecurity(m_callSecurity); m_con->SetTransportSecurity(m_callSecurity);
} }
void H460_FeatureStd22::OnReceiveServiceControlIndication(const H225_FeatureDesc riptor & pdu) void H460_FeatureStd22::OnReceiveServiceControlIndication(const H225_FeatureDesc riptor & pdu)
{ {
H460_FeatureStd * feat = PRemoveConst(H460_FeatureStd,&(const H460_FeatureStd &)pdu); H460_FeatureStd * feat = PRemoveConst(H460_FeatureStd,&(const H460_FeatureStd &)pdu);
H323TransportSecurity m_callSecurity(EP); H323TransportSecurity m_callSecurity(m_ep);
ReadFeature(&m_callSecurity,feat); ReadFeature(&m_callSecurity, feat);
#ifdef H323_H46018 #ifdef H323_H46018
if (EP && EP->GetGatekeeper()->GetFeatures().HasFeature(18)) { if (m_ep && m_ep->GetGatekeeper()->GetFeatures().HasFeature(18)) {
H460_Feature * feat = EP->GetGatekeeper()->GetFeatures().GetFeature(18); H460_Feature * feat = m_ep->GetGatekeeper()->GetFeatures().GetFeature(18
);
if (feat) if (feat)
((H460_FeatureStd18 *)feat)->SetTransportSecurity(m_callSecurity); ((H460_FeatureStd18 *)feat)->SetTransportSecurity(m_callSecurity);
} }
#endif #endif
}; };
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(default : 4239) #pragma warning(default : 4239)
#endif #endif
 End of changes. 24 change blocks. 
34 lines changed or deleted 36 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)