-
Notifications
You must be signed in to change notification settings - Fork 9
/
sysreg.h
123 lines (107 loc) · 2.74 KB
/
sysreg.h
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
122
123
/*
* PROJECT: ReactOS System Regression Testing Utility
* LICENSE: GNU GPLv2 or any later version as published by the Free Software Foundation
* PURPOSE: Shared header
* COPYRIGHT: Copyright 2008-2009 Christoph von Wittich <[email protected]>
* Copyright 2009 Colin Finck <[email protected]>
* Copyright 2012-2013 Pierre Schweitzer <[email protected]>
*/
#ifndef __SYSREG_H__
#define __SYSREG_H__
#include <dirent.h>
#include <fcntl.h>
#include <libvirt.h>
#include <poll.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
#include <errno.h>
#include <time.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#include <sys/stat.h>
#include <sys/sysinfo.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/time.h>
#define EXIT_CHECKPOINT_REACHED 0
#define EXIT_CONTINUE 1
#define EXIT_DONT_CONTINUE 2
#define NUM_STAGES 3
#define TYPE_KVM 0
#define TYPE_VMWARE_PLAYER 1
#define TYPE_VIRTUALBOX 2
#ifdef __cplusplus
extern "C"
{
#endif
extern const char gGitCommit[];
typedef struct _stage
{
char BootDevice[8];
char Checkpoint[80];
char HookCommand[255];
}
stage;
typedef struct _Settings
{
int Timeout;
int GlobalTimeout;
bool BreakOnTimeOut;
char Filename[255];
char Name[80];
char HardDiskImage[255];
int ImageSize;
stage Stage[NUM_STAGES];
unsigned int MaxCacheHits;
unsigned int MaxRetries;
unsigned int MaxConts;
unsigned int VMType;
union
{
struct
{
char Path[255];
int Socket;
} VMwarePlayer;
} Specific;
}
Settings;
typedef struct _ModuleListEntry
{
struct _ModuleListEntry* Next;
char* Module;
char* Path;
}
ModuleListEntry;
/* utils.c */
char* ReadFile (const char* filename);
ssize_t safewriteex(int fd, const void *buf, size_t count, int timeout);
#define safewrite(fd, buf, timeout) safewriteex(fd, buf, sizeof(buf) / sizeof(buf[0]) - 1, timeout)
void SysregPrintf(const char* format, ...);
int Execute(const char * command);
bool CreateLocalSocket(void);
/* options.c */
bool LoadSettings(const char* XmlConfig);
/* console.c */
int ProcessDebugData(const char* tty, int timeout, int stage);
/* raddr2line.c */
void InitializeModuleList();
void CleanModuleList();
bool ResolveAddressFromFile(char* Buffer, size_t BufferSize, const char* Data);
/* virt.c */
extern const char* OutputPath;
extern Settings AppSettings;
extern ModuleListEntry* ModuleList;
bool BreakToDebugger(void);
#ifdef __cplusplus
}
#endif
#endif