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

  1 martin 1.10 //%LICENSE////////////////////////////////////////////////////////////////
  2 martin 1.11 //
  3 martin 1.10 // Licensed to The Open Group (TOG) under one or more contributor license
  4             // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
  5             // this work for additional information regarding copyright ownership.
  6             // Each contributor licenses this file to you under the OpenPegasus Open
  7             // Source License; you may not use this file except in compliance with the
  8             // License.
  9 martin 1.11 //
 10 martin 1.10 // Permission is hereby granted, free of charge, to any person obtaining a
 11             // copy of this software and associated documentation files (the "Software"),
 12             // to deal in the Software without restriction, including without limitation
 13             // the rights to use, copy, modify, merge, publish, distribute, sublicense,
 14             // and/or sell copies of the Software, and to permit persons to whom the
 15             // Software is furnished to do so, subject to the following conditions:
 16 martin 1.11 //
 17 martin 1.10 // The above copyright notice and this permission notice shall be included
 18             // in all copies or substantial portions of the Software.
 19 martin 1.11 //
 20 martin 1.10 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 21 martin 1.11 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 22 martin 1.10 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 23             // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 24             // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 25             // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 26             // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 27 martin 1.11 //
 28 martin 1.10 //////////////////////////////////////////////////////////////////////////
 29 tony   1.1  //
 30             //%/////////////////////////////////////////////////////////////////////////////
 31             
 32             #include "CIMServerDiscovery.h"
 33             
 34 karl   1.3  #include <string.h> // for strdup
 35             
 36             PEGASUS_NAMESPACE_BEGIN
 37             /////////////////////////////////////////////////////////////////////////////
 38             // SLPClientOptions
 39 kumpf  1.9  // Filthy hack. User is responsible for adjusting values,
 40 karl   1.3  // and for new/delete of any struct used
 41             /////////////////////////////////////////////////////////////////////////////
 42 kumpf  1.9  
 43             SLPClientOptions::SLPClientOptions()
 44             {
 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             
 56             SLPClientOptions::~SLPClientOptions()
 57             {
 58                 // free all pointers
 59                 free(target_address);
 60                 free(local_interface);
 61                 free(spi);
 62                 free(scopes);
 63 kumpf  1.9      free(service_type);
 64                 free(predicate);
 65             }
 66             
 67             void SLPClientOptions::print() const
 68             {
 69                 printf("target_address %s\n",target_address!=NULL?target_address:"NULL");
 70                 printf("local_interface %s\n",local_interface!=NULL?local_interface:"NULL");
 71                 printf("target_port %d\n",target_port);
 72                 printf("spi %s\n",spi!=NULL?spi:"NULL");
 73                 printf("scopes %s\n",scopes!=NULL?scopes:"NULL");
 74                 printf("service_type %s\n",service_type!=NULL?service_type:"NULL");
 75                 printf("predicate %s\n",predicate!=NULL?predicate:"NULL");
 76                 printf("use_directory_agent %s\n",use_directory_agent==0?"false":"true");
 77 karl   1.3  }
 78             
 79             PEGASUS_NAMESPACE_END
 80             
 81 tony   1.1  #ifdef PEGASUS_SLP_CLIENT_INTERFACE_WRAPPER
 82             # include "PegasusSLPWrapper.cpp"
 83             #elif OPENSLP_SLP_CLIENT_INTERFACE_WRAPPER
 84             # include "OpenSLPWrapper.cpp"
 85             #else
 86 kumpf  1.9  
 87 tony   1.1  // No interface wrapper selected
 88 kumpf  1.9  
 89 tony   1.1  PEGASUS_NAMESPACE_BEGIN
 90 kumpf  1.9  
 91 karl   1.3  /////////////////////////////////////////////////////////////////////////////
 92             // CIMServerDiscoveryRep
 93             /////////////////////////////////////////////////////////////////////////////
 94 kumpf  1.9  
 95 tony   1.1  CIMServerDiscoveryRep::CIMServerDiscoveryRep()
 96             {
 97             }
 98             
 99             CIMServerDiscoveryRep::~CIMServerDiscoveryRep()
100             {
101             }
102             
103 kumpf  1.9  Array<CIMServerDescription> CIMServerDiscoveryRep::lookup(
104                 const Array<Attribute>& criteria,
105                 const SLPClientOptions* options)
106 tony   1.1  {
107 kumpf  1.9      Array<CIMServerDescription> connections;
108                 return connections;
109 tony   1.1  }
110             
111             PEGASUS_NAMESPACE_END
112             #endif
113             
114             PEGASUS_NAMESPACE_BEGIN
115             
116             /////////////////////////////////////////////////////////////////////////////
117             // CIMServerDiscovery
118             /////////////////////////////////////////////////////////////////////////////
119             CIMServerDiscovery::CIMServerDiscovery()
120 kumpf  1.9      :_rep(new CIMServerDiscoveryRep())
121 tony   1.1  {
122             }
123             
124             CIMServerDiscovery::~CIMServerDiscovery()
125             {
126                 delete _rep;
127             }
128             
129 kumpf  1.9  Array<CIMServerDescription> CIMServerDiscovery::lookup(
130                 const SLPClientOptions* options)
131 tony   1.1  {
132 kumpf  1.9      Array<Attribute> criteria;
133                 return _rep->lookup(criteria,options);
134 tony   1.1  }
135             
136 kumpf  1.9  Array<CIMServerDescription> CIMServerDiscovery::lookup(
137                 const Array<Attribute>& criteria,
138                 const SLPClientOptions* options)
139 tony   1.1  {
140 kumpf  1.9      return _rep->lookup(criteria,options);
141 tony   1.1  }
142             
143             PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2