1295367Sdes/* $OpenBSD: sftp-common.h,v 1.12 2015/01/14 13:54:13 djm Exp $ */ 276259Sgreen 376259Sgreen/* 476259Sgreen * Copyright (c) 2001 Markus Friedl. All rights reserved. 576259Sgreen * Copyright (c) 2001 Damien Miller. All rights reserved. 676259Sgreen * 776259Sgreen * Redistribution and use in source and binary forms, with or without 876259Sgreen * modification, are permitted provided that the following conditions 976259Sgreen * are met: 1076259Sgreen * 1. Redistributions of source code must retain the above copyright 1176259Sgreen * notice, this list of conditions and the following disclaimer. 1276259Sgreen * 2. Redistributions in binary form must reproduce the above copyright 1376259Sgreen * notice, this list of conditions and the following disclaimer in the 1476259Sgreen * documentation and/or other materials provided with the distribution. 1576259Sgreen * 1676259Sgreen * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 1776259Sgreen * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 1876259Sgreen * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1976259Sgreen * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 2076259Sgreen * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 2176259Sgreen * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2276259Sgreen * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2376259Sgreen * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2476259Sgreen * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 2576259Sgreen * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2676259Sgreen */ 2776259Sgreen 28157016Sdes/* Maximum packet that we are willing to send/accept */ 29157016Sdes#define SFTP_MAX_MSG_LENGTH (256 * 1024) 30157016Sdes 31295367Sdesstruct sshbuf; 3276259Sgreentypedef struct Attrib Attrib; 3376259Sgreen 3476259Sgreen/* File attributes */ 3576259Sgreenstruct Attrib { 3676259Sgreen u_int32_t flags; 3776259Sgreen u_int64_t size; 3876259Sgreen u_int32_t uid; 3976259Sgreen u_int32_t gid; 4076259Sgreen u_int32_t perm; 4176259Sgreen u_int32_t atime; 4276259Sgreen u_int32_t mtime; 4376259Sgreen}; 4476259Sgreen 4592555Sdesvoid attrib_clear(Attrib *); 46126274Sdesvoid stat_to_attrib(const struct stat *, Attrib *); 47126274Sdesvoid attrib_to_stat(const Attrib *, struct stat *); 48295367Sdesint decode_attrib(struct sshbuf *, Attrib *); 49295367Sdesint encode_attrib(struct sshbuf *, const Attrib *); 50204917Sdeschar *ls_file(const char *, const struct stat *, int, int); 5176259Sgreen 5292555Sdesconst char *fx2txt(int); 53