diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-30 02:26:30 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-30 02:26:30 +0200 |
commit | ca127fccb899627e9e9a69d139bd27d79b30cd54 (patch) | |
tree | d6aba2530629cf805fc279dcb2702a3f66cdd177 /src/handshake.h | |
parent | 4d696a973af61e716959801c88b3ddbeca582e89 (diff) | |
download | fastd-ca127fccb899627e9e9a69d139bd27d79b30cd54.tar fastd-ca127fccb899627e9e9a69d139bd27d79b30cd54.zip |
Rework handshake... again. ecfxp protocol broken, will be fixed with next commit.
Diffstat (limited to 'src/handshake.h')
-rw-r--r-- | src/handshake.h | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/src/handshake.h b/src/handshake.h index 5e5e67f..064e167 100644 --- a/src/handshake.h +++ b/src/handshake.h @@ -28,9 +28,42 @@ #define _FASTD_HANDSHAKE_H_ #include "fastd.h" +#include "packet.h" + + +typedef enum _fastd_handshake_record_type { + RECORD_HANDSHAKE_TYPE = 0, + RECORD_REPLY_CODE, + RECORD_ERROR_DETAIL, + RECORD_FLAGS, + RECORD_MODE, + RECORD_PROTOCOL_NAME, + RECORD_MAX, +} fastd_handshake_record_type; + +typedef enum _fastd_reply_code { + REPLY_SUCCESS = 0, + REPLY_MANDATORY_MISSING, + REPLY_UNACCEPTABLE_VALUE, + REPLY_MAX, +} fastd_reply_code; + + +typedef struct _fastd_handshake_record { + size_t length; + void *data; +} fastd_handshake_record; + +struct _fastd_handshake { + uint8_t req_id; + fastd_handshake_record records[RECORD_MAX]; +}; + + +fastd_buffer fastd_handshake_new_init(fastd_context *ctx, fastd_peer *peer, size_t tail_space); +fastd_buffer fastd_handshake_new_reply(fastd_context *ctx, fastd_peer *peer, const fastd_handshake *handshake, size_t tail_space); -void fastd_handshake_send(fastd_context *ctx, fastd_peer *peer); -void fastd_handshake_rehandshake(fastd_context *ctx, fastd_peer *peer); void fastd_handshake_handle(fastd_context *ctx, fastd_peer *peer, fastd_buffer buffer); + #endif /* _FASTD_HANDSHAKE_H_ */ |