xref: /freebsd/sbin/hastd/hast_checksum.h (revision 1fee97b01fbbd912fc03db57f8a20c3d6c3fc88d)
1*1fee97b0SPawel Jakub Dawidek /*-
2*1fee97b0SPawel Jakub Dawidek  * Copyright (c) 2011 Pawel Jakub Dawidek <pawel@dawidek.net>
3*1fee97b0SPawel Jakub Dawidek  * All rights reserved.
4*1fee97b0SPawel Jakub Dawidek  *
5*1fee97b0SPawel Jakub Dawidek  * Redistribution and use in source and binary forms, with or without
6*1fee97b0SPawel Jakub Dawidek  * modification, are permitted provided that the following conditions
7*1fee97b0SPawel Jakub Dawidek  * are met:
8*1fee97b0SPawel Jakub Dawidek  * 1. Redistributions of source code must retain the above copyright
9*1fee97b0SPawel Jakub Dawidek  *    notice, this list of conditions and the following disclaimer.
10*1fee97b0SPawel Jakub Dawidek  * 2. Redistributions in binary form must reproduce the above copyright
11*1fee97b0SPawel Jakub Dawidek  *    notice, this list of conditions and the following disclaimer in the
12*1fee97b0SPawel Jakub Dawidek  *    documentation and/or other materials provided with the distribution.
13*1fee97b0SPawel Jakub Dawidek  *
14*1fee97b0SPawel Jakub Dawidek  * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
15*1fee97b0SPawel Jakub Dawidek  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16*1fee97b0SPawel Jakub Dawidek  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17*1fee97b0SPawel Jakub Dawidek  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
18*1fee97b0SPawel Jakub Dawidek  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19*1fee97b0SPawel Jakub Dawidek  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20*1fee97b0SPawel Jakub Dawidek  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21*1fee97b0SPawel Jakub Dawidek  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22*1fee97b0SPawel Jakub Dawidek  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23*1fee97b0SPawel Jakub Dawidek  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24*1fee97b0SPawel Jakub Dawidek  * SUCH DAMAGE.
25*1fee97b0SPawel Jakub Dawidek  *
26*1fee97b0SPawel Jakub Dawidek  * $FreeBSD$
27*1fee97b0SPawel Jakub Dawidek  */
28*1fee97b0SPawel Jakub Dawidek 
29*1fee97b0SPawel Jakub Dawidek #ifndef	_HAST_CHECKSUM_H_
30*1fee97b0SPawel Jakub Dawidek #define	_HAST_CHECKSUM_H_
31*1fee97b0SPawel Jakub Dawidek 
32*1fee97b0SPawel Jakub Dawidek #include <stdlib.h>	/* size_t */
33*1fee97b0SPawel Jakub Dawidek 
34*1fee97b0SPawel Jakub Dawidek #include <hast.h>
35*1fee97b0SPawel Jakub Dawidek #include <nv.h>
36*1fee97b0SPawel Jakub Dawidek 
37*1fee97b0SPawel Jakub Dawidek const char *checksum_name(int num);
38*1fee97b0SPawel Jakub Dawidek 
39*1fee97b0SPawel Jakub Dawidek int checksum_send(const struct hast_resource *res, struct nv *nv,
40*1fee97b0SPawel Jakub Dawidek     void **datap, size_t *sizep, bool *freedatap);
41*1fee97b0SPawel Jakub Dawidek int checksum_recv(const struct hast_resource *res, struct nv *nv,
42*1fee97b0SPawel Jakub Dawidek     void **datap, size_t *sizep, bool *freedatap);
43*1fee97b0SPawel Jakub Dawidek 
44*1fee97b0SPawel Jakub Dawidek #endif	/* !_HAST_CHECKSUM_H_ */
45