dacaplib.hpp 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ############################################################################## */
  13. #ifndef DACAPLIB_HPP
  14. #define DACAPLIB_HPP
  15. #include "jstring.hpp"
  16. #include "dasess.hpp"
  17. #ifdef DACAP_LINKED_IN
  18. // only use following routine linked in
  19. // (i.e. not from the DLL which is seisint only)
  20. extern unsigned importDaliCapabilityXML_basic(const char *filename);
  21. // this is the basic (single dali server node verification) import
  22. // Note this routine *does not* transfer data to Dali directly as dali can't start until it is imported!!
  23. // This is inherently weak (there is no mechanism to ensure previous dali server node is removed)
  24. // We should adopt full client node authentication scheme if we want to ensure not broken
  25. #define dacaplib_decl
  26. #endif
  27. #ifndef dacaplib_decl
  28. #define dacaplib_decl DECL_IMPORT
  29. #endif
  30. interface IDaliCapabilityCreator: extends IInterface
  31. {
  32. virtual void setSystemID(const char *systemid)=0;
  33. virtual void setClientPassword(const char *password)=0;
  34. virtual void setServerPassword(const char *password)=0;
  35. virtual void addCapability(DaliClientRole role,const char *mac,const char *cpuid=NULL)=0;
  36. virtual void setLimit(DaliClientRole role,unsigned limit)=0;
  37. virtual void removeCapability(DaliClientRole role,const char *mac,const char *cpuid=NULL)=0;
  38. virtual void save(StringBuffer &text)=0;
  39. virtual void reset()=0;
  40. };
  41. extern dacaplib_decl IDaliCapabilityCreator *createDaliCapabilityCreator();
  42. extern dacaplib_decl bool getMAC(const IpAddress &ip,StringBuffer &out);
  43. #endif