1168404Spjd/*-
2168404Spjd * Copyright (c) 2003-2006, Maxime Henrion <mux@FreeBSD.org>
3168404Spjd * All rights reserved.
4168404Spjd *
5168404Spjd * Redistribution and use in source and binary forms, with or without
6168404Spjd * modification, are permitted provided that the following conditions
7168404Spjd * are met:
8168404Spjd * 1. Redistributions of source code must retain the above copyright
9168404Spjd *    notice, this list of conditions and the following disclaimer.
10168404Spjd * 2. Redistributions in binary form must reproduce the above copyright
11168404Spjd *    notice, this list of conditions and the following disclaimer in the
12168404Spjd *    documentation and/or other materials provided with the distribution.
13168404Spjd *
14168404Spjd * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15168404Spjd * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16168404Spjd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17168404Spjd * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18168404Spjd * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19168404Spjd * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20168404Spjd * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21168404Spjd * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22168404Spjd * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23219089Spjd * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24332525Smav * SUCH DAMAGE.
25287745Sdelphij *
26247265Smm * $FreeBSD$
27286575Smav */
28289422Smav#ifndef _PROTO_H_
29296519Smav#define _PROTO_H_
30332524Smav
31331397Smav#include <time.h>
32324010Savg
33331721Smav#include "misc.h"
34168404Spjd
35168404Spjd#define	PROTO_MAJ	17
36168404Spjd#define	PROTO_MIN	0
37251629Sdelphij#define	PROTO_SWVER	"CSUP_1_0"
38251629Sdelphij
39168404Spjdstruct stream;
40168404Spjd
41168404Spjdint	 proto_connect(struct config *, int, uint16_t);
42168404Spjdint	 proto_run(struct config *);
43168404Spjdint	 proto_printf(struct stream *, const char *, ...);
44168404Spjdchar	*proto_get_ascii(char **);
45168404Spjdchar	*proto_get_rest(char **);
46168404Spjdint	 proto_get_int(char **, int *, int);
47168404Spjdint	 proto_get_sizet(char **, size_t *, int);
48168404Spjdint	 proto_get_time(char **, time_t *);
49168404Spjd
50168404Spjd#endif /* !_PROTO_H_ */
51168404Spjd