Annotation of src/usr.bin/cvs/proto.h, Revision 1.9
1.9 ! joris 1: /* $OpenBSD: proto.h,v 1.8 2005/10/17 16:16:00 moritz Exp $ */
1.1 jfb 2: /*
3: * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
1.5 tedu 4: * All rights reserved.
1.1 jfb 5: *
1.5 tedu 6: * Redistribution and use in source and binary forms, with or without
7: * modification, are permitted provided that the following conditions
8: * are met:
1.1 jfb 9: *
1.5 tedu 10: * 1. Redistributions of source code must retain the above copyright
11: * notice, this list of conditions and the following disclaimer.
1.1 jfb 12: * 2. The name of the author may not be used to endorse or promote products
1.5 tedu 13: * derived from this software without specific prior written permission.
1.1 jfb 14: *
15: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
16: * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
17: * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
18: * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
21: * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22: * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23: * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
1.5 tedu 24: * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1.1 jfb 25: */
26:
27: #ifndef PROTO_H
28: #define PROTO_H
29:
30: #include <sys/param.h>
1.2 jfb 31:
32: #include "buf.h"
33: #include "file.h"
1.1 jfb 34:
1.4 jfb 35:
1.7 xsa 36: #define CVS_PROTO_MAXARG 256
1.4 jfb 37:
1.7 xsa 38: #define CVS_REQ_TIMEOUT 300
1.1 jfb 39:
40:
41: /* client/server protocol requests */
1.7 xsa 42: #define CVS_REQ_NONE 0
43: #define CVS_REQ_ROOT 1
44: #define CVS_REQ_VALIDREQ 2
45: #define CVS_REQ_VALIDRESP 3
46: #define CVS_REQ_DIRECTORY 4
47: #define CVS_REQ_MAXDOTDOT 5
48: #define CVS_REQ_STATICDIR 6
49: #define CVS_REQ_STICKY 7
50: #define CVS_REQ_ENTRY 8
51: #define CVS_REQ_ENTRYEXTRA 9
52: #define CVS_REQ_CHECKINTIME 10
53: #define CVS_REQ_MODIFIED 11
54: #define CVS_REQ_ISMODIFIED 12
55: #define CVS_REQ_UNCHANGED 13
56: #define CVS_REQ_USEUNCHANGED 14
57: #define CVS_REQ_NOTIFY 15
58: #define CVS_REQ_NOTIFYUSER 16
59: #define CVS_REQ_QUESTIONABLE 17
60: #define CVS_REQ_CASE 18
61: #define CVS_REQ_UTF8 19
62: #define CVS_REQ_ARGUMENT 20
63: #define CVS_REQ_ARGUMENTX 21
64: #define CVS_REQ_GLOBALOPT 22
65: #define CVS_REQ_GZIPSTREAM 23
66: #define CVS_REQ_KERBENCRYPT 24
67: #define CVS_REQ_GSSENCRYPT 25
68: #define CVS_REQ_PROTOENCRYPT 26
69: #define CVS_REQ_GSSAUTH 27
70: #define CVS_REQ_PROTOAUTH 28
71: #define CVS_REQ_READCVSRC2 29
72: #define CVS_REQ_READWRAP 30
73: #define CVS_REQ_ERRIFREADER 31
74: #define CVS_REQ_VALIDRCSOPT 32
75: #define CVS_REQ_READIGNORE 33
76: #define CVS_REQ_SET 34
77: #define CVS_REQ_XPANDMOD 35
78: #define CVS_REQ_CI 36
79: #define CVS_REQ_CHOWN 37
80: #define CVS_REQ_SETOWN 38
81: #define CVS_REQ_SETPERM 39
82: #define CVS_REQ_CHACL 40
83: #define CVS_REQ_LISTPERM 41
84: #define CVS_REQ_LISTACL 42
85: #define CVS_REQ_SETPASS 43
86: #define CVS_REQ_PASSWD 44
87: #define CVS_REQ_DIFF 45
88: #define CVS_REQ_STATUS 46
89: #define CVS_REQ_LS 47
90: #define CVS_REQ_TAG 48
91: #define CVS_REQ_IMPORT 49
92: #define CVS_REQ_ADMIN 50
93: #define CVS_REQ_HISTORY 51
94: #define CVS_REQ_WATCHERS 52
95: #define CVS_REQ_EDITORS 53
96: #define CVS_REQ_ANNOTATE 54
97: #define CVS_REQ_LOG 55
98: #define CVS_REQ_CO 56
99: #define CVS_REQ_EXPORT 57
100: #define CVS_REQ_RANNOTATE 58
101: #define CVS_REQ_INIT 59
102: #define CVS_REQ_UPDATE 60
103: #define CVS_REQ_ADD 62
104: #define CVS_REQ_REMOVE 63
105: #define CVS_REQ_NOOP 64
106: #define CVS_REQ_RTAG 65
107: #define CVS_REQ_RELEASE 66
108: #define CVS_REQ_RLOG 67
109: #define CVS_REQ_RDIFF 68
110: #define CVS_REQ_VERSION 69
1.8 moritz 111: #define CVS_REQ_WATCH_ON 70
112: #define CVS_REQ_WATCH_OFF 71
113: #define CVS_REQ_WATCH_ADD 72
114: #define CVS_REQ_WATCH_REMOVE 73
1.1 jfb 115:
1.8 moritz 116:
117: #define CVS_REQ_MAX 73
1.1 jfb 118:
119:
120: /* responses */
1.7 xsa 121: #define CVS_RESP_NONE 0
122: #define CVS_RESP_OK 1
123: #define CVS_RESP_ERROR 2
124: #define CVS_RESP_VALIDREQ 3
125: #define CVS_RESP_CHECKEDIN 4
126: #define CVS_RESP_NEWENTRY 5
127: #define CVS_RESP_CKSUM 6
128: #define CVS_RESP_COPYFILE 7
129: #define CVS_RESP_UPDATED 8
130: #define CVS_RESP_CREATED 9
131: #define CVS_RESP_UPDEXIST 10
132: #define CVS_RESP_MERGED 11
133: #define CVS_RESP_PATCHED 12
134: #define CVS_RESP_RCSDIFF 13
135: #define CVS_RESP_MODE 14
136: #define CVS_RESP_MODTIME 15
137: #define CVS_RESP_REMOVED 16
138: #define CVS_RESP_RMENTRY 17
139: #define CVS_RESP_SETSTATDIR 18
140: #define CVS_RESP_CLRSTATDIR 19
141: #define CVS_RESP_SETSTICKY 20
142: #define CVS_RESP_CLRSTICKY 21
143: #define CVS_RESP_TEMPLATE 22
144: #define CVS_RESP_SETCIPROG 23
145: #define CVS_RESP_SETUPDPROG 24
146: #define CVS_RESP_NOTIFIED 25
147: #define CVS_RESP_MODXPAND 26
148: #define CVS_RESP_WRAPRCSOPT 27
149: #define CVS_RESP_M 28
150: #define CVS_RESP_MBINARY 29
151: #define CVS_RESP_E 30
152: #define CVS_RESP_F 31
153: #define CVS_RESP_MT 32
1.3 jfb 154:
1.7 xsa 155: #define CVS_RESP_MAX 32
1.3 jfb 156:
157: struct cvs_req {
1.7 xsa 158: int req_id;
159: char req_str[32];
160: u_int req_flags;
1.3 jfb 161: };
162:
163: struct cvs_resp {
1.7 xsa 164: u_int resp_id;
165: char resp_str[32];
1.3 jfb 166: };
1.1 jfb 167:
168:
1.7 xsa 169: BUF *cvs_recvfile(struct cvsroot *, mode_t *);
1.9 ! joris 170: void cvs_sendfile(struct cvsroot *, const char *);
! 171: void cvs_connect(struct cvsroot *);
1.7 xsa 172: void cvs_disconnect(struct cvsroot *);
173:
174: int cvs_req_handle(char *);
175: struct cvs_req *cvs_req_getbyid(int);
176: struct cvs_req *cvs_req_getbyname(const char *);
177: char *cvs_req_getvalid(void);
178:
179: int cvs_resp_handle(struct cvsroot *, char *);
180: struct cvs_resp* cvs_resp_getbyid(int);
181: struct cvs_resp* cvs_resp_getbyname(const char *);
182: char* cvs_resp_getvalid(void);
183:
1.9 ! joris 184: void cvs_sendreq(struct cvsroot *, u_int, const char *);
! 185: void cvs_getresp(struct cvsroot *);
1.7 xsa 186: int cvs_sendresp(u_int, const char *);
187: int cvs_getln(struct cvsroot *, char *, size_t);
1.9 ! joris 188: void cvs_senddir(struct cvsroot *, CVSFILE *);
! 189: void cvs_sendarg(struct cvsroot *, const char *, int);
! 190: void cvs_sendln(struct cvsroot *, const char *);
! 191: void cvs_sendentry(struct cvsroot *, const CVSFILE *);
! 192: void cvs_sendraw(struct cvsroot *, const void *, size_t);
1.7 xsa 193: ssize_t cvs_recvraw(struct cvsroot *, void *, size_t);
1.1 jfb 194:
195:
1.7 xsa 196: #endif /* PROTO_H */