sftp-common.h revision 157016
18097Sjkh/*	$OpenBSD: sftp-common.h,v 1.6 2006/01/02 01:20:31 djm Exp $	*/
28097Sjkh
38097Sjkh/*
48097Sjkh * Copyright (c) 2001 Markus Friedl.  All rights reserved.
58097Sjkh * Copyright (c) 2001 Damien Miller.  All rights reserved.
68097Sjkh *
716412Sjkh * Redistribution and use in source and binary forms, with or without
88097Sjkh * modification, are permitted provided that the following conditions
98097Sjkh * are met:
108097Sjkh * 1. Redistributions of source code must retain the above copyright
118097Sjkh *    notice, this list of conditions and the following disclaimer.
128097Sjkh * 2. Redistributions in binary form must reproduce the above copyright
138097Sjkh *    notice, this list of conditions and the following disclaimer in the
148097Sjkh *    documentation and/or other materials provided with the distribution.
158097Sjkh *
168881Srgrimes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
178881Srgrimes * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
188097Sjkh * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
198097Sjkh * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
208097Sjkh * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
218097Sjkh * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
228097Sjkh * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
238097Sjkh * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
248097Sjkh * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
258097Sjkh * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
268097Sjkh */
278097Sjkh
288097Sjkh/* Maximum packet that we are willing to send/accept */
298097Sjkh#define SFTP_MAX_MSG_LENGTH	(256 * 1024)
308097Sjkh
318097Sjkhtypedef struct Attrib Attrib;
328097Sjkh
338097Sjkh/* File attributes */
348097Sjkhstruct Attrib {
358097Sjkh	u_int32_t	flags;
368097Sjkh	u_int64_t	size;
378097Sjkh	u_int32_t	uid;
388097Sjkh	u_int32_t	gid;
398097Sjkh	u_int32_t	perm;
408097Sjkh	u_int32_t	atime;
418097Sjkh	u_int32_t	mtime;
428097Sjkh};
438097Sjkh
448097Sjkhvoid	 attrib_clear(Attrib *);
4512661Spetervoid	 stat_to_attrib(const struct stat *, Attrib *);
4612661Spetervoid	 attrib_to_stat(const Attrib *, struct stat *);
478281SjkhAttrib	*decode_attrib(Buffer *);
488405Sjkhvoid	 encode_attrib(Buffer *, const Attrib *);
4912661Speterchar	*ls_file(const char *, const struct stat *, int);
508097Sjkh
518208Sjkhconst char *fx2txt(int);
528208Sjkh