Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
8c85f2a1
Commit
8c85f2a1
authored
Sep 09, 2006
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LDAP3
parent
b1093950
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
4064 additions
and
6 deletions
+4064
-6
examples/README
examples/README
+10
-4
examples/crfc2asn1.pl
examples/crfc2asn1.pl
+13
-2
examples/rfc4511.txt
examples/rfc4511.txt
+3811
-0
examples/sample.source.LDAP3/Makefile
examples/sample.source.LDAP3/Makefile
+200
-0
examples/sample.source.LDAP3/README
examples/sample.source.LDAP3/README
+20
-0
examples/sample.source.LDAP3/config.h
examples/sample.source.LDAP3/config.h
+10
-0
No files found.
examples/README
View file @
8c85f2a1
This directory contains a few examples.
1. The ./sample.source.PKIX1 directory contains the X.509 Certificate decoder.
1. The ./sample.source.PKIX1 directory contains the X.509 Certificate decoder,
as specified in rfc3280.txt.
2. The ./sample.source.TAP3 directory contains the GSM TAP3 decoder.
Before trying to compile, read the README file in that directory.
...
...
@@ -13,11 +14,16 @@ This directory contains a few examples.
3. The ./sample.source.MEGACO directory contains the decoder for
Media Gateway Control Protocol data units as specified in rfc3525.txt.
4. The ./sample.source.LDAP3 directory contains the decoder for
Lightweight Directory Access Protocol version 3 PDU as specified in
rfc4211.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 RFC
and MEGACO ASN.1 module from rfc3525.txt
.
For instance, it is used to extract X.509
, MEGACO, and LDAPv3 ASN.1 modules
from the corresponding RFC texts (rfc3280.txt, rfc3525.txt, rfc4211.txt)
.
To regenerate the .asn1 files from the original RFC texts, do `rm *.asn1; make`.
To regenerate the .asn1 files from the original RFC texts, execute
`make clean; make` in the current directory.
The clyx2asn1.pl script can be used to extract ASN.1 data from LyX editor files.
examples/crfc2asn1.pl
View file @
8c85f2a1
...
...
@@ -31,7 +31,7 @@ while(<>) {
if
(
$inasn
==
0
)
{
#
# The least correct way to find the start of ASN
# definition.
# definition.
That is, to ask a user.
#
if
(
/^[ \t]*END[ \t]*(--.*)?$/
)
{
print
STDERR
...
...
@@ -68,8 +68,19 @@ while(<>) {
}
}
next
unless
$inasn
;
}
elsif
(
/^\s*DEFINITIONS\s*$/
&&
$prevLine
=~
/^\s*([A-Z][A-Za-z0-9-]*)\s*{[0-9a-z)( -]+}\s*$/
)
{
$_
=
$prevLine
.
$prevComments
.
$_
;
$modName
=
$1
;
$currentFname
=
$rfcid
.
$modName
.
"
.asn1
";
$inasn
=
1
;
}
else
{
$prevLine
=
$_
;
if
(
/^[ \t]*--/
)
{
$prevComments
.=
$_
;
}
else
{
$prevComments
=
'';
$prevLine
=
$_
;
}
next
;
}
...
...
examples/rfc4511.txt
0 → 100644
View file @
8c85f2a1
This source diff could not be displayed because it is too large. You can
view the blob
instead.
examples/sample.source.LDAP3/Makefile
0 → 100644
View file @
8c85f2a1
ASN_MODULE_SOURCES
=
\
LDAPMessage.c
\
MessageID.c
\
LDAPString.c
\
LDAPOID.c
\
LDAPDN.c
\
RelativeLDAPDN.c
\
AttributeDescription.c
\
AttributeValue.c
\
AttributeValueAssertion.c
\
AssertionValue.c
\
PartialAttribute.c
\
Attribute.c
\
MatchingRuleId.c
\
LDAPResult.c
\
Referral.c
\
URI.c
\
Controls.c
\
Control.c
\
BindRequest.c
\
AuthenticationChoice.c
\
SaslCredentials.c
\
BindResponse.c
\
UnbindRequest.c
\
SearchRequest.c
\
AttributeSelection.c
\
Filter.c
\
SubstringFilter.c
\
MatchingRuleAssertion.c
\
SearchResultEntry.c
\
PartialAttributeList.c
\
SearchResultReference.c
\
SearchResultDone.c
\
ModifyRequest.c
\
ModifyResponse.c
\
AddRequest.c
\
AttributeList.c
\
AddResponse.c
\
DelRequest.c
\
DelResponse.c
\
ModifyDNRequest.c
\
ModifyDNResponse.c
\
CompareRequest.c
\
CompareResponse.c
\
AbandonRequest.c
\
ExtendedRequest.c
\
ExtendedResponse.c
\
IntermediateResponse.c
ASN_MODULE_HEADERS
=
\
LDAPMessage.h
\
MessageID.h
\
LDAPString.h
\
LDAPOID.h
\
LDAPDN.h
\
RelativeLDAPDN.h
\
AttributeDescription.h
\
AttributeValue.h
\
AttributeValueAssertion.h
\
AssertionValue.h
\
PartialAttribute.h
\
Attribute.h
\
MatchingRuleId.h
\
LDAPResult.h
\
Referral.h
\
URI.h
\
Controls.h
\
Control.h
\
BindRequest.h
\
AuthenticationChoice.h
\
SaslCredentials.h
\
BindResponse.h
\
UnbindRequest.h
\
SearchRequest.h
\
AttributeSelection.h
\
Filter.h
\
SubstringFilter.h
\
MatchingRuleAssertion.h
\
SearchResultEntry.h
\
PartialAttributeList.h
\
SearchResultReference.h
\
SearchResultDone.h
\
ModifyRequest.h
\
ModifyResponse.h
\
AddRequest.h
\
AttributeList.h
\
AddResponse.h
\
DelRequest.h
\
DelResponse.h
\
ModifyDNRequest.h
\
ModifyDNResponse.h
\
CompareRequest.h
\
CompareResponse.h
\
AbandonRequest.h
\
ExtendedRequest.h
\
ExtendedResponse.h
\
IntermediateResponse.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_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
+=
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
=
ldap3dump
CFLAGS
+=
-I
.
-DHAVE_CONFIG_H
OBJS
=
${ASN_MODULE_SOURCES:.c=.o}
$(TARGET)
.o
all
:
LDAPMessage.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 ../rfc4511-Lightweight-Directory-Access-Protocol-V3.asn1
LDAPMessage.c
:
regenerate.Makefile
./regenerate.Makefile
@
touch
LDAPMessage.c
make
ASN_CONVERTER
=
../../skeletons/converter-sample.c
$(TARGET).o
:
$(ASN_CONVERTER)
$(CC)
$(CFLAGS)
-DPDU
=
LDAPMessage
-o
$(TARGET)
.o
-c
$(ASN_CONVERTER)
distclean
:
clean
rm
-f
$(ASN_MODULE_SOURCES)
$(ASN_MODULE_HEADERS)
rm
-f
Makefile.am.sample
examples/sample.source.LDAP3/README
0 → 100644
View file @
8c85f2a1
GENERAL INFORMATION
===================
The LDAPv3 (Lightweight Directory Access Protocol) PDU decoder.
Invoking `make` will compile the ASN.1 specifications from the rfc4211.txt
in the above directory.
The ../../skeletons/converter-sample.c will supply the missing
"int main()" routine which drives the decoding process.
ldap3dump USAGE
==============
./ldap3dump LDAPMessage.ber # Print as XML (BASIC-XER)
The full list of recognized command line options may be obtained with
> ./ldap3dump -h
examples/sample.source.LDAP3/config.h
0 → 100644
View file @
8c85f2a1
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)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment