NG-RAN E1AP C Sample Code Using OSS ASN.1 Tools


This sample is provided as part of the OSS ASN.1 Tools trial and commercial shipments. The source code and related files are listed below for reference.

The sample demonstrates how to use the OSS ASN.1 Tools to process messages for the 3GPP 5G E1AP standard (TS 37.483 version 19.0.0).

It runs on Linux on x86-64 as an example and illustrates how to decode, inspect, and create PER-encoded 5G E1AP messages using the OSS ASN.1 Tools API.

The sample reads E1AP messages from .per files, decodes and prints them, and creates and encodes a response message.

A makefile is included for building and running the test program using the OSS ASN.1/C runtime.

To explore more samples (LTE RRC, 5G RRC, S1AP, X2AP), visit the main Sample Code page.

Overview

This sample shows how to:

  • Initialize the OSS ASN.1/C runtime for the 5G E1AP schema.
  • Read .per files that contain valid PER-encoded 5G E1AP messages.
  • Decode and print 5G E1AP messages.
  • Create and encode a response message.
  • Build and run the sample test program with a makefile on Linux.

Files in This Sample

The files listed below are included in the OSS ASN.1 Tools trial and commercial shipments and are used by this sample program:

File Description
README.TXT Instructions and sample overview.
*.asn ASN.1 source files that describe the 3GPP NG-RAN E1AP protocol (TS 37.483) used with this program example.
E1AP-PDU_Reset.per Valid PER-encoded E1AP message. It should pass testing.
te1ap.c Simple C program that shows how to work with NG-RAN E1AP protocol data. It reads input messages from files, decodes and prints them, and creates and encodes a response message.
makefile Makefile that builds and runs the sample test.
makefile.rtoed Makefile that builds and runs the sample test using RTOED.
gui/ ASN.1 Studio project for viewing/compiling schema and generating sample data.

Build and Run Instructions

(Installation instructions for the OSS ASN.1 Tools are included in all trial and commercial shipments.)

To build and run this sample, install a trial or licensed version of the OSS ASN.1 Tools for C.

1. Generate C source and header files (runtime-only shipments)

If your shipment is runtime-only, generate the .c and .h files by running:

make cross

This creates a samples/cross directory with:

  • the required .asn files
  • scripts to run the OSS ASN.1/C compiler (asn1cpl.sh or asn1cpl.bat)
2. Build and run the sample
make

This command compiles the sample C source, links it with the OSS ASN.1 static library, and executes the test. To use another type of library in the shipment (such as a shared library), set the A makefile variable, for example:

make A=so
3. Clean up generated files
make clean
4. Other Platforms

Note: The C source code in this sample is platform-independent. Linux commands are shown as an example, but equivalent samples and build instructions are available for Windows, macOS, and other platforms. For help with platform-specific instructions, please contact OSS Support.

Code Listing: te1ap.c

The following listing shows the main C source file for this sample test program, te1ap.c. It demonstrates how to read PER-encoded 5G E1AP messages from files, decode and print them, and create and encode a response message using the OSS ASN.1 Tools API.

Show te1ap.c source code
/*****************************************************************************/
/*  Copyright (C) ###RELEASE_YEAR### OSS Nokalva, Inc.  All rights reserved.               */
/*****************************************************************************/
/* THIS FILE IS PROPRIETARY MATERIAL OF OSS NOKALVA, INC.                    */
/* AND MAY BE USED ONLY BY DIRECT LICENSEES OF OSS NOKALVA, INC.             */
/* THIS FILE MAY NOT BE DISTRIBUTED.                                         */
/* THIS COPYRIGHT STATEMENT MAY NOT BE REMOVED.                              */
/* THIS SAMPLE PROGRAM IS PROVIDED AS IS. THE SAMPLE PROGRAM AND ANY RESULTS */
/* OBTAINED FROM IT ARE PROVIDED WITHOUT ANY WARRANTIES OR REPRESENTATIONS,  */
/* EXPRESS, IMPLIED OR STATUTORY.                                            */
/*****************************************************************************/

