Generated BER Encode Functions

Note

This section assumes standard memory-buffer based encoding is to be done. If stream-based encoding is to be done (specified by adding -stream to the ASN1C command-line), see the Generated BER Streaming Encode Functions section for correct procedures on using the stream-based encode functions.

For each ASN.1 production defined in the ASN.1 source file, a C encode function is generated. This function will convert a populated C variable of the given type into an encoded ASN.1 message.

If C++ code generation is specified, a control class is generated that contains an Encode method that wraps this function. This function is invoked through the class interface to convert a populated msgData attribute variable into an encoded ASN.1 message.