Gets values of object-identifier structure corresponding to the specified mechanism.
Network Services Library (libnsl.a)
#include <rpc/rpcsec_gss.h>
 bool_t rpc_gss_mech_to_oid(mech,oid)
char *mech;
rpc_gss_OIDc *oid;
Kernel remote procedure call (RPC) routines use non-string values to represent mechanisms and quality of parameters. The non-string values, which an application sometimes needs, can be in the form of structures or just numbers. This subroutine provides values of an object-identifier structure that are related to the specified mechanism.
| Item | Description | 
|---|---|
| mech | Represents the supported security mechanism that is used for context creation (for example, kerberosv5). | 
| oid | Points to an rpc_gss_OIDc structure that is filled up by this subroutine. | 
| Item | Description | 
|---|---|
| TRUE | successful | 
| FALSE | unsuccessful | 
#include <stdlib.h>
#include <rpc/rpc.h>
#include <rpc/rpcsec_gss.h>
int main(int argc,char *argv[])
{
    rpc_gss_OID *oid;
    char *mechanism;
    mechanism = "kerberosv5";
    /* Get non-string value for mechanism */
    if(rpc_gss_mech_to_oid(mechanism,oid) == FALSE)
    {
        fprintf(stderr,"\nrpc_gss_mech_to_oid() failed!\n");
        exit(1);
    }
    return 0;
}