source: trunk/third/cns/src/include/prot.h @ 8789

Revision 8789, 3.0 KB checked in by ghudson, 28 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r8788, which included commits to RCS files with non-trunk default branches.
Line 
1/*
2 * prot.h
3 *
4 * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute
5 * of Technology.
6 *
7 * For copying and distribution information, please see the file
8 * <mit-copyright.h>.
9 *
10 * Include file with authentication protocol information.
11 */
12
13#include "mit-copyright.h"
14
15#include "krb_conf.h"
16
17#ifndef PROT_DEFS
18#define PROT_DEFS
19
20#define         KRB_PORT                750     /* PC's don't have
21                                                 * /etc/services */
22#define         KRB_PROT_VERSION        4
23#define         MAX_PKT_LEN             1000
24#define         MAX_TXT_LEN             1000
25#define         TICKET_GRANTING_TICKET  "krbtgt"
26
27/* Macro's to obtain various fields from a packet */
28
29#define pkt_version(packet)  (unsigned int) *(packet->dat)
30#define pkt_msg_type(packet) (unsigned int) *(packet->dat+1)
31#define pkt_a_name(packet)   (packet->dat+2)
32#define pkt_a_inst(packet)   \
33        (packet->dat+3+strlen((char *)pkt_a_name(packet)))
34#define pkt_a_realm(packet)  \
35        (pkt_a_inst(packet)+1+strlen((char *)pkt_a_inst(packet)))
36
37/* Macro to obtain realm from application request */
38#define apreq_realm(auth)     (auth->dat + 3)
39
40#define pkt_time_ws(packet) (char *) \
41        (packet->dat+5+strlen((char *)pkt_a_name(packet)) + \
42         strlen((char *)pkt_a_inst(packet)) + \
43         strlen((char *)pkt_a_realm(packet)))
44
45#define pkt_no_req(packet) (unsigned short) \
46        *(packet->dat+9+strlen((char *)pkt_a_name(packet)) + \
47          strlen((char *)pkt_a_inst(packet)) + \
48          strlen((char *)pkt_a_realm(packet)))
49#define pkt_x_date(packet) (char *) \
50        (packet->dat+10+strlen((char *)pkt_a_name(packet)) + \
51         strlen((char *)pkt_a_inst(packet)) + \
52         strlen((char *)pkt_a_realm(packet)))
53#define pkt_err_code(packet) ( (char *) \
54        (packet->dat+9+strlen((char *)pkt_a_name(packet)) + \
55         strlen((char *)pkt_a_inst(packet)) + \
56         strlen((char *)pkt_a_realm(packet))))
57#define pkt_err_text(packet) \
58        (packet->dat+13+strlen((char *)pkt_a_name(packet)) + \
59         strlen((char *)pkt_a_inst(packet)) + \
60         strlen((char *)pkt_a_realm(packet)))
61
62/* Routines to create and read packets may be found in prot.c */
63
64KTEXT create_auth_reply();
65KTEXT create_death_packet();
66char *pkt_cipher();
67
68/* Message types , always leave lsb for byte order */
69
70#define         AUTH_MSG_KDC_REQUEST                     1<<1
71#define         AUTH_MSG_KDC_REPLY                       2<<1
72#define         AUTH_MSG_APPL_REQUEST                    3<<1
73#define         AUTH_MSG_APPL_REQUEST_MUTUAL             4<<1
74#define         AUTH_MSG_ERR_REPLY                       5<<1
75#define         AUTH_MSG_PRIVATE                         6<<1
76#define         AUTH_MSG_SAFE                            7<<1
77#define         AUTH_MSG_APPL_ERR                        8<<1
78#define         AUTH_MSG_DIE                            63<<1
79
80/* values for kerb error codes */
81
82#define         KERB_ERR_OK                              0
83#define         KERB_ERR_NAME_EXP                        1
84#define         KERB_ERR_SERVICE_EXP                     2
85#define         KERB_ERR_AUTH_EXP                        3
86#define         KERB_ERR_PKT_VER                         4
87#define         KERB_ERR_NAME_MAST_KEY_VER               5
88#define         KERB_ERR_SERV_MAST_KEY_VER               6
89#define         KERB_ERR_BYTE_ORDER                      7
90#define         KERB_ERR_PRINCIPAL_UNKNOWN               8
91#define         KERB_ERR_PRINCIPAL_NOT_UNIQUE            9
92#define         KERB_ERR_NULL_KEY                       10
93/* Cygnus extensions for Preauthentication */
94#define         KERB_ERR_PREAUTH_SHORT                  11
95#define         KERB_ERR_PREAUTH_MISMATCH               12
96
97#endif /* PROT_DEFS */
Note: See TracBrowser for help on using the repository browser.