src/sync_actions.c
author Volker Birk <vb@pep-project.org>
Sun, 15 May 2016 15:18:53 +0200
changeset 623 533a7fcc423b
child 627 ef1fdfde8ced
permissions -rw-r--r--
basic structure and skeleton
vb@623
     1
// Actions for DeviceState state machine
vb@623
     2
vb@623
     3
#include <assert.h>
vb@623
     4
#include "sync_fsm.h"
vb@623
     5
vb@623
     6
vb@623
     7
// sendBeacon() - 
vb@623
     8
//
vb@623
     9
//  params:
vb@623
    10
//      partner (in)        (must be NULL)
vb@623
    11
//
vb@623
    12
//  returns:
vb@623
    13
//      PEP_STATUS_OK or any other value on error
vb@623
    14
vb@623
    15
PEP_STATUS sendBeacon(const Identity partner)
vb@623
    16
{
vb@623
    17
    PEP_STATUS status = PEP_STATUS_OK;
vb@623
    18
vb@623
    19
    assert(partner == NULL);
vb@623
    20
    if (partner)
vb@623
    21
        return PEP_ILLEGAL_VALUE;
vb@623
    22
vb@623
    23
    // working code
vb@623
    24
vb@623
    25
vb@623
    26
    return status;
vb@623
    27
}
vb@623
    28
vb@623
    29
// sendHandshakeRequest() - 
vb@623
    30
//
vb@623
    31
//  params:
vb@623
    32
//      partner (in)        partner in sync
vb@623
    33
//
vb@623
    34
//  returns:
vb@623
    35
//      PEP_STATUS_OK or any other value on error
vb@623
    36
vb@623
    37
PEP_STATUS sendHandshakeRequest(const Identity partner)
vb@623
    38
{
vb@623
    39
    PEP_STATUS status = PEP_STATUS_OK;
vb@623
    40
vb@623
    41
    assert(partner);
vb@623
    42
    if (!partner)
vb@623
    43
        return PEP_ILLEGAL_VALUE;
vb@623
    44
vb@623
    45
    // working code
vb@623
    46
vb@623
    47
vb@623
    48
    return status;
vb@623
    49
}
vb@623
    50
vb@623
    51
// showHandshake() - 
vb@623
    52
//
vb@623
    53
//  params:
vb@623
    54
//      partner (in)        partner in sync
vb@623
    55
//
vb@623
    56
//  returns:
vb@623
    57
//      PEP_STATUS_OK or any other value on error
vb@623
    58
vb@623
    59
PEP_STATUS showHandshake(const Identity partner)
vb@623
    60
{
vb@623
    61
    PEP_STATUS status = PEP_STATUS_OK;
vb@623
    62
vb@623
    63
    assert(partner);
vb@623
    64
    if (!partner)
vb@623
    65
        return PEP_ILLEGAL_VALUE;
vb@623
    66
vb@623
    67
    // working code
vb@623
    68
vb@623
    69
vb@623
    70
    return status;
vb@623
    71
}
vb@623
    72
vb@623
    73
// reject() - 
vb@623
    74
//
vb@623
    75
//  params:
vb@623
    76
//      partner (in)        partner in sync
vb@623
    77
//
vb@623
    78
//  returns:
vb@623
    79
//      PEP_STATUS_OK or any other value on error
vb@623
    80
vb@623
    81
PEP_STATUS reject(const Identity partner)
vb@623
    82
{
vb@623
    83
    PEP_STATUS status = PEP_STATUS_OK;
vb@623
    84
vb@623
    85
    assert(partner);
vb@623
    86
    if (!partner)
vb@623
    87
        return PEP_ILLEGAL_VALUE;
vb@623
    88
vb@623
    89
    // working code
vb@623
    90
vb@623
    91
vb@623
    92
    return status;
vb@623
    93
}
vb@623
    94
vb@623
    95
// storeGroupKeys() - 
vb@623
    96
//
vb@623
    97
//  params:
vb@623
    98
//      partner (in)        partner in sync
vb@623
    99
//
vb@623
   100
//  returns:
vb@623
   101
//      PEP_STATUS_OK or any other value on error
vb@623
   102
vb@623
   103
PEP_STATUS storeGroupKeys(const Identity partner)
vb@623
   104
{
vb@623
   105
    PEP_STATUS status = PEP_STATUS_OK;
vb@623
   106
vb@623
   107
    assert(partner);
vb@623
   108
    if (!partner)
vb@623
   109
        return PEP_ILLEGAL_VALUE;
vb@623
   110
vb@623
   111
    // working code
vb@623
   112
vb@623
   113
vb@623
   114
    return status;
vb@623
   115
}
vb@623
   116
vb@623
   117
// sendOwnKeys() - 
vb@623
   118
//
vb@623
   119
//  params:
vb@623
   120
//      partner (in)        (must be NULL)
vb@623
   121
//
vb@623
   122
//  returns:
vb@623
   123
//      PEP_STATUS_OK or any other value on error
vb@623
   124
vb@623
   125
PEP_STATUS sendOwnKeys(const Identity partner)
vb@623
   126
{
vb@623
   127
    PEP_STATUS status = PEP_STATUS_OK;
vb@623
   128
vb@623
   129
    assert(partner == NULL);
vb@623
   130
    if (partner)
vb@623
   131
        return PEP_ILLEGAL_VALUE;
vb@623
   132
vb@623
   133
    // working code
vb@623
   134
vb@623
   135
vb@623
   136
    return status;
vb@623
   137
}
vb@623
   138
vb@623
   139
// transmitGroupKeys() - 
vb@623
   140
//
vb@623
   141
//  params:
vb@623
   142
//      partner (in)        partner in sync
vb@623
   143
//
vb@623
   144
//  returns:
vb@623
   145
//      PEP_STATUS_OK or any other value on error
vb@623
   146
vb@623
   147
PEP_STATUS transmitGroupKeys(const Identity partner)
vb@623
   148
{
vb@623
   149
    PEP_STATUS status = PEP_STATUS_OK;
vb@623
   150
vb@623
   151
    assert(partner);
vb@623
   152
    if (!partner)
vb@623
   153
        return PEP_ILLEGAL_VALUE;
vb@623
   154
vb@623
   155
    // working code
vb@623
   156
vb@623
   157
vb@623
   158
    return status;
vb@623
   159
}
vb@623
   160