Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends
Arc::TCPSecAttr Class Reference
Inheritance diagram for Arc::TCPSecAttr:
Inheritance graph
[legend]
Collaboration diagram for Arc::TCPSecAttr:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TCPSecAttr (const std::string &remote_ip, const std::string &remote_port, const std::string &local_ip, const std::string &local_port)
virtual ~TCPSecAttr (void)
virtual operator bool (void)
virtual bool Export (SecAttrFormat format, XMLNode &val) const
 Convert internal structure into specified format.
bool operator== (const SecAttr &b) const
 This function should (in inheriting classes) return true if this and b are considered to represent same content.
bool operator!= (const SecAttr &b) const
 This is a convenience function to allow the usage of "not equal" conditions and need not be overridden.
virtual operator bool () const
 This function should return false if the value is to be considered null, e.g.
virtual bool Export (SecAttrFormat format, std::string &val) const
 Convert internal structure into specified format.
virtual bool Import (SecAttrFormat format, const std::string &val)
 Fills internal structure from external object of specified format.
virtual bool Import (SecAttrFormat format, XMLNode val)

Static Public Attributes

static SecAttrFormat UNDEFINED
static SecAttrFormat ARCAuth
 own serialization/deserialization format
static SecAttrFormat XACML
 representation for ARC authorization policy
static SecAttrFormat SAML
 represenation for XACML policy
static SecAttrFormat GACL
 suitable for inclusion into SAML structures

Protected Member Functions

virtual bool equal (const SecAttr &b) const

Protected Attributes

std::string local_ip_
std::string local_port_
std::string remote_ip_
std::string remote_port_

Friends

class MCC_TCP_Service

Detailed Description

Definition at line 338 of file MCCTCP.cpp.


Constructor & Destructor Documentation

Arc::TCPSecAttr::TCPSecAttr ( const std::string &  remote_ip,
const std::string &  remote_port,
const std::string &  local_ip,
const std::string &  local_port 
)

Definition at line 353 of file MCCTCP.cpp.

                                                                                                                                       :
 remote_ip_(remote_ip), remote_port_(remote_port), local_ip_(local_ip), local_port_(local_port) {
}
Arc::TCPSecAttr::~TCPSecAttr ( void  ) [virtual]

Definition at line 357 of file MCCTCP.cpp.

                            {
}

Member Function Documentation

bool Arc::TCPSecAttr::equal ( const SecAttr b) const [protected, virtual]

Reimplemented from Arc::SecAttr.

Definition at line 364 of file MCCTCP.cpp.

                                             {
  try {
    const TCPSecAttr& a = (const TCPSecAttr&)b;
    if((!local_ip_.empty()) && (!a.local_ip_.empty()) && (local_ip_ != a.local_ip_)) return false;
    if((!local_port_.empty()) && (!a.local_port_.empty()) && (local_port_ != a.local_port_)) return false;
    if((!remote_ip_.empty()) && (!a.remote_ip_.empty()) && (remote_ip_ != a.remote_ip_)) return false;
    if((!remote_port_.empty()) && (!a.remote_port_.empty()) && (remote_port_ != a.remote_port_)) return false;
    return true;
  } catch(std::exception&) { };
  return false;
}
bool Arc::SecAttr::Export ( SecAttrFormat  format,
std::string &  val 
) const [virtual, inherited]

Convert internal structure into specified format.

Returns false if format is not supported/suitable for this attribute.