/*
 * Demonstrates work with data for E1 protocol of NG-RAN
 */
#include <errno.h>
#include <string.h>
#include "e1ap_r19.h"

/* Names of Criticality values */
static const char *Criticalities[] = { "reject", "ignore", "notify" };

/* The directory where input files reside. It is set to the command line parameter
 * if any and to the directory where the sample is started, otherwise.
 */
char *filesDir;

/************************ UTILITY FUNCTIONS section:  ************************/

/*
 * FUNCTION     reportError() prints error message and error code returned
 *              by any runtime API function.
 *
 * PARAMETERS
 *     world    OSS environment variable
 *     where    error origin
 *     errcode  error code
 *     errmsg   error message or NULL if ossGetErrMsg() should be used
 *              to get it
 *
 * RETURNS      errcode
 */
static int reportError(OssGlobal *world, const char *where,
				    int errcode, const char *errmsg)
{
    /* Error occured */
    if (errcode) {
        ossPrint(world, "%s failed, error code: %d\n", where, errcode);
	/* Get and print error message */
	if (errmsg || (world && NULL != (errmsg = ossGetErrMsg(world))))
	    ossPrint(world, "Error text: %s\n", errmsg);
    }
    return errcode;
}

/*
 * FUNCTION     Helper function to open file in the specified directory.
 *
 * PARAMETERS
 *     world            OSS environment variable
 *     directoryName    directory where fileName resides
 *     fileName         file to open
 *
 * RETURNS      pointer to file on success, NULL on failure
 */
FILE * openInputFile(OssGlobal *world, char *directoryName, const char *fileName)
{
    char *path;
    FILE *fv;
    const char kPathSeparator =
#ifdef _WIN32
				'\\';
#else
				'/';
#endif

    if (directoryName) {
	size_t dLength = strlen(directoryName);

	if (NULL == (path = ossGetMemory(world, dLength + strlen(fileName) + 2))) {
	    return NULL;
	}

	memcpy(path, directoryName, dLength);
	if (path[dLength - 1] != kPathSeparator)
	    path[dLength++] = kPathSeparator;
	strcpy(path+dLength, fileName);
    } else {
	path = (char *) fileName;
    }

    if (!(fv = fopen(path, "rb"))) {
	ossPrint(world, "Failed to open the '%s' file. Restart the sample program using the file "
		"location as the input parameter.\n", path);
    }

    if (path != fileName)
	ossFreeMemory(world, path);

    return fv;
}

/*
 * FUNCTION     readEncodingFromFile() reads serialized message from specified
 *              file
 *
 * PARAMETERS
 *    world     OSS environment variable
 *    filename  name of file containing serialized message
 *    encoding  read message
 *
 * RETURNS      0 on success, error code on failure
 */
static int readEncodingFromFile(OssGlobal *world,
				    const char *filename, OssBuf *encoding)
{
    FILE        *in = openInputFile(world, filesDir, filename);
    long        length;
    unsigned char *data;

    if (!in)
	return reportError(world, "fopen()", errno, strerror(errno));

    if (fseek(in, 0, SEEK_END))
	return reportError(world, "fseek()", errno, strerror(errno));

    length = ftell(in);
    if (length < 0)
	return reportError(world, "ftell()", errno, strerror(errno));

    /* Allocate memory to store completely read message in it */
    data = ossGetMemory(world, (size_t)length);
    if (!data) {
	reportError(world, "ossGetMemory()", OUT_MEMORY, NULL);
	fclose(in);
	return OUT_MEMORY;
    }
    rewind(in);

    if ((size_t)length != fread(data, sizeof(char), (size_t)length, in))
	return reportError(world, "fread()", 1, NULL);
    fclose(in);
    /* Store read message in output argument */
    encoding->value = data;
    encoding->length = (size_t)length;
    return 0;
}


/*
 * FUNCTION     printHexString() prints data (octet string) as a sequence of
 *              hexadecimal digits 'XXXX...'H
 *
 * PARAMETERS
 *    world     OSS environment variable
 *    length    length of input data
 *    value     pointer to input data
 *    indent    indentation
 *
 * RETURNS      0 on success, error code on failure
 */
static int printHexString(OssGlobal *world,
		unsigned int length, unsigned char *value, int indent)
{
    unsigned int i, j,
		max_pos = 74 - indent;

    ossPrint(world, "'");
    for (i = 0, j = 1; i < length; i++, j += 2) {
	/* skip to next line when the current one is filled */
	if (j >= max_pos) {
	    ossPrint(world, "'\n%*s'", indent, "");
	    j = 1;
	}
	ossPrint(world, "%02X", value[i]);
    }
    ossPrint(world, "'H");
    return 0;
}

/* Prints a BIT STRING as a sequence of hexadecimal digits */
#define printHexBitString(ctx, length, value, indent)\
	    printHexString(ctx, (length + 7)/8, value, indent)

/*
 * FUNCTION     copyOctets() copies necessary number of bytes from input string
 *
 * PARAMETERS
 *    world     OSS environment variable
 *    value     pointer to input data
 *    length    length of new string in bytes
 *			(number of bytes that should be copied from the input string)
 *
 * RETURNS      copied string on success, NULL on failure
 */
static unsigned char *copyOctets(OssGlobal *world, unsigned char *value, OSS_UINT32 length)
{
    unsigned char *return_value;

    if (!length || NULL == (return_value = (unsigned char*)ossGetInitializedMemory(world, length)))
	return NULL;

    memcpy(return_value, value, length);

    return return_value;
}

/*****************************  MAIN section: ********************************/

/*****************************************************************************
 * Printing functions below are intended to demonstrate how to access e1ap
 * PDU components and to analyze their contents.
 *****************************************************************************/

/*
 * FUNCTION     printProtocolIEs() prints ProtocolIE_Container data.
 *              ossPrintPDU() is called to print IEs that are not
 *              handled by this function.
 *
 * PARAMETERS
 *    world     OSS environment variable
 *    pdu       input e1ap PDU which data should be printed
 *    ies       pointer to ProtocolIE-Container data to print
 *    indent    indentation
 *
 * RETURNS      0 on success, error code on failure
 */
static int printProtocolIEs(OssGlobal *world, struct OSS_E1AP_ResetIEs_ *ies, int indent)
{
    int err = 0;
    int      i;

    ossPrint(world, "%*s%s includes the following IEs:\n", indent++, "",
					"protocolIEs");
    /* Print each IE */
    for (i = 1; ies; ies = ies->next, i++) {
	struct OSS_E1AP_ResetIE *field = &ies->value;
	OSS_E1AP_ResetIEs_Value   *value = &field->value;

	ossPrint(world, "\n%*s#%d: id = %2hu, criticality = %s\n", indent, "",
		    i, field->id, Criticalities[field->criticality]);

	++indent;
	/* Print TransactionID IE */
        if (field->id == OSS_E1AP_id_TransactionID) {
	    ossPrint(world, "%*svalue %s: %u\n", indent, "", "TransactionID",
					*field->value.decoded.pdu_TransactionID);
	/* ResetType IE */
	} else if (field->id == OSS_E1AP_id_ResetType) {
		OSS_E1AP_ResetType *pResetType = field->value.decoded.pdu_ResetType;

	    ossPrint(world, "%*svalue %s:", indent, "", "ResetType");
		if (pResetType->choice == OSS_E1AP_e1_Interface_chosen) {
			ossPrint(world, "%s : %d", "e1_Interface",
							pResetType->u.e1_Interface);
		}
		else if (pResetType->choice == OSS_E1AP_partOfE1_Interface_chosen) {
			ossPrint(world, "%s :", "partOfE1_Interface");
			/* will not be used, no need to implement printing */
		}
		else if (pResetType->choice == OSS_E1AP_ResetType_choice_extension_chosen) {
					/* will not be used, no need to implement printing */
		}
	/* Cause IE */
	} else if (field->id == OSS_E1AP_id_Cause) {
	    OSS_E1AP_Cause  *pcause = field->value.decoded.pdu_Cause;

	    /*
	     * Named values can be printed below instead of numbers for all
	     * Cause components
	     */
	    ossPrint(world, "%*svalue %s: ", indent, "", "Cause");
	    /* radioNetwork */
	    if (pcause->choice == OSS_E1AP_radioNetwork_chosen)
		ossPrint(world, "%s : %d", "radioNetwork",
						pcause->u.radioNetwork);
	    /* transport */
	    else if (pcause->choice == OSS_E1AP_transport_chosen)
		ossPrint(world, "%s : %d", "transport", pcause->u.transport);
	    /* nas */
	    else if (pcause->choice == OSS_E1AP_protocol_chosen)
		ossPrint(world, "%s : %d", "protocol", pcause->u.protocol);
	    /* misc */
	    else if (pcause->choice == OSS_E1AP_misc_chosen)
		ossPrint(world, "%s : %d", "misc", pcause->u.misc);
	    ossPrint(world, "\n");
	} else
	    ossPrint(world, "PDU is not decoded\n");
	indent--;
    }
    return err;
}

