removing generated files sync
authorVolker Birk <vb@pep-project.org>
Sat, 14 Dec 2019 12:08:37 +0100
branchsync
changeset 42787f78ed8120cc
parent 4277 397e03959517
child 4279 1f9a55b8a012
removing generated files
src/distribution_codec.c
src/distribution_codec.h
     1.1 --- a/src/distribution_codec.c	Sat Dec 14 11:24:04 2019 +0100
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,134 +0,0 @@
     1.4 -// This file is under GNU General Public License 3.0
     1.5 -// see LICENSE.txt
     1.6 -
     1.7 -#include "platform.h"
     1.8 -
     1.9 -#include "distribution_codec.h"
    1.10 -#include "../asn.1/Distribution.h"
    1.11 -#include "pEp_internal.h"
    1.12 -#include "growing_buf.h"
    1.13 -
    1.14 -DYNAMIC_API PEP_STATUS decode_Distribution_message(
    1.15 -        const char *data,
    1.16 -        size_t size,
    1.17 -        Distribution_t **msg
    1.18 -    )
    1.19 -{
    1.20 -    assert(data && msg);
    1.21 -    if (!(data && msg))
    1.22 -        return PEP_ILLEGAL_VALUE;
    1.23 -
    1.24 -    *msg = NULL;
    1.25 -    Distribution_t *_msg = NULL;
    1.26 -    uper_decode_complete(NULL, &asn_DEF_Distribution, (void **) &_msg, data, size);
    1.27 -    if (!_msg)
    1.28 -        return PEP_DISTRIBUTION_ILLEGAL_MESSAGE;
    1.29 -
    1.30 -    *msg = _msg;
    1.31 -    return PEP_STATUS_OK;
    1.32 -}
    1.33 -
    1.34 -PEP_STATUS encode_Distribution_message(
    1.35 -        Distribution_t *msg,
    1.36 -        char **data,
    1.37 -        size_t *size
    1.38 -    )
    1.39 -{
    1.40 -    assert(data && msg);
    1.41 -    if (!(data && msg))
    1.42 -        return PEP_ILLEGAL_VALUE;
    1.43 -
    1.44 -    *data = NULL;
    1.45 -    *size = 0;
    1.46 -
    1.47 -    char *_data = NULL;
    1.48 -    ssize_t _size = uper_encode_to_new_buffer(&asn_DEF_Distribution, NULL, msg,
    1.49 -            (void **) &_data);
    1.50 -    if (_size == -1)
    1.51 -        return PEP_CANNOT_ENCODE;
    1.52 -
    1.53 -    *data = _data;
    1.54 -    *size = (size_t) _size;
    1.55 -
    1.56 -    return PEP_STATUS_OK;
    1.57 -}
    1.58 -
    1.59 -PEP_STATUS PER_to_XER_Distribution_msg(
    1.60 -        const char *data,
    1.61 -        size_t size,
    1.62 -        char **text
    1.63 -    )
    1.64 -{
    1.65 -    PEP_STATUS status = PEP_STATUS_OK;
    1.66 -    growing_buf_t *dst = NULL;
    1.67 -
    1.68 -    assert(data && text);
    1.69 -    if (!(data && text))
    1.70 -        return PEP_ILLEGAL_VALUE;
    1.71 -
    1.72 -    *text = NULL;
    1.73 -
    1.74 -    Distribution_t *msg = NULL;
    1.75 -    status = decode_Distribution_message(data, size, &msg);
    1.76 -    if (status)
    1.77 -        goto the_end;
    1.78 -
    1.79 -    dst = new_growing_buf();
    1.80 -    if (!dst) {
    1.81 -        status = PEP_OUT_OF_MEMORY;
    1.82 -        goto the_end;
    1.83 -    }
    1.84 -
    1.85 -    asn_enc_rval_t er = xer_encode(&asn_DEF_Distribution, msg, XER_F_BASIC,
    1.86 -            (asn_app_consume_bytes_f *) growing_buf_consume, (void *) dst);
    1.87 -    if (er.encoded == -1) {
    1.88 -        status = PEP_CANNOT_ENCODE;
    1.89 -        goto the_end;
    1.90 -    }
    1.91 -
    1.92 -    *text = dst->data;
    1.93 -    dst->data = NULL;
    1.94 -
    1.95 -the_end:
    1.96 -    free_growing_buf(dst);
    1.97 -    ASN_STRUCT_FREE(asn_DEF_Distribution, msg);
    1.98 -    return status;
    1.99 -}
   1.100 -
   1.101 -PEP_STATUS XER_to_PER_Distribution_msg(
   1.102 -        const char *text,
   1.103 -        char **data,
   1.104 -        size_t *size
   1.105 -    )
   1.106 -{
   1.107 -    PEP_STATUS status = PEP_STATUS_OK;
   1.108 -
   1.109 -    assert(text && data && size);
   1.110 -    if (!(text && data && size))
   1.111 -        return PEP_ILLEGAL_VALUE;
   1.112 -
   1.113 -    *data = NULL;
   1.114 -    *size = 0;
   1.115 -
   1.116 -    Distribution_t *msg = NULL;
   1.117 -    asn_dec_rval_t dr = xer_decode(NULL, &asn_DEF_Distribution, (void **) &msg,
   1.118 -            (const void *) text, strlen(text));
   1.119 -    if (dr.code != RC_OK) {
   1.120 -        status = PEP_DISTRIBUTION_ILLEGAL_MESSAGE;
   1.121 -        goto the_end;
   1.122 -    }
   1.123 -
   1.124 -    char *_data = NULL;
   1.125 -    size_t _size = 0;
   1.126 -    status = encode_Distribution_message(msg, &_data, &_size);
   1.127 -    if (status)
   1.128 -        goto the_end;
   1.129 -
   1.130 -    *data = _data;
   1.131 -    *size = (size_t) _size;
   1.132 -
   1.133 -the_end:
   1.134 -    ASN_STRUCT_FREE(asn_DEF_Distribution, msg);
   1.135 -    return status;
   1.136 -}
   1.137 -
     2.1 --- a/src/distribution_codec.h	Sat Dec 14 11:24:04 2019 +0100
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,82 +0,0 @@
     2.4 -// This file is under GNU General Public License 3.0
     2.5 -// see LICENSE.txt
     2.6 -
     2.7 -#pragma once
     2.8 -
     2.9 -
    2.10 -#include "pEpEngine.h"
    2.11 -
    2.12 -
    2.13 -#ifdef __cplusplus
    2.14 -extern "C" {
    2.15 -#endif
    2.16 -
    2.17 -
    2.18 -struct Distribution;
    2.19 -
    2.20 -// decode_Distribution_message() - decode PER encoded Distribution message
    2.21 -//
    2.22 -//  parameters:
    2.23 -//      data (in)               PER encoded data
    2.24 -//      size (in)               size of PER encoded data
    2.25 -//      msg (out)               Distribution message
    2.26 -//
    2.27 -//  caveat:
    2.28 -//      msg goes into the ownership of the caller
    2.29 -
    2.30 -DYNAMIC_API PEP_STATUS decode_Distribution_message(
    2.31 -        const char *data,
    2.32 -        size_t size,
    2.33 -        struct Distribution **msg
    2.34 -    );
    2.35 -
    2.36 -
    2.37 -// encode_Distribution_message() - encode Distribution message into PER encoded data
    2.38 -//
    2.39 -//  parameters:
    2.40 -//      msg (in)                Distribution message
    2.41 -//      data (out)              PER encoded data
    2.42 -//      size (out)              size of PER encoded data
    2.43 -//
    2.44 -//  caveat:
    2.45 -//      data goes to the ownership of the caller
    2.46 -
    2.47 -DYNAMIC_API PEP_STATUS encode_Distribution_message(
    2.48 -        struct Distribution *msg,
    2.49 -        char **data,
    2.50 -        size_t *size
    2.51 -    );
    2.52 -
    2.53 -
    2.54 -// PER_to_XER_Distribution_msg() - decode Distribution message from PER into XER
    2.55 -//
    2.56 -//  parameters:
    2.57 -//      data (in)               PER encoded data
    2.58 -//      size (in)               size of PER encoded data
    2.59 -//      text (out)              XER text of the same Distribution message
    2.60 -
    2.61 -DYNAMIC_API PEP_STATUS PER_to_XER_Distribution_msg(
    2.62 -        const char *data,
    2.63 -        size_t size,
    2.64 -        char **text
    2.65 -    );
    2.66 -
    2.67 -
    2.68 -// XER_to_PER_Distribution_msg() - encode Distribution message from XER into PER
    2.69 -//
    2.70 -//  parameters:
    2.71 -//      text (in)               string with XER text of the Distribution message
    2.72 -//      data (out)              PER encoded data
    2.73 -//      size (out)              size of PER encoded data
    2.74 -
    2.75 -DYNAMIC_API PEP_STATUS XER_to_PER_Distribution_msg(
    2.76 -        const char *text,
    2.77 -        char **data,
    2.78 -        size_t *size
    2.79 -    );
    2.80 -
    2.81 -
    2.82 -#ifdef __cplusplus
    2.83 -}
    2.84 -#endif
    2.85 -