Definition at line 20 of file SecAttr.cpp.

                                                              {
  NS ns;
  XMLNode x(ns, "");
  if(!Export(format,x)) return false;
  x.GetXML(val);
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool Arc::TCPSecAttr::Export ( SecAttrFormat  format,
XMLNode val 
) const [virtual]

Convert internal structure into specified format.

Returns false if format is not supported/suitable for this attribute. XML node referenced by is turned into top level element of specified format.

Reimplemented from Arc::SecAttr.

Definition at line 388 of file MCCTCP.cpp.

                                                               {
  if(format == UNDEFINED) {
  } else if(format == ARCAuth) {
    NS ns;
    ns["ra"]="http://www.nordugrid.org/schemas/request-arc";
    val.Namespaces(ns); val.Name("ra:Request");
    XMLNode item = val.NewChild("ra:RequestItem");
    if(!local_port_.empty()) {
      fill_arc_string_attribute(item.NewChild("ra:Resource"),local_ip_+":"+local_port_,"http://www.nordugrid.org/schemas/policy-arc/types/tcp/localendpoint");
    } else if(!local_ip_.empty()) {
      fill_arc_string_attribute(item.NewChild("ra:Resource"),local_ip_,"http://www.nordugrid.org/schemas/policy-arc/types/tcp/localendpoint");
    };
    if(!remote_port_.empty()) {
      fill_arc_string_attribute(item.NewChild("ra:Subject").NewChild("ra:SubjectAttribute"),remote_ip_+":"+remote_port_,"http://www.nordugrid.org/schemas/policy-arc/types/tcp/remoteendpoint");
    } else if(!remote_ip_.empty()) {
      fill_arc_string_attribute(item.NewChild("ra:Subject").NewChild("ra:SubjectAttribute"),remote_ip_,"http://www.nordugrid.org/schemas/policy-arc/types/tcp/remoteiendpoint");
    };
    return true;
  } else if(format == XACML) {
    NS ns;
    ns["ra"]="urn:oasis:names:tc:xacml:2.0:context:schema:os";
    val.Namespaces(ns); val.Name("ra:Request");
    if(!local_port_.empty()) {
      fill_xacml_string_attribute(val.NewChild("ra:Resource").NewChild("ra:Attribute"),local_ip_+":"+local_port_,"http://www.nordugrid.org/schemas/policy-arc/types/tcp/localendpoint");
    } else if(!local_ip_.empty()) {
      fill_xacml_string_attribute(val.NewChild("ra:Resource").NewChild("ra:Attribute"),local_ip_,"http://www.nordugrid.org/schemas/policy-arc/types/tcp/localendpoint");
    };
    if(!remote_port_.empty()) {
      fill_xacml_string_attribute(val.NewChild("ra:Subject").NewChild("ra:Attribute"),remote_ip_+":"+remote_port_,"http://www.nordugrid.org/schemas/policy-arc/types/tcp/remoteendpoint");
    } else if(!remote_ip_.empty()) {
      fill_xacml_string_attribute(val.NewChild("ra:Subject").NewChild("ra:Attribute"),remote_ip_,"http://www.nordugrid.org/schemas/policy-arc/types/tcp/remoteiendpoint");
    };
    return true;
  } else {
  };
  return false;
}

Here is the call graph for this function:

bool Arc::SecAttr::Import ( SecAttrFormat  format,
const std::string &  val 
) [virtual, inherited]

Fills internal structure from external object of specified format.

Returns false if failed to do. The usage pattern for this method is not defined and it is provided only to make class symmetric. Hence it's implementation is not required yet.

Definition at line 32 of file SecAttr.cpp.

                                                              {
  XMLNode x(val);
  if(!x) return false;
  return Import(format,x);
}
bool Arc::SecAttr::Import ( SecAttrFormat  format,
XMLNode  val 
) [virtual, inherited]

Reimplemented in Arc::MultiSecAttr.

Definition at line 38 of file SecAttr.cpp.

                                           {
  return false;
}
Arc::SecAttr::operator bool ( void  ) const [virtual, inherited]

This function should return false if the value is to be considered null, e.g.

if it hasn't been set or initialized. In other cases it should return true.

Reimplemented in Arc::MultiSecAttr, TestSecAttr, Arc::TLSSecAttr, Arc::SOAPSecAttr, Arc::HTTPSecAttr, ArcSec::SAMLAssertionSecAttr, SPService::SAMLAssertionSecAttr, ISIS::ISISSecAttr, and ArcSec::DelegationSecAttr.

Definition at line 16 of file SecAttr.cpp.

                             {
  return false;
}
Arc::TCPSecAttr::operator bool ( void  ) [virtual]

Definition at line 360 of file MCCTCP.cpp.

                              {
  return true;
}
bool Arc::SecAttr::operator!= ( const SecAttr b) const [inline, inherited]

This is a convenience function to allow the usage of "not equal" conditions and need not be overridden.

Definition at line 54 of file SecAttr.h.

{ return !equal(b); };

Here is the call graph for this function:

bool Arc::SecAttr::operator== ( const SecAttr b) const [inline, inherited]

This function should (in inheriting classes) return true if this and b are considered to represent same content.

Identifying and restricting the type of b should be done using dynamic_cast operations. Currently it is not defined how comparison methods to be used. Hence their implementation is not required.

Definition at line 51 of file SecAttr.h.

{ return equal(b); };

Here is the call graph for this function:


Friends And Related Function Documentation

friend class MCC_TCP_Service [friend]

Definition at line 339 of file MCCTCP.cpp.


Member Data Documentation

SecAttrFormat Arc::SecAttr::ARCAuth [static, inherited]

own serialization/deserialization format

Definition at line 40 of file SecAttr.h.

SecAttrFormat Arc::SecAttr::GACL [static, inherited]

suitable for inclusion into SAML structures

Definition at line 43 of file SecAttr.h.

std::string Arc::TCPSecAttr::local_ip_ [protected]

Definition at line 346 of file MCCTCP.cpp.

std::string Arc::TCPSecAttr::local_port_ [protected]

Definition at line 347 of file MCCTCP.cpp.

std::string Arc::TCPSecAttr::remote_ip_ [protected]

Definition at line 348 of file MCCTCP.cpp.

std::string Arc::TCPSecAttr::remote_port_ [protected]

Definition at line 349 of file MCCTCP.cpp.

SecAttrFormat Arc::SecAttr::SAML [static, inherited]

represenation for XACML policy

Definition at line 42 of file SecAttr.h.

Definition at line 39 of file SecAttr.h.

SecAttrFormat Arc::SecAttr::XACML [static, inherited]

representation for ARC authorization policy

Definition at line 41 of file SecAttr.h.


The documentation for this class was generated from the following file: