src/sync_impl.h
author Krista Bennett <krista@pep-project.org>
Fri, 04 May 2018 16:30:21 +0200
branchlocal_cpptest
changeset 2652 43b913f99a27
parent 2287 026ab4dae779
child 2829 e444c3c960bb
permissions -rw-r--r--
Shelving broken things to break other things
krista@2271
     1
// This file is under GNU General Public License 3.0
krista@2271
     2
// see LICENSE.txt
krista@2271
     3
krista@2271
     4
#pragma once
krista@2271
     5
krista@2271
     6
#include "../asn.1/DeviceGroup-Protocol.h"
krista@2271
     7
#include "message.h"
krista@2271
     8
#include "sync.h"
krista@2271
     9
#include "sync_fsm.h"
krista@2271
    10
krista@2271
    11
#ifdef __cplusplus
krista@2271
    12
extern "C" {
krista@2271
    13
#endif
krista@2271
    14
krista@2271
    15
typedef struct _group_keys_extra {
krista@2271
    16
    identity_list *group_keys;
krista@2271
    17
    char *group_id;
krista@2271
    18
} group_keys_extra_t;
krista@2271
    19
krista@2271
    20
void free_group_keys_extra(group_keys_extra_t* groupkeys);
krista@2271
    21
group_keys_extra_t* group_keys_extra_dup(group_keys_extra_t* groupkeys);
krista@2271
    22
krista@2271
    23
PEP_STATUS receive_sync_msg(
krista@2271
    24
        PEP_SESSION session,
krista@2271
    25
        sync_msg_t *sync_msg,
krista@2271
    26
        time_t *timeout
krista@2271
    27
    );
krista@2271
    28
krista@2271
    29
PEP_STATUS inject_DeviceState_event(
krista@2271
    30
    PEP_SESSION session, 
krista@2271
    31
    DeviceState_event event,
krista@2271
    32
    Identity partner,
krista@2271
    33
    void *extra);
krista@2271
    34
krista@2271
    35
PEP_STATUS receive_DeviceState_msg(
krista@2271
    36
    PEP_SESSION session, 
krista@2271
    37
    message *src, 
krista@2271
    38
    PEP_rating rating, 
krista@2271
    39
    stringlist_t *keylist);
krista@2271
    40
krista@2271
    41
DeviceGroup_Protocol_t *new_DeviceGroup_Protocol_msg(DeviceGroup_Protocol__payload_PR type);
krista@2271
    42
void free_DeviceGroup_Protocol_msg(DeviceGroup_Protocol_t *msg);
krista@2271
    43
krista@2271
    44
PEP_STATUS unicast_msg(
krista@2271
    45
        PEP_SESSION session,
krista@2271
    46
        const Identity partner,
krista@2271
    47
        DeviceState_state state,
krista@2271
    48
        DeviceGroup_Protocol_t *msg,
krista@2271
    49
        bool encrypted
krista@2271
    50
    );
krista@2271
    51
krista@2271
    52
PEP_STATUS multicast_self_msg(
krista@2271
    53
        PEP_SESSION session,
krista@2271
    54
        DeviceState_state state,
krista@2271
    55
        DeviceGroup_Protocol_t *msg,
krista@2271
    56
        bool encrypted
krista@2271
    57
    );
krista@2271
    58
krista@2271
    59
bool is_double(DeviceGroup_Protocol_t *msg);
krista@2271
    60
krista@2271
    61
#ifdef __cplusplus
krista@2271
    62
}
krista@2271
    63
#endif
krista@2271
    64