Gets the number that is related to specified mechanism and quality of protection.
Network Services Library (libnsl.a)
#include <rpc/rpcsec_gss.h>
bool_t rpc_gss_qop_to_num(qop,mech,num)
char *qop;
char *mech;
u_int *num;
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.
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. |
Item | Description |
---|---|
TRUE | successful |
FALSE | unsuccessful |
#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;
}