1 #ifndef __LIBSSH2_PACKET_H
2 #define __LIBSSH2_PACKET_H
3 /*
4  * Copyright (C) 2010 by Daniel Stenberg
5  * Author: Daniel Stenberg <daniel@haxx.se>
6  *
7  * Redistribution and use in source and binary forms,
8  * with or without modification, are permitted provided
9  * that the following conditions are met:
10  *
11  *   Redistributions of source code must retain the above
12  *   copyright notice, this list of conditions and the
13  *   following disclaimer.
14  *
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.
19  *
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.
24  *
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
38  * OF SUCH DAMAGE.
39  *
40  */
41 
42 int _libssh2_packet_read(LIBSSH2_SESSION * session);
43 
44 int _libssh2_packet_ask(LIBSSH2_SESSION * session, unsigned char packet_type,
45                         unsigned char **data, size_t *data_len,
46                         int match_ofs,
47                         const unsigned char *match_buf,
48                         size_t match_len);
49 
50 int _libssh2_packet_askv(LIBSSH2_SESSION * session,
51                          const unsigned char *packet_types,
52                          unsigned char **data, size_t *data_len,
53                          int match_ofs,
54                          const unsigned char *match_buf,
55                          size_t match_len);
56 int _libssh2_packet_require(LIBSSH2_SESSION * session,
57                             unsigned char packet_type, unsigned char **data,
58                             size_t *data_len, int match_ofs,
59                             const unsigned char *match_buf,
60                             size_t match_len,
61                             packet_require_state_t * state);
62 int _libssh2_packet_requirev(LIBSSH2_SESSION *session,
63                              const unsigned char *packet_types,
64                              unsigned char **data, size_t *data_len,
65                              int match_ofs,
66                              const unsigned char *match_buf,
67                              size_t match_len,
68                              packet_requirev_state_t * state);
69 int _libssh2_packet_burn(LIBSSH2_SESSION * session,
70                          libssh2_nonblocking_states * state);
71 int _libssh2_packet_write(LIBSSH2_SESSION * session, unsigned char *data,
72                           unsigned long data_len);
73 int _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data,
74                         size_t datalen, int macstate);
75 
76 #endif /* __LIBSSH2_PACKET_H */
77