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