/*
 * FUNCTION     printResetMsg() prints e1ap pdu which contains
 *              Reset message.  The function is not intended to
 *              handle other types of messages.
 *
 * PARAMETERS
 *    world     OSS enviroonment variable
 *    pdu       input e1ap PDU which data should be printed
 *
 * RETURNS      0 on success, error code on failure
 */
static int printResetMsg(OssGlobal *world, OSS_E1AP_E1AP_PDU *pdu)
{
    int         msg_id;
    OSS_E1AP_E1AP_ELEMENTARY_PROCEDURES_InitiatingMessage  *msg_value;
    OSS_E1AP_Reset	*reset_value;

    /* Check the message type */
    if (pdu->choice != OSS_E1AP_initiatingMessage_chosen) {
	ossPrint(world, "### Unexpected type of message");
	return -1;
    }

    msg_value = &pdu->u.initiatingMessage.value;
    msg_id = msg_value->pduNum;
    if ( msg_id != OSS_E1AP_Reset_PDU) {
	ossPrint(world, "### Unexpected message id = %d\n", msg_id);
	return -1;
    } else {
	reset_value = msg_value->decoded.pdu_Reset;
    }

    ossPrint(world, "Message id = %d (Reset)\n\n", msg_id);

    if (!reset_value || !reset_value->protocolIEs) {
        ossPrint(world, "Incorrect message\n");
        return -1;
    }

    return printProtocolIEs(world, reset_value->protocolIEs, 0);
}

/*
 * FUNCTION     createSuccessResponse() creates e1ap successful outcome
 *              message for given HandoverRequired request.
 *
 * PARAMETERS
 *    world     OSS environment variable
 *    req       input message (request)
 *    resp      pointer to the successful outcome message (response)
 *              created by the function
 *
 * RETURNS      0 on success, error code on failure
 */
