dkscan_util.h revision 1.1
11.1Smartin/* $NetBSD: dkscan_util.h,v 1.1 2007/03/01 22:01:30 martin Exp $ */
21.1Smartin
31.1Smartin/*-
41.1Smartin * Copyright (c) 2007 The NetBSD Foundation, Inc.
51.1Smartin * All rights reserved.
61.1Smartin *
71.1Smartin * This code is derived from software contributed to The NetBSD Foundation
81.1Smartin * by Martin Husemann <martin@NetBSD.org>.
91.1Smartin *
101.1Smartin * Redistribution and use in source and binary forms, with or without
111.1Smartin * modification, are permitted provided that the following conditions
121.1Smartin * are met:
131.1Smartin * 1. Redistributions of source code must retain the above copyright
141.1Smartin *    notice, this list of conditions and the following disclaimer.
151.1Smartin * 2. Redistributions in binary form must reproduce the above copyright
161.1Smartin *    notice, this list of conditions and the following disclaimer in the
171.1Smartin *    documentation and/or other materials provided with the distribution.
181.1Smartin * 3. All advertising materials mentioning features or use of this software
191.1Smartin *    must display the following acknowledgement:
201.1Smartin *        This product includes software developed by the NetBSD
211.1Smartin *        Foundation, Inc. and its contributors.
221.1Smartin * 4. Neither the name of The NetBSD Foundation nor the names of its
231.1Smartin *    contributors may be used to endorse or promote products derived
241.1Smartin *    from this software without specific prior written permission.
251.1Smartin *
261.1Smartin * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
271.1Smartin * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
281.1Smartin * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
291.1Smartin * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
301.1Smartin * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
311.1Smartin * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
321.1Smartin * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
331.1Smartin * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
341.1Smartin * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
351.1Smartin * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
361.1Smartin * POSSIBILITY OF SUCH DAMAGE.
371.1Smartin */
381.1Smartin
391.1Smartin
401.1Smartin#define BLOCK_SIZE	512	/* XXX */
411.1Smartin
421.1Smartinu_int dkcksum(struct disklabel *);
431.1Smartinu_int dkcksum_sized(struct disklabel *, size_t);
441.1Smartinint dkwedge_read(struct disk *pdk, struct vnode *vp, daddr_t blkno,
451.1Smartin	void *tbuf, size_t len);
461.1Smartinint dkwedge_add(struct dkwedge_info *dkw);
471.1Smartinvoid aprint_error(const char *format, ...);
481.1Smartinvoid aprint_verbose(const char *format, ...);
491.1Smartinvoid usage(void);
501.1Smartin
511.1Smartin
521.1Smartinextern int verbose;	/* are we verbose? */
531.1Smartinextern int no_action;	/* don't do anything, just print info */
541.1Smartinextern int disk_fd;	/* file descriptor for disk access */
55