Mercurial > dropbear
comparison channel.h @ 511:582cb38e4eb5 insecure-nocrypto
propagate from branch 'au.asn.ucc.matt.dropbear' (head cdcc3c729e29544e8b98a408e2dc60e4483dfd2a)
to branch 'au.asn.ucc.matt.dropbear.insecure-nocrypto' (head 0ca38a1cf349f7426ac9de34ebe4c3e3735effab)
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 06 Nov 2008 13:16:55 +0000 |
parents | 9c61e7af0156 |
children | cf376c696dfc |
comparison
equal
deleted
inserted
replaced
361:461c4b1fb35f | 511:582cb38e4eb5 |
---|---|
43 #define SSH_OPEN_RESOURCE_SHORTAGE 4 | 43 #define SSH_OPEN_RESOURCE_SHORTAGE 4 |
44 | 44 |
45 /* Not a real type */ | 45 /* Not a real type */ |
46 #define SSH_OPEN_IN_PROGRESS 99 | 46 #define SSH_OPEN_IN_PROGRESS 99 |
47 | 47 |
48 #define MAX_CHANNELS 100 /* simple mem restriction, includes each tcp/x11 | |
49 connection, so can't be _too_ small */ | |
50 | |
51 #define CHAN_EXTEND_SIZE 3 /* how many extra slots to add when we need more */ | 48 #define CHAN_EXTEND_SIZE 3 /* how many extra slots to add when we need more */ |
52 | |
53 #define RECV_MAXWINDOW 8000 /* tweak */ | |
54 #define RECV_WINDOWEXTEND 1000 /* We send a "window extend" every | |
55 RECV_WINDOWEXTEND bytes */ | |
56 #define RECV_MAXPACKET RECV_MAXWINDOW /* tweak */ | |
57 | 49 |
58 struct ChanType; | 50 struct ChanType; |
59 | 51 |
60 struct Channel { | 52 struct Channel { |
61 | 53 |
71 Doesn't exactly belong here, but is cleaner here */ | 63 Doesn't exactly belong here, but is cleaner here */ |
72 circbuffer *writebuf; /* data from the wire, for local consumption */ | 64 circbuffer *writebuf; /* data from the wire, for local consumption */ |
73 circbuffer *extrabuf; /* extended-data for the program - used like writebuf | 65 circbuffer *extrabuf; /* extended-data for the program - used like writebuf |
74 but for stderr */ | 66 but for stderr */ |
75 | 67 |
76 int sentclosed, recvclosed; | 68 /* whether close/eof messages have been exchanged */ |
77 | 69 int sent_close, recv_close; |
78 /* this is set when we receive/send a channel eof packet */ | 70 int recv_eof, sent_eof; |
79 int recveof, senteof; | |
80 | 71 |
81 int initconn; /* used for TCP forwarding, whether the channel has been | 72 int initconn; /* used for TCP forwarding, whether the channel has been |
82 fully initialised */ | 73 fully initialised */ |
83 | 74 |
84 int await_open; /* flag indicating whether we've sent an open request | 75 int await_open; /* flag indicating whether we've sent an open request |
85 for this channel (and are awaiting a confirmation | 76 for this channel (and are awaiting a confirmation |
86 or failure). */ | 77 or failure). */ |
78 | |
79 int flushing; | |
87 | 80 |
88 const struct ChanType* type; | 81 const struct ChanType* type; |
89 | 82 |
90 }; | 83 }; |
91 | 84 |
92 struct ChanType { | 85 struct ChanType { |
93 | 86 |
94 int sepfds; /* Whether this channel has seperate pipes for in/out or not */ | 87 int sepfds; /* Whether this channel has seperate pipes for in/out or not */ |
95 char *name; | 88 char *name; |
96 int (*inithandler)(struct Channel*); | 89 int (*inithandler)(struct Channel*); |
97 int (*checkclose)(struct Channel*); | 90 int (*check_close)(struct Channel*); |
98 void (*reqhandler)(struct Channel*); | 91 void (*reqhandler)(struct Channel*); |
99 void (*closehandler)(struct Channel*); | 92 void (*closehandler)(struct Channel*); |
100 | 93 |
101 }; | 94 }; |
102 | 95 |