diff options
Diffstat (limited to 'OnionRouter.hs')
-rw-r--r-- | OnionRouter.hs | 31 |
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 @@ | |||
1 | module OnionRouter where | ||
2 | |||
3 | import Crypto.Tox | ||
4 | import Network.Kademlia | ||
5 | import Network.Kademlia.Routing | ||
6 | import Network.QueryResponse | ||
7 | import Network.Tox.NodeId | ||
8 | import Network.Tox.Onion.Transport | ||
9 | |||
10 | import Network.Socket (SockAddr) | ||
11 | import Control.Concurrent.STM | ||
12 | |||
13 | newtype RouteId = RouteId Int | ||
14 | deriving Show | ||
15 | |||
16 | data OnionRouter | ||
17 | |||
18 | newOnionRouter :: IO OnionRouter | ||
19 | newOnionRouter = return _todo | ||
20 | |||
21 | lookupSender :: OnionRouter -> SockAddr -> Nonce8 -> IO (Maybe (NodeInfo, RouteId)) | ||
22 | lookupSender _ _ _ = return Nothing -- todo | ||
23 | |||
24 | lookupRoute :: OnionRouter -> NodeInfo -> RouteId -> IO (Maybe OnionRoute) | ||
25 | lookupRoute _ _ _ = return Nothing -- todo | ||
26 | |||
27 | hookQueries :: OnionRouter -> (tid -> Nonce8) -> TransactionMethods d tid x -> TransactionMethods d tid x | ||
28 | hookQueries _ n8 tmethods = tmethods -- todo | ||
29 | |||
30 | hookBucketList :: OnionRouter -> RoutingTransition ni -> STM () | ||
31 | hookBucketList _ _ = return () -- todo | ||