In this section, you will create a new ASN.1 Module in the ASN.1 project we previous created.
-
In the Package Explorer view, select the source folder and click the menu item File > New > Other....
-
Select ASN.1 Module then click Next to start the New ASN.1 Module wizard:
On this page, type "MyHTTP" in the Module name field. Then click Finish.
- The new file is opened in the editor. It contains the new module, and comments.
- Enter the following content in the opening editor.
MyHTTP DEFINITIONS
AUTOMATIC TAGS ::=
BEGIN
GetRequest ::= SEQUENCE {
header-only BOOLEAN,
lock BOOLEAN,
accept-types AcceptTypes,
url Url,
...,
timestamp GeneralizedTime
}
AcceptTypes ::= SET {
standards BIT STRING { html(0), plain-text(1), gif(2), jpeg(3) } (SIZE(4)) OPTIONAL,
others SEQUENCE OF VisibleString (SIZE(4)) OPTIONAL
}
Url ::= VisibleString (FROM("a".."z"|"A".."Z"|"0".."9"|"./-_~%#"))
myRequest GetRequest ::= {
header-only TRUE,
lock FALSE,
accept-types {
standards { html, plain-text }
},
url "www.asnlab.org",
timestamp "20121221121221Z"
}
END
- Save the file.
Next Section: Opening an ASN.1 editor