src/sync_impl.h
author Edouard Tisserant <edouard@pep-project.org>
Thu, 16 Feb 2017 12:43:35 +0100
branchGroupMerge
changeset 1586 599deda50386
parent 1517 f29830f1c407
child 1597 cc039a6139cb
permissions -rw-r--r--
KeySync: added device group merge. Builds but still untested.
vb@1517
     1
// This file is under GNU General Public License 3.0
vb@1517
     2
// see LICENSE.txt
vb@1517
     3
vb@1059
     4
#pragma once
vb@1059
     5
edouard@1586
     6
#include "../asn.1/DeviceGroup-Protocol.h"
vb@1059
     7
#include "message.h"
edouard@1172
     8
#include "sync.h"
vb@1059
     9
#include "sync_fsm.h"
vb@1059
    10
vb@1059
    11
#ifdef __cplusplus
vb@1059
    12
extern "C" {
vb@1059
    13
#endif
vb@1059
    14
edouard@1586
    15
typedef struct _group_keys_extra {
edouard@1586
    16
    identity_list *group_keys;
edouard@1586
    17
    char *group_id;
edouard@1586
    18
} group_keys_extra_t;
edouard@1586
    19
vb@1059
    20
PEP_STATUS receive_sync_msg(
vb@1059
    21
        PEP_SESSION session,
edouard@1445
    22
        sync_msg_t *sync_msg,
edouard@1445
    23
        time_t *timeout
vb@1059
    24
    );
vb@1059
    25
edouard@1195
    26
PEP_STATUS inject_DeviceState_event(
edouard@1195
    27
    PEP_SESSION session, 
edouard@1195
    28
    DeviceState_event event,
edouard@1195
    29
    Identity partner,
edouard@1195
    30
    void *extra);
edouard@1195
    31
edouard@1165
    32
PEP_STATUS receive_DeviceState_msg(
edouard@1165
    33
    PEP_SESSION session, 
edouard@1165
    34
    message *src, 
edouard@1165
    35
    PEP_rating rating, 
edouard@1165
    36
    stringlist_t *keylist);
vb@1059
    37
vb@1059
    38
DeviceGroup_Protocol_t *new_DeviceGroup_Protocol_msg(DeviceGroup_Protocol__payload_PR type);
vb@1059
    39
void free_DeviceGroup_Protocol_msg(DeviceGroup_Protocol_t *msg);
vb@1059
    40
vb@1059
    41
PEP_STATUS unicast_msg(
vb@1059
    42
        PEP_SESSION session,
vb@1091
    43
        const Identity partner,
vb@1059
    44
        DeviceState_state state,
vb@1097
    45
        DeviceGroup_Protocol_t *msg,
vb@1097
    46
        bool encrypted
vb@1059
    47
    );
vb@1059
    48
vb@1059
    49
PEP_STATUS multicast_self_msg(
vb@1059
    50
        PEP_SESSION session,
vb@1059
    51
        DeviceState_state state,
vb@1097
    52
        DeviceGroup_Protocol_t *msg,
vb@1097
    53
        bool encrypted
vb@1059
    54
    );
vb@1059
    55
vb@1085
    56
bool is_double(DeviceGroup_Protocol_t *msg);
vb@1085
    57
vb@1059
    58
#ifdef __cplusplus
vb@1059
    59
}
vb@1059
    60
#endif
vb@1059
    61