rxgen, kauth: Set but not used variables
[openafs.git] / src / kauth / prot.h
1
2 /*
3  * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute
4  * of Technology.
5  *
6  * For copying and distribution information, please see the file
7  * <mit-copyright.h>.
8  *
9  * Include file with authentication protocol information.
10  */
11
12 #include <mit-cpyright.h>
13
14                                                                                                                                         /* #include <krb_conf.h> *//* removed 890221 */
15
16 #ifndef PROT_DEFS
17 #define PROT_DEFS
18
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"
25
26 /* Macro's to obtain various fields from a packet */
27
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)))
35
36 /* Macro to obtain realm from application request */
37 #define apreq_realm(auth)     (auth->dat + 3)
38
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)))
43
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)))
60
61 /* Routines to create and read packets may be found in prot.c */
62
63                                                                                                                                                                  /* KTEXT create_auth_reply(); *//* removed 890221 */
64                                                                                                                                                                            /* KTEXT create_death_packet(); *//* removed 890221 */
65                                                                                                                               /* KTEXT pkt_cipher(); *//* removed 890221 */
66
67 /* Message types , always leave lsb for byte order */
68
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
78
79 /* values for kerb error codes */
80 /* EXP errors are:   Principal expired, Service expired, Auth expired,
81  * but are not currently used much */
82
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
95
96 #endif /* PROT_DEFS */