scp_common.h File Reference

Definitions common to SCP client and server. More...

#include "ssh/ssh.h"

Go to the source code of this file.

Data Structures

struct  ScpDirective
 SCP directive parameters. More...
 

Macros

#define SCP_MODE_IXOTH   0x0001
 
#define SCP_MODE_IWOTH   0x0002
 
#define SCP_MODE_IROTH   0x0004
 
#define SCP_MODE_IRWXO   0x0007
 
#define SCP_MODE_IXGRP   0x0008
 
#define SCP_MODE_IWGRP   0x0010
 
#define SCP_MODE_IRGRP   0x0020
 
#define SCP_MODE_IRWXG   0x0038
 
#define SCP_MODE_IXUSR   0x0040
 
#define SCP_MODE_IWUSR   0x0080
 
#define SCP_MODE_IRUSR   0x0100
 
#define SCP_MODE_IRWXU   0x01C0
 

Enumerations

enum  ScpOpcode {
  SCP_OPCODE_OK = 0 , SCP_OPCODE_WARNING = 1 , SCP_OPCODE_ERROR = 2 , SCP_OPCODE_FILE = 67 ,
  SCP_OPCODE_DIR = 68 , SCP_OPCODE_END = 69 , SCP_OPCODE_TIME = 84
}
 SCP directive opcodes. More...
 

Functions

size_t scpFormatDirective (const ScpDirective *directive, char_t *buffer)
 Format SCP directive. More...
 
error_t scpParseDirective (const char_t *buffer, ScpDirective *directive)
 Parse SCP directive. More...
 

Detailed Description

Definitions common to SCP client and server.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2019-2024 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneSSH Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.0

Definition in file scp_common.h.

Macro Definition Documentation

◆ SCP_MODE_IRGRP

#define SCP_MODE_IRGRP   0x0020

Definition at line 44 of file scp_common.h.

◆ SCP_MODE_IROTH

#define SCP_MODE_IROTH   0x0004

Definition at line 40 of file scp_common.h.

◆ SCP_MODE_IRUSR

#define SCP_MODE_IRUSR   0x0100

Definition at line 48 of file scp_common.h.

◆ SCP_MODE_IRWXG

#define SCP_MODE_IRWXG   0x0038

Definition at line 45 of file scp_common.h.

◆ SCP_MODE_IRWXO

#define SCP_MODE_IRWXO   0x0007

Definition at line 41 of file scp_common.h.

◆ SCP_MODE_IRWXU

#define SCP_MODE_IRWXU   0x01C0

Definition at line 49 of file scp_common.h.

◆ SCP_MODE_IWGRP

#define SCP_MODE_IWGRP   0x0010

Definition at line 43 of file scp_common.h.

◆ SCP_MODE_IWOTH

#define SCP_MODE_IWOTH   0x0002

Definition at line 39 of file scp_common.h.

◆ SCP_MODE_IWUSR

#define SCP_MODE_IWUSR   0x0080

Definition at line 47 of file scp_common.h.

◆ SCP_MODE_IXGRP

#define SCP_MODE_IXGRP   0x0008

Definition at line 42 of file scp_common.h.

◆ SCP_MODE_IXOTH

#define SCP_MODE_IXOTH   0x0001

Definition at line 38 of file scp_common.h.

◆ SCP_MODE_IXUSR

#define SCP_MODE_IXUSR   0x0040

Definition at line 46 of file scp_common.h.

Enumeration Type Documentation

◆ ScpOpcode

enum ScpOpcode

SCP directive opcodes.

Enumerator
SCP_OPCODE_OK 
SCP_OPCODE_WARNING 
SCP_OPCODE_ERROR 
SCP_OPCODE_FILE 
SCP_OPCODE_DIR 
SCP_OPCODE_END 
SCP_OPCODE_TIME 

Definition at line 61 of file scp_common.h.

Function Documentation

◆ scpFormatDirective()

size_t scpFormatDirective ( const ScpDirective directive,
char_t buffer 
)

Format SCP directive.

Parameters
[in]directiveSCP directive parameters
[out]bufferBuffer where to format the directive line
Returns
Error code

Definition at line 48 of file scp_common.c.

◆ scpParseDirective()

error_t scpParseDirective ( const char_t buffer,
ScpDirective directive 
)

Parse SCP directive.

Parameters
[in]bufferPointer to the directive line
[out]directiveSCP directive parameters
Returns
Error code

Definition at line 127 of file scp_common.c.