X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=sim%2Fe2-interface.git;a=blobdiff_plain;f=e2sim%2Fprevious%2Fsrc%2FX2AP%2Fx2ap_asn_codec.c;fp=e2sim%2Fprevious%2Fsrc%2FX2AP%2Fx2ap_asn_codec.c;h=0000000000000000000000000000000000000000;hp=959e7efd0f4d0470dc8bb3fd95cc2bab560f9848;hb=f86662b5b6481f27e18313a36355871f3a947193;hpb=a9f02a2b5886990fd81e64f7c218c5d4844f18a3 diff --git a/e2sim/previous/src/X2AP/x2ap_asn_codec.c b/e2sim/previous/src/X2AP/x2ap_asn_codec.c deleted file mode 100644 index 959e7ef..0000000 --- a/e2sim/previous/src/X2AP/x2ap_asn_codec.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Copyright 2019 AT&T Intellectual Property - * Copyright 2019 Nokia - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include "x2ap_asn_codec.h" -#include "per_decoder.h" -#include "per_encoder.h" - -/* Encode X2AP PDU ASN1 buffer*/ -int X2AP_ASN_encode(X2AP_PDU_t *pdu, uint8_t **buffer, uint32_t *len) -{ - ssize_t encoded; - - assert(pdu != NULL); - assert(buffer != NULL); - assert(len != NULL); - - encoded = aper_encode_to_new_buffer(&asn_DEF_X2AP_PDU, 0, pdu, (void **)buffer); - - if (encoded < 0) - { - return -1; - } - - *len = encoded; - - ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_X2AP_PDU, pdu); - return encoded; -} - -/* Decode XASN1 buffer to X2AP PDU*/ -int X2AP_ASN_decode(X2AP_PDU_t *pdu, const uint8_t *const buffer, const int len) -{ - asn_dec_rval_t dec_ret; - - assert(buffer != NULL); - - dec_ret = aper_decode(NULL, &asn_DEF_X2AP_PDU, (void **)&pdu, buffer, - len, 0, 0); - - //xer_fprint(stdout, &asn_DEF_X2AP_PDU, pdu); - - if (dec_ret.code != RC_OK) { - fprintf(stderr, "ERROR: Failed to decode pdu\n"); - return -1; - } - - return 0; -}