libssh  0.5.4
packet.h
1 /*
2  * This file is part of the SSH Library
3  *
4  * Copyright (c) 2009 by Aris Adamantiadis
5  *
6  * The SSH Library is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation; either version 2.1 of the License, or (at your
9  * option) any later version.
10  *
11  * The SSH Library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14  * License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with the SSH Library; see the file COPYING. If not, write to
18  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
19  * MA 02111-1307, USA.
20  */
21 
22 #ifndef PACKET_H_
23 #define PACKET_H_
24 
25 /* this structure should go someday */
26 typedef struct packet_struct {
27  int valid;
28  uint32_t len;
29  uint8_t type;
30 } PACKET;
31 
33 enum ssh_packet_state_e {
35  PACKET_STATE_INIT,
37  PACKET_STATE_SIZEREAD,
40  PACKET_STATE_PROCESSING
41 };
42 
43 int packet_send(ssh_session session);
44 
45 #ifdef WITH_SSH1
46 int packet_send1(ssh_session session) ;
47 void ssh_packet_set_default_callbacks1(ssh_session session);
48 
49 SSH_PACKET_CALLBACK(ssh_packet_disconnect1);
50 SSH_PACKET_CALLBACK(ssh_packet_smsg_success1);
51 SSH_PACKET_CALLBACK(ssh_packet_smsg_failure1);
52 int ssh_packet_socket_callback1(const void *data, size_t receivedlen, void *user);
53 
54 #endif
55 
56 SSH_PACKET_CALLBACK(ssh_packet_unimplemented);
57 int ssh_packet_send_unimplemented(ssh_session session, uint32_t seqnum);
58 int ssh_packet_parse_type(ssh_session session);
59 //int packet_flush(ssh_session session, int enforce_blocking);
60 
61 
62 #endif /* PACKET_H_ */