[BACK]Return to proto.h CVS log [TXT][DIR] Up to [local] / src / usr.bin / cvs

Annotation of src/usr.bin/cvs/proto.h, Revision 1.12

1.12    ! xsa         1: /*     $OpenBSD: proto.h,v 1.11 2006/01/02 09:42:20 xsa 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
1.2       jfb        29:
                     30: #include "buf.h"
                     31: #include "file.h"
1.1       jfb        32:
1.4       jfb        33:
1.7       xsa        34: #define CVS_PROTO_MAXARG       256
1.4       jfb        35:
1.7       xsa        36: #define CVS_REQ_TIMEOUT                300
1.1       jfb        37:
                     38:
                     39: /* client/server protocol requests */
1.7       xsa        40: #define CVS_REQ_NONE           0
                     41: #define CVS_REQ_ROOT           1
                     42: #define CVS_REQ_VALIDREQ       2
                     43: #define CVS_REQ_VALIDRESP      3
                     44: #define CVS_REQ_DIRECTORY      4
                     45: #define CVS_REQ_MAXDOTDOT      5
                     46: #define CVS_REQ_STATICDIR      6
                     47: #define CVS_REQ_STICKY         7
                     48: #define CVS_REQ_ENTRY          8
                     49: #define CVS_REQ_ENTRYEXTRA     9
                     50: #define CVS_REQ_CHECKINTIME    10
                     51: #define CVS_REQ_MODIFIED       11
                     52: #define CVS_REQ_ISMODIFIED     12
                     53: #define CVS_REQ_UNCHANGED      13
                     54: #define CVS_REQ_USEUNCHANGED   14
                     55: #define CVS_REQ_NOTIFY         15
                     56: #define CVS_REQ_NOTIFYUSER     16
                     57: #define CVS_REQ_QUESTIONABLE   17
                     58: #define CVS_REQ_CASE           18
                     59: #define CVS_REQ_UTF8           19
                     60: #define CVS_REQ_ARGUMENT       20
                     61: #define CVS_REQ_ARGUMENTX      21
                     62: #define CVS_REQ_GLOBALOPT      22
                     63: #define CVS_REQ_GZIPSTREAM     23
                     64: #define CVS_REQ_KERBENCRYPT    24
                     65: #define CVS_REQ_GSSENCRYPT     25
                     66: #define CVS_REQ_PROTOENCRYPT   26
                     67: #define CVS_REQ_GSSAUTH                27
                     68: #define CVS_REQ_PROTOAUTH      28
                     69: #define CVS_REQ_READCVSRC2     29
                     70: #define CVS_REQ_READWRAP       30
                     71: #define CVS_REQ_ERRIFREADER    31
                     72: #define CVS_REQ_VALIDRCSOPT    32
                     73: #define CVS_REQ_READIGNORE     33
                     74: #define CVS_REQ_SET            34
                     75: #define CVS_REQ_XPANDMOD       35
                     76: #define CVS_REQ_CI             36
                     77: #define CVS_REQ_CHOWN          37
                     78: #define CVS_REQ_SETOWN         38
                     79: #define CVS_REQ_SETPERM                39
                     80: #define CVS_REQ_CHACL          40
                     81: #define CVS_REQ_LISTPERM       41
                     82: #define CVS_REQ_LISTACL                42
                     83: #define CVS_REQ_SETPASS                43
                     84: #define CVS_REQ_PASSWD         44
                     85: #define CVS_REQ_DIFF           45
                     86: #define CVS_REQ_STATUS         46
                     87: #define CVS_REQ_LS             47
                     88: #define CVS_REQ_TAG            48
                     89: #define CVS_REQ_IMPORT         49
                     90: #define CVS_REQ_ADMIN          50
                     91: #define CVS_REQ_HISTORY                51
                     92: #define CVS_REQ_WATCHERS       52
                     93: #define CVS_REQ_EDITORS                53
                     94: #define CVS_REQ_ANNOTATE       54
                     95: #define CVS_REQ_LOG            55
                     96: #define CVS_REQ_CO             56
                     97: #define CVS_REQ_EXPORT         57
                     98: #define CVS_REQ_RANNOTATE      58
                     99: #define CVS_REQ_INIT           59
                    100: #define CVS_REQ_UPDATE         60
                    101: #define CVS_REQ_ADD            62
                    102: #define CVS_REQ_REMOVE         63
                    103: #define CVS_REQ_NOOP           64
                    104: #define CVS_REQ_RTAG           65
                    105: #define CVS_REQ_RELEASE                66
                    106: #define CVS_REQ_RLOG           67
                    107: #define CVS_REQ_RDIFF          68
                    108: #define CVS_REQ_VERSION                69
