xref: /titanic_44/usr/src/cmd/ssh/include/sftp-common.h (revision 99ebb4ca412cb0a19d77a3899a87c055b9c30fa8)
1 /*	$OpenBSD: sftp-common.h,v 1.4 2002/09/11 22:41:50 djm Exp $	*/
2 
3 #ifndef	_SFTP_COMMON_H
4 #define	_SFTP_COMMON_H
5 
6 #pragma ident	"%Z%%M%	%I%	%E% SMI"
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 
13 /*
14  * Copyright (c) 2001 Markus Friedl.  All rights reserved.
15  * Copyright (c) 2001 Damien Miller.  All rights reserved.
16  *
17  * Redistribution and use in source and binary forms, with or without
18  * modification, are permitted provided that the following conditions
19  * are met:
20  * 1. Redistributions of source code must retain the above copyright
21  *    notice, this list of conditions and the following disclaimer.
22  * 2. Redistributions in binary form must reproduce the above copyright
23  *    notice, this list of conditions and the following disclaimer in the
24  *    documentation and/or other materials provided with the distribution.
25  *
26  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
27  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
28  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
29  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
30  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
31  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  */
37 
38 typedef struct Attrib Attrib;
39 
40 /* File attributes */
41 struct Attrib {
42 	u_int32_t	flags;
43 	u_int64_t	size;
44 	u_int32_t	uid;
45 	u_int32_t	gid;
46 	u_int32_t	perm;
47 	u_int32_t	atime;
48 	u_int32_t	mtime;
49 };
50 
51 void	 attrib_clear(Attrib *);
52 void	 stat_to_attrib(struct stat *, Attrib *);
53 void	 attrib_to_stat(Attrib *, struct stat *);
54 Attrib	*decode_attrib(Buffer *);
55 void	 encode_attrib(Buffer *, Attrib *);
56 char	*ls_file(char *, struct stat *, int);
57 
58 const char *fx2txt(int);
59 
60 #ifdef __cplusplus
61 }
62 #endif
63 
64 #endif /* _SFTP_COMMON_H */
65