11fee97b0SPawel Jakub Dawidek /*- 2*4d846d26SWarner Losh * SPDX-License-Identifier: BSD-2-Clause 31de7b4b8SPedro F. Giffuni * 41fee97b0SPawel Jakub Dawidek * Copyright (c) 2011 Pawel Jakub Dawidek <pawel@dawidek.net> 51fee97b0SPawel Jakub Dawidek * All rights reserved. 61fee97b0SPawel Jakub Dawidek * 71fee97b0SPawel Jakub Dawidek * Redistribution and use in source and binary forms, with or without 81fee97b0SPawel Jakub Dawidek * modification, are permitted provided that the following conditions 91fee97b0SPawel Jakub Dawidek * are met: 101fee97b0SPawel Jakub Dawidek * 1. Redistributions of source code must retain the above copyright 111fee97b0SPawel Jakub Dawidek * notice, this list of conditions and the following disclaimer. 121fee97b0SPawel Jakub Dawidek * 2. Redistributions in binary form must reproduce the above copyright 131fee97b0SPawel Jakub Dawidek * notice, this list of conditions and the following disclaimer in the 141fee97b0SPawel Jakub Dawidek * documentation and/or other materials provided with the distribution. 151fee97b0SPawel Jakub Dawidek * 161fee97b0SPawel Jakub Dawidek * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND 171fee97b0SPawel Jakub Dawidek * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 181fee97b0SPawel Jakub Dawidek * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 191fee97b0SPawel Jakub Dawidek * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE 201fee97b0SPawel Jakub Dawidek * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 211fee97b0SPawel Jakub Dawidek * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 221fee97b0SPawel Jakub Dawidek * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 231fee97b0SPawel Jakub Dawidek * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 241fee97b0SPawel Jakub Dawidek * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 251fee97b0SPawel Jakub Dawidek * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 261fee97b0SPawel Jakub Dawidek * SUCH DAMAGE. 271fee97b0SPawel Jakub Dawidek */ 281fee97b0SPawel Jakub Dawidek 291fee97b0SPawel Jakub Dawidek #ifndef _HAST_CHECKSUM_H_ 301fee97b0SPawel Jakub Dawidek #define _HAST_CHECKSUM_H_ 311fee97b0SPawel Jakub Dawidek 321fee97b0SPawel Jakub Dawidek #include <stdlib.h> /* size_t */ 331fee97b0SPawel Jakub Dawidek 341fee97b0SPawel Jakub Dawidek #include <hast.h> 351fee97b0SPawel Jakub Dawidek #include <nv.h> 361fee97b0SPawel Jakub Dawidek 371fee97b0SPawel Jakub Dawidek const char *checksum_name(int num); 381fee97b0SPawel Jakub Dawidek 391fee97b0SPawel Jakub Dawidek int checksum_send(const struct hast_resource *res, struct nv *nv, 401fee97b0SPawel Jakub Dawidek void **datap, size_t *sizep, bool *freedatap); 411fee97b0SPawel Jakub Dawidek int checksum_recv(const struct hast_resource *res, struct nv *nv, 421fee97b0SPawel Jakub Dawidek void **datap, size_t *sizep, bool *freedatap); 431fee97b0SPawel Jakub Dawidek 441fee97b0SPawel Jakub Dawidek #endif /* !_HAST_CHECKSUM_H_ */ 45