diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2018-07-27 17:08:02 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2018-07-27 17:08:02 +0200 |
commit | 48f11c634b04d6960404ba18240d33f6cc2d38aa (patch) | |
tree | 07756d7f87069e6d9065e737a3ac4a959b88aede /src/jail_protocol.h | |
parent | 4c31056b7bc7c5fbcf81bff0fdeb2229b4f8f0ad (diff) |
jail protocol handshake read/writefeature/jail_protocol
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/jail_protocol.h')
-rw-r--r-- | src/jail_protocol.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/jail_protocol.h b/src/jail_protocol.h index 51cdf54..b608253 100644 --- a/src/jail_protocol.h +++ b/src/jail_protocol.h @@ -16,14 +16,14 @@ #define PROTO_TYPE_PASS 0x42424242 #define PROTO_TYPE_DATA 0x43434343 -typedef struct __attribute__((packed, aligned(4))) jail_data { +typedef struct jail_data { int used; uint32_t last_type; char user[USER_LEN+1]; char pass[PASS_LEN+1]; } jail_data; -typedef struct jail_protocol_hdr { +typedef struct __attribute__((packed, aligned(4))) jail_protocol_hdr { uint32_t magic; uint32_t type; uint32_t size; @@ -38,8 +38,7 @@ ssize_t jail_protocol_writehdr(int type, unsigned char *buf, size_t bufsiz); int jail_protocol_handshake_read(event_ctx *ev_client, int client_fd, int tty_fd, jail_data *dst); -int jail_protocol_handshake_write(event_ctx *ev_server, int server_fd, - int proto_fd, jail_data *dst); +int jail_protocol_handshake_write(int server_fd, jail_data *dst); int jail_protocol_loop(event_ctx *ctx, on_event_cb on_event, void *user_data); |