diff options
author | David Barksdale <amatus@amatus.name> | 2014-11-30 19:30:31 -0600 |
---|---|---|
committer | David Barksdale <amatus@amatus.name> | 2014-11-30 19:30:31 -0600 |
commit | 083812b44bdc3dc68c5317bf7e5db00c3083e452 (patch) | |
tree | c1f67d41bc26362b9b5b18c4476491f169184639 /src/cljs/gnunet_web/transport.cljs | |
parent | 45a57724b2799da9c8173031f0e19db083becfc9 (diff) |
Use GNUNET_TRANSPORT_offer_hello for hostlist
Diffstat (limited to 'src/cljs/gnunet_web/transport.cljs')
-rw-r--r-- | src/cljs/gnunet_web/transport.cljs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/cljs/gnunet_web/transport.cljs b/src/cljs/gnunet_web/transport.cljs index 8827a72..d51177e 100644 --- a/src/cljs/gnunet_web/transport.cljs +++ b/src/cljs/gnunet_web/transport.cljs @@ -16,7 +16,7 @@ (ns gnunet-web.transport (:require [gnunet-web.encoder :refer [encode-uint32]] - [gnunet-web.hello :refer [parse-hello]] + [gnunet-web.hello :refer [encode-hello parse-hello]] [gnunet-web.message :refer [encode-message parse-message-types parse-peer-identity]] [gnunet-web.parser :refer [items optional parser parse-absolute-time @@ -117,3 +117,22 @@ (defn addr->string [address] (utf8ByteArrayToString (to-array (drop 8 address)))) + +(def transport-handle (js/_GNUNET_TRANSPORT_connect + 0 ; const struct GNUNET_CONFIGURATION_Handle *cfg + 0 ; const struct GNUNET_PeerIdentity *self + 0 ; void *cls + 0 ; GNUNET_TRANSPORT_ReceiveCallback rec + 0 ; GNUNET_TRANSPORT_NotifyConnect nc + 0)) ; GNUNET_TRANSPORT_NotifyDisconnect nd + +(defn offer-hello + [hello] + (js/ccallFunc + js/_GNUNET_TRANSPORT_offer_hello + "number" + (array "number" "array" "number" "number") + (array transport-handle + (into-array (encode-hello hello)) + 0 + 0))) |