1 /*
2  * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
3  */
4 
5 /*
6  * profile.h
7  */
8 
9 #ifndef _KRB5_PROFILE_H
10 #define _KRB5_PROFILE_H
11 
12 #if defined(_WIN32)
13 #include <win-mac.h>
14 #endif
15 
16 #if defined(__MACH__) && defined(__APPLE__)
17 #    include <TargetConditionals.h>
18 #    if TARGET_RT_MAC_CFM
19 #        error "Use KfM 4.0 SDK headers for CFM compilation."
20 #    endif
21 #endif
22 
23 #ifndef KRB5_CALLCONV
24 #define KRB5_CALLCONV
25 #define KRB5_CALLCONV_C
26 #endif
27 
28 typedef struct _profile_t *profile_t;
29 
30 /*
31  * Used by the profile iterator in prof_get.c
32  */
33 #define PROFILE_ITER_LIST_SECTION	0x0001
34 #define PROFILE_ITER_SECTIONS_ONLY	0x0002
35 #define PROFILE_ITER_RELATIONS_ONLY	0x0004
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 typedef char* profile_filespec_t;	/* path as C string */
42 typedef char* profile_filespec_list_t;	/* list of : separated paths, C string */
43 typedef const char * const_profile_filespec_t;	/* path as C string */
44 typedef const char * const_profile_filespec_list_t;	/* list of : separated paths, C string */
45 
46 long KRB5_CALLCONV profile_init
47 	(const_profile_filespec_t *files, profile_t *ret_profile);
48 
49 long KRB5_CALLCONV profile_init_path
50 	(const_profile_filespec_list_t filelist, profile_t *ret_profile);
51 
52 long KRB5_CALLCONV profile_flush
53 	(profile_t profile);
54 long KRB5_CALLCONV profile_flush_to_file
55 	(profile_t profile, const_profile_filespec_t outfile);
56 long KRB5_CALLCONV profile_flush_to_buffer
57 	(profile_t profile, char **bufp);
58 void KRB5_CALLCONV profile_free_buffer
59 	(profile_t profile, char *buf);
60 
61 long KRB5_CALLCONV profile_is_writable
62 	(profile_t profile, int *writable);
63 long KRB5_CALLCONV profile_is_modified
64 	(profile_t profile, int *modified);
65 
66 void KRB5_CALLCONV profile_abandon
67 	(profile_t profile);
68 
69 void KRB5_CALLCONV profile_release
70 	(profile_t profile);
71 
72 long KRB5_CALLCONV profile_get_values
73 	(profile_t profile, const char *const *names, char ***ret_values);
74 
75 void KRB5_CALLCONV profile_free_list
76 	(char **list);
77 
78 long KRB5_CALLCONV profile_get_string
79 	(profile_t profile, const char *name, const char *subname,
80 			const char *subsubname, const char *def_val,
81 			char **ret_string);
82 long KRB5_CALLCONV profile_get_integer
83 	(profile_t profile, const char *name, const char *subname,
84 			const char *subsubname, int def_val,
85 			int *ret_default);
86 
87 long KRB5_CALLCONV profile_get_boolean
88 	(profile_t profile, const char *name, const char *subname,
89 			const char *subsubname, int def_val,
90 			int *ret_default);
91 
92 long KRB5_CALLCONV profile_get_relation_names
93 	(profile_t profile, const char **names, char ***ret_names);
94 
95 long KRB5_CALLCONV profile_get_subsection_names
96 	(profile_t profile, const char **names, char ***ret_names);
97 
98 long KRB5_CALLCONV profile_iterator_create
99 	(profile_t profile, const char *const *names,
100 		   int flags, void **ret_iter);
101 
102 void KRB5_CALLCONV profile_iterator_free
103 	(void **iter_p);
104 
105 long KRB5_CALLCONV profile_iterator
106 	(void	**iter_p, char **ret_name, char **ret_value);
107 
108 void KRB5_CALLCONV profile_release_string (char *str);
109 
110 long KRB5_CALLCONV profile_update_relation
111 	(profile_t profile, const char **names,
112 		   const char *old_value, const char *new_value);
113 
114 long KRB5_CALLCONV profile_clear_relation
115 	(profile_t profile, const char **names);
116 
117 long KRB5_CALLCONV profile_rename_section
118 	(profile_t profile, const char **names,
119 		   const char *new_name);
120 
121 long KRB5_CALLCONV profile_add_relation
122 	(profile_t profile, const char **names,
123 		   const char *new_value);
124 
125 /*
126  * Solaris Kerberos: Provide abstract declarations for applications, such as
127  * kconf and smb.
128  */
129 long __profile_init(char *filename, profile_t *profile);
130 long __profile_release(profile_t profile);
131 void __profile_abandon(profile_t profile);
132 long __profile_add_domain_mapping(profile_t profile, char *domain, char *realm);
133 long __profile_remove_domain_mapping(profile_t profile, char *realm);
134 long __profile_get_realm_entry(profile_t profile, char *realm, char *name,
135     char ***ret_value);
136 long __profile_add_realm_entry(profile_t profile, char *realm, char *name,
137     char **values);
138 long __profile_get_default_realm(profile_t profile, char **realm);
139 long __profile_get_realms(profile_t profile, char ***realms);
140 long __profile_add_realm(profile_t profile, char *realm, char *master,
141     char **kdcs, boolean_t set_change, boolean_t default_realm);
142 long __profile_remove_xrealm_mapping(profile_t profile, char *realm);
143 long __profile_remove_realm(profile_t profile, char *realm);
144 long __profile_add_xrealm_mapping(profile_t profile, char *source, char *target,
145     char *inter);
146 long __profile_validate(profile_t profile, int *val_err, char **val);
147 
148 #ifdef __cplusplus
149 }
150 #endif
151 
152 #endif /* _KRB5_PROFILE_H */
153 
154 /*
155  * ettmp22072.h:
156  * This file is automatically generated; please do not edit it.
157  */
158 
159 #include <com_err.h>
160 
161 #define PROF_VERSION                             (-1429577728L)
162 #define PROF_MAGIC_NODE                          (-1429577727L)
163 #define PROF_NO_SECTION                          (-1429577726L)
164 #define PROF_NO_RELATION                         (-1429577725L)
165 #define PROF_ADD_NOT_SECTION                     (-1429577724L)
166 #define PROF_SECTION_WITH_VALUE                  (-1429577723L)
167 #define PROF_BAD_LINK_LIST                       (-1429577722L)
168 #define PROF_BAD_GROUP_LVL                       (-1429577721L)
169 #define PROF_BAD_PARENT_PTR                      (-1429577720L)
170 #define PROF_MAGIC_ITERATOR                      (-1429577719L)
171 #define PROF_SET_SECTION_VALUE                   (-1429577718L)
172 #define PROF_EINVAL                              (-1429577717L)
173 #define PROF_READ_ONLY                           (-1429577716L)
174 #define PROF_SECTION_NOTOP                       (-1429577715L)
175 #define PROF_SECTION_SYNTAX                      (-1429577714L)
176 #define PROF_RELATION_SYNTAX                     (-1429577713L)
177 #define PROF_EXTRA_CBRACE                        (-1429577712L)
178 #define PROF_MISSING_OBRACE                      (-1429577711L)
179 #define PROF_MAGIC_PROFILE                       (-1429577710L)
180 #define PROF_MAGIC_SECTION                       (-1429577709L)
181 #define PROF_TOPSECTION_ITER_NOSUPP              (-1429577708L)
182 #define PROF_INVALID_SECTION                     (-1429577707L)
183 #define PROF_END_OF_SECTIONS                     (-1429577706L)
184 #define PROF_BAD_NAMESET                         (-1429577705L)
185 #define PROF_NO_PROFILE                          (-1429577704L)
186 #define PROF_MAGIC_FILE                          (-1429577703L)
187 #define PROF_FAIL_OPEN                           (-1429577702L)
188 #define PROF_EXISTS                              (-1429577701L)
189 #define PROF_BAD_BOOLEAN                         (-1429577700L)
190 #define PROF_BAD_INTEGER                         (-1429577699L)
191 #define PROF_MAGIC_FILE_DATA                     (-1429577698L)
192 
193 #define ERROR_TABLE_BASE_prof (-1429577728L)
194 
195 /* for compatibility with older versions... */
196 #define prof_err_base ERROR_TABLE_BASE_prof
197