summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSam T <sta.cs.vsu@gmail.com>2013-04-03 01:12:22 +0400
committerSam T <sta.cs.vsu@gmail.com>2013-04-03 01:12:22 +0400
commit8f5985915ece236a29fcb340e1e0ef731e3214e9 (patch)
tree465eecee0d5fddda2175457cc47e7a3731ce268b /src
parentc104cd0854a4fe9178f2578ef5b998b716d9d907 (diff)
+ handshake datatype
Diffstat (limited to 'src')
-rw-r--r--src/Network/Torrent/Handshake.hs25
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 #-}
2module Network.Torrent.Handshake
3 ( Handshake
4 ) where
5
6import Data.Word
7import Data.ByteString (ByteString)
8import qualified Data.ByteString as B
9
10data Handshake = Handshake {
11 hsProtocol :: ByteString
12 , hsReserved :: Word64
13 , hsInfoHash :: ByteString
14 , hsPeerID :: ByteString
15 } deriving (Show, Eq)
16
17defaultProtocol :: ByteString
18defaultProtocol = "BitTorrent protocol"
19
20
21fromByteString :: ByteString -> Handshake
22fromByteString = undefined
23
24toByteString :: Handshake -> ByteString
25toByteString = undefined \ No newline at end of file