SETREF Datatypes

SETREF's fundamental datatypes are the same as those for SET, and are derived from the ASN.1 contained in the SET specification through automatic means. Because SETREF's fundamental datatypes are those defined in the SET specification, the user should refer to the SET specification for specific information about these types.

Example Datatype

As an example, SET defines the type PInitReq using the following ASN.1:
PInitReq ::= SEQUENCE {               -- Purchase Initialization Request
   rrpid           RRPID,
   language        Language,
   localID-C       LocalID,
   localID-M       [0] LocalID  OPTIONAL,
   chall-C         Challenge,
   brandID         BrandID,
   bin             BIN,
   thumbs          [1] EXPLICIT Thumbs  OPTIONAL,
   piRqExtensions  [2] MsgExtensions {{PIRqExtensionsIOS}}  OPTIONAL
}
In SETREF, the corresponding data type is named asn1set__PInitReq, and is defined as a native C type as follows:
typedef
    struct                         asn1set__PInitReq_                 
    {                                                                 
# define                               asn1set__PInitReq__localID_M        0 
# define                               asn1set__PInitReq__thumbs           1 
# define                               asn1set__PInitReq__piRqExtensions   2 
        UCHAR                          _present[1]                      ; 
        asn1set__RRPID                 rrpid                            ; 
        asn1set__Language              language                         ; 
        asn1set__LocalID               localID_C                        ; 
        asn1set__LocalID               localID_M                        ; 
        asn1set__Challenge             chall_C                          ; 
        asn1set__BrandID               brandID                          ; 
        asn1set__BIN                   bin                              ; 
        asn1set__Thumbs                thumbs                           ; 
        asn1set__MsgExtensions         *piRqExtensions                  ; 
    }                              asn1set__PInitReq                ; 

Namespaces

The prefix asn1set specifies the namespace for this type, which is used to disambiguate the type name among the different ASN.1 modules. ASN.1 provides namespaces for defining types, but since C has no notion of namespaces, the namespace for each type is pre-pended to the name of that type. In SETREF, there are three namespaces for defined types:

Optional Elements

The _present element is used for specifying the presence or absence of optional elements. In this example, localID-M and thumbs are both optional in the ASN.1. The following macros are used to are used to specify or query the status of optional elements: For instance, IS_PRESENT(msg,asn1set__PInitReq__localID_M) determines whether localID-M is present in msg, where msg is an object of type PInitReq. It is usually unnecessary to invoke the SET_ABSENT() macro because absent is the default setting.


Copyright © 1996, 1997, Visa International Service Association and MasterCard International Incorporated
All Rights Reserved.