1.8       moritz    109: #define CVS_REQ_WATCH_ON       70
                    110: #define CVS_REQ_WATCH_OFF      71
                    111: #define CVS_REQ_WATCH_ADD      72
                    112: #define CVS_REQ_WATCH_REMOVE   73
1.1       jfb       113:
1.8       moritz    114:
                    115: #define CVS_REQ_MAX            73
1.1       jfb       116:
                    117:
                    118: /* responses */
1.7       xsa       119: #define CVS_RESP_NONE          0
                    120: #define CVS_RESP_OK            1
                    121: #define CVS_RESP_ERROR         2
                    122: #define CVS_RESP_VALIDREQ      3
                    123: #define CVS_RESP_CHECKEDIN     4
                    124: #define CVS_RESP_NEWENTRY      5
                    125: #define CVS_RESP_CKSUM         6
                    126: #define CVS_RESP_COPYFILE      7
                    127: #define CVS_RESP_UPDATED       8
                    128: #define CVS_RESP_CREATED       9
                    129: #define CVS_RESP_UPDEXIST      10
                    130: #define CVS_RESP_MERGED                11
                    131: #define CVS_RESP_PATCHED       12
                    132: #define CVS_RESP_RCSDIFF       13
                    133: #define CVS_RESP_MODE          14
                    134: #define CVS_RESP_MODTIME       15
                    135: #define CVS_RESP_REMOVED       16
                    136: #define CVS_RESP_RMENTRY       17
                    137: #define CVS_RESP_SETSTATDIR    18
                    138: #define CVS_RESP_CLRSTATDIR    19
                    139: #define CVS_RESP_SETSTICKY     20
                    140: #define CVS_RESP_CLRSTICKY     21
                    141: #define CVS_RESP_TEMPLATE      22
                    142: #define CVS_RESP_SETCIPROG     23
                    143: #define CVS_RESP_SETUPDPROG    24
                    144: #define CVS_RESP_NOTIFIED      25
                    145: #define CVS_RESP_MODXPAND      26
                    146: #define CVS_RESP_WRAPRCSOPT    27
                    147: #define CVS_RESP_M             28
                    148: #define CVS_RESP_MBINARY       29
                    149: #define CVS_RESP_E             30
                    150: #define CVS_RESP_F             31
                    151: #define CVS_RESP_MT            32
1.3       jfb       152:
1.7       xsa       153: #define CVS_RESP_MAX   32
1.3       jfb       154:
                    155: struct cvs_req {
1.7       xsa       156:        int     req_id;
                    157:        char    req_str[32];
                    158:        u_int   req_flags;
1.3       jfb       159: };
                    160:
                    161: struct cvs_resp {
1.7       xsa       162:        u_int   resp_id;
                    163:        char    resp_str[32];
1.3       jfb       164: };
1.1       jfb       165:
                    166:
1.7       xsa       167: BUF    *cvs_recvfile(struct cvsroot *, mode_t *);
1.9       joris     168: void    cvs_sendfile(struct cvsroot *, const char *);
                    169: void    cvs_connect(struct cvsroot *);
1.7       xsa       170: void    cvs_disconnect(struct cvsroot *);
                    171:
                    172: int             cvs_req_handle(char *);
                    173: struct cvs_req *cvs_req_getbyid(int);
                    174: struct cvs_req *cvs_req_getbyname(const char *);
                    175: char           *cvs_req_getvalid(void);
                    176:
                    177: int              cvs_resp_handle(struct cvsroot *, char *);
                    178: struct cvs_resp* cvs_resp_getbyid(int);
                    179: struct cvs_resp* cvs_resp_getbyname(const char *);
                    180: char*            cvs_resp_getvalid(void);
                    181:
1.9       joris     182: void   cvs_sendreq(struct cvsroot *, u_int, const char *);
                    183: void   cvs_getresp(struct cvsroot *);
1.12    ! xsa       184: void   cvs_sendresp(u_int, const char *);
1.10      joris     185: void   cvs_getln(struct cvsroot *, char *, size_t);
1.9       joris     186: void   cvs_senddir(struct cvsroot *, CVSFILE *);
                    187: void   cvs_sendarg(struct cvsroot *, const char *, int);
                    188: void   cvs_sendln(struct cvsroot *, const char *);
                    189: void   cvs_sendentry(struct cvsroot *, const CVSFILE *);
                    190: void   cvs_sendraw(struct cvsroot *, const void *, size_t);
1.10      joris     191: size_t cvs_recvraw(struct cvsroot *, void *, size_t);
1.1       jfb       192:
                    193:
1.7       xsa       194: #endif /* PROTO_H */