/* ****************************************************************************** * HEADER FILE * * Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipssh_buffer.h,v $ $Revision: 1.11.10.1 $ * $Source: /home/interpeak/CVSRoot/ipssh/src/ipssh_buffer.h,v $ * $Author: ulf $ $Date: 2011-09-22 11:40:52 $ * $State: Exp $ $Locker: $ * * INTERPEAK_COPYRIGHT_STRING * Design and implementation by Roger Boden ****************************************************************************** */ #ifndef ipssh_buffer_h #define ipssh_buffer_h /* **************************************************************************** * 1 DESCRIPTION **************************************************************************** */ /* **************************************************************************** * 2 CONFIGURATION **************************************************************************** */ /* **************************************************************************** * 3 INCLUDE FILES **************************************************************************** */ #include "ipcom_buffer.h" #include "ipssh_list.h" #include #include #ifdef __cplusplus extern "C" { #endif /* **************************************************************************** * 4 DEFINES **************************************************************************** */ #define ipssh_buffer_get_uint(buf, val) ipssh_buffer_get_int(buf, (Ip_s32*)val) #define ipssh_buffer_put_uint(buf, val) ipcom_buffer_put_int(buf, (Ip_s32)ip_htonl(val)) #define ipssh_buffer_put_int(buf, val) ipcom_buffer_put_int(buf, ip_htonl(val)) /* **************************************************************************** * 5 TYPES **************************************************************************** */ /* **************************************************************************** * 6 FUNCTIONS **************************************************************************** */ IP_GLOBAL Ip_err ipssh_buffer_put_sshstr(Ipcom_buffer* buf, const char* str); IP_GLOBAL Ip_err ipssh_buffer_put_sshbuf(Ipcom_buffer* buf, const Ip_u8* str, Ip_size_t len); IP_GLOBAL char* ipssh_buffer_get_sshstr(Ipcom_buffer* buf); IP_GLOBAL Ip_u8* ipssh_buffer_get_sshbuf(Ipcom_buffer* buf, Ip_u32* len); IP_GLOBAL Ip_err ipssh_buffer_get_ssh_mpint(Ipcom_buffer* buf, Ip_u8* mpint, Ip_size_t len); IP_GLOBAL Ip_err ipssh_buffer_get_ssh_mpint2(Ipcom_buffer* buf, BIGNUM** bn); IP_GLOBAL Ip_err ipssh_buffer_put_ssh_mpint(Ipcom_buffer* buf, Ip_u8* mpint, Ip_size_t len); IP_GLOBAL Ip_err ipssh_buffer_put_ssh_mpint2(Ipcom_buffer* buf, BIGNUM* bn); IP_GLOBAL Ip_err ipssh_buffer_get_int(Ipcom_buffer* buf, Ip_s32* val); IP_PUBLIC Ip_err ipssh_buffer_put_u64(Ipcom_buffer* buf, Ip_u64 val); IP_GLOBAL Ip_err ipssh_buffer_get_u64(Ipcom_buffer* buf, Ip_u64* val); IP_GLOBAL Ip_err ipssh_append_list(Ipcom_buffer* buf, Ip_u8* alg_ids); IP_GLOBAL Ip_err ipssh_buffer_put_dsa_key(Ipcom_buffer* buf, DSA* dsa); IP_GLOBAL Ip_err ipssh_buffer_put_rsa_key(Ipcom_buffer* buf, RSA* dsa); IP_GLOBAL EVP_PKEY* ipssh_buffer_get_pub_key(Ipcom_buffer* buf); IP_GLOBAL Ip_err ipssh_buffer_put_pub_key(Ipcom_buffer* buf, EVP_PKEY* key); IP_GLOBAL Ip_err ipssh_buffer_put_bn(Ipcom_buffer* buf, BIGNUM* bn); IP_GLOBAL Ip_err ipssh_buffer_put_bn_v1(Ipcom_buffer* buf, BIGNUM* bn); IP_GLOBAL Ip_err ipssh_buffer_put_bn2_v1(Ipcom_buffer* buf, Ip_u8* value, Ip_u16 bits); IP_GLOBAL BIGNUM* ipssh_buffer_get_v1_bn(Ipcom_buffer* buf); IP_GLOBAL Ipcom_buffer* ipssh_buffer_new_v1_pkt(Ip_size_t size, Ip_u8 pkt_type); IP_GLOBAL Ipcom_buffer* ipssh_buffer_new_v2_pkt(Ip_size_t size, Ip_u8 pkt_type); IP_GLOBAL Ipcom_buffer* ipssh_buffer_new_sftp_pkt(Ip_size_t sftp_msg_size, Ip_u8 sftp_msg_type); IP_GLOBAL Ipcom_buffer* ipssh_buffer_new_channel_data_pkt(Ip_size_t pkt_size, Ipssh_channel* channel); #if defined(IPCOM_USE_DMALLOC) && !defined(IPCOM_DMALLOC_C) IP_PUBLIC char* ipssh_buffer_get_sshstr_d(Ipcom_buffer* buf, const char *file, const char *function, Ip_u32 line); #define ipssh_buffer_get_sshstr(b) ipssh_buffer_get_sshstr_d(b, __FILE__, __FUNCTION__, __LINE__) #endif #ifdef __cplusplus } #endif #endif /* **************************************************************************** * END OF FILE **************************************************************************** */