X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=sim%2Fe2-interface.git;a=blobdiff_plain;f=e2sim%2Fprevious%2FASN1c%2Fber_tlv_tag.h;fp=e2sim%2Fprevious%2FASN1c%2Fber_tlv_tag.h;h=0000000000000000000000000000000000000000;hp=8eac6d9480bd410e7d193f0407c8e1c8ab7ae84e;hb=f86662b5b6481f27e18313a36355871f3a947193;hpb=a9f02a2b5886990fd81e64f7c218c5d4844f18a3 diff --git a/e2sim/previous/ASN1c/ber_tlv_tag.h b/e2sim/previous/ASN1c/ber_tlv_tag.h deleted file mode 100644 index 8eac6d9..0000000 --- a/e2sim/previous/ASN1c/ber_tlv_tag.h +++ /dev/null @@ -1,78 +0,0 @@ -/***************************************************************************** -# * -# Copyright 2019 AT&T Intellectual Property * -# * -# 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. * -# * -******************************************************************************/ - -/*- - * Copyright (c) 2003-2017 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef _BER_TLV_TAG_H_ -#define _BER_TLV_TAG_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -enum asn_tag_class { - ASN_TAG_CLASS_UNIVERSAL = 0, /* 0b00 */ - ASN_TAG_CLASS_APPLICATION = 1, /* 0b01 */ - ASN_TAG_CLASS_CONTEXT = 2, /* 0b10 */ - ASN_TAG_CLASS_PRIVATE = 3 /* 0b11 */ -}; -typedef unsigned ber_tlv_tag_t; /* BER TAG from Tag-Length-Value */ - -/* - * Tag class is encoded together with tag value for optimization purposes. - */ -#define BER_TAG_CLASS(tag) ((tag) & 0x3) -#define BER_TAG_VALUE(tag) ((tag) >> 2) -#define BER_TLV_CONSTRUCTED(tagptr) (((*(const uint8_t *)tagptr)&0x20)?1:0) - -#define BER_TAGS_EQUAL(tag1, tag2) ((tag1) == (tag2)) - -/* - * Several functions for printing the TAG in the canonical form - * (i.e. "[PRIVATE 0]"). - * Return values correspond to their libc counterparts (if any). - */ -ssize_t ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t buflen); -ssize_t ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE *); -char *ber_tlv_tag_string(ber_tlv_tag_t tag); - - -/* - * This function tries to fetch the tag from the input stream. - * RETURN VALUES: - * 0: More data expected than bufptr contains. - * -1: Fatal error deciphering tag. - * >0: Number of bytes used from bufptr. tag_r will contain the tag. - */ -ssize_t ber_fetch_tag(const void *bufptr, size_t size, ber_tlv_tag_t *tag_r); - -/* - * This function serializes the tag (T from TLV) in BER format. - * It always returns number of bytes necessary to represent the tag, - * it is a caller's responsibility to check the return value - * against the supplied buffer's size. - */ -size_t ber_tlv_tag_serialize(ber_tlv_tag_t tag, void *bufptr, size_t size); - -#ifdef __cplusplus -} -#endif - -#endif /* _BER_TLV_TAG_H_ */