1265574Smarcel/*-
2265574Smarcel * Copyright (c) 2014 Juniper Networks, Inc.
3265574Smarcel * All rights reserved.
4265574Smarcel *
5265574Smarcel * Redistribution and use in source and binary forms, with or without
6265574Smarcel * modification, are permitted provided that the following conditions
7265574Smarcel * are met:
8265574Smarcel * 1. Redistributions of source code must retain the above copyright
9265574Smarcel *    notice, this list of conditions and the following disclaimer.
10265574Smarcel * 2. Redistributions in binary form must reproduce the above copyright
11265574Smarcel *    notice, this list of conditions and the following disclaimer in the
12265574Smarcel *    documentation and/or other materials provided with the distribution.
13265574Smarcel *
14265574Smarcel * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15265574Smarcel * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16265574Smarcel * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17265574Smarcel * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18265574Smarcel * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19265574Smarcel * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20265574Smarcel * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21265574Smarcel * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22265574Smarcel * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23265574Smarcel * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24265574Smarcel * SUCH DAMAGE.
25265574Smarcel *
26265574Smarcel * $FreeBSD$
27265574Smarcel */
28265574Smarcel
29265574Smarcel#ifndef _MKIMG_IMAGE_H_
30265574Smarcel#define	_MKIMG_IMAGE_H_
31265574Smarcel
32265579Smarceltypedef int64_t lba_t;
33265579Smarcel
34265574Smarcelint image_copyin(lba_t blk, int fd, uint64_t *sizep);
35265618Smarcelint image_copyout(int fd);
36269177Smarcelint image_copyout_done(int fd);
37269177Smarcelint image_copyout_region(int fd, lba_t blk, lba_t size);
38287122Smarcelint image_copyout_zeroes(int fd, size_t count);
39269177Smarcelint image_data(lba_t blk, lba_t size);
40265725Smarcellba_t image_get_size(void);
41265618Smarcelint image_init(void);
42265574Smarcelint image_set_size(lba_t blk);
43265574Smarcelint image_write(lba_t blk, void *buf, ssize_t len);
44265574Smarcel
45265574Smarcel#endif /* _MKIMG_IMAGE_H_ */
46