File: mock-sysfs.h

package info (click to toggle)
bolt 0.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,788 kB
  • sloc: ansic: 28,869; python: 2,813; xml: 460; javascript: 269; sh: 180; makefile: 13
file content (121 lines) | stat: -rw-r--r-- 4,297 bytes parent folder | download | duplicates (4)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/*
 * Copyright © 2018 Red Hat, Inc
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors:
 *       Christian J. Kellner <christian@kellner.me>
 */


#pragma once

#include <gio/gio.h>

#include "bolt-enums.h"
#include "bolt-wire.h"


G_BEGIN_DECLS

typedef struct MockDevId
{

  gint        vendor_id;
  const char *vendor_name;

  gint        device_id;
  const char *device_name;

  const char *unique_id;

} MockDevId;

#define MOCK_TYPE_SYSFS mock_sysfs_get_type ()
G_DECLARE_FINAL_TYPE (MockSysfs, mock_sysfs, MOCK, SYSFS, GObject);

MockSysfs *      mock_sysfs_new (void);

const char *     mock_sysfs_force_power_add (MockSysfs *ms);

gboolean         mock_sysfs_force_power_remove (MockSysfs *ms);

void             mock_sysfs_force_power_load (MockSysfs *ms);

void             mock_sysfs_force_power_unload (MockSysfs *ms);

char *           mock_sysfs_force_power_read (MockSysfs *ms);

gboolean         mock_sysfs_force_power_enabled (MockSysfs *ms);

const char *     mock_sysfs_dmi_id_add (MockSysfs  *ms,
                                        const char *sys_vendor,
                                        const char *product_name,
                                        const char *product_version);

gboolean         mock_sysfs_dmi_id_remove (MockSysfs *ms);

const char *     mock_sysfs_domain_add (MockSysfs   *ms,
                                        BoltSecurity security,
                                        ...) G_GNUC_NULL_TERMINATED;

const char *     mock_sysfs_domain_get_syspath (MockSysfs  *ms,
                                                const char *id);

gboolean         mock_sysfs_domain_remove (MockSysfs  *ms,
                                           const char *id);

GStrv            mock_sysfs_domain_bootacl_get (MockSysfs  *ms,
                                                const char *id,
                                                GError    **error);

gboolean         mock_sysfs_domain_bootacl_set (MockSysfs  *ms,
                                                const char *id,
                                                GStrv       acl,
                                                GError    **error);

gboolean         mock_syfs_domain_iommu_set (MockSysfs  *ms,
                                             const char *id,
                                             const char *val,
                                             GError    **error);

const char *     mock_sysfs_host_add (MockSysfs  *ms,
                                      const char *domain,
                                      MockDevId  *id);

void             mock_sysfs_host_remove (MockSysfs  *ms,
                                         const char *host);

const char *     mock_sysfs_device_add (MockSysfs     *ms,
                                        const char    *parent,
                                        MockDevId     *id,
                                        guint          authorized,
                                        const char    *key,
                                        gint           boot,
                                        BoltLinkSpeed *link);

const char *     mock_sysfs_device_get_syspath (MockSysfs  *ms,
                                                const char *id);

const char *     mock_sysfs_device_get_parent (MockSysfs  *ms,
                                               const char *id);

gboolean         mock_sysfs_device_remove (MockSysfs  *ms,
                                           const char *id);

gboolean         mock_sysfs_set_osrelease (MockSysfs  *ms,
                                           const char *version);


G_END_DECLS