static int createSuccessResponse(OssGlobal *world, OSS_E1AP_E1AP_PDU *req,
							    OSS_E1AP_E1AP_PDU **resp)
{
	OSS_E1AP_Reset *reset_value;
	OSS_E1AP_ResetIEs reqies;
	OSS_E1AP_ResetAcknowledgeIEs respies;

    OSS_E1AP_SuccessfulOutcome *outcome_msg;
    OSS_E1AP_E1AP_ELEMENTARY_PROCEDURES_SuccessfulOutcome  *ot_val;

    ossBoolean  element_was_found;

    if (req->choice != OSS_E1AP_initiatingMessage_chosen) {
	ossPrint(world, "Unexpected type of message");
	return -1;
    }

    if (req->u.initiatingMessage.value.pduNum == 0
	    || req->u.initiatingMessage.value.encoded.value) {
	ossPrint(world, "Unexpected Reset request data");
	return -1;
    }

    reset_value = req->u.initiatingMessage.value.decoded.pdu_Reset;

    if (NULL == (reqies = reset_value->protocolIEs)) {
	ossPrint(world, "No IEs in Reset request");
	return -1;
    }

    /*
     * Create successful outcome message from initiating message. Copy
     * some IEs from input to output.
     */
    *resp = ossGetInitializedMemory(world, sizeof(OSS_E1AP_E1AP_PDU));
    if (!*resp)
	return reportError(world, "ossGetInitializedMemory for OSS_E1AP_PDU", OUT_MEMORY, NULL);

    (*resp)->choice = OSS_E1AP_successfulOutcome_chosen;

    outcome_msg = &(*resp)->u.successfulOutcome;
    outcome_msg->procedureCode = req->u.initiatingMessage.procedureCode;
    outcome_msg->criticality = OSS_E1AP_reject;

    ot_val = &outcome_msg->value;
    ot_val->pduNum = OSS_E1AP_ResetAcknowledge_PDU;
    ot_val->decoded.pdu_ResetAcknowledge =
	ossGetInitializedMemory(world, sizeof(OSS_E1AP_ResetAcknowledge));
    if (!ot_val->decoded.pdu_ResetAcknowledge) {
	/* Deallocate OSS_E1AP_PDU on error */
	ossFreePDU(world, OSS_E1AP_E1AP_PDU_PDU, *resp);
	return reportError(world, "ossGetInitializedMemory for OSS_E1AP_ResetAcknowledge", OUT_MEMORY, NULL);
    }

    ot_val->decoded.pdu_ResetAcknowledge->protocolIEs =
			ossGetInitializedMemory(world, sizeof(struct OSS_E1AP_ResetAcknowledgeIEs_));
    if (NULL == (respies = ot_val->decoded.pdu_ResetAcknowledge->protocolIEs)) {
	/* Deallocate OSS_E1AP_PDU on error */
	ossFreePDU(world, OSS_E1AP_E1AP_PDU_PDU, *resp);
	return reportError(world, "ossGetInitializedMemory for OSS_E1AP_ProtocolIE_Container", OUT_MEMORY, NULL);
    }

    for (element_was_found = FALSE; reqies; reqies = reqies->next) {
	 if (reqies->value.id == OSS_E1AP_id_TransactionID) {
	    if (element_was_found) {
    		respies->next = ossGetInitializedMemory(world,
					sizeof(struct OSS_E1AP_ResetAcknowledgeIEs_));
    		if (!respies->next) {
		    /* Deallocate OSS_E1AP_PDU on error */
		    ossFreePDU(world, OSS_E1AP_E1AP_PDU_PDU, *resp);
		    return reportError(world, "ossGetInitializedMemory for OSS_E1AP_ProtocolIE_Container",
										OUT_MEMORY, NULL);
		}
	        respies = respies->next;
	    }


	    if (reqies->value.id == OSS_E1AP_id_TransactionID) {
	        respies->value.id = OSS_E1AP_id_TransactionID;
			respies->value.criticality = OSS_E1AP_reject;
			respies->value.value.decoded.pdu_TransactionID = ossGetInitializedMemory(world, sizeof(OSS_E1AP_TransactionID));
	    	if (!respies->value.value.decoded.pdu_TransactionID) {
		    /* Deallocate OSS_E1AP_PDU on error */
		    ossFreePDU(world, OSS_E1AP_E1AP_PDU_PDU, *resp);
		    return reportError(world, "ossGetInitializedMemory for OSS_E1AP_TransactionID",
											OUT_MEMORY, NULL);
		}
		respies->value.value.pduNum = OSS_E1AP_PDU_ResetAcknowledgeIEs_Value_TransactionID;
	        *respies->value.value.decoded.pdu_TransactionID =
						*reqies->value.value.decoded.pdu_TransactionID;
	    }

	    element_was_found = TRUE;
	    }
    }

    return 0;
}

