src/transport.h
author us@chu.huenfield.org
Tue, 25 Dec 2018 14:46:45 +0100
branchsync
changeset 3209 c15b4ca2b52a
parent 3121 f33a2ae77177
child 4792 7056435ab9e7
child 5246 67016f508d40
permissions -rw-r--r--
Replace use of Sequoia's backend with a custom key store.

- Sequoia's key store doesn't meet pep's needs (in particular, the
ability to search on a key's user id) and trying to shoehorn pep's
needs onto Sequoia's key store abstractions is just introducing
overhead with no appreciable gain in functionality.

- This patch changes the Sequoia backend to use a local sqlite
database to store the public keys.
     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