allowed_basenames.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*############################################################################
  2. # Copyright 2017 Intel Corporation
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. ############################################################################*/
  16. /// Basename management APIs
  17. /*! \file */
  18. #ifndef EPID_MEMBER_SRC_ALLOWED_BASENAMES_H_
  19. #define EPID_MEMBER_SRC_ALLOWED_BASENAMES_H_
  20. #include <stddef.h>
  21. #include "epid/common/errors.h"
  22. #include "epid/common/stdtypes.h"
  23. /// \cond
  24. typedef struct AllowedBasenames AllowedBasenames;
  25. typedef struct AllowedBasename AllowedBasename;
  26. /// \endcond
  27. /// Creates empty list of allowed basenames
  28. EpidStatus CreateBasenames(AllowedBasenames** basename_container);
  29. /// Checks if given basename is in the allowed list
  30. bool IsBasenameAllowed(AllowedBasenames const* basenames, void const* basename,
  31. size_t length);
  32. /// Adds a new allowed basename
  33. EpidStatus AllowBasename(AllowedBasenames* basenames, void const* basename,
  34. size_t length);
  35. /// Deletes list of allowed basenames
  36. void DeleteBasenames(AllowedBasenames** basename_container);
  37. #endif // EPID_MEMBER_SRC_ALLOWED_BASENAMES_H_