xref: /freebsd/sys/fs/cd9660/iso_rrip.h (revision 96e69c8e3167a57b8b37317796eba3068d12a771)
1df8bae1dSRodney W. Grimes /*-
251369649SPedro F. Giffuni  * SPDX-License-Identifier: BSD-3-Clause
351369649SPedro F. Giffuni  *
4df8bae1dSRodney W. Grimes  * Copyright (c) 1993, 1994
5df8bae1dSRodney W. Grimes  *	The Regents of the University of California.  All rights reserved.
6df8bae1dSRodney W. Grimes  *
7df8bae1dSRodney W. Grimes  * This code is derived from software contributed to Berkeley
8df8bae1dSRodney W. Grimes  * by Pace Willisson (pace@blitz.com).  The Rock Ridge Extension
9df8bae1dSRodney W. Grimes  * Support code is derived from software contributed to Berkeley
10df8bae1dSRodney W. Grimes  * by Atsushi Murai (amurai@spec.co.jp).
11df8bae1dSRodney W. Grimes  *
12df8bae1dSRodney W. Grimes  * Redistribution and use in source and binary forms, with or without
13df8bae1dSRodney W. Grimes  * modification, are permitted provided that the following conditions
14df8bae1dSRodney W. Grimes  * are met:
15df8bae1dSRodney W. Grimes  * 1. Redistributions of source code must retain the above copyright
16df8bae1dSRodney W. Grimes  *    notice, this list of conditions and the following disclaimer.
17df8bae1dSRodney W. Grimes  * 2. Redistributions in binary form must reproduce the above copyright
18df8bae1dSRodney W. Grimes  *    notice, this list of conditions and the following disclaimer in the
19df8bae1dSRodney W. Grimes  *    documentation and/or other materials provided with the distribution.
20fbbd9655SWarner Losh  * 3. Neither the name of the University nor the names of its contributors
21df8bae1dSRodney W. Grimes  *    may be used to endorse or promote products derived from this software
22df8bae1dSRodney W. Grimes  *    without specific prior written permission.
23df8bae1dSRodney W. Grimes  *
24df8bae1dSRodney W. Grimes  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25df8bae1dSRodney W. Grimes  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26df8bae1dSRodney W. Grimes  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27df8bae1dSRodney W. Grimes  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28df8bae1dSRodney W. Grimes  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29df8bae1dSRodney W. Grimes  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30df8bae1dSRodney W. Grimes  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31df8bae1dSRodney W. Grimes  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32df8bae1dSRodney W. Grimes  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33df8bae1dSRodney W. Grimes  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34df8bae1dSRodney W. Grimes  * SUCH DAMAGE.
35df8bae1dSRodney W. Grimes  */
36df8bae1dSRodney W. Grimes 
37d33cdf16SEd Maste #ifndef _ISOFS_CD9660_ISO_RRIP_H_
38d33cdf16SEd Maste #define _ISOFS_CD9660_ISO_RRIP_H_
39d33cdf16SEd Maste 
40df8bae1dSRodney W. Grimes /*
41df8bae1dSRodney W. Grimes  *	Analyze function flag (similar to RR field bits)
42df8bae1dSRodney W. Grimes  */
43df8bae1dSRodney W. Grimes #define	ISO_SUSP_ATTR		0x0001
44df8bae1dSRodney W. Grimes #define	ISO_SUSP_DEVICE		0x0002
45df8bae1dSRodney W. Grimes #define	ISO_SUSP_SLINK		0x0004
46df8bae1dSRodney W. Grimes #define	ISO_SUSP_ALTNAME	0x0008
47df8bae1dSRodney W. Grimes #define	ISO_SUSP_CLINK		0x0010
48df8bae1dSRodney W. Grimes #define	ISO_SUSP_PLINK		0x0020
49df8bae1dSRodney W. Grimes #define	ISO_SUSP_RELDIR		0x0040
50df8bae1dSRodney W. Grimes #define	ISO_SUSP_TSTAMP		0x0080
51df8bae1dSRodney W. Grimes #define	ISO_SUSP_IDFLAG		0x0100
52df8bae1dSRodney W. Grimes #define	ISO_SUSP_EXTREF		0x0200
53df8bae1dSRodney W. Grimes #define	ISO_SUSP_CONT		0x0400
54df8bae1dSRodney W. Grimes #define	ISO_SUSP_OFFSET		0x0800
55df8bae1dSRodney W. Grimes #define	ISO_SUSP_STOP		0x1000
56df8bae1dSRodney W. Grimes #define	ISO_SUSP_UNKNOWN	0x8000
57df8bae1dSRodney W. Grimes 
5855cfad42SConrad Meyer #ifdef _KERNEL
59df8bae1dSRodney W. Grimes typedef struct {
60df8bae1dSRodney W. Grimes 	struct iso_node	*inop;
61df8bae1dSRodney W. Grimes 	int		fields;		/* interesting fields in this analysis */
62df8bae1dSRodney W. Grimes 	daddr_t		iso_ce_blk;	/* block of continuation area */
63df8bae1dSRodney W. Grimes 	off_t		iso_ce_off;	/* offset of continuation area */
64df8bae1dSRodney W. Grimes 	int		iso_ce_len;	/* length of continuation area */
65df8bae1dSRodney W. Grimes 	struct iso_mnt	*imp;		/* mount structure */
66*96e69c8eSMark Johnston 	ino_t		*inump;		/* inode number pointer */
67df8bae1dSRodney W. Grimes 	char		*outbuf;	/* name/symbolic link output area */
68df8bae1dSRodney W. Grimes 	u_short		*outlen;	/* length of above */
69df8bae1dSRodney W. Grimes 	u_short		maxlen;		/* maximum length of above */
70df8bae1dSRodney W. Grimes 	int		cont;		/* continuation of above */
71df8bae1dSRodney W. Grimes } ISO_RRIP_ANALYZE;
72df8bae1dSRodney W. Grimes 
739cf2c3e7SBruce Evans struct iso_directory_record;
749cf2c3e7SBruce Evans 
7589c9a483SAlfred Perlstein int cd9660_rrip_analyze(struct iso_directory_record *isodir,
7689c9a483SAlfred Perlstein 			    struct iso_node *inop, struct iso_mnt *imp);
7789c9a483SAlfred Perlstein int cd9660_rrip_getname(struct iso_directory_record *isodir,
78df8bae1dSRodney W. Grimes 			    char *outbuf, u_short *outlen,
79*96e69c8eSMark Johnston 			    ino_t *inump, struct iso_mnt *imp);
8089c9a483SAlfred Perlstein int cd9660_rrip_getsymname(struct iso_directory_record *isodir,
81df8bae1dSRodney W. Grimes 			       char *outbuf, u_short *outlen,
8289c9a483SAlfred Perlstein 			       struct iso_mnt *imp);
8389c9a483SAlfred Perlstein int cd9660_rrip_offset(struct iso_directory_record *isodir,
8489c9a483SAlfred Perlstein 			   struct iso_mnt *imp);
8555cfad42SConrad Meyer #endif /* _KERNEL */
86d33cdf16SEd Maste 
87d33cdf16SEd Maste #endif /* _ISOFS_CD9660_ISO_RRIP_H_ */
88