diff options
author | lns <matzeton@googlemail.com> | 2018-08-13 15:54:49 +0200 |
---|---|---|
committer | lns <matzeton@googlemail.com> | 2018-08-13 16:27:53 +0200 |
commit | 63f2669df12d6833d0049313594e1f366e0c4127 (patch) | |
tree | 4cdd8d0c6d3538915b23dcaafb6bc17da0228e13 /src/jail_packet.h | |
parent | d6bbb0e218ea74e6205cfc0b180e768e80e1bc31 (diff) |
basic jail packet parsing functions
Signed-off-by: lns <matzeton@googlemail.com>
Diffstat (limited to 'src/jail_packet.h')
-rw-r--r-- | src/jail_packet.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/jail_packet.h b/src/jail_packet.h index 0fc202d..55016d5 100644 --- a/src/jail_packet.h +++ b/src/jail_packet.h @@ -38,19 +38,23 @@ #include "pevent.h" -#define PKT_INVALID 0x0 -#define PKT_HELLO 0x1 +#define PKT_INVALID 0x0 /* should not happen, otherwise error */ +#define PKT_HELLO 0x1 /* request(PKT_HELLO) -> response(PKT_HELLO) */ +#define PKT_USER 0x2 /* request(PKT_USER) -> response(PKT_USER) */ +#define PKT_PASS 0x3 /* request(PKT_PASS) -> response(PKT_PASS) */ typedef enum jail_packet_state { JP_NONE, JP_INVALID, JP_HELLO } jail_packet_state; typedef struct jail_packet_ctx { + int is_server; jail_packet_state pstate; + on_data_cb on_data; + void *user_data; } jail_packet_ctx; -int jail_packet_loop(event_ctx *ctx, jail_packet_ctx *pkt_ctx, - on_data_cb on_data); +int jail_packet_loop(event_ctx *ctx, jail_packet_ctx *pkt_ctx); #endif |