diff options
author | Joe Crayne <joe@jerkface.net> | 2018-12-03 21:03:52 -0500 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2018-12-16 14:08:26 -0500 |
commit | 97cbacd0c9fb0d9aa1d76c29ea87404b9d3c1cc4 (patch) | |
tree | 829ec78b0ded3c5652adc81971f3d3850b0b5393 /src/Data | |
parent | 93e51f29cc6c25455a5f91dbc1c3e678922523fd (diff) |
TCP Client, WIP.
Diffstat (limited to 'src/Data')
-rw-r--r-- | src/Data/Tox/Relay.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Data/Tox/Relay.hs b/src/Data/Tox/Relay.hs index 72a05660..1437c9cd 100644 --- a/src/Data/Tox/Relay.hs +++ b/src/Data/Tox/Relay.hs | |||
@@ -41,8 +41,8 @@ data RelayPacket | |||
41 | | RoutingResponse ConId PublicKey -- 0 for refusal, 16-255 for success. | 41 | | RoutingResponse ConId PublicKey -- 0 for refusal, 16-255 for success. |
42 | | ConnectNotification ConId | 42 | | ConnectNotification ConId |
43 | | DisconnectNotification ConId | 43 | | DisconnectNotification ConId |
44 | | RelayPing Word64 | 44 | | RelayPing Nonce8 |
45 | | RelayPong Word64 | 45 | | RelayPong Nonce8 |
46 | | OOBSend PublicKey ByteString | 46 | | OOBSend PublicKey ByteString |
47 | | OOBRecv PublicKey ByteString | 47 | | OOBRecv PublicKey ByteString |
48 | | OnionPacket (OnionRequest N0) | 48 | | OnionPacket (OnionRequest N0) |
@@ -82,8 +82,8 @@ instance Serialize RelayPacket where | |||
82 | 1 -> RoutingResponse <$> get <*> getPublicKey | 82 | 1 -> RoutingResponse <$> get <*> getPublicKey |
83 | 2 -> ConnectNotification <$> get | 83 | 2 -> ConnectNotification <$> get |
84 | 3 -> DisconnectNotification <$> get | 84 | 3 -> DisconnectNotification <$> get |
85 | 4 -> RelayPing <$> getWord64be | 85 | 4 -> RelayPing <$> get |
86 | 5 -> RelayPong <$> getWord64be | 86 | 5 -> RelayPong <$> get |
87 | 6 -> OOBSend <$> getPublicKey <*> (remaining >>= getBytes) | 87 | 6 -> OOBSend <$> getPublicKey <*> (remaining >>= getBytes) |
88 | 7 -> OOBRecv <$> getPublicKey <*> (remaining >>= getBytes) | 88 | 7 -> OOBRecv <$> getPublicKey <*> (remaining >>= getBytes) |
89 | 8 -> OnionPacket <$> get | 89 | 8 -> OnionPacket <$> get |
@@ -97,8 +97,8 @@ instance Serialize RelayPacket where | |||
97 | RoutingResponse rpid k -> put rpid >> putPublicKey k | 97 | RoutingResponse rpid k -> put rpid >> putPublicKey k |
98 | ConnectNotification conid -> put conid | 98 | ConnectNotification conid -> put conid |
99 | DisconnectNotification conid -> put conid | 99 | DisconnectNotification conid -> put conid |
100 | RelayPing pingid -> putWord64be pingid | 100 | RelayPing pingid -> put pingid |
101 | RelayPong pingid -> putWord64be pingid | 101 | RelayPong pingid -> put pingid |
102 | OOBSend k bs -> putPublicKey k >> putByteString bs | 102 | OOBSend k bs -> putPublicKey k >> putByteString bs |
103 | OOBRecv k bs -> putPublicKey k >> putByteString bs | 103 | OOBRecv k bs -> putPublicKey k >> putByteString bs |
104 | OnionPacket query -> put query | 104 | OnionPacket query -> put query |