comparison channel.h @ 297:79bf1023cf11 agent-client

propagate from branch 'au.asn.ucc.matt.dropbear' (head 0501e6f661b5415eb76f3b312d183c3adfbfb712) to branch 'au.asn.ucc.matt.dropbear.cli-agent' (head 01038174ec27245b51bd43a66c01ad930880f67b)
author Matt Johnston <matt@ucc.asn.au>
date Tue, 21 Mar 2006 16:20:59 +0000
parents 84925eceeb13
children 78518751cb82
comparison
equal deleted inserted replaced
225:ca7e76d981d9 297:79bf1023cf11
63 unsigned int remotechan; 63 unsigned int remotechan;
64 unsigned int recvwindow, transwindow; 64 unsigned int recvwindow, transwindow;
65 unsigned int recvdonelen; 65 unsigned int recvdonelen;
66 unsigned int recvmaxpacket, transmaxpacket; 66 unsigned int recvmaxpacket, transmaxpacket;
67 void* typedata; /* a pointer to type specific data */ 67 void* typedata; /* a pointer to type specific data */
68 int infd; /* data to send over the wire */ 68 int writefd; /* read from wire, written to insecure side */
69 int outfd; /* data for consumption, what was in writebuf */ 69 int readfd; /* read from insecure size, written to wire */
70 int errfd; /* used like infd or errfd, depending if it's client or server. 70 int errfd; /* used like writefd or readfd, depending if it's client or server.
71 Doesn't exactly belong here, but is cleaner here */ 71 Doesn't exactly belong here, but is cleaner here */
72 circbuffer *writebuf; /* data from the wire, for local consumption */ 72 circbuffer *writebuf; /* data from the wire, for local consumption */
73 circbuffer *extrabuf; /* extended-data for the program - used like writebuf 73 circbuffer *extrabuf; /* extended-data for the program - used like writebuf
74 but for stderr */ 74 but for stderr */
75 75
78 /* this is set when we receive/send a channel eof packet */ 78 /* this is set when we receive/send a channel eof packet */
79 int recveof, senteof; 79 int recveof, senteof;
80 80
81 int initconn; /* used for TCP forwarding, whether the channel has been 81 int initconn; /* used for TCP forwarding, whether the channel has been
82 fully initialised */ 82 fully initialised */
83
84 int await_open; /* flag indicating whether we've sent an open request
85 for this channel (and are awaiting a confirmation
86 or failure). */
83 87
84 const struct ChanType* type; 88 const struct ChanType* type;
85 89
86 }; 90 };
87 91
94 void (*reqhandler)(struct Channel*); 98 void (*reqhandler)(struct Channel*);
95 void (*closehandler)(struct Channel*); 99 void (*closehandler)(struct Channel*);
96 100
97 }; 101 };
98 102
99 void chaninitialise(); 103 void chaninitialise(const struct ChanType *chantypes[]);
100 void chancleanup(); 104 void chancleanup();
101 void setchannelfds(fd_set *readfd, fd_set *writefd); 105 void setchannelfds(fd_set *readfd, fd_set *writefd);
102 void channelio(fd_set *readfd, fd_set *writefd); 106 void channelio(fd_set *readfd, fd_set *writefd);
103 struct Channel* getchannel(); 107 struct Channel* getchannel();
104 struct Channel* newchannel(unsigned int remotechan, 108 struct Channel* newchannel(unsigned int remotechan,
117 121
118 void common_recv_msg_channel_data(struct Channel *channel, int fd, 122 void common_recv_msg_channel_data(struct Channel *channel, int fd,
119 circbuffer * buf); 123 circbuffer * buf);
120 124
121 #ifdef DROPBEAR_CLIENT 125 #ifdef DROPBEAR_CLIENT
122 const struct ChanType clichansess; 126 extern const struct ChanType clichansess;
123 #endif 127 #endif
124 128
125 #if defined(USING_LISTENERS) || defined(DROPBEAR_CLIENT) 129 #if defined(USING_LISTENERS) || defined(DROPBEAR_CLIENT)
126 int send_msg_channel_open_init(int fd, const struct ChanType *type); 130 int send_msg_channel_open_init(int fd, const struct ChanType *type);
127 void recv_msg_channel_open_confirmation(); 131 void recv_msg_channel_open_confirmation();