File: Name.xs

package info (click to toggle)
libgssapi-perl 0.22-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 180 kB
  • ctags: 35
  • sloc: perl: 706; makefile: 53
file content (123 lines) | stat: -rw-r--r-- 2,318 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
GSSAPI::Name_out
new(class)
	char *	class
    CODE:
	RETVAL = NULL;
    OUTPUT:
	RETVAL

void
DESTROY(name)
	GSSAPI::Name_opt	name
    PREINIT:
	OM_uint32		minor;
    CODE:
	if (name != NULL) {
	    (void)gss_release_name(&minor, &name);
	}


GSSAPI::Status
import(class, dest, name, ...)
	char *			class
	GSSAPI::Name_out	dest
	gss_buffer_str		name
    PREINIT:
	GSSAPI__OID	nametype = GSS_C_NO_OID;
    PROTOTYPE: $$$;$
    CODE:
	if (items > 3) {
	    if (! SvOK(ST(3))) {
		/* do nothing */
	    } else if (sv_isa(ST(3), "GSSAPI::OID")) {
		SV *tmp = SvRV(ST(3));
		nametype = (GSSAPI__OID) SvIV(tmp);
	    } else {
		croak("nametype is not of type GSSAPI::OID");
	    }
	}
	RETVAL.major =
		gss_import_name(&RETVAL.minor, &name, nametype, &dest);
    OUTPUT:
	RETVAL
	dest


GSSAPI::Status
duplicate(src, dest)
	GSSAPI::Name_opt	src
	GSSAPI::Name_out	dest
    CODE:
	RETVAL.major = gss_duplicate_name(&RETVAL.minor, src, &dest);
    OUTPUT:
	RETVAL
	dest


GSSAPI::Status
display(src, output, ...)
	GSSAPI::Name_opt	src
	gss_buffer_str_out	output
    PROTOTYPE: $$;$
    CODE:
	if (items > 2) {
	    GSSAPI__OID	outputtype = GSS_C_NO_OID;
	    RETVAL.major =
		gss_display_name(&RETVAL.minor, src, &output, &outputtype);
	    sv_setref_pvn(ST(2), "GSSAPI::OID", (void*)&outputtype,
						sizeof(outputtype));
	} else {
	    RETVAL.major = gss_display_name(&RETVAL.minor, src, &output, NULL);
	}
    OUTPUT:
	RETVAL
	output


GSSAPI::Status
compare(arg1, arg2, ret)
	GSSAPI::Name_opt	arg1
	GSSAPI::Name_opt	arg2
	int_out			ret
    CODE:
	RETVAL.major = gss_compare_name(&RETVAL.minor, arg1, arg2, &ret);
    OUTPUT:
	RETVAL
	ret


#	This is not actually implemented in the gssapi_krb5 library
#GSSAPI::Status
#inquire_mechs(name, oidset)
#	GSSAPI::Name		name
#	GSSAPI::OID::Set	oidset
#    CODE:
#	RETVAL.major =
#		gss_inquire_mechs_for_name(&RETVAL.minor, name, &oidset);
#    OUTPUT:
#	RETVAL
#	oidset


GSSAPI::Status
canonicalize(src, type, dest)
	GSSAPI::Name_opt	src
	GSSAPI::OID		type
	GSSAPI::Name_out	dest
    CODE:
	RETVAL.major = gss_canonicalize_name(&RETVAL.minor, src, type, &dest);
    OUTPUT:
	RETVAL
	dest


GSSAPI::Status
export(name, output)
	GSSAPI::Name_opt	name
	gss_buffer_str_out	output
    CODE:
	RETVAL.major = gss_export_name(&RETVAL.minor, name, &output);
    OUTPUT:
	RETVAL
	output