rpc_gss_get_mech_info Subroutine

Purpose

Gets a list of quality of protections for the specified mechanism and security type.

Library

Network Services Library (libnsl.a)

Syntax

#include <rpc/rpcsec_gss.h>
char ** rpc_gss_get_mech_info(mechanism, service)
char *mechanism;
rpc_gss_service_t *service;

Description

The subroutine provides a list of quality of protections for the specified mechanism and security type.

Parameters

Item Description
mechanism Represents the supported security mechanism that is used for context creation (for example, kerberosv5).
service Represents the type of service for the session that basically offers a level of protection (for example, integrity and privacy).

Return Values

Item Description
a list of character strings terminated by a null value successful
a null value unsuccessful

The value of null specifies that you can use the default quality of protection.

Examples

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

int main(int argc,char *argv[])
{
    char **s;
    char *mechanism;
    int i;
    rpc_gss_service_t service;

    mechanism = "kerberosv5";
    service = 2;              /* 1: none, 2: integrity. 3: privacy */

    if((s = rpc_gss_get_mech_info(mechanism, &service)) == NULL)
    {
         fprintf(stderr,"\nrpc_gss_get_mech_info() Returned NULL, default QOP value can be used!\n");
         exit(1);
    }
    return 0;
}