Blame


1 f024663d 2021-09-05 stsp /*
2 f024663d 2021-09-05 stsp * Copyright (c) 2019 Ori Bernstein <ori@openbsd.org>
3 f024663d 2021-09-05 stsp * Copyright (c) 2021 Stefan Sperling <stsp@openbsd.org>
4 f024663d 2021-09-05 stsp *
5 f024663d 2021-09-05 stsp * Permission to use, copy, modify, and distribute this software for any
6 f024663d 2021-09-05 stsp * purpose with or without fee is hereby granted, provided that the above
7 f024663d 2021-09-05 stsp * copyright notice and this permission notice appear in all copies.
8 f024663d 2021-09-05 stsp *
9 f024663d 2021-09-05 stsp * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 f024663d 2021-09-05 stsp * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 f024663d 2021-09-05 stsp * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 f024663d 2021-09-05 stsp * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 f024663d 2021-09-05 stsp * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 f024663d 2021-09-05 stsp * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 f024663d 2021-09-05 stsp * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 f024663d 2021-09-05 stsp */
17 f024663d 2021-09-05 stsp
18 77d7d3bb 2021-09-05 stsp #define GOT_PKT_MAX 65536
19 77d7d3bb 2021-09-05 stsp
20 f024663d 2021-09-05 stsp const struct got_error *got_pkt_readn(ssize_t *off, int fd, void *buf,
21 f024663d 2021-09-05 stsp size_t n);
22 f024663d 2021-09-05 stsp const struct got_error *got_pkt_flushpkt(int fd, int chattygot);
23 f024663d 2021-09-05 stsp const struct got_error *got_pkt_readhdr(int *datalen, int fd, int chattygot);
24 f024663d 2021-09-05 stsp const struct got_error *got_pkt_readpkt(int *outlen, int fd, char *buf,
25 f024663d 2021-09-05 stsp int buflen, int chattygot);
26 f024663d 2021-09-05 stsp const struct got_error *got_pkt_writepkt(int fd, char *buf, int nbuf,
27 f024663d 2021-09-05 stsp int chattygot);