Commit d83172f7 authored by Lev Walkin's avatar Lev Walkin
Browse files

MEGACO (Media Gateway Control) protocol decoder

parent 1b1c5fc7
0.9.21: 2006-Aug-27
0.9.21: 2006-Sep-08
* skeletons/standard-modules directory is now used for standard types.
* Fixed class field access problem (Test case 98)
......@@ -10,6 +10,7 @@
* Refactored ValueSetTypeAssignment parsing.
* First release of PER encoder (does not encode SETs yet).
* asn-decoder-template.c renamed into converter-sample.c
* MEGACO (Media Gateway Control Protocol) decoder sample added.
0.9.20: 2006-Mar-06
......
......@@ -97,8 +97,6 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFIGURE_DEPENDS = @CONFIGURE_DEPENDS@
CPLUSPLUS_FOUND_FALSE = @CPLUSPLUS_FOUND_FALSE@
CPLUSPLUS_FOUND_TRUE = @CPLUSPLUS_FOUND_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
......
......@@ -105,8 +105,6 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFIGURE_DEPENDS = @CONFIGURE_DEPENDS@
CPLUSPLUS_FOUND_FALSE = @CPLUSPLUS_FOUND_FALSE@
CPLUSPLUS_FOUND_TRUE = @CPLUSPLUS_FOUND_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
......
......@@ -62,8 +62,6 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFIGURE_DEPENDS = @CONFIGURE_DEPENDS@
CPLUSPLUS_FOUND_FALSE = @CPLUSPLUS_FOUND_FALSE@
CPLUSPLUS_FOUND_TRUE = @CPLUSPLUS_FOUND_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
......
......@@ -83,8 +83,6 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFIGURE_DEPENDS = @CONFIGURE_DEPENDS@
CPLUSPLUS_FOUND_FALSE = @CPLUSPLUS_FOUND_FALSE@
CPLUSPLUS_FOUND_TRUE = @CPLUSPLUS_FOUND_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
......
......@@ -72,8 +72,6 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFIGURE_DEPENDS = @CONFIGURE_DEPENDS@
CPLUSPLUS_FOUND_FALSE = @CPLUSPLUS_FOUND_FALSE@
CPLUSPLUS_FOUND_TRUE = @CPLUSPLUS_FOUND_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
......
......@@ -6,11 +6,18 @@ ASN1_FILES_1 = \
rfc3280-PKIX1Explicit88.asn1 \
rfc3280-PKIX1Implicit88.asn1
all: $(ASN1_FILES_1)
ASN1_SOURCE_2 = rfc3525.txt
ASN1_FILES_2 = \
rfc3525-MEDIA-GATEWAY-CONTROL.asn1
all: $(ASN1_FILES_1) $(ASN1_FILES_2)
$(ASN1_FILES_1): crfc2asn1.pl $(ASN1_SOURCE_1)
./crfc2asn1.pl $(ASN1_SOURCE_1)
$(ASN1_FILES_2): crfc2asn1.pl $(ASN1_SOURCE_2)
./crfc2asn1.pl $(ASN1_SOURCE_2)
EXTRA_DIST = $(srcdir)/rfc*.txt \
$(srcdir)/sample.source.PKIX1/README \
$(srcdir)/sample.source.PKIX1/config.h \
......
......@@ -67,8 +67,6 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFIGURE_DEPENDS = @CONFIGURE_DEPENDS@
CPLUSPLUS_FOUND_FALSE = @CPLUSPLUS_FOUND_FALSE@
CPLUSPLUS_FOUND_TRUE = @CPLUSPLUS_FOUND_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
......@@ -170,6 +168,10 @@ ASN1_FILES_1 = \
rfc3280-PKIX1Explicit88.asn1 \
rfc3280-PKIX1Implicit88.asn1
ASN1_SOURCE_2 = rfc3525.txt
ASN1_FILES_2 = \
rfc3525-MEDIA-GATEWAY-CONTROL.asn1
EXTRA_DIST = $(srcdir)/rfc*.txt \
$(srcdir)/sample.source.PKIX1/README \
$(srcdir)/sample.source.PKIX1/config.h \
......@@ -367,11 +369,14 @@ uninstall-am: uninstall-dist_binSCRIPTS uninstall-info-am
uninstall-dist_binSCRIPTS uninstall-info-am
all: $(ASN1_FILES_1)
all: $(ASN1_FILES_1) $(ASN1_FILES_2)
$(ASN1_FILES_1): crfc2asn1.pl $(ASN1_SOURCE_1)
./crfc2asn1.pl $(ASN1_SOURCE_1)
$(ASN1_FILES_2): crfc2asn1.pl $(ASN1_SOURCE_2)
./crfc2asn1.pl $(ASN1_SOURCE_2)
clean-local:
cd sample.source.PKIX1 && make distclean
cd sample.source.TAP3 && make distclean
......
This directory contains a examples of ASN.1 converters.
This directory contains a few examples.
1. The ./sample.source.PKIX1 directory contains the X.509 Certificate decoder.
......@@ -10,8 +10,13 @@ This directory contains a examples of ASN.1 converters.
ISO 13522 MHEG-5/ITU-T T.172 (Multimedia Hypermedia Experts Group,
Multimedia Presentations). Read the README file in that directory.
3. The ./sample.source.MEGACO directory contains the decoder for
Media Gateway Control Protocol data units as specified in rfc3525.txt.
The crfc2asn1.pl script can be used to extract ASN.1 data from RFC texts.
For instance, it is used to extract X.509 ASN.1 modules from PKIX1 RFCs.
For instance, it is used to extract X.509 ASN.1 modules from PKIX1 RFC
and MEGACO ASN.1 module from rfc3525.txt.
To regenerate the .asn1 files from the original RFC texts, do `rm *.asn1; make`.
The clyx2asn1.pl script can be used to extract ASN.1 data from LyX editor files.
......
This diff is collapsed.
ASN_MODULE_SOURCES= \
MegacoMessage.c \
AuthenticationHeader.c \
SecurityParmIndex.c \
SequenceNum.c \
AuthData.c \
Message.c \
MId.c \
DomainName.c \
IP4Address.c \
IP6Address.c \
PathName.c \
Transaction.c \
TransactionId.c \
TransactionRequest.c \
TransactionPending.c \
TransactionReply.c \
TransactionResponseAck.c \
TransactionAck.c \
ErrorDescriptor.c \
ErrorCode.c \
ErrorText.c \
ContextID.c \
ActionRequest.c \
ActionReply.c \
ContextRequest.c \
ContextAttrAuditRequest.c \
CommandRequest.c \
Command.c \
CommandReply.c \
TopologyRequest.c \
AmmRequest.c \
AmmDescriptor.c \
AmmsReply.c \
SubtractRequest.c \
AuditRequest.c \
AuditReply.c \
AuditResult.c \
TerminationAudit.c \
AuditReturnParameter.c \
AuditDescriptor.c \
NotifyRequest.c \
NotifyReply.c \
ObservedEventsDescriptor.c \
ObservedEvent.c \
EventName.c \
EventParameter.c \
ServiceChangeRequest.c \
ServiceChangeReply.c \
ServiceChangeResult.c \
WildcardField.c \
TerminationID.c \
TerminationIDList.c \
MediaDescriptor.c \
StreamDescriptor.c \
StreamParms.c \
LocalControlDescriptor.c \
StreamMode.c \
PropertyParm.c \
Name.c \
PkgdName.c \
Relation.c \
LocalRemoteDescriptor.c \
PropertyGroup.c \
TerminationStateDescriptor.c \
EventBufferControl.c \
ServiceState.c \
MuxDescriptor.c \
MuxType.c \
StreamID.c \
EventsDescriptor.c \
RequestedEvent.c \
RequestedActions.c \
EventDM.c \
SecondEventsDescriptor.c \
SecondRequestedEvent.c \
SecondRequestedActions.c \
EventBufferDescriptor.c \
EventSpec.c \
SignalsDescriptor.c \
SignalRequest.c \
SeqSigList.c \
Signal.c \
SignalType.c \
SignalName.c \
NotifyCompletion.c \
SigParameter.c \
RequestID.c \
ModemDescriptor.c \
ModemType.c \
DigitMapDescriptor.c \
DigitMapName.c \
DigitMapValue.c \
ServiceChangeParm.c \
ServiceChangeAddress.c \
ServiceChangeResParm.c \
ServiceChangeMethod.c \
ServiceChangeProfile.c \
PackagesDescriptor.c \
PackagesItem.c \
StatisticsDescriptor.c \
StatisticsParameter.c \
NonStandardData.c \
NonStandardIdentifier.c \
H221NonStandard.c \
TimeNotation.c \
Value.c
ASN_MODULE_HEADERS= \
MegacoMessage.h \
AuthenticationHeader.h \
SecurityParmIndex.h \
SequenceNum.h \
AuthData.h \
Message.h \
MId.h \
DomainName.h \
IP4Address.h \
IP6Address.h \
PathName.h \
Transaction.h \
TransactionId.h \
TransactionRequest.h \
TransactionPending.h \
TransactionReply.h \
TransactionResponseAck.h \
TransactionAck.h \
ErrorDescriptor.h \
ErrorCode.h \
ErrorText.h \
ContextID.h \
ActionRequest.h \
ActionReply.h \
ContextRequest.h \
ContextAttrAuditRequest.h \
CommandRequest.h \
Command.h \
CommandReply.h \
TopologyRequest.h \
AmmRequest.h \
AmmDescriptor.h \
AmmsReply.h \
SubtractRequest.h \
AuditRequest.h \
AuditReply.h \
AuditResult.h \
TerminationAudit.h \
AuditReturnParameter.h \
AuditDescriptor.h \
NotifyRequest.h \
NotifyReply.h \
ObservedEventsDescriptor.h \
ObservedEvent.h \
EventName.h \
EventParameter.h \
ServiceChangeRequest.h \
ServiceChangeReply.h \
ServiceChangeResult.h \
WildcardField.h \
TerminationID.h \
TerminationIDList.h \
MediaDescriptor.h \
StreamDescriptor.h \
StreamParms.h \
LocalControlDescriptor.h \
StreamMode.h \
PropertyParm.h \
Name.h \
PkgdName.h \
Relation.h \
LocalRemoteDescriptor.h \
PropertyGroup.h \
TerminationStateDescriptor.h \
EventBufferControl.h \
ServiceState.h \
MuxDescriptor.h \
MuxType.h \
StreamID.h \
EventsDescriptor.h \
RequestedEvent.h \
RequestedActions.h \
EventDM.h \
SecondEventsDescriptor.h \
SecondRequestedEvent.h \
SecondRequestedActions.h \
EventBufferDescriptor.h \
EventSpec.h \
SignalsDescriptor.h \
SignalRequest.h \
SeqSigList.h \
Signal.h \
SignalType.h \
SignalName.h \
NotifyCompletion.h \
SigParameter.h \
RequestID.h \
ModemDescriptor.h \
ModemType.h \
DigitMapDescriptor.h \
DigitMapName.h \
DigitMapValue.h \
ServiceChangeParm.h \
ServiceChangeAddress.h \
ServiceChangeResParm.h \
ServiceChangeMethod.h \
ServiceChangeProfile.h \
PackagesDescriptor.h \
PackagesItem.h \
StatisticsDescriptor.h \
StatisticsParameter.h \
NonStandardData.h \
NonStandardIdentifier.h \
H221NonStandard.h \
TimeNotation.h \
Value.h
ASN_MODULE_HEADERS+=BOOLEAN.h
ASN_MODULE_SOURCES+=BOOLEAN.c
ASN_MODULE_HEADERS+=ENUMERATED.h
ASN_MODULE_SOURCES+=ENUMERATED.c
ASN_MODULE_HEADERS+=INTEGER.h
ASN_MODULE_HEADERS+=NativeEnumerated.h
ASN_MODULE_HEADERS+=IA5String.h
ASN_MODULE_SOURCES+=IA5String.c
ASN_MODULE_SOURCES+=INTEGER.c
ASN_MODULE_HEADERS+=NULL.h
ASN_MODULE_SOURCES+=NULL.c
ASN_MODULE_SOURCES+=NativeEnumerated.c
ASN_MODULE_HEADERS+=NativeInteger.h
ASN_MODULE_SOURCES+=NativeInteger.c
ASN_MODULE_HEADERS+=OBJECT_IDENTIFIER.h
ASN_MODULE_SOURCES+=OBJECT_IDENTIFIER.c
ASN_MODULE_HEADERS+=asn_SEQUENCE_OF.h
ASN_MODULE_SOURCES+=asn_SEQUENCE_OF.c
ASN_MODULE_HEADERS+=asn_SET_OF.h
ASN_MODULE_SOURCES+=asn_SET_OF.c
ASN_MODULE_HEADERS+=constr_CHOICE.h
ASN_MODULE_SOURCES+=constr_CHOICE.c
ASN_MODULE_HEADERS+=constr_SEQUENCE.h
ASN_MODULE_SOURCES+=constr_SEQUENCE.c
ASN_MODULE_HEADERS+=constr_SEQUENCE_OF.h
ASN_MODULE_SOURCES+=constr_SEQUENCE_OF.c
ASN_MODULE_HEADERS+=constr_SET_OF.h
ASN_MODULE_SOURCES+=constr_SET_OF.c
ASN_MODULE_HEADERS+=asn_application.h
ASN_MODULE_HEADERS+=asn_system.h
ASN_MODULE_HEADERS+=asn_codecs.h
ASN_MODULE_HEADERS+=asn_internal.h
ASN_MODULE_HEADERS+=OCTET_STRING.h
ASN_MODULE_SOURCES+=OCTET_STRING.c
ASN_MODULE_HEADERS+=BIT_STRING.h
ASN_MODULE_SOURCES+=BIT_STRING.c
ASN_MODULE_SOURCES+=asn_codecs_prim.c
ASN_MODULE_HEADERS+=asn_codecs_prim.h
ASN_MODULE_HEADERS+=ber_tlv_length.h
ASN_MODULE_SOURCES+=ber_tlv_length.c
ASN_MODULE_HEADERS+=ber_tlv_tag.h
ASN_MODULE_SOURCES+=ber_tlv_tag.c
ASN_MODULE_HEADERS+=ber_decoder.h
ASN_MODULE_SOURCES+=ber_decoder.c
ASN_MODULE_HEADERS+=der_encoder.h
ASN_MODULE_SOURCES+=der_encoder.c
ASN_MODULE_HEADERS+=constr_TYPE.h
ASN_MODULE_SOURCES+=constr_TYPE.c
ASN_MODULE_HEADERS+=constraints.h
ASN_MODULE_SOURCES+=constraints.c
ASN_MODULE_HEADERS+=xer_support.h
ASN_MODULE_SOURCES+=xer_support.c
ASN_MODULE_HEADERS+=xer_decoder.h
ASN_MODULE_SOURCES+=xer_decoder.c
ASN_MODULE_HEADERS+=xer_encoder.h
ASN_MODULE_SOURCES+=xer_encoder.c
ASN_MODULE_HEADERS+=per_support.h
ASN_MODULE_SOURCES+=per_support.c
ASN_MODULE_HEADERS+=per_decoder.h
ASN_MODULE_SOURCES+=per_decoder.c
ASN_MODULE_HEADERS+=per_encoder.h
ASN_MODULE_SOURCES+=per_encoder.c
lib_LTLIBRARIES=libsomething.la
libsomething_la_SOURCES=$(ASN_MODULE_SOURCES) $(ASN_MODULE_HEADERS)
# This file may be used as an input for make(3)
# Remove the lines below to convert it into a pure .am file
TARGET = megacoDump
CFLAGS += -I. -DHAVE_CONFIG_H
OBJS=${ASN_MODULE_SOURCES:.c=.o} $(TARGET).o
all: MegacoMessage.c $(TARGET)
$(TARGET): ${OBJS}
$(CC) $(CFLAGS) -o $(TARGET) ${OBJS} $(LDFLAGS) $(LIBS)
.SUFFIXES:
.SUFFIXES: .c .o
.c.o:
$(CC) $(CFLAGS) -o $@ -c $<
clean:
rm -f $(TARGET)
rm -f $(OBJS)
regen: regenerate-from-asn1-source
regenerate-from-asn1-source:
../../asn1c/asn1c -fcompound-names -S ../../skeletons ../rfc3525-MEDIA-GATEWAY-CONTROL.asn1
MegacoMessage.c: regenerate.Makefile
./regenerate.Makefile
@touch MegacoMessage.c
make
ASN_CONVERTER=../../skeletons/converter-sample.c
$(TARGET).o: $(ASN_CONVERTER)
$(CC) $(CFLAGS) -DPDU=MegacoMessage -o $(TARGET).o -c $(ASN_CONVERTER)
distclean: clean
rm -f $(ASN_MODULE_SOURCES) $(ASN_MODULE_HEADERS)
rm -f Makefile.am.sample
GENERAL INFORMATION
===================
The MEGACO (Media Gateway Control Protocol) PDU decoder.
Invoking `make` will compile the ASN.1 specifications from the rfc3525.txt
in the above directory.
The ../../skeletons/converter-sample.c will supply the missing
"int main()" routine which drives the decoding process.
megacoDump USAGE
==============
./megacoDump MegacoMessage.ber # Print as XML (BASIC-XER)
The full list of recognized command line options may be obtained with
> ./megacoDump -h
extern int opt_debug;
#define ASN_DEBUG(fmt, args...) do { \
if(opt_debug < 2) break; \
fprintf(stderr, fmt, ##args); \
fprintf(stderr, " (%s:%d)\n", \
__FILE__, __LINE__); \
} while(0)
......@@ -82,8 +82,6 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFIGURE_DEPENDS = @CONFIGURE_DEPENDS@
CPLUSPLUS_FOUND_FALSE = @CPLUSPLUS_FOUND_FALSE@
CPLUSPLUS_FOUND_TRUE = @CPLUSPLUS_FOUND_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
......
......@@ -90,8 +90,6 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFIGURE_DEPENDS = @CONFIGURE_DEPENDS@
CPLUSPLUS_FOUND_FALSE = @CPLUSPLUS_FOUND_FALSE@
CPLUSPLUS_FOUND_TRUE = @CPLUSPLUS_FOUND_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
......
......@@ -89,8 +89,6 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFIGURE_DEPENDS = @CONFIGURE_DEPENDS@
CPLUSPLUS_FOUND_FALSE = @CPLUSPLUS_FOUND_FALSE@
CPLUSPLUS_FOUND_TRUE = @CPLUSPLUS_FOUND_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
......
......@@ -80,8 +80,6 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFIGURE_DEPENDS = @CONFIGURE_DEPENDS@
CPLUSPLUS_FOUND_FALSE = @CPLUSPLUS_FOUND_FALSE@
CPLUSPLUS_FOUND_TRUE = @CPLUSPLUS_FOUND_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
......
......@@ -82,8 +82,6 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFIGURE_DEPENDS = @CONFIGURE_DEPENDS@
CPLUSPLUS_FOUND_FALSE = @CPLUSPLUS_FOUND_FALSE@
CPLUSPLUS_FOUND_TRUE = @CPLUSPLUS_FOUND_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
......
......@@ -73,8 +73,6 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFIGURE_DEPENDS = @CONFIGURE_DEPENDS@
CPLUSPLUS_FOUND_FALSE = @CPLUSPLUS_FOUND_FALSE@
CPLUSPLUS_FOUND_TRUE = @CPLUSPLUS_FOUND_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
......
......@@ -130,8 +130,6 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFIGURE_DEPENDS = @CONFIGURE_DEPENDS@
CPLUSPLUS_FOUND_FALSE = @CPLUSPLUS_FOUND_FALSE@
CPLUSPLUS_FOUND_TRUE = @CPLUSPLUS_FOUND_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment