source: trunk/libtransmission/handshake.h

Last change on this file was 14724, checked in by jordan, 5 years ago

use '#pragma once' instead of #ifndef..#define..#endif guards

  • Property svn:keywords set to Date Rev Author Id
File size: 1.7 KB
Line 
1/*
2 * This file Copyright (C) 2007-2014 Mnemosyne LLC
3 *
4 * It may be used under the GNU GPL versions 2 or 3
5 * or any future license endorsed by Mnemosyne LLC.
6 *
7 * $Id: handshake.h 14724 2016-03-29 16:37:21Z mikedld $
8 */
9
10#ifndef __TRANSMISSION__
11 #error only libtransmission should #include this header.
12#endif
13
14#pragma once
15
16#include "transmission.h"
17#include "net.h"
18
19/** @addtogroup peers Peers
20    @{ */
21
22struct tr_peerIo;
23
24/** @brief opaque struct holding hanshake state information.
25           freed when the handshake is completed. */
26typedef struct tr_handshake tr_handshake;
27
28/* returns true on success, false on error */
29typedef bool (*handshakeDoneCB)(struct tr_handshake * handshake,
30                                   struct tr_peerIo    * io,
31                                   bool                  readAnythingFromPeer,
32                                   bool                  isConnected,
33                                   const uint8_t       * peerId,
34                                   void                * userData);
35
36/** @brief instantiate a new handshake */
37tr_handshake *         tr_handshakeNew (struct tr_peerIo * io,
38                                        tr_encryption_mode encryptionMode,
39                                        handshakeDoneCB    doneCB,
40                                        void *             doneUserData);
41
42const tr_address *     tr_handshakeGetAddr (const struct tr_handshake  * handshake,
43                                            tr_port                    * port);
44
45void                   tr_handshakeAbort (tr_handshake * handshake);
46
47struct tr_peerIo*      tr_handshakeGetIO (tr_handshake * handshake);
48
49struct tr_peerIo*      tr_handshakeStealIO (tr_handshake * handshake);
50
51
52/** @} */
Note: See TracBrowser for help on using the repository browser.