summaryrefslogtreecommitdiff
path: root/OnionRouter.hs
blob: 153042219de44daa44c6a73a775b054db3d6d162 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
module OnionRouter where

import Crypto.Tox
import Network.Kademlia
import Network.Kademlia.Routing
import Network.QueryResponse
import Network.Tox.NodeId
import Network.Tox.Onion.Transport

import Network.Socket (SockAddr)
import Control.Concurrent.STM

newtype RouteId = RouteId Int
 deriving Show

data OnionRouter

newOnionRouter :: IO OnionRouter
newOnionRouter = return _todo

lookupSender :: OnionRouter -> SockAddr -> Nonce8 -> IO (Maybe (NodeInfo, RouteId))
lookupSender _ _ _ = return Nothing -- todo

lookupRoute :: OnionRouter -> NodeInfo -> RouteId -> IO (Maybe OnionRoute)
lookupRoute _ _ _ = return Nothing -- todo

hookQueries :: OnionRouter -> (tid -> Nonce8) -> TransactionMethods d tid x -> TransactionMethods d tid x
hookQueries _ n8 tmethods = tmethods -- todo

hookBucketList :: OnionRouter -> RoutingTransition ni -> STM ()
hookBucketList _ _ = return () -- todo