xref: /dragonfly/bin/cpdup/hcproto.h (revision 521a7b05)
1 /*
2  * HCPROTO.H
3  *
4  * $DragonFly: src/bin/cpdup/hcproto.h,v 1.1 2006/08/13 20:51:40 dillon Exp $
5  */
6 
7 #ifndef _HCPROTO_H_
8 #define _HCPROTO_H_
9 
10 #define HC_HELLO	0x0001
11 
12 #define HC_STAT		0x0010
13 #define HC_LSTAT	0x0011
14 #define HC_OPENDIR	0x0012
15 #define HC_READDIR	0x0013
16 #define HC_CLOSEDIR	0x0014
17 #define HC_OPEN		0x0015
18 #define HC_CLOSE	0x0016
19 #define HC_READ		0x0017
20 #define HC_WRITE	0x0018
21 #define HC_REMOVE	0x0019
22 #define HC_MKDIR	0x001A
23 #define HC_RMDIR	0x001B
24 #define HC_CHOWN	0x001C
25 #define HC_LCHOWN	0x001D
26 #define HC_CHMOD	0x001E
27 #define HC_LINK		0x001F
28 #define HC_CHFLAGS	0x0020
29 #define HC_READLINK	0x0021
30 #define HC_UMASK	0x0022
31 #define HC_SYMLINK	0x0023
32 #define HC_RENAME	0x0024
33 #define HC_UTIMES	0x0025
34 
35 #define LC_HELLOSTR	(0x0001|LCF_STRING)
36 #define LC_PATH1	(0x0010|LCF_STRING)
37 #define LC_PATH2	(0x0011|LCF_STRING)
38 #define LC_OFLAGS	(0x0012|LCF_INT32)
39 #define LC_MODE		(0x0013|LCF_INT32)
40 #define LC_BYTES	(0x0014|LCF_INT32)
41 #define LC_OWNER	(0x0015|LCF_INT32)
42 #define LC_GROUP	(0x0016|LCF_INT32)
43 #define LC_DEV		(0x0017|LCF_INT32)
44 #define LC_INO		(0x0018|LCF_INT64)
45 #define LC_NLINK	(0x0019|LCF_INT32)
46 #define LC_UID		(0x001A|LCF_INT32)
47 #define LC_GID		(0x001B|LCF_INT32)
48 #define LC_RDEV		(0x001C|LCF_INT32)
49 #define LC_ATIME	(0x001D|LCF_INT64)
50 #define LC_MTIME	(0x001E|LCF_INT64)
51 #define LC_CTIME	(0x001F|LCF_INT64)
52 #define LC_FILESIZE	(0x0020|LCF_INT64)
53 #define LC_FILEBLKS	(0x0021|LCF_INT64)
54 #define LC_FILEFLAGS	(0x0022|LCF_INT64)
55 #define LC_FSMID	(0x0023|LCF_INT64)
56 #define LC_DESCRIPTOR	(0x0024|LCF_INT32)
57 #define LC_DATA		(0x0025|LCF_BINARY)
58 #define LC_TYPE		(0x0026|LCF_INT32)
59 #define LC_BLKSIZE	(0x0027|LCF_INT32)
60 
61 #define XO_NATIVEMASK	3		/* passed through directly */
62 #define XO_CREAT	0x00010000
63 #define XO_EXCL		0x00020000
64 #define XO_TRUNC	0x00040000
65 
66 #define HC_DESC_DIR	1
67 #define HC_DESC_FD	2
68 
69 int hc_connect(struct HostConf *hc);
70 void hc_slave(int fdin, int fdout);
71 
72 int hc_hello(struct HostConf *hc);
73 int hc_stat(struct HostConf *hc, const char *path, struct stat *st);
74 int hc_lstat(struct HostConf *hc, const char *path, struct stat *st);
75 DIR *hc_opendir(struct HostConf *hc, const char *path);
76 struct dirent *hc_readdir(struct HostConf *hc, DIR *dir);
77 int hc_closedir(struct HostConf *hc, DIR *dir);
78 int hc_open(struct HostConf *hc, const char *path, int flags, mode_t mode);
79 int hc_close(struct HostConf *hc, int fd);
80 ssize_t hc_read(struct HostConf *hc, int fd, void *buf, size_t bytes);
81 ssize_t hc_write(struct HostConf *hc, int fd, const void *buf, size_t bytes);
82 int hc_remove(struct HostConf *hc, const char *path);
83 int hc_mkdir(struct HostConf *hc, const char *path, mode_t mode);
84 int hc_rmdir(struct HostConf *hc, const char *path);
85 int hc_chown(struct HostConf *hc, const char *path, uid_t owner, gid_t group);
86 int hc_lchown(struct HostConf *hc, const char *path, uid_t owner, gid_t group);
87 int hc_chmod(struct HostConf *hc, const char *path, mode_t mode);
88 int hc_link(struct HostConf *hc, const char *name1, const char *name2);
89 int hc_chflags(struct HostConf *hc, const char *path, u_long flags);
90 int hc_readlink(struct HostConf *hc, const char *path, char *buf, int bufsiz);
91 mode_t hc_umask(struct HostConf *hc, mode_t numask);
92 int hc_symlink(struct HostConf *hc, const char *name1, const char *name2);
93 int hc_rename(struct HostConf *hc, const char *name1, const char *name2);
94 int hc_utimes(struct HostConf *hc, const char *path, const struct timeval *times);
95 
96 #endif
97 
98