src/transport.h
author Krista Grothoff <krista@pep-project.org>
Sat, 24 Sep 2016 18:09:18 +0200
branchENGINE-27
changeset 1185 4b01328f3cf2
parent 259 71d6c073fda4
child 1513 e7f7e42385b5
permissions -rw-r--r--
ENGINE-27: update_identity no longer pays attention to the input identity's fpr, but pulls one from elect_pubkey.
     1 #pragma once
     2 
     3 #include "pEpEngine.h"
     4 #include "message.h"
     5 
     6 #ifdef __cplusplus
     7 extern "C" {
     8 #endif
     9 
    10 typedef enum _PEP_transports {
    11     // auto transport chooses transport per message automatically
    12     PEP_trans_auto = 0,
    13 //    PEP_trans_email,
    14 //    PEP_trans_whatsapp,
    15 
    16     PEP_trans__count
    17 } PEP_transports;
    18 
    19 typedef struct _PEP_transport_t PEP_transport_t;
    20 
    21 typedef PEP_STATUS (*sendto_t)(PEP_SESSION session, const message *msg);
    22 typedef PEP_STATUS (*readnext_t)(PEP_SESSION session, message **msg,
    23         PEP_transport_t **via);
    24 
    25 struct _PEP_transport_t {
    26     uint8_t id;                             // transport ID
    27     sendto_t sendto;                        // sendto function
    28     readnext_t readnext;                    // readnext function
    29     bool long_message_supported;            // flag if this transport supports
    30                                             // long messages
    31     bool formatted_message_supported;       // flag if this transport supports
    32                                             // formatted messages
    33     PEP_text_format native_text_format;     // native format of the transport
    34 };
    35 
    36 extern PEP_transport_t transports[PEP_trans__count];
    37 
    38 typedef uint64_t transports_mask;
    39 
    40 #ifdef __cplusplus
    41 }
    42 #endif
    43