Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
LSH
lsh
Commits
4167debe
Commit
4167debe
authored
Sep 03, 1998
by
Niels Möller
Browse files
Added handler for unimplemented packet types.
Rev: src/connection.c:1.2 Rev: src/connection.h:1.2
parent
847942db
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/connection.c
View file @
4167debe
...
...
@@ -4,6 +4,8 @@
#include
"connection.h"
#include
"xalloc.h"
#include
"ssh.h"
#include
"format.h"
struct
ssh_connection
*
ssh_connection_alloc
()
{
...
...
@@ -15,3 +17,27 @@ struct ssh_connection *ssh_connection_alloc()
return
connection
;
}
static
int
handle_unimplemented
(
struct
abstract_write
**
w
,
struct
lsh_string
*
packet
)
{
struct
abstract_write_pipe
*
closure
=
(
struct
abstract_write_pipe
*
)
*
w
;
return
A_WRITE
(
closure
->
next
,
ssh_format
(
"%c%i"
,
SSH_MSG_UNIMPLEMENTED
,
packet
->
sequence_number
));
}
struct
abstract_write
*
make_unimplemented
(
struct
abstract_write
*
w
)
{
struct
abstract_write_pipe
*
res
=
xalloc
(
sizeof
(
struct
abstract_write_pipe
));
res
->
super
.
write
=
handle_unimplemented
;
res
->
next
=
w
;
return
&
res
->
super
;
}
src/connection.h
View file @
4167debe
...
...
@@ -6,6 +6,7 @@
#define LSH_CONNECTION_H_INCLUDED
#include
"lsh_types.h"
#include
"abstract_io.h"
struct
ssh_connection
{
...
...
@@ -24,4 +25,14 @@ struct ssh_connection
struct
ssh_connection
*
ssh_connection_alloc
();
struct
connection_closure
{
struct
abstract_write
super
;
struct
connection
*
connection
;
};
#if 0
struct abstract_write *make_unimplemented(struct connection *c);
#endif
#endif
/* LSH_CONNECTION_H_INCLUDED */
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment