summaryrefslogtreecommitdiffstats
path: root/mountd/ASEC.h
blob: c87b288777aa9cbcdcca30ab601ae19070c10a4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef _ASEC_H
#define _ASEC_H

#define ASEC_STORES_MAX 4
#define MAX_LOOP 8

typedef enum AsecState {
    // Feature disabled
    ASEC_DISABLED,

    // Feature enabled and operational
    ASEC_AVAILABLE,

    // Busy
    ASEC_BUSY,

    // Internal Error
    ASEC_FAILED_INTERR,

    // No media available
    ASEC_FAILED_NOMEDIA,

    // Media is corrupt
    ASEC_FAILED_BADMEDIA,

    // Key mismatch
    ASEC_FAILED_BADKEY,
} AsecState;

/*
 * ASEC commands
 */
#define ASEC_CMD_SEND_STATUS		"asec_send_status"
#define ASEC_CMD_ENABLE			"asec_enable"
#define ASEC_CMD_DISABLE		"asec_disable"

/*
 * ASEC events
 */

// These events correspond to the states in the AsecState enum.
// A path to the ASEC mount point follows the colon
#define ASEC_EVENT_DISABLED		"asec_disabled:"
#define ASEC_EVENT_AVAILABLE		"asec_available:"
#define ASEC_EVENT_BUSY			"asec_busy:"
#define ASEC_EVENT_FAILED_INTERR	"asec_failed_interror:"
#define ASEC_EVENT_FAILED_NOMEDIA	"asec_failed_nomedia"
#define ASEC_EVENT_FAILED_BADMEDIA	"asec_failed_badmedia:"
#define ASEC_EVENT_FAILED_BADKEY	"asec_failed_badkey:"

/*
 * System Properties
 */

#define ASEC_ENABLED			"asec.enabled"

#define ASEC_STATUS			"ro.asec.status"
#define ASEC_STATUS_DISABLED		"disabled"
#define ASEC_STATUS_AVAILABLE		"available"
#define ASEC_STATUS_BUSY			"busy"
#define ASEC_STATUS_FAILED_INTERR	"internal_error"
#define ASEC_STATUS_FAILED_NOMEDIA	"no_media"
#define ASEC_STATUS_FAILED_BADMEDIA	"bad_media"
#define ASEC_STATUS_FAILED_BADKEY	"bad_key"

#endif