ASN.1
Previous: Modules and Assignments Up: Modules and Assignments Next: Type Assignment


Modules

The fundamental unit of ASN.1 is the module. The sole purpose of a module is to name a collection of type definitions and/or value definitions (assignments) that constitute a data specification. A type definition is used to define and name a new type by means of a type assignment and a value definition is used to define and name a specific value, when it is necessary, by means of a value assignment. The only format constraint on type and/or value assignments in a module is that each must be on a new line.

The Figure below contains an example module. It is defined as a module reference InventoryList, followed by an optional object identifier value 1 2 0 0 6 1 (See the Simple Types Section.), followed by the keyword DEFINITIONS, followed by the optional tag default (not included in the example), followed by the assignment character sequence ::= , followed by the keywords BEGIN and END bracketing the module body.

 
	 InventoryList {1 2 0 0 6 1} DEFINITIONS ::= 
	   BEGIN 
	     {  
	      ItemId ::= SEQUENCE 
	        { 
	         partnumber IA5String, 
	         quantity INTEGER, 
	         wholesaleprice REAL,  
	         saleprice REAL  
	        }  
	      StoreLocation ::= ENUMERATED 
	        {  
	         Baltimore (0), 
	         Philadelphia (1), 
	         Washington (2)
                } 
             }
           END 
		

Figure: Example of an ASN.1 module.


This site was developed from:
Computer Networks and Open Systems
An Application Development Perspective

by
Lillian N. Cassel
Richard H. Austing

Jones & Bartlett Publisher
ISBN 0-7637-1122-5

This site is hosted by:


Real World ASN.1 and XML Solutions