summaryrefslogtreecommitdiff
path: root/src/Data/Kademlia/Routing/Table.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Data/Kademlia/Routing/Table.hs')
-rw-r--r--src/Data/Kademlia/Routing/Table.hs38
1 files changed, 38 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..b79a0a31
--- /dev/null
+++ b/src/Data/Kademlia/Routing/Table.hs
@@ -0,0 +1,38 @@
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 ( Table(nodeID)
13 ) where
14
15import Control.Applicative
16import Data.List as L
17import Data.Maybe
18
19import Data.Kademlia.Routing.Tree
20
21
22data Table k v = Table {
23 routeTree :: Tree k v
24
25 -- | Set degree of parallelism in node lookup calls.
26 , alpha :: Int
27 , nodeID :: k
28 }
29
30--insert :: NodeID -> Table -> Table
31--insert x t = undefined
32
33--closest :: InfoHash -> Table -> [NodeID]
34--closest = undefined
35
36
37-- TODO table serialization: usually we need to save table between
38-- target program executions for bootstrapping