2 * Amanda, The Advanced Maryland Automatic Network Disk Archiver
3 * Copyright (c) 1991-1998 University of Maryland at College Park
6 * Permission to use, copy, modify, distribute, and sell this software and its
7 * documentation for any purpose is hereby granted without fee, provided that
8 * the above copyright notice appear in all copies and that both that
9 * copyright notice and this permission notice appear in supporting
10 * documentation, and that the name of U.M. not be used in advertising or
11 * publicity pertaining to distribution of the software without specific,
12 * written prior permission. U.M. makes no representations about the
13 * suitability of this software for any purpose. It is provided "as is"
14 * without express or implied warranty.
16 * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
18 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
20 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
21 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 * Authors: the Amanda Development Team. Its members are listed in a
24 * file named AUTHORS, in the root directory of this distribution.
27 * $Id: protocol.h,v 1.8.10.2.2.2 2004/04/29 20:47:22 martinea Exp $
29 * interfaces for amanda protocol
39 S_STARTUP, S_SENDREQ, S_ACKWAIT, S_REPWAIT, S_SUCCEEDED, S_FAILED
42 typedef enum { A_BOGUS, A_START, A_TIMEOUT, A_RCVDATA } action_t;
44 typedef enum { P_BOGUS, P_REQ, P_REP, P_PREP, P_ACK, P_NAK } pktype_t;
46 typedef struct { /* a predigested datagram */
48 struct sockaddr_in peer;
50 int version_major, version_minor;
59 typedef struct proto_s {
62 struct sockaddr_in peer;
65 time_t origtime, curtime;
66 int reqtries, acktries;
71 char *req; /* body of request msg */
72 void (*continuation) P((struct proto_s *, pkt_t *));
74 struct proto_s *prev,*next;
77 void proto_init P((int sock, int startseq, int handles));
78 int make_request P((char *hostname, int port, char *req, void *datap,
80 void (*continuation) P((proto_t *p, pkt_t *pkt))
83 void check_protocol P((void));
84 void run_protocol P((void));
86 void parse_pkt_header P((pkt_t *pkt));
89 int make_krb_request P((char *hostname, int port, char *req,
90 void *datap, time_t repwait,
91 void (*continuation) P((proto_t *p, pkt_t *pkt))
95 extern char *parse_errmsg;
97 #endif /* PROTOCOL_H */