diff options
author | Sam T <sta.cs.vsu@gmail.com> | 2013-04-03 01:12:22 +0400 |
---|---|---|
committer | Sam T <sta.cs.vsu@gmail.com> | 2013-04-03 01:12:22 +0400 |
commit | 8f5985915ece236a29fcb340e1e0ef731e3214e9 (patch) | |
tree | 465eecee0d5fddda2175457cc47e7a3731ce268b /src/Network/Torrent | |
parent | c104cd0854a4fe9178f2578ef5b998b716d9d907 (diff) |
+ handshake datatype
Diffstat (limited to 'src/Network/Torrent')
-rw-r--r-- | src/Network/Torrent/Handshake.hs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/Network/Torrent/Handshake.hs b/src/Network/Torrent/Handshake.hs new file mode 100644 index 00000000..d48d04e6 --- /dev/null +++ b/src/Network/Torrent/Handshake.hs | |||
@@ -0,0 +1,25 @@ | |||
1 | {-# LANGUAGE OverloadedStrings #-} | ||
2 | module Network.Torrent.Handshake | ||
3 | ( Handshake | ||
4 | ) where | ||
5 | |||
6 | import Data.Word | ||
7 | import Data.ByteString (ByteString) | ||
8 | import qualified Data.ByteString as B | ||
9 | |||
10 | data Handshake = Handshake { | ||
11 | hsProtocol :: ByteString | ||
12 | , hsReserved :: Word64 | ||
13 | , hsInfoHash :: ByteString | ||
14 | , hsPeerID :: ByteString | ||
15 | } deriving (Show, Eq) | ||
16 | |||
17 | defaultProtocol :: ByteString | ||
18 | defaultProtocol = "BitTorrent protocol" | ||
19 | |||
20 | |||
21 | fromByteString :: ByteString -> Handshake | ||
22 | fromByteString = undefined | ||
23 | |||
24 | toByteString :: Handshake -> ByteString | ||
25 | toByteString = undefined \ No newline at end of file | ||