version 1.2.2.4, 2001/03/21 18:52:45 |
version 1.3, 2000/06/20 01:39:41 |
|
|
* 2. Redistributions in binary form must reproduce the above copyright |
* 2. Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* documentation and/or other materials provided with the distribution. |
|
* 3. All advertising materials mentioning features or use of this software |
|
* must display the following acknowledgement: |
|
* This product includes software developed by Markus Friedl. |
|
* 4. The name of the author may not be used to endorse or promote products |
|
* derived from this software without specific prior written permission. |
* |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
|
|
*/ |
*/ |
#include "includes.h" |
#include "includes.h" |
RCSID("$OpenBSD$"); |
RCSID("$OpenBSD$"); |
|
#include "ssh.h" |
#include "ssh1.h" |
|
#include "ssh2.h" |
|
#include "log.h" |
|
#include "dispatch.h" |
#include "dispatch.h" |
#include "packet.h" |
#include "packet.h" |
#include "compat.h" |
|
|
|
#define DISPATCH_MIN 0 |
#define DISPATCH_MIN 0 |
#define DISPATCH_MAX 255 |
#define DISPATCH_MAX 255 |
|
|
dispatch_fn *dispatch[DISPATCH_MAX]; |
dispatch_fn *dispatch[DISPATCH_MAX]; |
|
|
void |
void |
dispatch_protocol_error(int type, int plen, void *ctxt) |
dispatch_protocol_error(int type, int plen) |
{ |
{ |
error("Hm, dispatch protocol error: type %d plen %d", type, plen); |
error("Hm, dispatch protocol error: type %d plen %d", type, plen); |
if (compat20 && type == SSH2_MSG_KEXINIT) |
|
fatal("dispatch_protocol_error: rekeying is not supported"); |
|
} |
} |
void |
void |
dispatch_init(dispatch_fn *dflt) |
dispatch_init(dispatch_fn *dflt) |
|
|
dispatch[type] = fn; |
dispatch[type] = fn; |
} |
} |
void |
void |
dispatch_run(int mode, int *done, void *ctxt) |
dispatch_run(int mode, int *done) |
{ |
{ |
for (;;) { |
for (;;) { |
int plen; |
int plen; |
|
|
return; |
return; |
} |
} |
if (type > 0 && type < DISPATCH_MAX && dispatch[type] != NULL) |
if (type > 0 && type < DISPATCH_MAX && dispatch[type] != NULL) |
(*dispatch[type])(type, plen, ctxt); |
(*dispatch[type])(type, plen); |
else |
else |
packet_disconnect("protocol error: rcvd type %d", type); |
packet_disconnect("protocol error: rcvd type %d", type); |
if (done != NULL && *done) |
if (done != NULL && *done) |
return; |
return; |
} |
} |