fix comments, moved to htonu64 function to sftp.c and made it static

This commit is contained in:
Daniel Stenberg 2009-03-27 07:03:00 +00:00
parent 9df891e412
commit f390c8e02d
5 changed files with 22 additions and 25 deletions

View File

@ -1166,8 +1166,6 @@ static int kexinit(LIBSSH2_SESSION * session)
return 0;
}
/* }}} */
/* kex_agree_instr
* Kex specific variant of strstr()
* Needle must be preceed by BOL or ',', and followed by ',' or EOL

View File

@ -1137,7 +1137,6 @@ void _libssh2_session_shutdown(LIBSSH2_SESSION * session);
unsigned int _libssh2_ntohu32(const unsigned char *buf);
libssh2_uint64_t _libssh2_ntohu64(const unsigned char *buf);
void _libssh2_htonu32(unsigned char *buf, unsigned int val);
void _libssh2_htonu64(unsigned char *buf, libssh2_uint64_t val);
#ifdef WIN32
ssize_t _libssh2_recv(int socket, void *buffer, size_t length, int flags);

View File

@ -115,7 +115,7 @@ _libssh2_ntohu32(const unsigned char *buf)
}
/* libssh2_ntohu64
/* _libssh2_ntohu64
*/
libssh2_uint64_t
_libssh2_ntohu64(const unsigned char *buf)
@ -128,7 +128,7 @@ _libssh2_ntohu64(const unsigned char *buf)
return ((libssh2_uint64_t)msl <<32) | lsl;
}
/* libssh2_htonu32
/* _libssh2_htonu32
*/
void
_libssh2_htonu32(unsigned char *buf, unsigned int value)
@ -139,24 +139,6 @@ _libssh2_htonu32(unsigned char *buf, unsigned int value)
buf[3] = value & 0xFF;
}
/* libssh2_htonu64
*/
void
_libssh2_htonu64(unsigned char *buf, libssh2_uint64_t value)
{
unsigned long msl = ((libssh2_uint64_t)value >> 32);
buf[0] = (msl >> 24) & 0xFF;
buf[1] = (msl >> 16) & 0xFF;
buf[2] = (msl >> 8) & 0xFF;
buf[3] = msl & 0xFF;
buf[4] = (value >> 24) & 0xFF;
buf[5] = (value >> 16) & 0xFF;
buf[6] = (value >> 8) & 0xFF;
buf[7] = value & 0xFF;
}
/* Base64 Conversion */
static const char base64_table[] =
@ -240,8 +222,6 @@ libssh2_base64_decode(LIBSSH2_SESSION * session, char **data,
return 0;
}
/* }}} */
#ifdef LIBSSH2DEBUG
LIBSSH2_API int
libssh2_trace(LIBSSH2_SESSION * session, int bitmask)

View File

@ -51,6 +51,8 @@
#include <alloca.h>
#endif
#include "transport.h"
/* libssh2_default_alloc
*/
static

View File

@ -83,6 +83,24 @@
/* S_IFDIR */
#define LIBSSH2_SFTP_ATTR_PFILETYPE_DIR 0040000
/* libssh2_htonu64
*/
static void
_libssh2_htonu64(unsigned char *buf, libssh2_uint64_t value)
{
unsigned long msl = ((libssh2_uint64_t)value >> 32);
buf[0] = (msl >> 24) & 0xFF;
buf[1] = (msl >> 16) & 0xFF;
buf[2] = (msl >> 8) & 0xFF;
buf[3] = msl & 0xFF;
buf[4] = (value >> 24) & 0xFF;
buf[5] = (value >> 16) & 0xFF;
buf[6] = (value >> 8) & 0xFF;
buf[7] = value & 0xFF;
}
/*
* sftp_packet_add
*