Gets a list of quality of protections for the specified mechanism and security type.
Network Services Library (libnsl.a)
#include <rpc/rpcsec_gss.h>
char ** rpc_gss_get_mech_info(mechanism, service)
char *mechanism;
rpc_gss_service_t *service;
The subroutine provides a list of quality of protections for the specified mechanism and security type.
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). |
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.
#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;
}