1
#ifndef __LIBSSH2_MISC_H
2
#define __LIBSSH2_MISC_H
3
/* Copyright (c) 2009-2010 by Daniel Stenberg
7
* Redistribution and use in source and binary forms,
8
* with or without modification, are permitted provided
9
* that the following conditions are met:
11
* Redistributions of source code must retain the above
12
* copyright notice, this list of conditions and the
13
* following disclaimer.
15
* Redistributions in binary form must reproduce the above
16
* copyright notice, this list of conditions and the following
17
* disclaimer in the documentation and/or other materials
18
* provided with the distribution.
20
* Neither the name of the copyright holder nor the names
21
* of any other contributors may be used to endorse or
22
* promote products derived from this software without
23
* specific prior written permission.
25
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
26
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
27
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
28
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
30
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
32
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
33
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
35
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
36
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
37
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
42
struct list_node *last;
43
struct list_node *first;
47
struct list_node *next;
48
struct list_node *prev;
49
struct list_head *head;
52
int _libssh2_error(LIBSSH2_SESSION* session, int errcode, const char* errmsg);
54
void _libssh2_list_init(struct list_head *head);
56
/* add a node last in the list */
57
void _libssh2_list_add(struct list_head *head,
58
struct list_node *entry);
60
/* return the "first" node in the list this head points to */
61
void *_libssh2_list_first(struct list_head *head);
63
/* return the next node in the list */
64
void *_libssh2_list_next(struct list_node *node);
66
/* return the prev node in the list */
67
void *_libssh2_list_prev(struct list_node *node);
69
/* remove this node from the list */
70
void _libssh2_list_remove(struct list_node *entry);
72
size_t _libssh2_base64_encode(struct _LIBSSH2_SESSION *session,
73
const char *inp, size_t insize, char **outptr);
75
unsigned int _libssh2_ntohu32(const unsigned char *buf);
76
libssh2_uint64_t _libssh2_ntohu64(const unsigned char *buf);
77
void _libssh2_htonu32(unsigned char *buf, uint32_t val);
78
void _libssh2_store_u32(unsigned char **buf, uint32_t value);
79
void _libssh2_store_str(unsigned char **buf, const char *str, size_t len);
81
#endif /* _LIBSSH2_MISC_H */