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

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2