Welcome to mirror list, hosted at ThFree Co, Russian Federation.

utils.h « src - github.com/freebsd/poudriere.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: db81247fd06c2d096fd74cc2d00820b061da7632 (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
67
68
69
70
71
72
73
74
#ifndef _UTILS_H
#define _UTILS_H

#include <sys/param.h>
#include <sys/queue.h>

#include <stdbool.h>

struct zfs_prop {
	const char *title;
	const char *name;
	const char *format;
};

typedef enum {
	STRING,
	INTEGER,
} zfs_query_type;

struct zfs_query {
	char *name;
	zfs_query_type type;
	char *strval;
	size_t strsize;
	int intval;
};

struct pjail {
	char name[20];
	char version[13];
	char arch[7];
	char method[8];
	char mountpoint[MAXPATHLEN];
	char fs[MAXPATHLEN];
	int built;
	int failed;
	int ignored;
	int skipped;
	int queued;
	char status[BUFSIZ];
	struct pkg *pkg;
	STAILQ_HEAD(jails, pjail) children;
	STAILQ_ENTRY(pjail) next;
};

struct pkg {
	char origin[BUFSIZ];
	STAILQ_HEAD(deps, dep) deps;
	STAILQ_ENTRY(pkg) next;
};

struct pport_tree {
	char name[20];
	char method[10];
	char mountpoint[MAXPATHLEN];
	char fs[MAXPATHLEN];
	struct pport_tree *next;
};

void zfs_list(struct zfs_prop[], const char *, int);
int jail_runs(const char *name);
int zfs_query(const char *, const char *, struct zfs_query[], int);
void jail_stop(struct pjail *j);
void jail_start(struct pjail *j, bool network);
void jail_setup(struct pjail *j);
void jail_kill(struct pjail *j);
void jail_run(struct pjail *j, bool network);
int exec(char *, char * const argv[]);
int jexec(struct pjail *j, char *argv[]);
void mount_nullfs(struct pjail *j, struct pport_tree *p);
int split_chr(char *str, char sep);
FILE *injail(struct pjail *j, char *cmd[], pid_t *p);

#endif