OSF DCE Application Development Guide--Core Components
OSF DCE Application Development Guide—Core Components
15.3.6.1 DCE RPC Evaluation Routines
DCE RPC provides two character and code set compatibility evaluation routines:
rpc_cs_eval_with_universal( ) and rpc_cs_eval_without_universal(). To use either
one of these routines, specify their names in the evaluation function argument to the
rpc_ns_import_ctx_add_eval() routine. (The sample client code shown in Section
15.3.5.3 specifies a DCE RPC character and code set evaluation routine.)
The rpc_cs_eval_with_universal( ) routine first compares the client’s local code set with
the server’s local code set. If they are the same, client-server character and code set
compatibility exists. The routine returns to the NSI import routine, which returns the
server binding to the client.
If the routine finds that the client and server local code sets differ, it calls the routine
rpc_cs_char_set_compat_check( ) to determine client-server character set
compatibility. If the client and server are using the same character set, it will be safe for
them to exchange character data despite their use of different encodings for the character
data. Clients and servers using different character sets are considered to be incompatible
since the process of converting the character data from one character set to the other will
result in significant data loss.
Using the client and server’s local code set identifiers as indexes into the code set
registry, the rpc_cs_char_set_compat_check( ) routine obtains the registered values
that represent the character set(s) that the specified code sets support. If the client and
server support just one character set, the routine compares the values for compatibility.
If the values do not match, then the client-server character sets are not compatible; for
example, the client is using the German character set and the server is using the Korean
character set. In this case, the routine returns the status code
rpc_s_ss_no_compat_charsets to the evaluation routine so that binding to that server
will be rejected.
If the client and server support multiple character sets, the
rpc_cs_char_set_compat_check( ) routine determines whether at least two of the sets
are compatible. If two or more sets match, the routine considers the character sets
compatible and returns a success status code to the evaluation routine.
In the case where the client and server are character set compatible, the
rpc_cs_eval_with_universal( ) routine uses the following model to determine a
conversion method:
• RMIR (receiver makes it right)
• SMIR (client uses its local code set, server converts to and from it)
• CMIR (server uses its local code set, client converts to and from it)
• Use an intermediate code set
• Use the universal (ISO 10646) code set
This conversion model translates into the following steps:
1. The rpc_cs_eval_with_universal() routine takes the client’s local code set and
searches through the server’s code sets array to determine whether it has a
converter for the client’s local set. Then it takes the server’s local code set and
searches through the client’s code sets array to see if it has a converter for the
15 − 28 Tandem Computers Incorporated 124245