1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | struct key { atomic_t usage; /* number of references */ key_serial_t serial; /* key serial number */ struct key_type *type; /* type of key */ time_t expiry; /* time at which key expires (or 0) */ uid_t uid; /* UID */ gid_t gid; /* GID */ key_perm_t perm; /* access permissions */ unsigned short quotalen; /* length added to quota */ unsigned short datalen; /* payload data length char *description; union { unsigned long value; void *data; struct keyring_list *subscriptions; } payload; /* Actual security data */ .... .... }; |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | struct key_type { const char *name; size_t def_datalen; /* Operations that can be defined for a key_type */ int (*instantiate)(struct key *key, const void *data, size_t datalen); int (*update)(struct key *key, const void *data, size_t datalen); int (*match)(const struct key *key, const void *desc); void (*revoke)(struct key *key); void (*destroy)(struct key *key); void (*describe)(const struct key *key, struct seq_file *p); long (*read)(const struct key *key, char __user *buffer, size_t buflen); .... .... }; |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |