mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 08:46:45 +00:00
Update libssh2 to 1.11.1
This commit is contained in:
parent
58ef6f6dac
commit
2bc341de52
118 changed files with 11071 additions and 4234 deletions
|
|
@ -18,7 +18,8 @@ additional procedures are provided for string transcoding (see below). No
|
|||
wrappers to standard procedures are provided: however, nested calls to
|
||||
transcoding procedures may be used.
|
||||
|
||||
Crypto API is provided by the IBM QC3 API library. It supports RSA, but not DSA.
|
||||
Crypto API is provided by the IBM QC3 API library. It supports RSA and EC,
|
||||
but not DSA.
|
||||
|
||||
|
||||
Standard compilation environment does support neither autotools nor make;
|
||||
|
|
@ -36,23 +37,31 @@ Compiling on OS/400:
|
|||
archive extraction. Do not ask questions about these subjects if you're not
|
||||
familiar with.
|
||||
|
||||
_ As a prerequisite, QADRT development environment must be installed.
|
||||
_ Install the libssh2 sources directory in IFS.
|
||||
_ As a prerequisite, QADRT development environment >= 20211112 must be
|
||||
installed.
|
||||
For more information on downloading and installing the QADRT development kit,
|
||||
please see https://www.ibm.com/support/pages/node/6258183
|
||||
_ If data compression has to be supported, ZLIB development environment must
|
||||
be installed.
|
||||
_ Install the libssh2 sources directory in IFS. Do NOT install it in the
|
||||
installation target directory (which defaults to /libssh2).
|
||||
_ Enter shell (QSH). You may need to change the LANG environment variable
|
||||
to be in phase with the libssh2 source files CCSID.
|
||||
_ Change current directory to the libssh2 sources installation directory
|
||||
_ Change current directory to os400
|
||||
_ Edit file iniscript.sh. You may want to change tunable configuration
|
||||
parameters, like debug info generation, optimisation level, listing option,
|
||||
target library, zlib availability and location, etc.
|
||||
- If you want to change the default configuration parameters like debug info
|
||||
generation, optimization level, listing option, target library, zlib
|
||||
availability and location, etc., copy file config400.default to
|
||||
config400.override and edit the latter. Do not edit the original default file
|
||||
as it might be overwritten by a subsequent source installation.
|
||||
_ Copy any file in the current directory to makelog (i.e.:
|
||||
cp initscript.sh makelog): this is intended to create the makelog file with
|
||||
an ASCII CCSID!
|
||||
_ Enter the command "sh make.sh > makelog 2>&1'
|
||||
_ Examine the makelog file to check for compilation errors.
|
||||
|
||||
Leaving file initscript.sh unchanged, this will produce the following OS/400
|
||||
objects:
|
||||
Without configuration parameters override, this will produce the following
|
||||
OS/400 objects:
|
||||
_ Library LIBSSH2. All other objects will be stored in this library.
|
||||
_ Modules for all libssh2 units.
|
||||
_ Binding directory LIBSSH2_A, to be used at calling program link time for
|
||||
|
|
@ -123,7 +132,8 @@ char * libssh2_to_ccsid(LIBSSH2_SESSION *session,
|
|||
size_t *outlen);
|
||||
|
||||
where:
|
||||
session is a libssh2 session used for memory allocation.
|
||||
session is a libssh2 session used for memory allocation or NULL for
|
||||
global allocation scheme.
|
||||
cache is the address of a string cache.
|
||||
ccsid is the external (i.e.: non libssh2) coded character set id.
|
||||
65535 means no conversion and 0 means the current job's CCSID.
|
||||
|
|
@ -145,6 +155,8 @@ or NULL if an error occurred. In addition, the variable pointed by outlen
|
|||
receives the effective byte length of the (cached) translated string, or -1
|
||||
in case of error.
|
||||
|
||||
Please take care to never mix different sessions into the same cache.
|
||||
|
||||
|
||||
|
||||
ILE/RPG support:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2015 Patrick Monnerat, D+H <patrick.monnerat@dh.com>
|
||||
* Copyright (C) Patrick Monnerat <patrick@monnerat.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms,
|
||||
|
|
@ -34,6 +34,8 @@
|
|||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
/* Character encoding wrappers. */
|
||||
|
|
@ -46,6 +48,7 @@
|
|||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
|
||||
|
|
@ -56,6 +59,11 @@
|
|||
|
||||
#define OFFSET_OF(t, f) ((size_t) ((char *) &((t *) 0)->f - (char *) 0))
|
||||
|
||||
#define ALLOC(s, sz) ((s)? LIBSSH2_ALLOC((s), (sz)): malloc(sz))
|
||||
#define REALLOC(s, p, sz) ((s)? LIBSSH2_REALLOC((s), (p), (sz)): \
|
||||
realloc((p), (sz)))
|
||||
#define FREE(s, p) ((s)? LIBSSH2_FREE((s), (p)): free(p))
|
||||
|
||||
|
||||
struct _libssh2_string_cache {
|
||||
libssh2_string_cache * next;
|
||||
|
|
@ -80,7 +88,7 @@ terminator_size(unsigned short ccsid)
|
|||
/* Return the null-terminator size for the given CCSID. */
|
||||
|
||||
/* Fast check usual CCSIDs. */
|
||||
switch (ccsid) {
|
||||
switch(ccsid) {
|
||||
case CCSID_UTF8:
|
||||
case 0: /* Job CCSID is SBCS EBCDIC. */
|
||||
return 1;
|
||||
|
|
@ -90,19 +98,19 @@ terminator_size(unsigned short ccsid)
|
|||
|
||||
/* Convert an UTF-8 NUL to the target CCSID: use the converted size as
|
||||
result. */
|
||||
memset((void *) &outcode, 0, sizeof outcode);
|
||||
memset((void *) &outcode, 0, sizeof(outcode));
|
||||
outcode.CCSID = ccsid;
|
||||
cd = QtqIconvOpen(&outcode, (QtqCode_T *) &utf8code);
|
||||
if (cd.return_value == -1)
|
||||
if(cd.return_value == -1)
|
||||
return -1;
|
||||
inp = "";
|
||||
ilen = 1;
|
||||
outp = buf;
|
||||
olen = sizeof buf;
|
||||
olen = sizeof(buf);
|
||||
iconv(cd, &inp, &ilen, &outp, &olen);
|
||||
iconv_close(cd);
|
||||
olen = sizeof buf - olen;
|
||||
return olen? olen: -1;
|
||||
olen = sizeof(buf - olen);
|
||||
return olen ? olen : -1;
|
||||
}
|
||||
|
||||
static char *
|
||||
|
|
@ -124,66 +132,66 @@ convert_ccsid(LIBSSH2_SESSION *session, libssh2_string_cache **cache,
|
|||
QtqCode_T outcode;
|
||||
iconv_t cd;
|
||||
|
||||
if (!instring) {
|
||||
if (outlen)
|
||||
if(!instring) {
|
||||
if(outlen)
|
||||
*outlen = 0;
|
||||
return NULL;
|
||||
}
|
||||
if (outlen)
|
||||
if(outlen)
|
||||
*outlen = -1;
|
||||
if (!session || !cache)
|
||||
if(!cache)
|
||||
return NULL;
|
||||
|
||||
/* Get terminator size. */
|
||||
termsize = terminator_size(outccsid);
|
||||
if (termsize < 0)
|
||||
if(termsize < 0)
|
||||
return NULL;
|
||||
|
||||
/* Prepare conversion parameters. */
|
||||
memset((void *) &incode, 0, sizeof incode);
|
||||
memset((void *) &outcode, 0, sizeof outcode);
|
||||
memset((void *) &incode, 0, sizeof(incode));
|
||||
memset((void *) &outcode, 0, sizeof(outcode));
|
||||
incode.CCSID = inccsid;
|
||||
outcode.CCSID = outccsid;
|
||||
curlen = OFFSET_OF(libssh2_string_cache, string);
|
||||
inp = (char *) instring;
|
||||
ilen = inlen;
|
||||
buflen = inlen + curlen;
|
||||
if (inlen < 0) {
|
||||
if(inlen < 0) {
|
||||
incode.length_option = 1;
|
||||
buflen = STRING_GRANULE;
|
||||
ilen = 0;
|
||||
}
|
||||
|
||||
/* Allocate output string buffer and open conversion descriptor. */
|
||||
dst = LIBSSH2_ALLOC(session, buflen + termsize);
|
||||
if (!dst)
|
||||
dst = ALLOC(session, buflen + termsize);
|
||||
if(!dst)
|
||||
return NULL;
|
||||
cd = QtqIconvOpen(&outcode, &incode);
|
||||
if (cd.return_value == -1) {
|
||||
LIBSSH2_FREE(session, (char *) dst);
|
||||
if(cd.return_value == -1) {
|
||||
FREE(session, dst);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Convert string. */
|
||||
for (;;) {
|
||||
for(;;) {
|
||||
outp = dst + curlen;
|
||||
olen = buflen - curlen;
|
||||
i = iconv(cd, &inp, &ilen, &outp, &olen);
|
||||
if (inlen < 0 && olen == buflen - curlen) {
|
||||
if(inlen < 0 && olen == buflen - curlen) {
|
||||
/* Special case: converted 0-length (sub)strings do not store the
|
||||
terminator. */
|
||||
if (termsize) {
|
||||
if(termsize) {
|
||||
memset(outp, 0, termsize);
|
||||
olen -= termsize;
|
||||
}
|
||||
}
|
||||
curlen = buflen - olen;
|
||||
if (i >= 0 || errno != E2BIG)
|
||||
if(i >= 0 || errno != E2BIG)
|
||||
break;
|
||||
/* Must expand buffer. */
|
||||
buflen += STRING_GRANULE;
|
||||
outp = LIBSSH2_REALLOC(session, dst, buflen + termsize);
|
||||
if (!outp)
|
||||
outp = REALLOC(session, dst, buflen + termsize);
|
||||
if(!outp)
|
||||
break;
|
||||
dst = outp;
|
||||
}
|
||||
|
|
@ -191,20 +199,20 @@ convert_ccsid(LIBSSH2_SESSION *session, libssh2_string_cache **cache,
|
|||
iconv_close(cd);
|
||||
|
||||
/* Check for error. */
|
||||
if (i < 0 || !outp) {
|
||||
LIBSSH2_FREE(session, dst);
|
||||
if(i < 0 || !outp) {
|
||||
FREE(session, dst);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Process terminator. */
|
||||
if (inlen < 0)
|
||||
if(inlen < 0)
|
||||
curlen -= termsize;
|
||||
else if (termsize)
|
||||
else if(termsize)
|
||||
memset(dst + curlen, 0, termsize);
|
||||
|
||||
/* Shorten buffer if possible. */
|
||||
if (curlen < buflen)
|
||||
dst = LIBSSH2_REALLOC(session, dst, curlen + termsize);
|
||||
if(curlen < buflen)
|
||||
dst = REALLOC(session, dst, curlen + termsize);
|
||||
|
||||
/* Link to cache. */
|
||||
outstring = (libssh2_string_cache *) dst;
|
||||
|
|
@ -212,7 +220,7 @@ convert_ccsid(LIBSSH2_SESSION *session, libssh2_string_cache **cache,
|
|||
*cache = outstring;
|
||||
|
||||
/* Return length if required. */
|
||||
if (outlen)
|
||||
if(outlen)
|
||||
*outlen = curlen - OFFSET_OF(libssh2_string_cache, string);
|
||||
|
||||
return outstring->string;
|
||||
|
|
@ -242,10 +250,10 @@ libssh2_release_string_cache(LIBSSH2_SESSION *session,
|
|||
{
|
||||
libssh2_string_cache *p;
|
||||
|
||||
if (session && cache)
|
||||
while ((p = *cache)) {
|
||||
if(cache)
|
||||
while((p = *cache)) {
|
||||
*cache = p->next;
|
||||
LIBSSH2_FREE(session, (char *) p);
|
||||
FREE(session, (char *) p);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
28
libssh2/os400/config400.default
Normal file
28
libssh2/os400/config400.default
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#!/bin/sh
|
||||
# Copyright (C) The libssh2 project and its contributors.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
################################################################################
|
||||
|
||||
# Tunable configuration parameters.
|
||||
|
||||
setenv TARGETLIB 'LIBSSH2' # Target OS/400 program library.
|
||||
setenv STATBNDDIR 'LIBSSH2_A' # Static binding directory.
|
||||
setenv DYNBNDDIR 'LIBSSH2' # Dynamic binding directory.
|
||||
setenv SRVPGM "LIBSSH2.${SONAME}" # Service program.
|
||||
setenv TGTCCSID '500' # Target CCSID of objects.
|
||||
setenv DEBUG '*ALL' # Debug level.
|
||||
setenv OPTIMIZE '10' # Optimisation level
|
||||
setenv OUTPUT '*NONE' # Compilation output option.
|
||||
setenv TGTRLS '*CURRENT' # Target OS release.
|
||||
setenv IFSDIR '/libssh2' # Installation IFS directory.
|
||||
setenv QADRTDIR '/QIBM/ProdData/qadrt' # QADRT IFS directory.
|
||||
|
||||
setenv WITH_MD5 'yes' # enable MD5 support.
|
||||
|
||||
# Define ZLIB availability and locations.
|
||||
|
||||
setenv WITH_ZLIB 0 # Define to 1 to enable.
|
||||
setenv ZLIB_INCLUDE '/zlib/include' # ZLIB include IFS directory.
|
||||
setenv ZLIB_LIB 'ZLIB' # ZLIB library.
|
||||
setenv ZLIB_BNDDIR 'ZLIB_A' # ZLIB binding directory.
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2015 Patrick Monnerat, D+H <patrick.monnerat@dh.com>
|
||||
* Copyright (C) Patrick Monnerat <patrick@monnerat.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms,
|
||||
|
|
@ -34,6 +34,8 @@
|
|||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifndef LIBSSH2_ALLOCA_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2023 Patrick Monnerat <patrick@monnerat.net>
|
||||
* Copyright (C) Patrick Monnerat <patrick@monnerat.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms,
|
||||
|
|
@ -34,6 +34,8 @@
|
|||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifndef LIBSSH2_ASSERT_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2015 Patrick Monnerat, D+H <patrick.monnerat@dh.com>
|
||||
* Copyright (C) Patrick Monnerat <patrick@monnerat.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms,
|
||||
|
|
@ -34,6 +34,8 @@
|
|||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifndef LIBSSH2_SYS_SOCKET_H
|
||||
|
|
@ -64,7 +66,7 @@
|
|||
#endif
|
||||
|
||||
extern int _libssh2_os400_connect(int sd,
|
||||
struct sockaddr * destaddr, int addrlen);
|
||||
struct sockaddr *destaddr, int addrlen);
|
||||
|
||||
#ifndef LIBSSH2_DISABLE_QADRT_EXT
|
||||
#define connect(sd, addr, len) _libssh2_os400_connect((sd), (addr), (len))
|
||||
|
|
|
|||
100
libssh2/os400/initscript.sh
Normal file → Executable file
100
libssh2/os400/initscript.sh
Normal file → Executable file
|
|
@ -1,19 +1,20 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Copyright (C) The libssh2 project and its contributors.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
setenv()
|
||||
|
||||
{
|
||||
# Define and export.
|
||||
|
||||
eval ${1}="${2}"
|
||||
export ${1}
|
||||
eval "${1}=${2}"
|
||||
export "${1?}"
|
||||
}
|
||||
|
||||
|
||||
case "${SCRIPTDIR}" in
|
||||
/*) ;;
|
||||
*) SCRIPTDIR="`pwd`/${SCRIPTDIR}"
|
||||
*) SCRIPTDIR="$(pwd)/${SCRIPTDIR}"
|
||||
esac
|
||||
|
||||
while true
|
||||
|
|
@ -25,64 +26,43 @@ done
|
|||
|
||||
# The script directory is supposed to be in $TOPDIR/os400.
|
||||
|
||||
TOPDIR=`dirname "${SCRIPTDIR}"`
|
||||
TOPDIR=$(dirname "${SCRIPTDIR}")
|
||||
export SCRIPTDIR TOPDIR
|
||||
|
||||
# Extract the SONAME from the library makefile.
|
||||
|
||||
SONAME=`sed -e '/^VERSION=/!d' -e 's/^.* \([0-9]*\):.*$/\1/' -e 'q' \
|
||||
< "${TOPDIR}/src/Makefile.am"`
|
||||
SONAME=$(sed -e '/^VERSION=/!d' \
|
||||
-e 's/^.* \([0-9]*\):.*$/\1/' -e 'q' \
|
||||
< "${TOPDIR}/src/Makefile.am")
|
||||
export SONAME
|
||||
|
||||
# Get OS/400 configuration parameters.
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Tunable configuration parameters.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
setenv TARGETLIB 'LIBSSH2' # Target OS/400 program library.
|
||||
setenv STATBNDDIR 'LIBSSH2_A' # Static binding directory.
|
||||
setenv DYNBNDDIR 'LIBSSH2' # Dynamic binding directory.
|
||||
setenv SRVPGM "LIBSSH2.${SONAME}" # Service program.
|
||||
setenv TGTCCSID '500' # Target CCSID of objects.
|
||||
setenv DEBUG '*ALL' # Debug level.
|
||||
setenv OPTIMIZE '10' # Optimisation level
|
||||
setenv OUTPUT '*NONE' # Compilation output option.
|
||||
setenv TGTRLS 'V7R3M0' # Target OS release.
|
||||
setenv IFSDIR '/libssh2' # Installation IFS directory.
|
||||
setenv QADRTDIR '/QIBM/ProdData/qadrt' # QADRT IFS directory.
|
||||
|
||||
# Define ZLIB availability and locations.
|
||||
|
||||
setenv WITH_ZLIB 0 # Define to 1 to enable.
|
||||
setenv ZLIB_INCLUDE '/zlib/include' # ZLIB include IFS directory.
|
||||
setenv ZLIB_LIB 'ZLIB' # ZLIB library.
|
||||
setenv ZLIB_BNDDIR 'ZLIB_A' # ZLIB binding directory.
|
||||
|
||||
|
||||
################################################################################
|
||||
. "${SCRIPTDIR}/config400.default"
|
||||
if [ -f "${SCRIPTDIR}/config400.override" ]
|
||||
then . "${SCRIPTDIR}/config400.override"
|
||||
fi
|
||||
|
||||
# Need to get the version definitions.
|
||||
|
||||
LIBSSH2_VERSION=`grep '^#define *LIBSSH2_VERSION ' \
|
||||
LIBSSH2_VERSION=$(grep '^#define *LIBSSH2_VERSION ' \
|
||||
"${TOPDIR}/include/libssh2.h" |
|
||||
sed 's/.*"\(.*\)".*/\1/'`
|
||||
LIBSSH2_VERSION_MAJOR=`grep '^#define *LIBSSH2_VERSION_MAJOR ' \
|
||||
sed 's/.*"\(.*\)".*/\1/')
|
||||
LIBSSH2_VERSION_MAJOR=$(grep '^#define *LIBSSH2_VERSION_MAJOR ' \
|
||||
"${TOPDIR}/include/libssh2.h" |
|
||||
sed 's/^#define *LIBSSH2_VERSION_MAJOR *\([^ ]*\).*/\1/'`
|
||||
LIBSSH2_VERSION_MINOR=`grep '^#define *LIBSSH2_VERSION_MINOR ' \
|
||||
sed 's/^#define *LIBSSH2_VERSION_MAJOR *\([^ ]*\).*/\1/')
|
||||
LIBSSH2_VERSION_MINOR=$(grep '^#define *LIBSSH2_VERSION_MINOR ' \
|
||||
"${TOPDIR}/include/libssh2.h" |
|
||||
sed 's/^#define *LIBSSH2_VERSION_MINOR *\([^ ]*\).*/\1/'`
|
||||
LIBSSH2_VERSION_PATCH=`grep '^#define *LIBSSH2_VERSION_PATCH ' \
|
||||
sed 's/^#define *LIBSSH2_VERSION_MINOR *\([^ ]*\).*/\1/')
|
||||
LIBSSH2_VERSION_PATCH=$(grep '^#define *LIBSSH2_VERSION_PATCH ' \
|
||||
"${TOPDIR}/include/libssh2.h" |
|
||||
sed 's/^#define *LIBSSH2_VERSION_PATCH *\([^ ]*\).*/\1/'`
|
||||
LIBSSH2_VERSION_NUM=`grep '^#define *LIBSSH2_VERSION_NUM ' \
|
||||
sed 's/^#define *LIBSSH2_VERSION_PATCH *\([^ ]*\).*/\1/')
|
||||
LIBSSH2_VERSION_NUM=$(grep '^#define *LIBSSH2_VERSION_NUM ' \
|
||||
"${TOPDIR}/include/libssh2.h" |
|
||||
sed 's/^#define *LIBSSH2_VERSION_NUM *0x\([^ ]*\).*/\1/'`
|
||||
LIBSSH2_TIMESTAMP=`grep '^#define *LIBSSH2_TIMESTAMP ' \
|
||||
sed 's/^#define *LIBSSH2_VERSION_NUM *0x\([^ ]*\).*/\1/')
|
||||
LIBSSH2_TIMESTAMP=$(grep '^#define *LIBSSH2_TIMESTAMP ' \
|
||||
"${TOPDIR}/include/libssh2.h" |
|
||||
sed 's/.*"\(.*\)".*/\1/'`
|
||||
sed 's/.*"\(.*\)".*/\1/')
|
||||
export LIBSSH2_VERSION
|
||||
export LIBSSH2_VERSION_MAJOR LIBSSH2_VERSION_MINOR LIBSSH2_VERSION_PATCH
|
||||
export LIBSSH2_VERSION_NUM LIBSSH2_TIMESTAMP
|
||||
|
|
@ -113,7 +93,8 @@ action_needed()
|
|||
|
||||
{
|
||||
[ ! -e "${1}" ] && return 0
|
||||
[ "${2}" ] || return 1
|
||||
[ -n "${2}" ] || return 1
|
||||
# shellcheck disable=SC3013
|
||||
[ "${1}" -ot "${2}" ] && return 0
|
||||
return 1
|
||||
}
|
||||
|
|
@ -130,7 +111,7 @@ canonicalize_path()
|
|||
{
|
||||
if expr "${1}" : '^/' > /dev/null
|
||||
then P="${1}"
|
||||
else P="`pwd`/${1}"
|
||||
else P="$(pwd)/${1}"
|
||||
fi
|
||||
|
||||
R=
|
||||
|
|
@ -141,7 +122,7 @@ canonicalize_path()
|
|||
do IFS="${IFSSAVE}"
|
||||
case "${C}" in
|
||||
.) ;;
|
||||
..) R=`expr "${R}" : '^\(.*/\)..*'`
|
||||
..) R="$(expr "${R}" : '^\(.*/\)..*')"
|
||||
;;
|
||||
?*) R="${R}${C}/"
|
||||
;;
|
||||
|
|
@ -150,7 +131,7 @@ canonicalize_path()
|
|||
done
|
||||
|
||||
IFS="${IFSSAVE}"
|
||||
echo "/`expr "${R}" : '^\(.*\)/'`"
|
||||
echo "/$(expr "${R}" : '^\(.*\)/')"
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -166,7 +147,7 @@ make_module()
|
|||
MODULES="${MODULES} ${1}"
|
||||
MODIFSNAME="${LIBIFSNAME}/${1}.MODULE"
|
||||
action_needed "${MODIFSNAME}" "${2}" || return 0;
|
||||
SRCDIR=`dirname \`canonicalize_path "${2}"\``
|
||||
SRCDIR="$(dirname "$(canonicalize_path "${2}")")"
|
||||
|
||||
# #pragma convert has to be in the source file itself, i.e.
|
||||
# putting it in an include file makes it only active
|
||||
|
|
@ -174,10 +155,12 @@ make_module()
|
|||
# Thus we build a temporary file with the pragma prepended to
|
||||
# the source file and we compile that temporary file.
|
||||
|
||||
echo "#line 1 \"${2}\"" > __tmpsrcf.c
|
||||
echo "#pragma convert(819)" >> __tmpsrcf.c
|
||||
echo "#line 1" >> __tmpsrcf.c
|
||||
cat "${2}" >> __tmpsrcf.c
|
||||
{
|
||||
echo "#line 1 \"${2}\""
|
||||
echo "#pragma convert(819)"
|
||||
echo "#line 1"
|
||||
cat "${2}"
|
||||
} > __tmpsrcf.c
|
||||
CMD="CRTCMOD MODULE(${TARGETLIB}/${1}) SRCSTMF('__tmpsrcf.c')"
|
||||
# CMD="${CMD} SYSIFCOPT(*IFS64IO) OPTION(*INCDIRFIRST *SHOWINC *SHOWSYS)"
|
||||
CMD="${CMD} SYSIFCOPT(*IFS64IO) OPTION(*INCDIRFIRST)"
|
||||
|
|
@ -202,12 +185,17 @@ make_module()
|
|||
then DEFINES="${DEFINES} LIBSSH2_HAVE_ZLIB"
|
||||
fi
|
||||
|
||||
if [ "${DEFINES}" ]
|
||||
if [ "${WITH_MD5}" != 'yes' ]
|
||||
then DEFINES="${DEFINES} LIBSSH2_NO_MD5"
|
||||
fi
|
||||
|
||||
if [ -n "${DEFINES}" ]
|
||||
then CMD="${CMD} DEFINE(${DEFINES})"
|
||||
fi
|
||||
|
||||
system "${CMD}"
|
||||
rm -f __tmpsrcf.c
|
||||
# shellcheck disable=SC2034
|
||||
LINK=YES
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2015 Patrick Monnerat, D+H <patrick.monnerat@dh.com>
|
||||
* Copyright (C) Patrick Monnerat <patrick@monnerat.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms,
|
||||
|
|
@ -34,6 +34,8 @@
|
|||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
/* CCSID conversion support. */
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2015 Patrick Monnerat, D+H <patrick.monnerat@dh.com>
|
||||
* Copyright (C) Patrick Monnerat <patrick@monnerat.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms,
|
||||
|
|
@ -34,6 +34,8 @@
|
|||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifndef LIBSSH2_CONFIG_H
|
||||
|
|
@ -89,9 +91,6 @@
|
|||
/* use SO_NONBLOCK for non-blocking sockets */
|
||||
#undef HAVE_SO_NONBLOCK
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdio.h> header file. */
|
||||
#define HAVE_STDIO_H 1
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
* Copyright (c) 2015 Patrick Monnerat, D+H <patrick.monnerat@dh.com>
|
||||
* Copyright (C) Patrick Monnerat <patrick@monnerat.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms,
|
||||
|
|
@ -33,12 +33,14 @@
|
|||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
/if not defined(LIBSSH2_H_)
|
||||
/define LIBSSH2_H_
|
||||
|
||||
d LIBSSH2_COPYRIGHT...
|
||||
d c '2004-2015 The libssh2 project and +
|
||||
d c 'The libssh2 project and +
|
||||
d its contributors.'
|
||||
|
||||
* We use underscore instead of dash when appending DEV in dev versions
|
||||
|
|
@ -110,8 +112,12 @@
|
|||
|
||||
d libssh2_uint8_t...
|
||||
d s 3u 0 based(######typedef######)
|
||||
d libssh2_uint16_t...
|
||||
d s 5u 0 based(######typedef######)
|
||||
d libssh2_uint32_t...
|
||||
d s 10u 0 based(######typedef######)
|
||||
d libssh2_int32_t...
|
||||
d s 10i 0 based(######typedef######)
|
||||
d libssh2_uint64_t...
|
||||
d s 20u 0 based(######typedef######)
|
||||
d libssh2_int64_t...
|
||||
|
|
@ -121,6 +127,10 @@
|
|||
d s 10i 0 based(######typedef######)
|
||||
d LIBSSH2_INVALID_SOCKET...
|
||||
d c -1
|
||||
d LIBSSH2_SOCKET_CLOSE...
|
||||
d pr extproc('close')
|
||||
d like(libssh2_Cint)
|
||||
d s value like(libssh2_socket_t)
|
||||
|
||||
d libssh2_mode_t s 10u 0 based(######typedef######)
|
||||
d libssh2_ino_t s 10u 0 based(######typedef######)
|
||||
|
|
@ -163,9 +173,9 @@
|
|||
|
||||
* Part of every banner, user specified or not.
|
||||
d LIBSSH2_SSH_BANNER...
|
||||
d c 'SSH-2.0-libssh2_1.6.1_DEV'
|
||||
d c 'SSH-2.0-libssh2_@LIBSSH2_VERSION@'
|
||||
d LIBSSH2_SSH_DEFAULT_BANNER...
|
||||
d c 'SSH-2.0-libssh2_1.6.1_DEV'
|
||||
d c 'SSH-2.0-libssh2_@LIBSSH2_VERSION@'
|
||||
|
||||
* Default generate and safe prime sizes for
|
||||
* diffie-hellman-group-exchange-sha1.
|
||||
|
|
@ -211,8 +221,8 @@
|
|||
d LIBSSH2_USERAUTH_KBDINT_PROMPT...
|
||||
d ds based(######typedef######)
|
||||
d align qualified
|
||||
d text * char *
|
||||
d length like(libssh2_Cuint)
|
||||
d text * unsigned char *
|
||||
d length like(libssh2_Csize_t)
|
||||
d echo like(libssh2_Cuchar)
|
||||
|
||||
d LIBSSH2_USERAUTH_KBDINT_RESPONSE...
|
||||
|
|
@ -221,6 +231,22 @@
|
|||
d text * char *
|
||||
d length like(libssh2_Cuint)
|
||||
|
||||
d LIBSSH2_SK_SIG_INFO...
|
||||
d ds based(######typedef######)
|
||||
d align qualified
|
||||
d flags like(libssh2_uint8_t)
|
||||
d counter like(libssh2_uint32_t)
|
||||
d sig_r * unsigned char *
|
||||
d sig_r_len like(libssh2_Csize_t)
|
||||
d sig_s * unsigned char *
|
||||
d sig_s_len like(libssh2_Csize_t)
|
||||
|
||||
* Flags for SK authentication
|
||||
d LIBSSH2_SK_PRESENCE_REQUIRED...
|
||||
d c X'01'
|
||||
d LIBSSH2_SK_VERIFICATION_REQUIRED...
|
||||
d c X'04'
|
||||
|
||||
* libssh2_session_callback_set() constants.
|
||||
d LIBSSH2_CALLBACK_IGNORE...
|
||||
d c 0
|
||||
|
|
@ -236,6 +262,12 @@
|
|||
d c 5
|
||||
d LIBSSH2_CALLBACK_RECV...
|
||||
d c 6
|
||||
d LIBSSH2_CALLBACK_AUTHAGENT...
|
||||
d c 7
|
||||
d LIBSSH2_CALLBACK_AUTHAGENT_IDENTITIES...
|
||||
d c 8
|
||||
d LIBSSH2_CALLBACK_AUTHAGENT_SIGN...
|
||||
d c 9
|
||||
|
||||
* libssh2_session_method_pref() constants.
|
||||
d LIBSSH2_METHOD_KEX...
|
||||
|
|
@ -258,12 +290,38 @@
|
|||
d c 8
|
||||
d LIBSSH2_METHOD_LANG_SC...
|
||||
d c 9
|
||||
d LIBSSH2_METHOD_SIGN_ALGO...
|
||||
d c 10
|
||||
|
||||
* flags.
|
||||
d LIBSSH2_FLAG_SIGPIPE...
|
||||
d c X'0001'
|
||||
d LIBSSH2_FLAG_COMPRESS...
|
||||
d c X'0002'
|
||||
d LIBSSH2_FLAG_QUOTE_PATHS...
|
||||
d c X'0003'
|
||||
|
||||
* SK signature callback
|
||||
d LIBSSH2_PRIVKEY_SK...
|
||||
d ds based(######typedef######)
|
||||
d align qualified
|
||||
d algorithm like(libssh2_Cint)
|
||||
d flags like(libssh2_uint8_t)
|
||||
d application * const char *
|
||||
d key_handle * const uchar *
|
||||
d handle_len like(libssh2_Csize_t)
|
||||
d sign_callback * procptr
|
||||
d orig_abstract * void **
|
||||
|
||||
d libssh2_sign_sk...
|
||||
d pr extproc('libssh2_sign_sk')
|
||||
d like(libssh2_Cint)
|
||||
d session * value LIBSSH2_SESSION *
|
||||
d sig * unsigned char *[]
|
||||
d sig_len value like(libssh2_Csize_t)
|
||||
d data * value const uchar *
|
||||
d data_len value like(libssh2_Csize_t)
|
||||
d abstract * void *
|
||||
|
||||
d LIBSSH2_POLLFD ds based(######typedef######)
|
||||
d align qualified
|
||||
|
|
@ -321,6 +379,8 @@
|
|||
d c 1
|
||||
d LIBSSH2_HOSTKEY_HASH_SHA1...
|
||||
d c 2
|
||||
d LIBSSH2_HOSTKEY_HASH_SHA256...
|
||||
d c 3
|
||||
|
||||
* Hostkey Types.
|
||||
d LIBSSH2_HOSTKEY_TYPE_UNKNOWN...
|
||||
|
|
@ -329,6 +389,14 @@
|
|||
d c 1
|
||||
d LIBSSH2_HOSTKEY_TYPE_DSS...
|
||||
d c 2
|
||||
d LIBSSH2_HOSTKEY_TYPE_ECDSA_256...
|
||||
d c 3
|
||||
d LIBSSH2_HOSTKEY_TYPE_ECDSA_384...
|
||||
d c 4
|
||||
d LIBSSH2_HOSTKEY_TYPE_ECDSA_521...
|
||||
d c 5
|
||||
d LIBSSH2_HOSTKEY_TYPE_ED25519...
|
||||
d c 6
|
||||
|
||||
* Disconnect Codes (defined by SSH protocol).
|
||||
d SSH_DISCONNECT_HOST_NOT_ALLOWED_TO_CONNECT...
|
||||
|
|
@ -466,6 +534,20 @@
|
|||
d c -45
|
||||
d LIBSSH2_ERROR_KNOWN_HOSTS...
|
||||
d c -46
|
||||
d LIBSSH2_ERROR_CHANNEL_WINDOW_FULL...
|
||||
d c -47
|
||||
d LIBSSH2_ERROR_KEYFILE_AUTH_FAILED...
|
||||
d c -48
|
||||
d LIBSSH2_ERROR_RANDGEN...
|
||||
d c -49
|
||||
d LIBSSH2_ERROR_MISSING_USERAUTH_BANNER...
|
||||
d c -50
|
||||
d LIBSSH2_ERROR_ALGO_UNSUPPORTED...
|
||||
d c -51
|
||||
d LIBSSH2_ERROR_MAC_FAILURE...
|
||||
d c -52
|
||||
d LIBSSH2_ERROR_HASH_INIT...
|
||||
d c -53
|
||||
|
||||
* this is a define to provide the old (<= 1.2.7) name.
|
||||
d LIBSSH2_ERROR_BANNER_NONE...
|
||||
|
|
@ -540,6 +622,17 @@
|
|||
d pr * extproc('libssh2_session_abstract') void * *
|
||||
d session * value LIBSSH2_SESSION *
|
||||
|
||||
d libssh2_cb_generic_ptr...
|
||||
d s * based(######typedef######) procptr
|
||||
|
||||
d libssh2_session_callback_set2...
|
||||
d pr extproc(
|
||||
d 'libssh2_session_callback_set2')
|
||||
d like(libssh2_cb_generic_ptr)
|
||||
d session * value LIBSSH2_SESSION *
|
||||
d cbtype value like(libssh2_Cint)
|
||||
d callback value like(libssh2_cb_generic_ptr)
|
||||
|
||||
d libssh2_session_callback_set...
|
||||
d pr * extproc( void *
|
||||
d 'libssh2_session_callback_set')
|
||||
|
|
@ -553,6 +646,7 @@
|
|||
d session * value LIBSSH2_SESSION *
|
||||
d banner * value options(*string) const char *
|
||||
|
||||
/if not defined(LIBSSH2_NO_DEPRECATED)
|
||||
d libssh2_banner_set...
|
||||
d pr extproc('libssh2_banner_set')
|
||||
d like(libssh2_Cint)
|
||||
|
|
@ -564,6 +658,7 @@
|
|||
d like(libssh2_Cint)
|
||||
d session * value LIBSSH2_SESSION *
|
||||
d sock value like(libssh2_Cint)
|
||||
/endif
|
||||
|
||||
d libssh2_session_handshake...
|
||||
d pr extproc('libssh2_session_handshake')
|
||||
|
|
@ -662,6 +757,12 @@
|
|||
d username * value options(*string) const char *
|
||||
d username_len value like(libssh2_Cuint)
|
||||
|
||||
d libssh2_userauth_banner...
|
||||
d pr extproc('libssh2_userauth_banner')
|
||||
d like(libssh2_Cint)
|
||||
d session * value LIBSSH2_SESSION *
|
||||
d banner * char *
|
||||
|
||||
d libssh2_userauth_authenticated...
|
||||
d pr extproc(
|
||||
d 'libssh2_userauth_authenticated')
|
||||
|
|
@ -794,6 +895,24 @@
|
|||
d response_callback...
|
||||
d * value procptr
|
||||
|
||||
d libssh2_userauth_publickey_sk...
|
||||
d pr extproc(
|
||||
d 'libssh2_userauth_publickey_sk')
|
||||
d like(libssh2_Cint)
|
||||
d session * value LIBSSH2_SESSION *
|
||||
d username * value options(*string) const char *
|
||||
d username_len value like(libssh2_Csize_t)
|
||||
d pubkeydata * value const uchar *
|
||||
d pubkeydata_len...
|
||||
d value like(libssh2_Csize_t)
|
||||
d privatekeydata...
|
||||
d * value options(*string) const char *
|
||||
d privatekeydata_len...
|
||||
d value like(libssh2_Csize_t)
|
||||
d passphrase * value options(*string) const char *
|
||||
d sign_callback * value procptr
|
||||
d abstract * void *
|
||||
|
||||
d libssh2_poll pr extproc('libssh2_poll')
|
||||
d like(libssh2_Cint)
|
||||
d fds * value LIBSSH2_POLLFD *
|
||||
|
|
@ -858,6 +977,14 @@
|
|||
d host * value options(*string) const char *
|
||||
d port value like(libssh2_Cint)
|
||||
|
||||
d libssh2_channel_direct_streamlocal_ex...
|
||||
d pr * extproc('libssh2_channel_direct- LIBSSH2_CHANNEL *
|
||||
d _streamlocal_ex')
|
||||
d session * value LIBSSH2_SESSION *
|
||||
d socket_path * value options(*string) const char *
|
||||
d shost * value options(*string) const char *
|
||||
d sport value like(libssh2_Cint)
|
||||
|
||||
d libssh2_channel_forward_listen_ex...
|
||||
d pr * extproc( LIBSSH2_LISTENER *
|
||||
d 'libssh2_channel_forward_listen_ex')
|
||||
|
|
@ -902,6 +1029,12 @@
|
|||
d varname * value options(*string) const char *
|
||||
d value * value options(*string) const char *
|
||||
|
||||
d libssh2_channel_request_auth_agent...
|
||||
d pr extproc(
|
||||
d 'libssh2_channel_request_auth_agent')
|
||||
d like(libssh2_Cint)
|
||||
d channel * value LIBSSH2_CHANNEL *
|
||||
|
||||
d libssh2_channel_request_pty_ex...
|
||||
d pr extproc(
|
||||
d 'libssh2_channel_request_pty_ex')
|
||||
|
|
@ -961,6 +1094,20 @@
|
|||
d channel * value LIBSSH2_CHANNEL *
|
||||
d screen_number value like(libssh2_Cint)
|
||||
|
||||
d libssh2_channel_signal_ex...
|
||||
d pr extproc('libssh2_channel_signal_ex')
|
||||
d like(libssh2_Cint)
|
||||
d channel * value LIBSSH2_CHANNEL *
|
||||
d signame * value options(*string) const char *
|
||||
d signame_len value like(libssh2_Csize_t)
|
||||
|
||||
* C macro implementation
|
||||
d libssh2_channel_signal...
|
||||
d pr extproc('libssh2_channel_signal_ex')
|
||||
d like(libssh2_Cint)
|
||||
d channel * value LIBSSH2_CHANNEL *
|
||||
d signame * value options(*string) const char *
|
||||
|
||||
d libssh2_channel_process_startup...
|
||||
d pr extproc(
|
||||
d 'libssh2_channel_process_startup')
|
||||
|
|
@ -1038,6 +1185,16 @@
|
|||
d like(libssh2_Culong)
|
||||
d channel * value LIBSSH2_CHANNEL *
|
||||
|
||||
/if not defined(LIBSSH2_NO_DEPRECATED)
|
||||
d libssh2_channel_receive_window_adjust...
|
||||
d pr extproc('libssh2_channel_receive_win-
|
||||
d dow_adjust')
|
||||
d like(libssh2_Culong)
|
||||
d channel * value LIBSSH2_CHANNEL *
|
||||
d adjustment value like(libssh2_Culong)
|
||||
d force value like(libssh2_Cuchar)
|
||||
/endif
|
||||
|
||||
d libssh2_channel_receive_window_adjust2...
|
||||
d pr extproc('libssh2_channel_receive_win-
|
||||
d dow_adjust2')
|
||||
|
|
@ -1117,6 +1274,26 @@
|
|||
d like(libssh2_Clong)
|
||||
d session * value LIBSSH2_SESSION *
|
||||
|
||||
d libssh2_session_set_read_timeout...
|
||||
d pr extproc(
|
||||
d 'libssh2_session_set_read_timeout')
|
||||
d session * value LIBSSH2_SESSION *
|
||||
d timeout value like(libssh2_Clong)
|
||||
|
||||
d libssh2_session_get_read_timeout...
|
||||
d pr extproc(
|
||||
d 'libssh2_session_get_read_timeout')
|
||||
d like(libssh2_Clong)
|
||||
d session * value LIBSSH2_SESSION *
|
||||
|
||||
/if not defined(LIBSSH2_NO_DEPRECATED)
|
||||
d libssh2_channel_handle_extended_data...
|
||||
d pr extproc('libssh2_channel_handle_exte-
|
||||
d nded_data')
|
||||
d channel * value LIBSSH2_CHANNEL *
|
||||
d ignore_mode value like(libssh2_Cint)
|
||||
/endif
|
||||
|
||||
d libssh2_channel_handle_extended_data2...
|
||||
d pr extproc('libssh2_channel_handle_exte-
|
||||
d nded_data2')
|
||||
|
|
@ -1124,8 +1301,16 @@
|
|||
d channel * value LIBSSH2_CHANNEL *
|
||||
d ignore_mode value like(libssh2_Cint)
|
||||
|
||||
/if not defined(LIBSSH2_NO_DEPRECATED)
|
||||
* libssh2_channel_ignore_extended_data() is defined below for BC with
|
||||
* version 0.1.
|
||||
* C macro implementation.
|
||||
d libssh2_channel_ignore_extended_data...
|
||||
d pr extproc('libssh2_channel-
|
||||
d _ignore_extended_data')
|
||||
d channel * value LIBSSH2_CHANNEL *
|
||||
d ignore value like(libssh2_Cint)
|
||||
/endif
|
||||
|
||||
d LIBSSH2_CHANNEL_FLUSH_EXTENDED_DATA...
|
||||
d c -1
|
||||
|
|
@ -1201,6 +1386,14 @@
|
|||
d like(libssh2_Cint)
|
||||
d channel * value LIBSSH2_CHANNEL *
|
||||
|
||||
/if not defined(LIBSSH2_NO_DEPRECATED)
|
||||
d libssh2_scp_recv...
|
||||
d pr * extproc('libssh2_scp_recv') LIBSSH2_CHANNEL *
|
||||
d session * value LIBSSH2_SESSION *
|
||||
d path * value options(*string) const char *
|
||||
d sb * value struct stat *
|
||||
/endif
|
||||
|
||||
* Use libssh2_scp_recv2 for large (> 2GB) file support.
|
||||
d libssh2_scp_recv2...
|
||||
d pr * extproc('libssh2_scp_recv2') LIBSSH2_CHANNEL *
|
||||
|
|
@ -1234,6 +1427,7 @@
|
|||
d mode value like(libssh2_Cint)
|
||||
d size value like(libssh2_int64_t)
|
||||
|
||||
* DEPRECATED
|
||||
d libssh2_base64_decode...
|
||||
d pr extproc('libssh2_base64_decode')
|
||||
d like(libssh2_Cint)
|
||||
|
|
@ -1249,6 +1443,26 @@
|
|||
d req_version_num...
|
||||
d value like(libssh2_Cint)
|
||||
|
||||
d libssh2_crypto_engine_t...
|
||||
d s based(######typedef######)
|
||||
d like(libssh2_Cenum)
|
||||
d libssh2_no_crypto...
|
||||
d c 0
|
||||
d libssh2_openssl...
|
||||
d c 1
|
||||
d libssh2_gcrypt...
|
||||
d c 2
|
||||
d libssh2_mbedtls...
|
||||
d c 3
|
||||
d libssh2_wincng...
|
||||
d c 4
|
||||
d libssh2_os400qc3...
|
||||
d c 5
|
||||
|
||||
d libssh2_crypto_engine...
|
||||
d pr extproc('libssh2_crypto_engine')
|
||||
d like(libssh2_crypto_engine_t)
|
||||
|
||||
d HAVE_LIBSSH2_KNOWNHOST_API... since 1.1.1
|
||||
d c X'010101'
|
||||
d HAVE_LIBSSH2_VERSION_API... since 1.1
|
||||
|
|
@ -1311,9 +1525,9 @@
|
|||
d LIBSSH2_KNOWNHOST_KEYENC_BASE64...
|
||||
d c X'00020000'
|
||||
|
||||
* type of key (3 bits).
|
||||
* type of key (4 bits).
|
||||
d LIBSSH2_KNOWNHOST_KEY_MASK...
|
||||
d c X'001C0000'
|
||||
d c X'003C0000'
|
||||
d LIBSSH2_KNOWNHOST_KEY_SHIFT...
|
||||
d c 18
|
||||
d LIBSSH2_KNOWNHOST_KEY_RSA1...
|
||||
|
|
@ -1322,8 +1536,16 @@
|
|||
d c X'00080000'
|
||||
d LIBSSH2_KNOWNHOST_KEY_SSHDSS...
|
||||
d c X'000C0000'
|
||||
d LIBSSH2_KNOWNHOST_KEY_UNKNOWN...
|
||||
d LIBSSH2_KNOWNHOST_KEY_ECDSA_256...
|
||||
d c X'00100000'
|
||||
d LIBSSH2_KNOWNHOST_KEY_ECDSA_384...
|
||||
d c X'00140000'
|
||||
d LIBSSH2_KNOWNHOST_KEY_ECDSA_521...
|
||||
d c X'00180000'
|
||||
d LIBSSH2_KNOWNHOST_KEY_ED25519...
|
||||
d c X'001C0000'
|
||||
d LIBSSH2_KNOWNHOST_KEY_UNKNOWN...
|
||||
d c X'003C0000'
|
||||
|
||||
d libssh2_knownhost_add...
|
||||
d pr extproc('libssh2_knownhost_add')
|
||||
|
|
@ -1609,6 +1831,24 @@
|
|||
d username * value options(*string) const char *
|
||||
d identity likeds(libssh2_agent_publickey)
|
||||
|
||||
* libssh2_agent_sign()
|
||||
*
|
||||
* Sign a payload using a system-installed ssh-agent.
|
||||
*
|
||||
* Returns 0 if succeeded, or a negative value for error.
|
||||
|
||||
d libssh2_agent_sign...
|
||||
d pr extproc('libssh2_agent_sign')
|
||||
d like(libssh2_Cint)
|
||||
d agent * value LIBSSH2_AGENT *
|
||||
d identity likeds(libssh2_agent_publickey)
|
||||
d sig * unsigned char *
|
||||
d s_len like(libssh2_Csize_t)
|
||||
d data * value const uchar *
|
||||
d d_len value like(libssh2_Csize_t)
|
||||
d method * value options(*string) const char *
|
||||
d method_len value like(libssh2_Cuint)
|
||||
|
||||
* libssh2_agent_disconnect()
|
||||
*
|
||||
* Close a connection to an ssh-agent.
|
||||
|
|
@ -1629,6 +1869,24 @@
|
|||
d pr extproc('libssh2_agent_free')
|
||||
d agent * value LIBSSH2_AGENT *
|
||||
|
||||
* libssh2_agent_set_identity_path()
|
||||
*
|
||||
* Allows a custom agent identity socket path beyond SSH_AUTH_SOCK env
|
||||
|
||||
d libssh2_agent_set_identity_path...
|
||||
d pr extproc(
|
||||
d 'libssh2_agent_set_identity_path')
|
||||
d agent * value LIBSSH2_AGENT *
|
||||
d path * value options(*string) const char *
|
||||
|
||||
* libssh2_agent_get_identity_path()
|
||||
*
|
||||
* Returns the custom agent identity socket path if set
|
||||
|
||||
d libssh2_agent_get_identity_path...
|
||||
d pr * extproc( const char *
|
||||
d 'libssh2_agent_get_identity_path')
|
||||
d agent * value LIBSSH2_AGENT *
|
||||
|
||||
* libssh2_keepalive_config()
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
* Copyright (c) 2015 Patrick Monnerat, D+H <patrick.monnerat@dh.com>
|
||||
* Copyright (C) Patrick Monnerat <patrick@monnerat.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms,
|
||||
|
|
@ -33,6 +33,8 @@
|
|||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
/if not defined(LIBSSH2_CCSID_H_)
|
||||
/define LIBSSH2_CCSID_H_
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
* Copyright (c) 2015, Patrick Monnerat, D+H <patrick.monnerat@dh.com>
|
||||
* Copyright (C) Patrick Monnerat <patrick@monnerat.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms,
|
||||
|
|
@ -40,6 +40,8 @@
|
|||
*
|
||||
* For more information on the publickey subsystem,
|
||||
* refer to IETF draft: secsh-publickey
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
/if not defined(LIBSSH2_PUBLICKEY_H_)
|
||||
/define LIBSSH2_PUBLICKEY_H_
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
* Copyright (c) 2015, Patrick Monnerat, D+H <patrick.monnerat@dh.com>
|
||||
* Copyright (C) Patrick Monnerat <patrick@monnerat.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms,
|
||||
|
|
@ -33,6 +33,8 @@
|
|||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
/if not defined(LIBSSH2_SFTP_H_)
|
||||
/define LIBSSH2_SFTP_H_
|
||||
|
|
@ -77,6 +79,10 @@
|
|||
d LIBSSH2_SFTP_REALPATH...
|
||||
d c 2
|
||||
|
||||
* Flags for sftp_mkdir()
|
||||
d LIBSSH2_SFTP_DEFAULT_MODE...
|
||||
d c -1
|
||||
|
||||
* SFTP attribute flag bits.
|
||||
d LIBSSH2_SFTP_ATTR_SIZE...
|
||||
d c X'00000001'
|
||||
|
|
@ -95,7 +101,7 @@
|
|||
d LIBSSH2_SFTP_ST_NOSUID...
|
||||
d c X'00000002'
|
||||
|
||||
d #LIBSSH2_SFTP_ATTRIBUTES...
|
||||
d LIBSSH2_SFTP_ATTRIBUTES...
|
||||
d ds based(######typedef######)
|
||||
d align qualified
|
||||
* If flags & ATTR_* bit is set, then the value in this struct will be
|
||||
|
|
@ -334,8 +340,7 @@
|
|||
|
||||
* C macro implementation.
|
||||
d libssh2_sftp_open...
|
||||
d pr * extproc('libssh2_sftp_open') LIBSSH2_SFTP_HANDLE
|
||||
d *
|
||||
d pr * extproc('libssh2_sftp_open') LIBSSH2_SFTP_HANDLE*
|
||||
d sftp * value LIBSSH2_SFTP *
|
||||
d filename * value options(*string) const char *
|
||||
d flags value like(libssh2_Culong)
|
||||
|
|
@ -344,16 +349,34 @@
|
|||
* C macro libssh2_sftp_opendir implementation.
|
||||
* Renamed to avoid upper/lower case name clash.
|
||||
d libssh2_sftp_open_dir...
|
||||
d pr * extproc('libssh2_sftp_opendir') LIBSSH2_SFTP_HANDLE
|
||||
d *
|
||||
d pr * extproc('libssh2_sftp_opendir') LIBSSH2_SFTP_HANDLE*
|
||||
d sftp * value LIBSSH2_SFTP *
|
||||
d path * value options(*string) const char *
|
||||
|
||||
d libssh2_sftp_open_ex_r...
|
||||
d pr * extproc('libssh2_sftp_open_ex_r') LIBSSH2_SFTP_HANDLE*
|
||||
d sftp * value LIBSSH2_SFTP *
|
||||
d filename * value options(*string) const char *
|
||||
d filename_len value like(libssh2_Csize_t)
|
||||
d flags value like(libssh2_Culong)
|
||||
d mode value like(libssh2_Clong)
|
||||
d open_type value like(libssh2_Cint)
|
||||
d attrs likeds(LIBSSH2_SFTP_ATTRIBUTES)
|
||||
|
||||
* C macro implementation.
|
||||
d libssh2_sftp_open_r...
|
||||
d pr * extproc('libssh2_sftp_open_r') LIBSSH2_SFTP_HANDLE*
|
||||
d sftp * value LIBSSH2_SFTP *
|
||||
d filename * value options(*string) const char *
|
||||
d flags value like(libssh2_Culong)
|
||||
d mode value like(libssh2_Clong)
|
||||
d attrs likeds(LIBSSH2_SFTP_ATTRIBUTES)
|
||||
|
||||
d libssh2_sftp_read...
|
||||
d pr extproc('libssh2_sftp_read')
|
||||
d like(libssh2_Cssize_t)
|
||||
d handle * value LIBSSH2_SFTP_HANDLE*
|
||||
d buffer * value options(*string) char *
|
||||
d buffer * value char *
|
||||
d buffer_maxlen value like(libssh2_Csize_t)
|
||||
|
||||
d libssh2_sftp_readdir_ex...
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2015 Patrick Monnerat, D+H <patrick.monnerat@dh.com>
|
||||
* Copyright (C) Patrick Monnerat <patrick@monnerat.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms,
|
||||
|
|
@ -34,6 +34,8 @@
|
|||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifndef LIBSSH2_MACROS_H_
|
||||
|
|
@ -90,6 +92,8 @@ libssh2_channel_request_pty_size(LIBSSH2_CHANNEL *channel,
|
|||
LIBSSH2_API int
|
||||
libssh2_channel_x11_req(LIBSSH2_CHANNEL *channel, int screen_number);
|
||||
LIBSSH2_API int
|
||||
libssh2_channel_signal(LIBSSH2_CHANNEL *channel, const char *signame);
|
||||
LIBSSH2_API int
|
||||
libssh2_channel_shell(LIBSSH2_CHANNEL *channel);
|
||||
LIBSSH2_API int
|
||||
libssh2_channel_exec(LIBSSH2_CHANNEL *channel, const char *command);
|
||||
|
|
@ -98,16 +102,20 @@ libssh2_channel_subsystem(LIBSSH2_CHANNEL *channel, const char *subsystem);
|
|||
LIBSSH2_API ssize_t
|
||||
libssh2_channel_read(LIBSSH2_CHANNEL *channel, char *buf, size_t buflen);
|
||||
LIBSSH2_API ssize_t
|
||||
libssh2_channel_read_stderr(LIBSSH2_CHANNEL *channel, char *buf, size_t buflen);
|
||||
libssh2_channel_read_stderr(LIBSSH2_CHANNEL *channel,
|
||||
char *buf, size_t buflen);
|
||||
LIBSSH2_API unsigned long
|
||||
libssh2_channel_window_read(LIBSSH2_CHANNEL *channel);
|
||||
LIBSSH2_API ssize_t
|
||||
libssh2_channel_write(LIBSSH2_CHANNEL *channel, const char *buf, size_t buflen);
|
||||
libssh2_channel_write(LIBSSH2_CHANNEL *channel,
|
||||
const char *buf, size_t buflen);
|
||||
LIBSSH2_API ssize_t
|
||||
libssh2_channel_write_stderr(LIBSSH2_CHANNEL *channel,
|
||||
const char *buf, size_t buflen);
|
||||
LIBSSH2_API unsigned long
|
||||
libssh2_channel_window_write(LIBSSH2_CHANNEL *channel);
|
||||
LIBSSH2_API void
|
||||
libssh2_channel_ignore_extended_data(LIBSSH2_CHANNEL *channel, int ignore);
|
||||
LIBSSH2_API int libssh2_channel_flush(LIBSSH2_CHANNEL *channel);
|
||||
LIBSSH2_API int libssh2_channel_flush_stderr(LIBSSH2_CHANNEL *channel);
|
||||
LIBSSH2_API LIBSSH2_CHANNEL *
|
||||
|
|
@ -135,6 +143,10 @@ libssh2_sftp_open(LIBSSH2_SFTP *sftp, const char *filename,
|
|||
unsigned long flags, long mode);
|
||||
LIBSSH2_API LIBSSH2_SFTP_HANDLE *
|
||||
libssh2_sftp_opendir(LIBSSH2_SFTP *sftp, const char *path);
|
||||
LIBSSH2_API LIBSSH2_SFTP_HANDLE *
|
||||
libssh2_sftp_open_r(LIBSSH2_SFTP *sftp, const char *filename,
|
||||
unsigned long flags, long mode,
|
||||
LIBSSH2_SFTP_ATTRIBUTES *attrs);
|
||||
LIBSSH2_API int libssh2_sftp_readdir(LIBSSH2_SFTP_HANDLE *handle,
|
||||
char *buffer, size_t buffer_maxlen,
|
||||
LIBSSH2_SFTP_ATTRIBUTES *attrs);
|
||||
|
|
|
|||
10
libssh2/os400/make-include.sh
Normal file → Executable file
10
libssh2/os400/make-include.sh
Normal file → Executable file
|
|
@ -1,11 +1,13 @@
|
|||
#!/bin/sh
|
||||
# Copyright (C) The libssh2 project and its contributors.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
# Installation of the header files in the OS/400 library.
|
||||
#
|
||||
|
||||
SCRIPTDIR=`dirname "${0}"`
|
||||
SCRIPTDIR=$(dirname "${0}")
|
||||
. "${SCRIPTDIR}/initscript.sh"
|
||||
cd "${TOPDIR}/include"
|
||||
cd "${TOPDIR}/include" || exit 1
|
||||
|
||||
|
||||
# Create the OS/400 source program file for the header files.
|
||||
|
|
@ -45,11 +47,11 @@ copy_hfile()
|
|||
# Copy the header files.
|
||||
|
||||
for HFILE in *.h "${TOPDIR}/os400/libssh2_ccsid.h"
|
||||
do DEST="${SRCPF}/`db2_name \"${HFILE}\"`.MBR"
|
||||
do DEST="${SRCPF}/$(db2_name "${HFILE}").MBR"
|
||||
|
||||
if action_needed "${DEST}" "${HFILE}"
|
||||
then copy_hfile "${DEST}" "${HFILE}"
|
||||
IFSDEST="${IFSINCLUDE}/`basename \"${HFILE}\"`"
|
||||
IFSDEST="${IFSINCLUDE}/$(basename "${HFILE}")"
|
||||
rm -f "${IFSDEST}"
|
||||
ln -s "${DEST}" "${IFSDEST}"
|
||||
fi
|
||||
|
|
|
|||
18
libssh2/os400/make-rpg.sh
Normal file → Executable file
18
libssh2/os400/make-rpg.sh
Normal file → Executable file
|
|
@ -1,11 +1,13 @@
|
|||
#!/bin/sh
|
||||
# Copyright (C) The libssh2 project and its contributors.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
# Installation of the ILE/RPG header files in the OS/400 library.
|
||||
#
|
||||
|
||||
SCRIPTDIR=`dirname "${0}"`
|
||||
SCRIPTDIR=$(dirname "${0}")
|
||||
. "${SCRIPTDIR}/initscript.sh"
|
||||
cd "${TOPDIR}/os400/libssh2rpg"
|
||||
cd "${TOPDIR}/os400/libssh2rpg" || exit 1
|
||||
|
||||
|
||||
# Create the OS/400 source program file for the ILE/RPG header files.
|
||||
|
|
@ -22,9 +24,9 @@ fi
|
|||
# Map file names to DB2 name syntax.
|
||||
|
||||
for HFILE in *.rpgle *.rpgle.in
|
||||
do NAME="`basename \"${HFILE}\" .in`"
|
||||
VAR="`basename \"${NAME}\" .rpgle`"
|
||||
VAL="`db2_name \"${NAME}\"`"
|
||||
do NAME="$(basename "${HFILE}" .in)"
|
||||
VAR="$(basename "${NAME}" .rpgle)"
|
||||
VAL="$(db2_name "${NAME}")"
|
||||
|
||||
eval "VAR_${VAR}=\"${VAL}\""
|
||||
echo "${VAR} s/${VAR}/${VAL}/g"
|
||||
|
|
@ -62,7 +64,7 @@ fi
|
|||
for HFILE in *.rpgle *.rpgle.in
|
||||
do IFSCMD="cat \"${HFILE}\""
|
||||
DB2CMD="change_include < \"${HFILE}\""
|
||||
IFSFILE="`basename \"${HFILE}\" .in`"
|
||||
IFSFILE="$(basename "${HFILE}" .in)"
|
||||
|
||||
case "${HFILE}" in
|
||||
|
||||
|
|
@ -77,7 +79,7 @@ do IFSCMD="cat \"${HFILE}\""
|
|||
then eval "${IFSCMD}" > "${IFSDEST}"
|
||||
fi
|
||||
|
||||
eval DB2MBR="\"\${VAR_`basename \"${IFSDEST}\" .rpgle`}\""
|
||||
eval DB2MBR="\"\${VAR_$(basename "${IFSDEST}" .rpgle)}\""
|
||||
DB2DEST="${SRCPF}/${DB2MBR}.MBR"
|
||||
|
||||
if action_needed "${DB2DEST}" "${HFILE}"
|
||||
|
|
@ -85,7 +87,7 @@ do IFSCMD="cat \"${HFILE}\""
|
|||
|
||||
# Need to translate to target CCSID.
|
||||
|
||||
CMD="CPY OBJ('`pwd`/tmphdrfile') TOOBJ('${DB2DEST}')"
|
||||
CMD="CPY OBJ('$(pwd)/tmphdrfile') TOOBJ('${DB2DEST}')"
|
||||
CMD="${CMD} TOCCSID(${TGTCCSID}) DTAFMT(*TEXT) REPLACE(*YES)"
|
||||
system "${CMD}"
|
||||
fi
|
||||
|
|
|
|||
56
libssh2/os400/make-src.sh
Normal file → Executable file
56
libssh2/os400/make-src.sh
Normal file → Executable file
|
|
@ -1,11 +1,13 @@
|
|||
#!/bin/sh
|
||||
# Copyright (C) The libssh2 project and its contributors.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
# libssh2 compilation script for the OS/400.
|
||||
#
|
||||
|
||||
SCRIPTDIR=`dirname "${0}"`
|
||||
SCRIPTDIR=$(dirname "${0}")
|
||||
. "${SCRIPTDIR}/initscript.sh"
|
||||
cd "${TOPDIR}/src"
|
||||
cd "${TOPDIR}/src" || exit 1
|
||||
|
||||
|
||||
# Function to extract external prototypes from header files.
|
||||
|
|
@ -46,10 +48,12 @@ fi
|
|||
|
||||
# Create and compile the identification source file.
|
||||
|
||||
echo '#pragma comment(user, "libssh2 version '"${LIBSSH2_VERSION}"'")' > os400.c
|
||||
echo '#pragma comment(user, __DATE__)' >> os400.c
|
||||
echo '#pragma comment(user, __TIME__)' >> os400.c
|
||||
echo '#pragma comment(copyright, "See COPYING file. OS/400 version by P. Monnerat")' >> os400.c
|
||||
{
|
||||
echo '#pragma comment(user, "libssh2 version '"${LIBSSH2_VERSION}"'")'
|
||||
echo '#pragma comment(user, __DATE__)'
|
||||
echo '#pragma comment(user, __TIME__)'
|
||||
echo '#pragma comment(copyright, "See COPYING file. OS/400 version by P. Monnerat")'
|
||||
} > os400.c
|
||||
make_module OS400 os400.c
|
||||
LINK= # No need to rebuild service program yet.
|
||||
MODULES=
|
||||
|
|
@ -78,28 +82,28 @@ fi
|
|||
|
||||
# Get source list.
|
||||
|
||||
cat Makefile.inc |
|
||||
sed -e ':begin' \
|
||||
-e '/\\$/{' \
|
||||
-e 's/\\$/ /' \
|
||||
-e 'N' \
|
||||
-e 'bbegin' \
|
||||
-e '}' \
|
||||
-e 's/\n//g' \
|
||||
-e 's/[[:space:]]*$//' \
|
||||
-e 's/^\([A-Za-z][A-Za-z0-9_]*\)[[:space:]]*=[[:space:]]*\(.*\)/\1="\2"/' \
|
||||
-e 's/\$(\([A-Za-z][A-Za-z0-9_]*\))/${\1}/g' \
|
||||
> tmpscript.sh
|
||||
sed -e ':begin' \
|
||||
-e '/\\$/{' \
|
||||
-e 's/\\$/ /' \
|
||||
-e 'N' \
|
||||
-e 'bbegin' \
|
||||
-e '}' \
|
||||
-e 's/\n//g' \
|
||||
-e 's/[[:space:]]*$//' \
|
||||
-e 's/^\([A-Za-z][A-Za-z0-9_]*\)[[:space:]]*=[[:space:]]*\(.*\)/\1="\2"/' \
|
||||
-e 's/\$(\([A-Za-z][A-Za-z0-9_]*\))/${\1}/g' \
|
||||
< Makefile.inc > tmpscript.sh
|
||||
. ./tmpscript.sh
|
||||
|
||||
|
||||
# Compile the sources into modules.
|
||||
|
||||
INCLUDES="'`pwd`'"
|
||||
# shellcheck disable=SC2034
|
||||
INCLUDES="'$(pwd)'"
|
||||
|
||||
for SRC in "${TOPDIR}/os400/os400sys.c" "${TOPDIR}/os400/ccsid.c" \
|
||||
${CSOURCES} macros.c
|
||||
do MODULE=`db2_name "${SRC}"`
|
||||
do MODULE=$(db2_name "${SRC}")
|
||||
make_module "${MODULE}" "${SRC}"
|
||||
done
|
||||
|
||||
|
|
@ -110,7 +114,7 @@ if action_needed "${LIBIFSNAME}/${STATBNDDIR}.BNDDIR"
|
|||
then LINK=YES
|
||||
fi
|
||||
|
||||
if [ "${LINK}" ]
|
||||
if [ -n "${LINK}" ]
|
||||
then rm -rf "${LIBIFSNAME}/${STATBNDDIR}.BNDDIR"
|
||||
CMD="CRTBNDDIR BNDDIR(${TARGETLIB}/${STATBNDDIR})"
|
||||
CMD="${CMD} TEXT('libssh2 API static binding directory')"
|
||||
|
|
@ -143,10 +147,10 @@ fi
|
|||
|
||||
# Gather the list of symbols to export.
|
||||
|
||||
EXPORTS=`cat "${TOPDIR}"/include/*.h "${TOPDIR}/os400/macros.h" \
|
||||
EXPORTS=$(cat "${TOPDIR}"/include/*.h "${TOPDIR}/os400/macros.h" \
|
||||
"${TOPDIR}/os400/libssh2_ccsid.h" |
|
||||
extproto |
|
||||
sed -e 's/(.*//;s/[^A-Za-z0-9_]/ /g;s/ *$//;s/^.* //'`
|
||||
sed -e 's/(.*//;s/[^A-Za-z0-9_]/ /g;s/ *$//;s/^.* //')
|
||||
|
||||
# Create the service program exportation file in DB2 member if needed.
|
||||
|
||||
|
|
@ -156,7 +160,7 @@ if action_needed "${BSF}" Makefile.am
|
|||
then LINK=YES
|
||||
fi
|
||||
|
||||
if [ "${LINK}" ]
|
||||
if [ -n "${LINK}" ]
|
||||
then echo " STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('LIBSSH2_${SONAME}')" \
|
||||
> "${BSF}"
|
||||
for EXPORT in ${EXPORTS}
|
||||
|
|
@ -173,7 +177,7 @@ if action_needed "${LIBIFSNAME}/${SRVPGM}.SRVPGM"
|
|||
then LINK=YES
|
||||
fi
|
||||
|
||||
if [ "${LINK}" ]
|
||||
if [ -n "${LINK}" ]
|
||||
then CMD="CRTSRVPGM SRVPGM(${TARGETLIB}/${SRVPGM})"
|
||||
CMD="${CMD} SRCFILE(${TARGETLIB}/TOOLS) SRCMBR(BNDSRC)"
|
||||
CMD="${CMD} MODULE(${TARGETLIB}/OS400)"
|
||||
|
|
@ -197,7 +201,7 @@ if action_needed "${LIBIFSNAME}/${DYNBNDDIR}.BNDDIR"
|
|||
then LINK=YES
|
||||
fi
|
||||
|
||||
if [ "${LINK}" ]
|
||||
if [ -n "${LINK}" ]
|
||||
then rm -rf "${LIBIFSNAME}/${DYNBNDDIR}.BNDDIR"
|
||||
CMD="CRTBNDDIR BNDDIR(${TARGETLIB}/${DYNBNDDIR})"
|
||||
CMD="${CMD} TEXT('libssh2 API dynamic binding directory')"
|
||||
|
|
|
|||
38
libssh2/os400/make.sh
Normal file → Executable file
38
libssh2/os400/make.sh
Normal file → Executable file
|
|
@ -1,13 +1,15 @@
|
|||
#!/bin/sh
|
||||
# Copyright (C) The libssh2 project and its contributors.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
# libssh2 compilation script for the OS/400.
|
||||
#
|
||||
#
|
||||
# This is a shell script since make is not a standard component of OS/400.
|
||||
|
||||
SCRIPTDIR=`dirname "${0}"`
|
||||
SCRIPTDIR=$(dirname "${0}")
|
||||
. "${SCRIPTDIR}/initscript.sh"
|
||||
cd "${TOPDIR}"
|
||||
cd "${TOPDIR}" || exit 1
|
||||
|
||||
|
||||
# Create the OS/400 library if it does not exist.
|
||||
|
|
@ -32,7 +34,7 @@ fi
|
|||
for TEXT in "${TOPDIR}/COPYING" "${SCRIPTDIR}/README400" \
|
||||
"${TOPDIR}/NEWS" "${TOPDIR}/README" "${TOPDIR}/docs/AUTHORS" \
|
||||
"${TOPDIR}/docs/BINDINGS.md"
|
||||
do MEMBER="${LIBIFSNAME}/DOCS.FILE/`db2_name \"${TEXT}\"`.MBR"
|
||||
do MEMBER="${LIBIFSNAME}/DOCS.FILE/$(db2_name "${TEXT}").MBR"
|
||||
|
||||
if action_needed "${MEMBER}" "${TEXT}"
|
||||
then CMD="CPY OBJ('${TEXT}') TOOBJ('${MEMBER}') TOCCSID(${TGTCCSID})"
|
||||
|
|
@ -42,6 +44,36 @@ do MEMBER="${LIBIFSNAME}/DOCS.FILE/`db2_name \"${TEXT}\"`.MBR"
|
|||
done
|
||||
|
||||
|
||||
# Create the RPGXAMPLES source file if it does not exist.
|
||||
|
||||
if action_needed "${LIBIFSNAME}/RPGXAMPLES.FILE"
|
||||
then CMD="CRTSRCPF FILE(${TARGETLIB}/RPGXAMPLES) RCDLEN(240)"
|
||||
CMD="${CMD} CCSID(${TGTCCSID}) TEXT('ILE/RPG examples')"
|
||||
system "${CMD}"
|
||||
fi
|
||||
|
||||
|
||||
# Copy RPG examples if needed.
|
||||
|
||||
for EXAMPLE in "${SCRIPTDIR}/rpg-examples"/*
|
||||
do MEMBER="$(basename "${EXAMPLE}")"
|
||||
IFSMEMBER="${LIBIFSNAME}/RPGXAMPLES.FILE/$(db2_name "${MEMBER}").MBR"
|
||||
|
||||
[ -e "${EXAMPLE}" ] || continue
|
||||
|
||||
if action_needed "${IFSMEMBER}" "${EXAMPLE}"
|
||||
then CMD="CPY OBJ('${EXAMPLE}') TOOBJ('${IFSMEMBER}')"
|
||||
CMD="${CMD} TOCCSID(${TGTCCSID}) DTAFMT(*TEXT) REPLACE(*YES)"
|
||||
system "${CMD}"
|
||||
MBRTEXT=$(sed -e '1!d;/^ \*/!d;s/^ *\* *//' \
|
||||
-e 's/ *$//;s/'"'"'/&&/g' < "${EXAMPLE}")
|
||||
CMD="CHGPFM FILE(${TARGETLIB}/RPGXAMPLES) MBR(${MEMBER})"
|
||||
CMD="${CMD} SRCTYPE(RPGLE) TEXT('${MBRTEXT}')"
|
||||
system "${CMD}"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
# Build in each directory.
|
||||
|
||||
for SUBDIR in include rpg src
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2015 Patrick Monnerat, D+H <patrick.monnerat@dh.com>
|
||||
* Copyright (C) Patrick Monnerat <patrick@monnerat.net>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms,
|
||||
|
|
@ -34,6 +34,8 @@
|
|||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
/* OS/400 additional support. */
|
||||
|
|
@ -75,106 +77,54 @@
|
|||
|
||||
|
||||
static int
|
||||
convert_sockaddr(struct sockaddr_storage * dstaddr,
|
||||
const struct sockaddr * srcaddr, int srclen)
|
||||
|
||||
convert_sockaddr(struct sockaddr_storage *dstaddr,
|
||||
const struct sockaddr *srcaddr, int srclen)
|
||||
{
|
||||
const struct sockaddr_un * srcu;
|
||||
struct sockaddr_un * dstu;
|
||||
unsigned int i;
|
||||
unsigned int dstsize;
|
||||
const struct sockaddr_un *srcu;
|
||||
struct sockaddr_un *dstu;
|
||||
unsigned int i;
|
||||
unsigned int dstsize;
|
||||
|
||||
/* Convert a socket address into job CCSID, if needed. */
|
||||
/* Convert a socket address into job CCSID, if needed. */
|
||||
|
||||
if(!srcaddr || srclen < offsetof(struct sockaddr, sa_family) +
|
||||
sizeof srcaddr->sa_family || srclen > sizeof *dstaddr) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
memcpy((char *) dstaddr, (char *) srcaddr, srclen);
|
||||
|
||||
switch (srcaddr->sa_family) {
|
||||
|
||||
case AF_UNIX:
|
||||
srcu = (const struct sockaddr_un *) srcaddr;
|
||||
dstu = (struct sockaddr_un *) dstaddr;
|
||||
dstsize = sizeof *dstaddr - offsetof(struct sockaddr_un, sun_path);
|
||||
srclen -= offsetof(struct sockaddr_un, sun_path);
|
||||
i = QadrtConvertA2E(dstu->sun_path, srcu->sun_path, dstsize - 1, srclen);
|
||||
dstu->sun_path[i] = '\0';
|
||||
i += offsetof(struct sockaddr_un, sun_path);
|
||||
srclen = i;
|
||||
}
|
||||
|
||||
return srclen;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
_libssh2_os400_connect(int sd, struct sockaddr * destaddr, int addrlen)
|
||||
|
||||
{
|
||||
int i;
|
||||
struct sockaddr_storage laddr;
|
||||
|
||||
i = convert_sockaddr(&laddr, destaddr, addrlen);
|
||||
|
||||
if(i < 0)
|
||||
return -1;
|
||||
|
||||
return connect(sd, (struct sockaddr *) &laddr, i);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
_libssh2_os400_vsnprintf(char *dst, size_t len, const char *fmt, va_list args)
|
||||
{
|
||||
size_t l = 4096;
|
||||
int i;
|
||||
char *buf;
|
||||
|
||||
if (!dst || !len) {
|
||||
if(!srcaddr || srclen < offsetof(struct sockaddr, sa_family) +
|
||||
sizeof(srcaddr->sa_family) || srclen > sizeof(*dstaddr)) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (l < len)
|
||||
l = len;
|
||||
memcpy((char *) dstaddr, (char *) srcaddr, srclen);
|
||||
|
||||
buf = alloca(l);
|
||||
switch(srcaddr->sa_family) {
|
||||
|
||||
if (!buf) {
|
||||
errno = ENOMEM;
|
||||
return -1;
|
||||
case AF_UNIX:
|
||||
srcu = (const struct sockaddr_un *) srcaddr;
|
||||
dstu = (struct sockaddr_un *) dstaddr;
|
||||
dstsize = sizeof(*dstaddr) - offsetof(struct sockaddr_un, sun_path);
|
||||
srclen -= offsetof(struct sockaddr_un, sun_path);
|
||||
i = QadrtConvertA2E(dstu->sun_path, srcu->sun_path,
|
||||
dstsize - 1, srclen);
|
||||
dstu->sun_path[i] = '\0';
|
||||
i += offsetof(struct sockaddr_un, sun_path);
|
||||
srclen = i;
|
||||
}
|
||||
|
||||
i = vsprintf(buf, fmt, args);
|
||||
|
||||
if (i < 0)
|
||||
return i;
|
||||
|
||||
if (--len > i)
|
||||
len = i;
|
||||
|
||||
if (len)
|
||||
memcpy(dst, buf, len);
|
||||
|
||||
dst[len] = '\0';
|
||||
return len;
|
||||
return srclen;
|
||||
}
|
||||
|
||||
/* VARARGS3 */
|
||||
int
|
||||
_libssh2_os400_snprintf(char *dst, size_t len, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
int ret;
|
||||
|
||||
va_start(args, fmt);
|
||||
ret = _libssh2_os400_vsnprintf(dst, len, fmt, args);
|
||||
va_end(args);
|
||||
return ret;
|
||||
int
|
||||
_libssh2_os400_connect(int sd, struct sockaddr *destaddr, int addrlen)
|
||||
{
|
||||
int i;
|
||||
struct sockaddr_storage laddr;
|
||||
|
||||
i = convert_sockaddr(&laddr, destaddr, addrlen);
|
||||
|
||||
if(i < 0)
|
||||
return -1;
|
||||
|
||||
return connect(sd, (struct sockaddr *) &laddr, i);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -186,11 +136,11 @@ _libssh2_os400_inflateInit_(z_streamp strm,
|
|||
char *ebcversion;
|
||||
int i;
|
||||
|
||||
if (!version)
|
||||
if(!version)
|
||||
return Z_VERSION_ERROR;
|
||||
i = strlen(version);
|
||||
ebcversion = alloca(i + 1);
|
||||
if (!ebcversion)
|
||||
if(!ebcversion)
|
||||
return Z_VERSION_ERROR;
|
||||
i = QadrtConvertA2E(ebcversion, version, i, i - 1);
|
||||
ebcversion[i] = '\0';
|
||||
|
|
@ -204,11 +154,11 @@ _libssh2_os400_deflateInit_(z_streamp strm, int level,
|
|||
char *ebcversion;
|
||||
int i;
|
||||
|
||||
if (!version)
|
||||
if(!version)
|
||||
return Z_VERSION_ERROR;
|
||||
i = strlen(version);
|
||||
ebcversion = alloca(i + 1);
|
||||
if (!ebcversion)
|
||||
if(!ebcversion)
|
||||
return Z_VERSION_ERROR;
|
||||
i = QadrtConvertA2E(ebcversion, version, i, i - 1);
|
||||
ebcversion[i] = '\0';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue