Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / crypto / kerberosIV / lib / krb / krb-protos.h
1 /*
2  * Copyright (c) 1997, 1998, 1999 Kungliga Tekniska Högskolan
3  * (Royal Institute of Technology, Stockholm, Sweden). 
4  * All rights reserved. 
5  *
6  * Redistribution and use in source and binary forms, with or without 
7  * modification, are permitted provided that the following conditions 
8  * are met: 
9  *
10  * 1. Redistributions of source code must retain the above copyright 
11  *    notice, this list of conditions and the following disclaimer. 
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright 
14  *    notice, this list of conditions and the following disclaimer in the 
15  *    documentation and/or other materials provided with the distribution. 
16  *
17  * 3. Neither the name of the Institute nor the names of its contributors 
18  *    may be used to endorse or promote products derived from this software 
19  *    without specific prior written permission. 
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 
22  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 
25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 
27  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
28  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 
30  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 
31  * SUCH DAMAGE. 
32  */
33
34 /* $Id: krb-protos.h,v 1.24.2.1 2000/06/23 03:32:04 assar Exp $ */
35 /* $FreeBSD: src/crypto/kerberosIV/lib/krb/krb-protos.h,v 1.1.1.2.2.2 2003/02/13 21:34:36 nectar Exp $ */
36 /* $DragonFly: src/crypto/kerberosIV/lib/krb/Attic/krb-protos.h,v 1.2 2003/06/17 04:24:36 dillon Exp $ */
37
38 #ifndef __krb_protos_h__
39 #define __krb_protos_h__
40
41 #if defined (__STDC__) || defined (_MSC_VER)
42 #include <stdarg.h>
43 #ifndef __P
44 #define __P(x) x
45 #endif
46 #else
47 #ifndef __P
48 #define __P(x) ()
49 #endif
50 #endif
51
52 #ifdef __STDC__
53 struct in_addr;
54 struct sockaddr_in;
55 struct timeval;
56 #endif
57
58 #ifndef KRB_LIB_FUNCTION
59 #if defined(__BORLANDC__)
60 #define KRB_LIB_FUNCTION /* not-ready-definition-yet */
61 #elif defined(_MSC_VER)
62 #define KRB_LIB_FUNCTION /* not-ready-definition-yet2 */
63 #else
64 #define KRB_LIB_FUNCTION
65 #endif
66 #endif
67
68 void KRB_LIB_FUNCTION
69 afs_string_to_key __P((
70         const char *str,
71         const char *cell,
72         des_cblock *key));
73
74 int KRB_LIB_FUNCTION
75 create_ciph __P((
76         KTEXT c,
77         unsigned char *session,
78         char *service,
79         char *instance,
80         char *realm,
81         u_int32_t life,
82         int kvno,
83         KTEXT tkt,
84         u_int32_t kdc_time,
85         des_cblock *key));
86
87 int KRB_LIB_FUNCTION
88 cr_err_reply __P((
89         KTEXT pkt,
90         char *pname,
91         char *pinst,
92         char *prealm,
93         u_int32_t time_ws,
94         u_int32_t e,
95         char *e_string));
96
97 int KRB_LIB_FUNCTION
98 decomp_ticket __P((
99         KTEXT tkt,
100         unsigned char *flags,
101         char *pname,
102         char *pinstance,
103         char *prealm,
104         u_int32_t *paddress,
105         unsigned char *session,
106         int *life,
107         u_int32_t *time_sec,
108         char *sname,
109         char *sinstance,
110         des_cblock *key,
111         des_key_schedule schedule));
112
113 int KRB_LIB_FUNCTION
114 dest_tkt __P((void));
115
116 int KRB_LIB_FUNCTION
117 get_ad_tkt __P((
118         char *service,
119         char *sinstance,
120         char *realm,
121         int lifetime));
122
123 int KRB_LIB_FUNCTION
124 getst __P((
125         int fd,
126         char *s,
127         int n));
128
129 int KRB_LIB_FUNCTION
130 in_tkt __P((
131         char *pname,
132         char *pinst));
133
134 int KRB_LIB_FUNCTION
135 k_get_all_addrs __P((struct in_addr **l));
136
137 int KRB_LIB_FUNCTION
138 k_gethostname __P((
139         char *name,
140         int namelen));
141
142 int KRB_LIB_FUNCTION
143 k_getportbyname __P((
144         const char *service,
145         const char *proto,
146         int default_port));
147
148 int KRB_LIB_FUNCTION
149 k_getsockinst __P((
150         int fd,
151         char *inst,
152         size_t inst_size));
153
154 int KRB_LIB_FUNCTION
155 k_isinst __P((char *s));
156
157 int KRB_LIB_FUNCTION
158 k_isname __P((char *s));
159
160 int KRB_LIB_FUNCTION
161 k_isrealm __P((char *s));
162
163 struct tm * KRB_LIB_FUNCTION
164 k_localtime __P((u_int32_t *tp));
165
166 int KRB_LIB_FUNCTION
167 kname_parse __P((
168         char *np,
169         char *ip,
170         char *rp,
171         char *fullname));
172
173 int KRB_LIB_FUNCTION
174 krb_atime_to_life __P((char *atime));
175
176 int KRB_LIB_FUNCTION
177 krb_check_auth __P((
178         KTEXT packet,
179         u_int32_t checksum,
180         MSG_DAT *msg_data,
181         des_cblock *session,
182         des_key_schedule schedule,
183         struct sockaddr_in *laddr,
184         struct sockaddr_in *faddr));
185
186 int KRB_LIB_FUNCTION
187 krb_check_tm __P((struct tm tm));
188
189 KTEXT KRB_LIB_FUNCTION
190 krb_create_death_packet __P((char *a_name));
191
192 int KRB_LIB_FUNCTION
193 krb_create_ticket __P((
194         KTEXT tkt,
195         unsigned char flags,
196         char *pname,
197         char *pinstance,
198         char *prealm,
199         int32_t paddress,
200         void *session,
201         int16_t life,
202         int32_t time_sec,
203         char *sname,
204         char *sinstance,
205         des_cblock *key));
206
207 int KRB_LIB_FUNCTION
208 krb_decode_as_rep __P((
209         const char *user,
210         char *instance,         /* INOUT parameter */
211         const char *realm,
212         const char *service,
213         const char *sinstance,
214         key_proc_t key_proc,
215         decrypt_proc_t decrypt_proc,
216         const void *arg,
217         KTEXT as_rep,
218         CREDENTIALS *cred));
219
220 int KRB_LIB_FUNCTION
221 krb_disable_debug __P((void));
222
223 int KRB_LIB_FUNCTION
224 krb_enable_debug __P((void));
225
226 int KRB_LIB_FUNCTION
227 krb_equiv __P((
228         u_int32_t a,
229         u_int32_t b));
230
231 int KRB_LIB_FUNCTION
232 krb_get_address __P((
233         void *from,
234         u_int32_t *to));
235
236 int KRB_LIB_FUNCTION
237 krb_get_admhst __P((
238         char *host,
239         char *realm,
240         int nth));
241
242 int KRB_LIB_FUNCTION
243 krb_get_config_bool __P((const char *variable));
244
245 const char * KRB_LIB_FUNCTION
246 krb_get_config_string __P((const char *variable));
247
248 int KRB_LIB_FUNCTION
249 krb_get_cred __P((
250         char *service,
251         char *instance,
252         char *realm,
253         CREDENTIALS *c));
254
255 int KRB_LIB_FUNCTION
256 krb_get_default_principal __P((
257         char *name,
258         char *instance,
259         char *realm));
260
261 char * KRB_LIB_FUNCTION
262 krb_get_default_realm __P((void));
263
264 const char * KRB_LIB_FUNCTION
265 krb_get_default_tkt_root __P((void));
266
267 const char * KRB_LIB_FUNCTION
268 krb_get_default_keyfile __P((void));
269
270 const char * KRB_LIB_FUNCTION
271 krb_get_err_text __P((int code));
272
273 struct krb_host* KRB_LIB_FUNCTION
274 krb_get_host __P((
275         int nth,
276         const char *realm,
277         int admin));
278
279 int KRB_LIB_FUNCTION
280 krb_get_in_tkt __P((
281         char *user,
282         char *instance,
283         char *realm,
284         char *service,
285         char *sinstance,
286         int life,
287         key_proc_t key_proc,
288         decrypt_proc_t decrypt_proc,
289         void *arg));
290
291 int KRB_LIB_FUNCTION
292 krb_get_int __P((
293         void *f,
294         u_int32_t *to,
295         int size,
296         int lsb));
297
298 int KRB_LIB_FUNCTION
299 krb_get_kdc_time_diff __P((void));
300
301 int KRB_LIB_FUNCTION
302 krb_get_krbconf __P((
303         int num,
304         char *buf,
305         size_t len));
306
307 int KRB_LIB_FUNCTION
308 krb_get_krbextra __P((
309         int num,
310         char *buf,
311         size_t len));
312
313 int KRB_LIB_FUNCTION
314 krb_get_krbhst __P((
315         char *host,
316         char *realm,
317         int nth));
318
319 int KRB_LIB_FUNCTION
320 krb_get_krbrealms __P((
321         int num,
322         char *buf,
323         size_t len));
324
325 int KRB_LIB_FUNCTION
326 krb_get_lrealm __P((
327         char *r,
328         int n));
329
330 int KRB_LIB_FUNCTION
331 krb_get_nir __P((
332         void *from,
333         char *name, size_t name_len,
334         char *instance, size_t instance_len,
335         char *realm, size_t realm_len));
336
337 char * KRB_LIB_FUNCTION
338 krb_get_phost __P((const char *alias));
339
340 int KRB_LIB_FUNCTION
341 krb_get_pw_in_tkt __P((
342         const char *user,
343         const char *instance,
344         const char *realm,
345         const char *service,
346         const char *sinstance,
347         int life,
348         const char *password));
349
350 int KRB_LIB_FUNCTION
351 krb_get_pw_in_tkt2 __P((
352         const char *user,
353         const char *instance,
354         const char *realm,
355         const char *service,
356         const char *sinstance,
357         int life,
358         const char *password,
359         des_cblock *key));
360
361 int KRB_LIB_FUNCTION
362 krb_get_string __P((
363         void *from,
364         char *to,
365         size_t to_size));
366
367 int KRB_LIB_FUNCTION
368 krb_get_svc_in_tkt __P((
369         char *user,
370         char *instance,
371         char *realm,
372         char *service,
373         char *sinstance,
374         int life,
375         char *srvtab));
376
377 int KRB_LIB_FUNCTION
378 krb_get_tf_fullname __P((
379         char *ticket_file,
380         char *name,
381         char *instance,
382         char *realm));
383
384 int KRB_LIB_FUNCTION
385 krb_get_tf_realm __P((
386         char *ticket_file,
387         char *realm));
388
389 void KRB_LIB_FUNCTION
390 krb_kdctimeofday __P((struct timeval *tv));
391
392 int KRB_LIB_FUNCTION
393 krb_kntoln __P((
394         AUTH_DAT *ad,
395         char *lname));
396
397 int KRB_LIB_FUNCTION
398 krb_kuserok __P((
399         char *name,
400         char *instance,
401         char *realm,
402         char *luser));
403
404 char * KRB_LIB_FUNCTION
405 krb_life_to_atime __P((int life));
406
407 u_int32_t KRB_LIB_FUNCTION
408 krb_life_to_time __P((
409         u_int32_t start,
410         int life_));
411
412 int KRB_LIB_FUNCTION
413 krb_lsb_antinet_ulong_cmp __P((
414         u_int32_t x,
415         u_int32_t y));
416
417 int KRB_LIB_FUNCTION
418 krb_lsb_antinet_ushort_cmp __P((
419         u_int16_t x,
420         u_int16_t y));
421
422 int KRB_LIB_FUNCTION
423 krb_mk_as_req __P((
424         const char *user,
425         const char *instance,
426         const char *realm,
427         const char *service,
428         const char *sinstance,
429         int life,
430         KTEXT cip));
431
432 int KRB_LIB_FUNCTION
433 krb_mk_auth __P((
434         int32_t options,
435         KTEXT ticket,
436         char *service,
437         char *instance,
438         char *realm,
439         u_int32_t checksum,
440         char *version,
441         KTEXT buf));
442
443 int32_t KRB_LIB_FUNCTION
444 krb_mk_err __P((
445         u_char *p,
446         int32_t e,
447         char *e_string));
448
449 int32_t KRB_LIB_FUNCTION
450 krb_mk_priv __P((
451         void *in,
452         void *out,
453         u_int32_t length,
454         des_key_schedule schedule,
455         des_cblock *key,
456         struct sockaddr_in *sender,
457         struct sockaddr_in *receiver));
458
459 int KRB_LIB_FUNCTION
460 krb_mk_req __P((
461         KTEXT authent,
462         char *service,
463         char *instance,
464         char *realm,
465         int32_t checksum));
466
467 int32_t KRB_LIB_FUNCTION
468 krb_mk_safe __P((
469         void *in,
470         void *out,
471         u_int32_t length,
472         des_cblock *key,
473         struct sockaddr_in *sender,
474         struct sockaddr_in *receiver));
475
476 int KRB_LIB_FUNCTION
477 krb_net_read __P((
478         int fd,
479         void *v,
480         size_t len));
481
482 int KRB_LIB_FUNCTION
483 krb_net_write __P((
484         int fd,
485         const void *v,
486         size_t len));
487
488 int KRB_LIB_FUNCTION
489 krb_parse_name __P((
490         const char *fullname,
491         krb_principal *principal));
492
493 int KRB_LIB_FUNCTION
494 krb_put_address __P((
495         u_int32_t addr,
496         void *to,
497         size_t rem));
498
499 int KRB_LIB_FUNCTION
500 krb_put_int __P((
501         u_int32_t from,
502         void *to,
503         size_t rem,
504         int size));
505
506 int KRB_LIB_FUNCTION
507 krb_put_nir __P((
508         const char *name,
509         const char *instance,
510         const char *realm,
511         void *to,
512         size_t rem));
513
514 int KRB_LIB_FUNCTION
515 krb_put_string __P((
516         const char *from,
517         void *to,
518         size_t rem));
519
520 int KRB_LIB_FUNCTION
521 krb_rd_err __P((
522         u_char *in,
523         u_int32_t in_length,
524         int32_t *code,
525         MSG_DAT *m_data));
526
527 int32_t KRB_LIB_FUNCTION
528 krb_rd_priv __P((
529         void *in,
530         u_int32_t in_length,
531         des_key_schedule schedule,
532         des_cblock *key,
533         struct sockaddr_in *sender,
534         struct sockaddr_in *receiver,
535         MSG_DAT *m_data));
536
537 int KRB_LIB_FUNCTION
538 krb_rd_req __P((
539         KTEXT authent,
540         char *service,
541         char *instance,
542         int32_t from_addr,
543         AUTH_DAT *ad,
544         char *fn));
545
546 int32_t KRB_LIB_FUNCTION
547 krb_rd_safe __P((
548         void *in,
549         u_int32_t in_length,
550         des_cblock *key,
551         struct sockaddr_in *sender,
552         struct sockaddr_in *receiver,
553         MSG_DAT *m_data));
554
555 int KRB_LIB_FUNCTION
556 krb_realm_parse __P((
557         char *realm,
558         int length));
559
560 char * KRB_LIB_FUNCTION
561 krb_realmofhost __P((const char *host));
562
563 int KRB_LIB_FUNCTION
564 krb_recvauth __P((
565         int32_t options,
566         int fd,
567         KTEXT ticket,
568         char *service,
569         char *instance,
570         struct sockaddr_in *faddr,
571         struct sockaddr_in *laddr,
572         AUTH_DAT *kdata,
573         char *filename,
574         des_key_schedule schedule,
575         char *version));
576
577 int KRB_LIB_FUNCTION
578 krb_sendauth __P((
579         int32_t options,
580         int fd,
581         KTEXT ticket,
582         char *service,
583         char *instance,
584         char *realm,
585         u_int32_t checksum,
586         MSG_DAT *msg_data,
587         CREDENTIALS *cred,
588         des_key_schedule schedule,
589         struct sockaddr_in *laddr,
590         struct sockaddr_in *faddr,
591         char *version));
592
593 void KRB_LIB_FUNCTION
594 krb_set_kdc_time_diff __P((int diff));
595
596 int KRB_LIB_FUNCTION
597 krb_set_key __P((
598         void *key,
599         int cvt));
600
601 int KRB_LIB_FUNCTION
602 krb_set_lifetime __P((int newval));
603
604 void KRB_LIB_FUNCTION
605 krb_set_tkt_string __P((const char *val));
606
607 const char * KRB_LIB_FUNCTION
608 krb_stime __P((time_t *t));
609
610 int KRB_LIB_FUNCTION
611 krb_time_to_life __P((
612         u_int32_t start,
613         u_int32_t end));
614
615 char * KRB_LIB_FUNCTION
616 krb_unparse_name __P((krb_principal *pr));
617
618 char * KRB_LIB_FUNCTION
619 krb_unparse_name_long __P((
620         char *name,
621         char *instance,
622         char *realm));
623
624 char * KRB_LIB_FUNCTION
625 krb_unparse_name_long_r __P((
626         char *name,
627         char *instance,
628         char *realm,
629         char *fullname));
630
631 char * KRB_LIB_FUNCTION
632 krb_unparse_name_r __P((
633         krb_principal *pr,
634         char *fullname));
635
636 int KRB_LIB_FUNCTION
637 krb_use_admin_server __P((int flag));
638
639 int KRB_LIB_FUNCTION
640 krb_verify_user __P((
641         char *name,
642         char *instance,
643         char *realm,
644         char *password,
645         int secure,
646         char *linstance));
647
648 int KRB_LIB_FUNCTION
649 krb_verify_user_srvtab __P((
650         char *name,
651         char *instance,
652         char *realm,
653         char *password,
654         int secure,
655         char *linstance,
656         char *srvtab));
657
658 int KRB_LIB_FUNCTION
659 kuserok __P((
660         AUTH_DAT *auth,
661         char *luser));
662
663 u_int32_t KRB_LIB_FUNCTION
664 lsb_time __P((
665         time_t t,
666         struct sockaddr_in *src,
667         struct sockaddr_in *dst));
668
669 const char * KRB_LIB_FUNCTION
670 month_sname __P((int n));
671
672 int KRB_LIB_FUNCTION
673 passwd_to_5key __P((
674         const char *user,
675         const char *instance,
676         const char *realm,
677         const void *passwd,
678         des_cblock *key));
679
680 int KRB_LIB_FUNCTION
681 passwd_to_afskey __P((
682         const char *user,
683         const char *instance,
684         const char *realm,
685         const void *passwd,
686         des_cblock *key));
687
688 int KRB_LIB_FUNCTION
689 passwd_to_key __P((
690         const char *user,
691         const char *instance,
692         const char *realm,
693         const void *passwd,
694         des_cblock *key));
695
696 int KRB_LIB_FUNCTION
697 read_service_key __P((
698         const char *service,
699         char *instance,
700         const char *realm,
701         int kvno,
702         const char *file,
703         void *key));
704
705 int KRB_LIB_FUNCTION
706 save_credentials __P((
707         char *service,
708         char *instance,
709         char *realm,
710         unsigned char *session,
711         int lifetime,
712         int kvno,
713         KTEXT ticket,
714         int32_t issue_date));
715
716 int KRB_LIB_FUNCTION
717 send_to_kdc __P((
718         KTEXT pkt,
719         KTEXT rpkt,
720         const char *realm));
721
722 int KRB_LIB_FUNCTION
723 srvtab_to_key __P((
724         const char *user,
725         char *instance,         /* INOUT parameter */
726         const char *realm,
727         const void *srvtab,
728         des_cblock *key));
729
730 void KRB_LIB_FUNCTION
731 tf_close __P((void));
732
733 int KRB_LIB_FUNCTION
734 tf_create __P((char *tf_name));
735
736 int KRB_LIB_FUNCTION
737 tf_get_cred __P((CREDENTIALS *c));
738
739 int KRB_LIB_FUNCTION
740 tf_get_cred_addr __P((char *realm, size_t realm_sz, struct in_addr *addr));
741
742 int KRB_LIB_FUNCTION
743 tf_get_pinst __P((char *inst));
744
745 int KRB_LIB_FUNCTION
746 tf_get_pname __P((char *p));
747
748 int KRB_LIB_FUNCTION
749 tf_init __P((
750         char *tf_name,
751         int rw));
752
753 int KRB_LIB_FUNCTION
754 tf_put_pinst __P((const char *inst));
755
756 int KRB_LIB_FUNCTION
757 tf_put_pname __P((const char *p));
758
759 int KRB_LIB_FUNCTION
760 tf_save_cred __P((
761         char *service,
762         char *instance,
763         char *realm,
764         unsigned char *session,
765         int lifetime,
766         int kvno,
767         KTEXT ticket,
768         u_int32_t issue_date));
769
770 int KRB_LIB_FUNCTION
771 tf_setup __P((
772         CREDENTIALS *cred,
773         const char *pname,
774         const char *pinst));
775
776 int KRB_LIB_FUNCTION
777 tf_get_addr __P((
778         const char *realm,
779         struct in_addr *addr));
780
781 int KRB_LIB_FUNCTION
782 tf_store_addr __P((const char *realm, struct in_addr *addr));
783
784 char * KRB_LIB_FUNCTION
785 tkt_string __P((void));
786
787 int KRB_LIB_FUNCTION
788 krb_add_our_ip_for_realm __P((const char *user, const char *instance,
789                               const char *realm, const char *password));
790
791 #endif /* __krb_protos_h__ */