<\body> Two arbitrary peers on GNUnet can communicate with the CADET service<\footnote> With some restrictions: there must be a path between the nodes, in a lossy and malicious network with few connections the connection will be lossy, etc. . The client code is available from the module, which implements the pattern \U connects to the service and returns a and breaks the connection. Before describing in more detail the API the software can use, some background on CADET's capabilities is given. <\warning> The API is not yet complete (listening is not yet supported) and some aspects (reconnecting, garbage collection) are unimplemented or untested. This is expected to improve in the future. <\footnote> They could have been called , but that means something different in CADET. \U i.e., bidirectional communication channels between two peers over CADET, are encrypted and authentication and hence are impractical to eavesdrop on or be modified by an attacker<\footnote> Assuming that the cryptography is not broken. . To aid reliability and performance, CADET aims to keep three independent connections between the two peers so manually creating multiple channels ought to be unnecessary. The unit of information sent over a channel is a \U essentially, a bytevector. The software can select multiple options: it can choose between or , and and or , see . To contact a peer over CADET, the remote peer must have an and the local peer needs to contact this port. The remote peer\Uport identifier pair is called a in Scheme-GNUnet. A can be made with the procedure: <\explain> )> <|explain> Make a CADET address for the peer (a readable bytevector slice containing a ) at the port (a readable bytevector slice containing a ). The slices and are copied, so future changes to them do not have any impact on the CADET address. The predicate for CADET addresses is . The peer and port can be extracted with the accessors and . CADET addresses can be compared with . Guile has a generic interface for network addresses, see (guile)Network Socket Address. If BSD socket integration is activated (see ), this interface is extended to support CADET addresses. In particular, will return (a symbol, also available as the variable ) an and will return the peer and port respectively as a bytevector that should not be modified<\footnote> A copy is made to avoid letting buggy code mutate the CADET address, but this is an implementation detail. . To listen at some address such that other peers can connect, the procedure is used. <\explain> (open-port! HANDLERS) To connect to a CADET address, the procedure is used: <\explain> )> <|explain> Asynchronuously connect to the CADET address via the CADET server object , returning a CADET channel object. When a message is received, it is passed to the appropriate handler. To actually send and receive messages, the can be used to retrieve the > of the channel and the procedure > can be used to send the message to the message queue. When done with the channel, it should be , to save resources. This is done with the procedure : <\explain> )> <|explain> Close the channel . This is an asynchronuous operation, it does not have an immediate effect. This is an idempotent operation, closing a channel twice does not have any additional effect. Any buffered messages before the call to the first , will still be sent to the service (unless cancelled and until the >). If messages requested reliable transport, then CADET will still retransmit lost messages even though the channel is closed or closing. For buffered messages not beforeafter' is not the same as \<#2018\>not before\<#2019\>.> the call, it is unspecified whether they will still be transmitted. Alternatively, you can do close the message queue of the channel with ))>, it's equivalent. In fact, that's exactly how is implemented! , (MSG_PEEK), getsockname \U\ ???, getpeername \U\ ???, accept, listen, bind, shutdown No reuseport (AF_CADET, SOCK_RAW, 0) \U\ GNUnet messages (with reliability according to socket options). (AF_CADET, SOCK_STREAM, 0) \U\ TCP/CADET (VPN) (AF_CADET, SOCK_DGRAM, 0) \U\ UDP/CADET (VPN) (AF_CADET, SOCK_SEQPACKET, 0) \U\ UDP/CADET (VPN), in-order, reliable (AF_CADET, SOCK_RDM, 0) \U\ UDP/CADET (VPN), out-of-order, reliable These sockets not dupable, don't have a fd. <\explain> (construct-open-local-port ) message for instructing the service to open the port at the local peer.> <\explain> (construct-close-local-port ) message for closing the port.> <\explain> (construct-local-data ) message for sending \ -\service> the channel with identifier at the priority specified by the numeric priority-preference value .> <\explain> )> message for the channel with identifier , for informing the client that the service is ready for more data.> <\explain> )> message for -\service, reasonable options>> <\explain> (construct-destroy-local-channel ) <|explain> Construct a new message to destroy the channel with identifier . This can be sent in two directions: from the client to the service, to close the channel, or from service to client, to inform the channel has been closed. <\initial> <\collection>