Open SCAP Library
fwupdsecattr_probe.h
1 /*
2  * Copyright 2022 Red Hat Inc., Durham, North Carolina.
3  * All Rights Reserved.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  * Authors:
20  * Kate Hsuan <hpa@redhat.com>
21  */
22 
23 #ifndef OPENSCAP_FWUPDSECATTR_PROBE_H
24 #define OPENSCAP_FWUPDSECATTR_PROBE_H
25 
26 #include <sys/queue.h>
27 
28 #include "probe-api.h"
29 
30 struct secattr_cache {
31  char *name;
32  uint32_t hsi_result;
33  LIST_ENTRY(secattr_cache) entries;
34 };
35 
36 typedef enum {
37  FWUPD_SECURITY_ATTR_RESULT_UNKNOWN,
38  FWUPD_SECURITY_ATTR_RESULT_ENABLED,
39  FWUPD_SECURITY_ATTR_RESULT_NOT_ENABLED,
40  FWUPD_SECURITY_ATTR_RESULT_VALID,
41  FWUPD_SECURITY_ATTR_RESULT_NOT_VALID,
42  FWUPD_SECURITY_ATTR_RESULT_LOCKED,
43  FWUPD_SECURITY_ATTR_RESULT_NOT_LOCKED,
44  FWUPD_SECURITY_ATTR_RESULT_ENCRYPTED,
45  FWUPD_SECURITY_ATTR_RESULT_NOT_ENCRYPTED,
46  FWUPD_SECURITY_ATTR_RESULT_TAINTED,
47  FWUPD_SECURITY_ATTR_RESULT_NOT_TAINTED,
48  FWUPD_SECURITY_ATTR_RESULT_FOUND,
49  FWUPD_SECURITY_ATTR_RESULT_NOT_FOUND,
50  FWUPD_SECURITY_ATTR_RESULT_SUPPORTED,
51  FWUPD_SECURITY_ATTR_RESULT_NOT_SUPPORTED,
52  /*< private >*/
53  FWUPD_SECURITY_ATTR_RESULT_LAST
54 } FwupdSecurityAttrResult;
55 
56 LIST_HEAD(cachehed, secattr_cache);
57 
58 int fwupdsecattr_probe_offline_mode_supported(void);
59 int fwupdsecattr_probe_main(probe_ctx *ctx, void *arg);
60 
61 #endif /* OPENSCAP_FWUPD_SECURITY_ATTR_PROBE_H */
Probe API public header.
Definition: probe.h:80
Definition: fwupdsecattr_probe.h:30