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

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2