src/transport.h
author Krista Bennett <krista@pep-project.org>
Wed, 15 Mar 2017 18:02:46 +0100
changeset 1674 5639f969866a
parent 1513 e7f7e42385b5
permissions -rw-r--r--
Added pgp_encrypt_only stubs for NetPGP
     1 // This file is under GNU General Public License 3.0
     2 // see LICENSE.txt
     3 
     4 #pragma once
     5 
     6 #include "pEpEngine.h"
     7 #include "message.h"
     8 
     9 #ifdef __cplusplus
    10 extern "C" {
    11 #endif
    12 
    13 typedef enum _PEP_transports {
    14     // auto transport chooses transport per message automatically
    15     PEP_trans_auto = 0,
    16 //    PEP_trans_email,
    17 //    PEP_trans_whatsapp,
    18 
    19     PEP_trans__count
    20 } PEP_transports;
    21 
    22 typedef struct _PEP_transport_t PEP_transport_t;
    23 
    24 typedef PEP_STATUS (*sendto_t)(PEP_SESSION session, const message *msg);
    25 typedef PEP_STATUS (*readnext_t)(PEP_SESSION session, message **msg,
    26         PEP_transport_t **via);
    27 
    28 struct _PEP_transport_t {
    29     uint8_t id;                             // transport ID
    30     sendto_t sendto;                        // sendto function
    31     readnext_t readnext;                    // readnext function
    32     bool long_message_supported;            // flag if this transport supports
    33                                             // long messages
    34     bool formatted_message_supported;       // flag if this transport supports
    35                                             // formatted messages
    36     PEP_text_format native_text_format;     // native format of the transport
    37 };
    38 
    39 extern PEP_transport_t transports[PEP_trans__count];
    40 
    41 typedef uint64_t transports_mask;
    42 
    43 #ifdef __cplusplus
    44 }
    45 #endif
    46