/*
 * FUNCTION     teste1ap() is used to test e1ap message, the input serialized
 *              pdu is deserialized and printed, then an outcome message
 *              is created, printed and encoded.
 *
 * PARAMETERS
 *    world	OSS environment variable
 *    filename  name of file containing serialized message
 *
 * RETURNS      0 on success, error code on failure
 */
static int teste1ap(OssGlobal *world, const char *filename)
{
    OssBuf	encoded_data;
    int		err, pdu_num = OSS_E1AP_E1AP_PDU_PDU;

    ossPrint(world, "### Reading serialized request message from file: %s ...\n", filename);
    err = readEncodingFromFile(world, filename, &encoded_data);
    if (!err) {
	/*
	 * Zero deserilaized message pointer in order to allocate it
	 * in API call
	 */
	OSS_E1AP_E1AP_PDU    *req = NULL;
	ossPrint(world, "### Deserializing the message...\n");
	err = ossDecode(world, &pdu_num, &encoded_data, (void**)&req);
        ossPrint(world, "\n");
	/* Print error diagnostics if an error takes place */
	if (err) {
	    reportError(world, "ossDecode()", err, NULL);
	} else {
	    ossPrint(world, "### Printing the deserialized message by ossPrintPDU():\n");
	    err = ossPrintPDU(world, OSS_E1AP_E1AP_PDU_PDU, req);
	    ossPrint(world, "\n");
	    if (err)
		reportError(world, "ossPrintPDU()", err, NULL);
	    else {
		/* Parse and print input message */
		ossPrint(world, "### Printing the deserialized message by a "
			"handwritten code demonstrating how to access data:\n\n");

		if (0 == (err = printResetMsg(world, req))) {
		    OSS_E1AP_E1AP_PDU    *resp;

		    ossPrint(world, "\n\n### Creating response message...");
		    err = createSuccessResponse(world, req, &resp);
		    if (!err) {
			OssBuf     msg = { 0, NULL };

			ossPrint(world, "\n### Printing the responce message by ossPrintPDU():\n");
			err = ossPrintPDU(world, OSS_E1AP_E1AP_PDU_PDU, resp);

			ossPrint(world, "\n### Serializing the response message... \n");
			err = ossEncode(world, OSS_E1AP_E1AP_PDU_PDU, resp, &msg);
			if (err) {
			    reportError(world, "ossEncode()", err, NULL);
			} else {
			    /* Print serialized outcome message */
			    ossPrint(world, "### The serialized message in hex (%ld bytes):\n",
					msg.length);
			    printHexString(world, msg.length, msg.value, 0);
			    ossFreeMemory(world, msg.value);
			    ossPrint(world, "\n\n");
			}
			/* Free memory allocated for outcome message */
			ossFreePDU(world, OSS_E1AP_E1AP_PDU_PDU, resp);
		    }
		}
	    }
	}
	/*
	 * Free memory allocated for input message if it is deserialized
	 * successfully
	 */
	if (req)
	    ossFreePDU(world, OSS_E1AP_E1AP_PDU_PDU, req);
	/* Free memory allocated for reading of input message from file */
	ossFreeMemory(world, encoded_data.value);
    }
    return err;
}

/*
 * Deserializes and prints input messages, creates and prints successful
 * outcome messages
 */
int main(int argc, char *argv[])
{
    OssGlobal world_data, *world = &world_data;
    int err = 0;

    err = ossinit(world, _oss_e1ap_control_table);
    if (err)
	return reportError(NULL, "ossinit()", err, NULL);

    filesDir = argc > 1 ? argv[1] : ".";

    /* Set flags */
    ossSetFlags(world, AUTOMATIC_ENCDEC);
    /* Set debug mode */
    ossSetDebugFlags(world, PRINT_ERROR_MESSAGES | PRINT_DECODING_DETAILS | PRINT_ENCODING_DETAILS);
    err = teste1ap(world, "E1AP-PDU_Reset.per");
    /* Free all resources */
    ossterm(world);

    if (!err)
	printf("### Testing successful.\n");

    return err;
}

