FakeSFTP/src/constants.rs

69 lines
2.8 KiB
Rust

pub const SSH_FXP_INIT: u8 = 1;
pub const SSH_FXP_VERSION: u8 = 2;
pub const SSH_FXP_OPEN: u8 = 3;
pub const SSH_FXP_CLOSE: u8 = 4;
pub const SSH_FXP_READ: u8 = 5;
pub const SSH_FXP_WRITE: u8 = 6;
pub const SSH_FXP_LSTAT: u8 = 7;
pub const SSH_FXP_FSTAT: u8 = 8;
pub const SSH_FXP_SETSTAT: u8 = 9;
pub const SSH_FXP_FSETSTAT: u8 = 10;
pub const SSH_FXP_OPENDIR: u8 = 11;
pub const SSH_FXP_READDIR: u8 = 12;
pub const SSH_FXP_REMOVE: u8 = 13;
pub const SSH_FXP_MKDIR: u8 = 14;
pub const SSH_FXP_RMDIR: u8 = 15;
pub const SSH_FXP_REALPATH: u8 = 16;
pub const SSH_FXP_STAT: u8 = 17;
pub const SSH_FXP_RENAME: u8 = 18;
pub const SSH_FXP_READLINK: u8 = 19;
pub const SSH_FXP_SYMLINK: u8 = 20;
pub const SSH_FXP_STATUS: u8 = 101;
pub const SSH_FXP_HANDLE: u8 = 102;
pub const SSH_FXP_DATA: u8 = 103;
pub const SSH_FXP_NAME: u8 = 104;
pub const SSH_FXP_ATTRS: u8 = 105;
pub const SSH_FXP_EXTENDED: u8 = 200;
pub const SSH_FXP_EXTENDED_REPLY: u8 = 201;
// Status codes.
pub const SSH_FX_OK: u32 = 0;
pub const SSH_FX_EOF: u32 = 1;
pub const SSH_FX_NO_SUCH_FILE: u32 = 2;
pub const SSH_FX_PERMISSION_DENIED: u32 = 3;
pub const SSH_FX_FAILURE: u32 = 4;
pub const SSH_FX_BAD_MESSAGE: u32 = 5;
pub const SSH_FX_NO_CONNECTION: u32 = 6;
pub const SSH_FX_CONNECTION_LOST: u32 = 7;
pub const SSH_FX_OP_UNSUPPORTED: u32 = 8;
// Attrs.
pub const SSH_FILEXFER_ATTR_SIZE: u32 = 0x1;
pub const SSH_FILEXFER_ATTR_UIDGID: u32 = 0x2;
pub const SSH_FILEXFER_ATTR_PERMISSIONS: u32 = 0x4;
pub const SSH_FILEXFER_ATTR_ACMODTIME: u32 = 0x8;
pub const SSH_FILEXFER_ATTR_EXTENDED: u32 = 0x80000000;
// Mode interpretation.
pub const S_IFIFO: u32 = 0o10000; /* named pipe (fifo) */
pub const S_IFCHR: u32 = 0o20000; /* character special */
pub const S_IFDIR: u32 = 0o40000; /* directory */
pub const S_IFBLK: u32 = 0o60000; /* block special */
pub const S_IFREG: u32 = 0o100000; /* regular */
pub const S_IFLNK: u32 = 0o120000; /* symbolic link */
pub const S_IFSOCK: u32 = 0o140000; /* socket */
// Permission flags.
pub const S_ISUID: u32 = 0o4000; /* set user id on execution */
pub const S_ISGID: u32 = 0o2000; /* set group id on execution */
pub const S_ISTXT: u32 = 0o1000; /* sticky bit */
pub const S_IRWXU: u32 = 0o700; /* RWX mask for owner */
pub const S_IRUSR: u32 = 0o400; /* R for owner */
pub const S_IWUSR: u32 = 0o200; /* W for owner */
pub const S_IXUSR: u32 = 0o100; /* X for owner */
pub const S_IRWXG: u32 = 0o70; /* RWX mask for group */
pub const S_IRGRP: u32 = 0o40; /* R for group */
pub const S_IWGRP: u32 = 0o20; /* W for group */
pub const S_IXGRP: u32 = 0o10; /* X for group */
pub const S_IRWXO: u32 = 0o7; /* RWX mask for other */
pub const S_IROTH: u32 = 0o4; /* R for other */
pub const S_IWOTH: u32 = 0o2; /* W for other */
pub const S_IXOTH: u32 = 0o1; /* X for other */
pub const S_ISVTX: u32 = 0o1000; /* save swapped text even after use */