1219354Spjd/*-
2330449Seadler * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3330449Seadler *
4219354Spjd * Copyright (c) 2011 Pawel Jakub Dawidek <pawel@dawidek.net>
5219354Spjd * All rights reserved.
6219354Spjd *
7219354Spjd * Redistribution and use in source and binary forms, with or without
8219354Spjd * modification, are permitted provided that the following conditions
9219354Spjd * are met:
10219354Spjd * 1. Redistributions of source code must retain the above copyright
11219354Spjd *    notice, this list of conditions and the following disclaimer.
12219354Spjd * 2. Redistributions in binary form must reproduce the above copyright
13219354Spjd *    notice, this list of conditions and the following disclaimer in the
14219354Spjd *    documentation and/or other materials provided with the distribution.
15219354Spjd *
16219354Spjd * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
17219354Spjd * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18219354Spjd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19219354Spjd * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
20219354Spjd * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21219354Spjd * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22219354Spjd * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23219354Spjd * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24219354Spjd * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25219354Spjd * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26219354Spjd * SUCH DAMAGE.
27219354Spjd *
28219354Spjd * $FreeBSD: stable/11/sbin/hastd/hast_compression.h 330449 2018-03-05 07:26:05Z eadler $
29219354Spjd */
30219354Spjd
31219354Spjd#ifndef	_HAST_COMPRESSION_H_
32219354Spjd#define	_HAST_COMPRESSION_H_
33219354Spjd
34219354Spjd#include <stdlib.h>	/* size_t */
35219354Spjd
36219354Spjd#include <hast.h>
37219354Spjd#include <nv.h>
38219354Spjd
39219354Spjdconst char *compression_name(int num);
40219354Spjd
41219354Spjdint compression_send(const struct hast_resource *res, struct nv *nv,
42219354Spjd    void **datap, size_t *sizep, bool *freedatap);
43219354Spjdint compression_recv(const struct hast_resource *res, struct nv *nv,
44219354Spjd    void **datap, size_t *sizep, bool *freedatap);
45219354Spjd
46219354Spjd#endif	/* !_HAST_COMPRESSION_H_ */
47