diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Network/BitTorrent.hs | 9 | ||||
-rw-r--r-- | src/Network/BitTorrent/PeerID.hs (renamed from src/Network/Torrent/PeerID.hs) | 2 | ||||
-rw-r--r-- | src/Network/BitTorrent/PeerWire.hs | 17 | ||||
-rw-r--r-- | src/Network/BitTorrent/PeerWire/Block.hs (renamed from src/Network/Torrent/PeerWire/Block.hs) | 2 | ||||
-rw-r--r-- | src/Network/BitTorrent/PeerWire/Handshake.hs (renamed from src/Network/Torrent/PeerWire/Handshake.hs) | 6 | ||||
-rw-r--r-- | src/Network/BitTorrent/PeerWire/Message.hs (renamed from src/Network/Torrent/PeerWire/Message.hs) | 4 | ||||
-rw-r--r-- | src/Network/BitTorrent/Tracker.hs (renamed from src/Network/Torrent/Tracker.hs) | 10 | ||||
-rw-r--r-- | src/Network/BitTorrent/Tracker/Scrape.hs (renamed from src/Network/Torrent/Tracker/Scrape.hs) | 2 | ||||
-rw-r--r-- | src/Network/Torrent.hs | 9 | ||||
-rw-r--r-- | src/Network/Torrent/PeerWire.hs | 17 |
10 files changed, 40 insertions, 38 deletions
diff --git a/src/Network/BitTorrent.hs b/src/Network/BitTorrent.hs new file mode 100644 index 00000000..9c1977d4 --- /dev/null +++ b/src/Network/BitTorrent.hs | |||
@@ -0,0 +1,9 @@ | |||
1 | module Network.BitTorrent | ||
2 | ( module Network.BitTorrent.PeerID | ||
3 | , module Network.BitTorrent.Tracker | ||
4 | , module Network.BitTorrent.PeerWire | ||
5 | ) where | ||
6 | |||
7 | import Network.BitTorrent.PeerID | ||
8 | import Network.BitTorrent.Tracker | ||
9 | import Network.BitTorrent.PeerWire | ||
diff --git a/src/Network/Torrent/PeerID.hs b/src/Network/BitTorrent/PeerID.hs index 7d928f80..cef1fa58 100644 --- a/src/Network/Torrent/PeerID.hs +++ b/src/Network/BitTorrent/PeerID.hs | |||
@@ -12,7 +12,7 @@ | |||
12 | -- though this module exports some other goodies for custom generation. | 12 | -- though this module exports some other goodies for custom generation. |
13 | -- | 13 | -- |
14 | {-# LANGUAGE OverloadedStrings, GeneralizedNewtypeDeriving #-} | 14 | {-# LANGUAGE OverloadedStrings, GeneralizedNewtypeDeriving #-} |
15 | module Network.Torrent.PeerID | 15 | module Network.BitTorrent.PeerID |
16 | ( -- * Peer addr | 16 | ( -- * Peer addr |
17 | Peer(..) | 17 | Peer(..) |
18 | , peerSockAddr, connectToPeer | 18 | , peerSockAddr, connectToPeer |
diff --git a/src/Network/BitTorrent/PeerWire.hs b/src/Network/BitTorrent/PeerWire.hs new file mode 100644 index 00000000..768da5f2 --- /dev/null +++ b/src/Network/BitTorrent/PeerWire.hs | |||
@@ -0,0 +1,17 @@ | |||
1 | -- | | ||
2 | -- Copyright : (c) Sam T. 2013 | ||
3 | -- License : MIT | ||
4 | -- Maintainer : pxqr.sta@gmail.com | ||
5 | -- Stability : experimental | ||
6 | -- Portability : portable | ||
7 | -- | ||
8 | {-# LANGUAGE DoAndIfThenElse #-} | ||
9 | module Network.BitTorrent.PeerWire | ||
10 | ( module Network.BitTorrent.PeerWire.Block | ||
11 | , module Network.BitTorrent.PeerWire.Message | ||
12 | , module Network.BitTorrent.PeerWire.Handshake | ||
13 | ) where | ||
14 | |||
15 | import Network.BitTorrent.PeerWire.Block | ||
16 | import Network.BitTorrent.PeerWire.Message | ||
17 | import Network.BitTorrent.PeerWire.Handshake | ||
diff --git a/src/Network/Torrent/PeerWire/Block.hs b/src/Network/BitTorrent/PeerWire/Block.hs index 056f6b18..33e3dead 100644 --- a/src/Network/Torrent/PeerWire/Block.hs +++ b/src/Network/BitTorrent/PeerWire/Block.hs | |||
@@ -1,4 +1,4 @@ | |||
1 | module Network.Torrent.PeerWire.Block | 1 | module Network.BitTorrent.PeerWire.Block |
2 | ( BlockIx(..), Block(..) | 2 | ( BlockIx(..), Block(..) |
3 | , defaultBlockSize | 3 | , defaultBlockSize |
4 | , blockRange, ixRange, pieceIx | 4 | , blockRange, ixRange, pieceIx |
diff --git a/src/Network/Torrent/PeerWire/Handshake.hs b/src/Network/BitTorrent/PeerWire/Handshake.hs index 733d5785..6ce37887 100644 --- a/src/Network/Torrent/PeerWire/Handshake.hs +++ b/src/Network/BitTorrent/PeerWire/Handshake.hs | |||
@@ -6,7 +6,7 @@ | |||
6 | -- Portability : portable | 6 | -- Portability : portable |
7 | -- | 7 | -- |
8 | {-# LANGUAGE OverloadedStrings #-} | 8 | {-# LANGUAGE OverloadedStrings #-} |
9 | module Network.Torrent.PeerWire.Handshake | 9 | module Network.BitTorrent.PeerWire.Handshake |
10 | ( Handshake | 10 | ( Handshake |
11 | , handshakeMaxSize | 11 | , handshakeMaxSize |
12 | , defaultBTProtocol, defaultReserved, defaultHandshake | 12 | , defaultBTProtocol, defaultReserved, defaultHandshake |
@@ -21,7 +21,9 @@ import Data.Serialize as S | |||
21 | import Data.Torrent.InfoHash | 21 | import Data.Torrent.InfoHash |
22 | import Network | 22 | import Network |
23 | import Network.Socket.ByteString | 23 | import Network.Socket.ByteString |
24 | import Network.Torrent.PeerID | 24 | |
25 | import Network.BitTorrent.PeerID | ||
26 | |||
25 | 27 | ||
26 | -- | In order to establish the connection between peers we should send 'Handshake' | 28 | -- | In order to establish the connection between peers we should send 'Handshake' |
27 | -- message. The 'Handshake' is a required message and must be the first message | 29 | -- message. The 'Handshake' is a required message and must be the first message |
diff --git a/src/Network/Torrent/PeerWire/Message.hs b/src/Network/BitTorrent/PeerWire/Message.hs index e04038ff..1bcb2ee5 100644 --- a/src/Network/Torrent/PeerWire/Message.hs +++ b/src/Network/BitTorrent/PeerWire/Message.hs | |||
@@ -1,4 +1,4 @@ | |||
1 | module Network.Torrent.PeerWire.Message | 1 | module Network.BitTorrent.PeerWire.Message |
2 | ( Message(..) | 2 | ( Message(..) |
3 | ) where | 3 | ) where |
4 | 4 | ||
@@ -8,7 +8,7 @@ import qualified Data.ByteString as B | |||
8 | 8 | ||
9 | import Data.Serialize | 9 | import Data.Serialize |
10 | 10 | ||
11 | import Network.Torrent.PeerWire.Block | 11 | import Network.BitTorrent.PeerWire.Block |
12 | 12 | ||
13 | 13 | ||
14 | -- TODO comment message constructors | 14 | -- TODO comment message constructors |
diff --git a/src/Network/Torrent/Tracker.hs b/src/Network/BitTorrent/Tracker.hs index ffbdc949..3cafbe1d 100644 --- a/src/Network/Torrent/Tracker.hs +++ b/src/Network/BitTorrent/Tracker.hs | |||
@@ -8,8 +8,8 @@ | |||
8 | -- | 8 | -- |
9 | {-# OPTIONS -fno-warn-orphans #-} | 9 | {-# OPTIONS -fno-warn-orphans #-} |
10 | {-# LANGUAGE OverloadedStrings #-} | 10 | {-# LANGUAGE OverloadedStrings #-} |
11 | module Network.Torrent.Tracker | 11 | module Network.BitTorrent.Tracker |
12 | ( module Network.Torrent.Tracker.Scrape | 12 | ( module Network.BitTorrent.Tracker.Scrape |
13 | 13 | ||
14 | -- * Requests | 14 | -- * Requests |
15 | , Event(..), TRequest(..) | 15 | , Event(..), TRequest(..) |
@@ -24,8 +24,6 @@ module Network.Torrent.Tracker | |||
24 | ) | 24 | ) |
25 | where | 25 | where |
26 | 26 | ||
27 | import Network.Torrent.Tracker.Scrape | ||
28 | |||
29 | import Control.Applicative | 27 | import Control.Applicative |
30 | import Data.Char as Char | 28 | import Data.Char as Char |
31 | import Data.Word (Word32) | 29 | import Data.Word (Word32) |
@@ -44,7 +42,9 @@ import Network | |||
44 | import Network.Socket | 42 | import Network.Socket |
45 | import Network.HTTP | 43 | import Network.HTTP |
46 | import Network.URI | 44 | import Network.URI |
47 | import Network.Torrent.PeerID | 45 | |
46 | import Network.BitTorrent.PeerID | ||
47 | import Network.BitTorrent.Tracker.Scrape | ||
48 | 48 | ||
49 | 49 | ||
50 | data Event = Started -- ^ For first request. | 50 | data Event = Started -- ^ For first request. |
diff --git a/src/Network/Torrent/Tracker/Scrape.hs b/src/Network/BitTorrent/Tracker/Scrape.hs index f5ebbea4..49451a57 100644 --- a/src/Network/Torrent/Tracker/Scrape.hs +++ b/src/Network/BitTorrent/Tracker/Scrape.hs | |||
@@ -11,7 +11,7 @@ | |||
11 | -- scrape info for a particular torrent list. | 11 | -- scrape info for a particular torrent list. |
12 | -- | 12 | -- |
13 | {-# LANGUAGE OverloadedStrings #-} | 13 | {-# LANGUAGE OverloadedStrings #-} |
14 | module Network.Torrent.Tracker.Scrape | 14 | module Network.BitTorrent.Tracker.Scrape |
15 | ( ScrapeInfo(..), Scrape | 15 | ( ScrapeInfo(..), Scrape |
16 | , scrapeURL | 16 | , scrapeURL |
17 | 17 | ||
diff --git a/src/Network/Torrent.hs b/src/Network/Torrent.hs deleted file mode 100644 index a37bee41..00000000 --- a/src/Network/Torrent.hs +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | module Network.Torrent | ||
2 | ( module Network.Torrent.PeerID | ||
3 | , module Network.Torrent.Tracker | ||
4 | , module Network.Torrent.PeerWire | ||
5 | ) where | ||
6 | |||
7 | import Network.Torrent.PeerID | ||
8 | import Network.Torrent.Tracker | ||
9 | import Network.Torrent.PeerWire | ||
diff --git a/src/Network/Torrent/PeerWire.hs b/src/Network/Torrent/PeerWire.hs deleted file mode 100644 index 887e56d5..00000000 --- a/src/Network/Torrent/PeerWire.hs +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | -- | | ||
2 | -- Copyright : (c) Sam T. 2013 | ||
3 | -- License : MIT | ||
4 | -- Maintainer : pxqr.sta@gmail.com | ||
5 | -- Stability : experimental | ||
6 | -- Portability : portable | ||
7 | -- | ||
8 | {-# LANGUAGE DoAndIfThenElse #-} | ||
9 | module Network.Torrent.PeerWire | ||
10 | ( module Network.Torrent.PeerWire.Block | ||
11 | , module Network.Torrent.PeerWire.Message | ||
12 | , module Network.Torrent.PeerWire.Handshake | ||
13 | ) where | ||
14 | |||
15 | import Network.Torrent.PeerWire.Block | ||
16 | import Network.Torrent.PeerWire.Message | ||
17 | import Network.Torrent.PeerWire.Handshake | ||