summaryrefslogtreecommitdiff
path: root/src/Data/Kademlia/Routing/Table.hs
diff options
context:
space:
mode:
authorSam T <pxqr.sta@gmail.com>2013-05-17 05:06:00 +0400
committerSam T <pxqr.sta@gmail.com>2013-05-17 05:06:00 +0400
commit3d53b08b7fe4a7727418670e510d826eae576f14 (patch)
treee7d2cb26077b6ab4ab5e732034bc23d542419a85 /src/Data/Kademlia/Routing/Table.hs
parent448b86fca5cac5abfef66598391614a8a4f83a46 (diff)
~ Reorganize modules.
Diffstat (limited to 'src/Data/Kademlia/Routing/Table.hs')
-rw-r--r--src/Data/Kademlia/Routing/Table.hs50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/Data/Kademlia/Routing/Table.hs b/src/Data/Kademlia/Routing/Table.hs
new file mode 100644
index 00000000..056692f3
--- /dev/null
+++ b/src/Data/Kademlia/Routing/Table.hs
@@ -0,0 +1,50 @@
1-- |
2-- Copyright : (c) Sam T. 2013
3-- License : MIT
4-- Maintainer : pxqr.sta@gmail.com
5-- Stability : experimental
6-- Portability : portable
7--
8-- Routing table used to lookup . Internally it uses not balanced tree
9--
10-- TODO write module synopsis
11module Data.Kademlia.Routing.Table
12 ( -- ContactInfo
13-- , Table
14 ) where
15
16import Control.Applicative
17import Data.ByteString
18import Data.List as L
19import Data.Maybe
20
21import Network.BitTorrent.Peer
22
23{-
24type NodeID = ByteString
25type InfoHash = ByteString
26
27data ContactInfo = ContactInfo {
28 peerAddr :: PeerAddr
29 , nodeID :: NodeID
30 } deriving (Show, Eq)
31
32
33type Distance = NodeID
34
35-- |
36data Table = Table {
37 routeTree :: Tree
38 , maxBucketSize :: Int
39 }
40
41insert :: NodeID -> Table -> Table
42insert x t = undefined
43
44closest :: InfoHash -> Table -> [NodeID]
45closest = undefined
46
47
48-- TODO table serialization: usually we need to save table between
49-- target program executions for bootstrapping
50-} \ No newline at end of file