(file) Return to CIMServerDiscovery.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Client

  1 karl  1.4 //%2004////////////////////////////////////////////////////////////////////////
  2 tony  1.1 //
  3 karl  1.4 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
  4           // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
  5           // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
  6 karl  1.2 // IBM Corp.; EMC Corporation, The Open Group.
  7 karl  1.4 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
  8           // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
  9 tony  1.1 //
 10           // Permission is hereby granted, free of charge, to any person obtaining a copy
 11           // of this software and associated documentation files (the "Software"), to
 12           // deal in the Software without restriction, including without limitation the
 13           // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 14           // sell copies of the Software, and to permit persons to whom the Software is
 15           // furnished to do so, subject to the following conditions:
 16           // 
 17           // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 18           // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 19           // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 20           // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 21           // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 22           // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 23           // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 24           // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 25           //
 26           //==============================================================================
 27           //
 28           // Author: Tony Fiorentino (fiorentino_tony@emc.com)
 29           //
 30 tony  1.1 // Modified By:
 31           //
 32           //%/////////////////////////////////////////////////////////////////////////////
 33           
 34           #include "CIMServerDiscovery.h"
 35           
 36 karl  1.3 #include <string.h> // for strdup
 37           
 38           PEGASUS_NAMESPACE_BEGIN
 39           /////////////////////////////////////////////////////////////////////////////
 40           // SLPClientOptions
 41           // Filthy hack. User is responsible for adjusting values, 
 42           // and for new/delete of any struct used
 43           /////////////////////////////////////////////////////////////////////////////
 44           SLPClientOptions::SLPClientOptions(){
 45           	//initialise everything
 46           	target_address  = NULL;
 47           	local_interface  = NULL;
 48           	target_port = 427;
 49           	spi = NULL;
 50           	scopes = strdup("DEFAULT");
 51           	service_type = strdup("service:wbem");
 52           	predicate = NULL;
 53           	use_directory_agent = false;
 54           }
 55           SLPClientOptions::~SLPClientOptions(){
 56           	// free all pointers
 57 karl  1.3 	free(target_address);
 58           	free(local_interface);
 59           	free(spi);
 60           	free(scopes);
 61           	free(service_type);
 62           	free(predicate);
 63           }
 64           void SLPClientOptions::print() const{
 65           	printf("target_address %s\n",target_address!=NULL?target_address:"NULL");
 66           	printf("local_interface %s\n",local_interface!=NULL?local_interface:"NULL");
 67           	printf("target_port %d\n",target_port);
 68           	printf("spi %s\n",spi!=NULL?spi:"NULL");
 69           	printf("scopes %s\n",scopes!=NULL?scopes:"NULL");
 70           	printf("service_type %s\n",service_type!=NULL?service_type:"NULL");
 71           	printf("predicate %s\n",predicate!=NULL?predicate:"NULL");
 72           	printf("use_directory_agent %d\n",use_directory_agent==0?"false":"true");
 73           }
 74           
 75           
 76           PEGASUS_NAMESPACE_END
 77           
 78 tony  1.1 #ifdef PEGASUS_SLP_CLIENT_INTERFACE_WRAPPER
 79           # include "PegasusSLPWrapper.cpp"
 80           #elif OPENSLP_SLP_CLIENT_INTERFACE_WRAPPER
 81           # include "OpenSLPWrapper.cpp"
 82           #else
 83           // No interface wrapper selected
 84           PEGASUS_NAMESPACE_BEGIN
 85 karl  1.3 /////////////////////////////////////////////////////////////////////////////
 86           // CIMServerDiscoveryRep
 87           /////////////////////////////////////////////////////////////////////////////
 88 tony  1.1 CIMServerDiscoveryRep::CIMServerDiscoveryRep()
 89           {
 90           }
 91           
 92           CIMServerDiscoveryRep::~CIMServerDiscoveryRep()
 93           {
 94           }
 95           
 96           Array<CIMServerDescription>
 97 karl  1.3 CIMServerDiscoveryRep::lookup(const Array<Attribute> & criteria, const SLPClientOptions* options)
 98 tony  1.1 {
 99             Array<CIMServerDescription> connections;
100             return connections;
101           }
102           
103           PEGASUS_NAMESPACE_END
104           #endif
105           
106           PEGASUS_NAMESPACE_BEGIN
107           
108           /////////////////////////////////////////////////////////////////////////////
109           // CIMServerDiscovery
110           /////////////////////////////////////////////////////////////////////////////
111           CIMServerDiscovery::CIMServerDiscovery()
112           :_rep(new CIMServerDiscoveryRep())
113           {
114           }
115           
116           CIMServerDiscovery::~CIMServerDiscovery()
117           {
118             if (_rep != NULL)
119 tony  1.1     delete _rep;
120             _rep = NULL;
121           }
122           
123           Array<CIMServerDescription>
124 karl  1.3 CIMServerDiscovery::lookup(const SLPClientOptions* options)
125 tony  1.1 {
126             Array<Attribute> criteria;
127 karl  1.3   return _rep->lookup(criteria,options);
128 tony  1.1 }
129           
130           Array<CIMServerDescription>
131 karl  1.3 CIMServerDiscovery::lookup(const Array<Attribute> & criteria, const SLPClientOptions* options)
132 tony  1.1 {
133 karl  1.3   return _rep->lookup(criteria,options);
134 tony  1.1 }
135           
136           PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2