Expected Output (Excerpt)

This is the expected output when running the sample:

Decoded E1AP message:
  ...
Encoding response message...
Encoding successful.

ASN.1 Schema Excerpt (e1ap.asn)

Show excerpt from e1ap.asn
-- Excerpt from e1ap.asn 3GPP TS 37.483 V19.0.0 (2025-09) 
-- **************************************************************
--
-- Elementary Procedure definitions
--
-- **************************************************************

E1AP-PDU-Descriptions {
itu-t (0) identified-organization (4) etsi (0) mobileDomain (0)
ngran-access (22) modules (3) e1ap (5) version1 (1) e1ap-PDU-Descriptions (0) }

DEFINITIONS AUTOMATIC TAGS ::= 

BEGIN

-- **************************************************************
--
-- IE parameter types from other modules
--
-- **************************************************************

IMPORTS
	Criticality,
	ProcedureCode

FROM E1AP-CommonDataTypes
	Reset,
	ResetAcknowledge,
	ErrorIndication,
	GNB-CU-UP-E1SetupRequest,
	GNB-CU-UP-E1SetupResponse,
	GNB-CU-UP-E1SetupFailure, 
	GNB-CU-CP-E1SetupRequest,
	GNB-CU-CP-E1SetupResponse,
	GNB-CU-CP-E1SetupFailure, 
	GNB-CU-UP-ConfigurationUpdate,
	GNB-CU-UP-ConfigurationUpdateAcknowledge,
	GNB-CU-UP-ConfigurationUpdateFailure,
	GNB-CU-CP-ConfigurationUpdate,
	GNB-CU-CP-ConfigurationUpdateAcknowledge,
	GNB-CU-CP-ConfigurationUpdateFailure,
	BCBearerContextSetupRequest,
	BCBearerContextSetupResponse,
	BCBearerContextSetupFailure,
	BCBearerContextModificationRequest,
	BCBearerContextModificationResponse,
	BCBearerContextModificationFailure,
	BCBearerContextModificationRequired,
	BCBearerContextModificationConfirm,
	BCBearerContextReleaseCommand,
	BCBearerContextReleaseComplete,
	BCBearerContextReleaseRequest,
	BearerContextSetupRequest,
	BearerContextSetupResponse,
	BearerContextSetupFailure,
	BearerContextModificationRequest,
	BearerContextModificationResponse,
	BearerContextModificationFailure,
	BearerContextModificationRequired,
	BearerContextModificationConfirm,
	BearerContextReleaseCommand,
	BearerContextReleaseComplete,
	BearerContextReleaseRequest,
	BearerContextInactivityNotification,
	DLDataNotification,
	ULDataNotification,
	DataUsageReport,
	E1ReleaseRequest,
	E1ReleaseResponse,
	GNB-CU-UP-CounterCheckRequest,
	GNB-CU-UP-StatusIndication,
	MCBearerContextSetupRequest,
	MCBearerContextSetupResponse,
	MCBearerContextSetupFailure,
	MCBearerContextModificationRequest,
	MCBearerContextModificationResponse,
	MCBearerContextModificationFailure,
	MCBearerContextModificationRequired,
	MCBearerContextModificationConfirm,
	MCBearerNotification,
	MCBearerContextReleaseCommand,
	MCBearerContextReleaseComplete,
	MCBearerContextReleaseRequest,
	MRDC-DataUsageReport,
	DeactivateTrace,
	TraceStart,
	PrivateMessage,
	ResourceStatusRequest,
	ResourceStatusResponse,
	ResourceStatusFailure,
	ResourceStatusUpdate,
	IAB-UPTNLAddressUpdate,
	IAB-UPTNLAddressUpdateAcknowledge,
	IAB-UPTNLAddressUpdateFailure,
	CellTrafficTrace,
	EarlyForwardingSNTransfer,
	GNB-CU-CPMeasurementResultsInformation,
	IABPSKNotification,
	DataCollectionRequest,
	DataCollectionResponse,
	DataCollectionFailure,
	DataCollectionUpdate

