-struct cp_global_state {
- uint8_t wrap_functions_set;
- uint8_t lock_state;
- u_int16_t reserved;
-};
-
-/*
- * On-disk structure written as the per-file EA payload
- * All on-disk multi-byte fields for the CP XATTR must be stored
- * little-endian on-disk. This means they must be endian swapped to
- * L.E on getxattr() and converted to LE on setxattr().
- *
- * This structure is a fixed length and is tightly packed.
- * 56 bytes total.
- */
-struct cp_xattr_v2 {
- u_int16_t xattr_major_version;
- u_int16_t xattr_minor_version;
- u_int32_t flags;
- u_int32_t persistent_class;
- u_int32_t key_size;
- uint8_t persistent_key[CP_V2_WRAPPEDKEYSIZE];
-} __attribute__((aligned(2), packed));
-
-
-/*
- * V4 Content Protection EA On-Disk Layout.
- *
- * This structure must be tightly packed, but the *size can vary*
- * depending on the length of the key. At MOST, the key length will be
- * CP_MAX_WRAPPEDKEYSIZE, but the length is defined by the key_size field.
- *
- * Either way, the packing must be applied to ensure that the key data is
- * retrievable in the right location relative to the start of the struct.
- *
- * Fully packed, this structure can range from :
- * MIN: 36 bytes (no key -- used with directories)
- * MAX: 164 bytes (with 128 byte key)
- *
- * During runtime we always allocate with the full 128 byte key, but only
- * use as much of the key buffer as needed. It must be tightly packed, though.
- */
-
-struct cp_xattr_v4 {
- u_int16_t xattr_major_version;
- u_int16_t xattr_minor_version;
- u_int32_t flags;
- u_int32_t persistent_class;
- u_int32_t key_size;
- /* CP V4 Reserved Bytes == 20 */
- u_int8_t reserved[CP_V4_RESERVEDBYTES];
- /* All above fields are fixed regardless of key length (36 bytes) */
- /* Max Wrapped Size == 128 */
- uint8_t persistent_key[CP_MAX_WRAPPEDKEYSIZE];
-} __attribute__((aligned(2), packed));
-
-
-/*
- * The Root Directory's EA (fileid 1) is special; it defines information about
- * what capabilities the filesystem is using.
- *
- * The data is still stored little endian.
- *
- * Note that this structure is tightly packed: 28 bytes total.
- */
- struct cp_root_xattr {
- u_int16_t major_version;
- u_int16_t minor_version;
- u_int64_t flags;
- u_int8_t reserved[16];
-} __attribute__((aligned(2), packed));
-
-
-/*
- * Functions to check the status of a CP and to query
- * the containing filesystem to see if it is supported.
- */
-int cp_vnode_getclass(vnode_t, int *);
-int cp_vnode_setclass(vnode_t, uint32_t);
-int cp_vnode_transcode(vnode_t);
-
-int cp_key_store_action(int);