rpc_gss_qop_to_num Subroutine

Purpose

Gets the number that is related to specified mechanism and quality of protection.

Library

Network Services Library (libnsl.a)

Syntax

#include <rpc/rpcsec_gss.h>
bool_t rpc_gss_qop_to_num(qop,mech,num)
char *qop;
char *mech;
u_int *num;

Description

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 the number that is related to the specified mechanism and quality of protection.

Parameters

Item Description
qop Represents the quality of protection (qop).
mech Represents the supported security mechanism that is used for context creation (for example, kerberosv5).
num Represents a non-string value for the specified mechanism-qop combination. The value is filled up by the subroutine.

Return Values

Item Description
TRUE successful
FALSE unsuccessful

Examples

#include <stdlib.h>
#include <rpc/rpc.h>
#include <rpc/rpcsec_gss.h>

int main(int argc, char *argv[])
{
    u_int num;
    char *qop, *mechanism;

    mechanism = "kerberosv5";
    qop = "GSS_C_QOP_DEFAULT";
    /* Get non-string value for qop */ 
    if(rpc_gss_qop_to_num(qop, mechanism, &num) == FALSE)
    {
         fprintf(stderr,"\nrpc_gss_qop_to_num() failed!\n");
         exit(1);
    }
    return 0;
}