FROM E1AP-PDU-Contents
	id-reset,
	id-errorIndication,
	id-gNB-CU-UP-E1Setup,
	id-gNB-CU-CP-E1Setup,
	id-gNB-CU-UP-ConfigurationUpdate,
	id-gNB-CU-CP-ConfigurationUpdate,
	id-e1Release,
	id-bearerContextSetup,
	id-bearerContextModification,
	id-bearerContextModificationRequired,
	id-bearerContextRelease,
	id-bearerContextReleaseRequest,
	id-bearerContextInactivityNotification,
	id-dLDataNotification,
	id-uLDataNotification,
	id-dataUsageReport,
	id-gNB-CU-UP-CounterCheck,
	id-gNB-CU-UP-StatusIndication,
	id-mRDC-DataUsageReport,
	id-DeactivateTrace,
	id-TraceStart,
	id-privateMessage,
	id-resourceStatusReportingInitiation,
	id-resourceStatusReporting,
	id-iAB-UPTNLAddressUpdate,
	id-CellTrafficTrace,
	id-earlyForwardingSNTransfer,
	id-gNB-CU-CPMeasurementResultsInformation,
	id-iABPSKNotification,
	id-BCBearerContextSetup,
	id-BCBearerContextModification,
	id-BCBearerContextModificationRequired,
	id-BCBearerContextRelease,
	id-BCBearerContextReleaseRequest,
	id-MCBearerContextSetup,
	id-MCBearerContextModification,
	id-MCBearerContextModificationRequired,
	id-MCBearerNotification,
	id-MCBearerContextRelease,
	id-MCBearerContextReleaseRequest,
	id-dataCollectionReportingInitiation,
	id-dataCollectionReporting

FROM E1AP-Constants;

-- **************************************************************
--
-- Interface Elementary Procedure Class
--
-- **************************************************************

E1AP-ELEMENTARY-PROCEDURE ::= CLASS {
	&InitiatingMessage				,
	&SuccessfulOutcome							OPTIONAL,
	
&UnsuccessfulOutcome						OPTIONAL,
	&procedureCode				ProcedureCode 	UNIQUE,
	&criticality				Criticality 	DEFAULT ignore
}
WITH SYNTAX {
	INITIATING MESSAGE			&InitiatingMessage
	[SUCCESSFUL OUTCOME			&SuccessfulOutcome]
	[UNSUCCESSFUL OUTCOME		&UnsuccessfulOutcome]
	PROCEDURE CODE				&procedureCode
	[CRITICALITY				&criticality]
}

-- **************************************************************
--
-- Interface PDU Definition
--
-- **************************************************************

E1AP-PDU ::= CHOICE {
	initiatingMessage		InitiatingMessage,
	successfulOutcome		SuccessfulOutcome,
	unsuccessfulOutcome		UnsuccessfulOutcome,
	...
}

Using ASN.1 Studio (Optional)

The gui/ subdirectory contains an ASN.1 Studio project for this sample. With ASN.1 Studio you can:

  • Open the 5G E1AP ASN.1 modules.
  • Generate code from the ASN.1 schema.
  • Create and edit sample encoded 5G E1AP messages.
  • Export projects to gmake makefiles.

Related Samples

Disclaimer

This sample is provided solely for illustration purposes, for example to demonstrate usage of the OSS ASN.1 Tools API with 3GPP 5G E1AP messages. It does not represent a complete application. To build and run this sample, you must use a trial or licensed version of the appropriate OSS ASN.1 Tools. The copyright and license statements included in each source file remain fully applicable.

Need Help?

If you have questions about using this sample, contact OSS Nokalva Support.

See Also