Pull in patch that properly includes stdint.h
[pkg-k5-afs_openafs.git] / src / kauth / prot.h
blobb62e049c748efb4d4e981ba54471036928b8a925
2 /*
3 * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute
4 * of Technology.
6 * For copying and distribution information, please see the file
7 * <mit-copyright.h>.
9 * Include file with authentication protocol information.
12 #include <mit-cpyright.h>
14 /* #include <krb_conf.h> *//* removed 890221 */
16 #ifndef PROT_DEFS
17 #define PROT_DEFS
19 #define KRB_PORT 750 /* PC's don't have /etc/services */
20 #define KRB5_PORT 88 /* PC's don't have /etc/services */
21 #define KRB_PROT_VERSION 4
22 #define MAX_PKT_LEN 1000
23 #define MAX_TXT_LEN 1000
24 #define TICKET_GRANTING_TICKET "krbtgt"
26 /* Macro's to obtain various fields from a packet */
28 #define pkt_version(packet) (unsigned int) *(packet->dat)
29 #define pkt_msg_type(packet) (unsigned int) *(packet->dat+1)
30 #define pkt_a_name(packet) (packet->dat+2)
31 #define pkt_a_inst(packet) \
32 (packet->dat+3+strlen((char *)pkt_a_name(packet)))
33 #define pkt_a_realm(packet) \
34 (pkt_a_inst(packet)+1+strlen((char *)pkt_a_inst(packet)))
36 /* Macro to obtain realm from application request */
37 #define apreq_realm(auth) (auth->dat + 3)
39 #define pkt_time_ws(packet) (char *) \
40 (packet->dat+5+strlen((char *)pkt_a_name(packet)) + \
41 strlen((char *)pkt_a_inst(packet)) + \
42 strlen((char *)pkt_a_realm(packet)))
44 #define pkt_no_req(packet) (unsigned short) \
45 *(packet->dat+9+strlen((char *)pkt_a_name(packet)) + \
46 strlen((char *)pkt_a_inst(packet)) + \
47 strlen((char *)pkt_a_realm(packet)))
48 #define pkt_x_date(packet) (char *) \
49 (packet->dat+10+strlen((char *)pkt_a_name(packet)) + \
50 strlen((char *)pkt_a_inst(packet)) + \
51 strlen((char *)pkt_a_realm(packet)))
52 #define pkt_err_code(packet) ( (char *) \
53 (packet->dat+9+strlen((char *)pkt_a_name(packet)) + \
54 strlen((char *)pkt_a_inst(packet)) + \
55 strlen((char *)pkt_a_realm(packet))))
56 #define pkt_err_text(packet) \
57 (packet->dat+13+strlen((char *)pkt_a_name(packet)) + \
58 strlen((char *)pkt_a_inst(packet)) + \
59 strlen((char *)pkt_a_realm(packet)))
61 /* Routines to create and read packets may be found in prot.c */
63 /* KTEXT create_auth_reply(); *//* removed 890221 */
64 /* KTEXT create_death_packet(); *//* removed 890221 */
65 /* KTEXT pkt_cipher(); *//* removed 890221 */
67 /* Message types , always leave lsb for byte order */
69 #define AUTH_MSG_KDC_REQUEST 1<<1
70 #define AUTH_MSG_KDC_REPLY 2<<1
71 #define AUTH_MSG_APPL_REQUEST 3<<1
72 #define AUTH_MSG_APPL_REQUEST_MUTUAL 4<<1
73 #define AUTH_MSG_ERR_REPLY 5<<1
74 #define AUTH_MSG_PRIVATE 6<<1
75 #define AUTH_MSG_SAFE 7<<1
76 #define AUTH_MSG_APPL_ERR 8<<1
77 #define AUTH_MSG_DIE 63<<1
79 /* values for kerb error codes */
80 /* EXP errors are: Principal expired, Service expired, Auth expired,
81 * but are not currently used much */
83 #define KERB_ERR_OK 0
84 #define KERB_ERR_NAME_EXP 1
85 #define KERB_ERR_SERVICE_EXP 2
86 #define KERB_ERR_AUTH_EXP 3
87 #define KERB_ERR_PKT_VER 4
88 #define KERB_ERR_NAME_MAST_KEY_VER 5
89 #define KERB_ERR_SERV_MAST_KEY_VER 6
90 #define KERB_ERR_BYTE_ORDER 7
91 #define KERB_ERR_PRINCIPAL_UNKNOWN 8
92 #define KERB_ERR_PRINCIPAL_NOT_UNIQUE 9
93 #define KERB_ERR_NULL_KEY 10
94 #define KERB_ERR_MAXIMUM 10
96 #endif /* PROT_DEFS */