summaryrefslogtreecommitdiff
path: root/OnionRouter.hs
diff options
context:
space:
mode:
Diffstat (limited to 'OnionRouter.hs')
-rw-r--r--OnionRouter.hs31
1 files changed, 31 insertions, 0 deletions
diff --git a/OnionRouter.hs b/OnionRouter.hs
new file mode 100644
index 00000000..15304221
--- /dev/null
+++ b/OnionRouter.hs
@@ -0,0 +1,31 @@
1module OnionRouter where
2
3import Crypto.Tox
4import Network.Kademlia
5import Network.Kademlia.Routing
6import Network.QueryResponse
7import Network.Tox.NodeId
8import Network.Tox.Onion.Transport
9
10import Network.Socket (SockAddr)
11import Control.Concurrent.STM
12
13newtype RouteId = RouteId Int
14 deriving Show
15
16data OnionRouter
17
18newOnionRouter :: IO OnionRouter
19newOnionRouter = return _todo
20
21lookupSender :: OnionRouter -> SockAddr -> Nonce8 -> IO (Maybe (NodeInfo, RouteId))
22lookupSender _ _ _ = return Nothing -- todo
23
24lookupRoute :: OnionRouter -> NodeInfo -> RouteId -> IO (Maybe OnionRoute)
25lookupRoute _ _ _ = return Nothing -- todo
26
27hookQueries :: OnionRouter -> (tid -> Nonce8) -> TransactionMethods d tid x -> TransactionMethods d tid x
28hookQueries _ n8 tmethods = tmethods -- todo
29
30hookBucketList :: OnionRouter -> RoutingTransition ni -> STM ()
31hookBucketList _ _ = return () -- todo