osd_sec.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * osd_sec.h - OSD security manager API
  3. *
  4. * Copyright (C) 2008 Panasas Inc. All rights reserved.
  5. *
  6. * Authors:
  7. * Boaz Harrosh <ooo@electrozaur.com>
  8. * Benny Halevy <bhalevy@panasas.com>
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2
  12. *
  13. */
  14. #ifndef __OSD_SEC_H__
  15. #define __OSD_SEC_H__
  16. #include <scsi/osd_protocol.h>
  17. #include <scsi/osd_types.h>
  18. /*
  19. * Contains types and constants of osd capabilities and security
  20. * encoding/decoding.
  21. * API is trying to keep security abstract so initiator of an object
  22. * based pNFS client knows as little as possible about security and
  23. * capabilities. It is the Server's osd-initiator place to know more.
  24. * Also can be used by osd-target.
  25. */
  26. void osd_sec_encode_caps(void *caps, ...);/* NI */
  27. void osd_sec_init_nosec_doall_caps(void *caps,
  28. const struct osd_obj_id *obj, bool is_collection, const bool is_v1);
  29. bool osd_is_sec_alldata(struct osd_security_parameters *sec_params);
  30. /* Conditionally sign the CDB according to security setting in ocdb
  31. * with cap_key */
  32. void osd_sec_sign_cdb(struct osd_cdb *ocdb, const u8 *cap_key);
  33. /* Unconditionally sign the BIO data with cap_key.
  34. * Check for osd_is_sec_alldata() was done prior to calling this. */
  35. void osd_sec_sign_data(void *data_integ, struct bio *bio, const u8 *cap_key);
  36. /* Version independent copy of caps into the cdb */
  37. void osd_set_caps(struct osd_cdb *cdb, const void *caps);
  38. #endif /* ndef __OSD_SEC_H__ */