/* krb_prot.h -- This contains stuff that is in the prot.h file inside
 * the kerberos library.  It is neccessary because the kerberos library
 * does not the functionality I need, exactly.  I have pulled out as little
 * of the library as I needed to get my code to work.
 *
 * Created by:	Derek Atkins <warlord@MIT.EDU>
 *
 * $Source: /afs/net.mit.edu/user/warlord/Thesis/src/lib/RCS/krb_prot.h,v $
 * $Author: warlord $
 *
 */

#include <warlord-copyright.h>

#ifndef _KRB_PROT_H
#define _KRB_PROT_H

#define KRB_PROT_VERSION	4

#ifndef HOST_BYTE_ORDER
static int krbONE=1;
#define	HOST_BYTE_ORDER		(* (char *) &krbONE)
#endif

#define pkt_version(packet)  (unsigned int) *(packet->dat)
#define pkt_msg_type(packet) (unsigned int) *(packet->dat+1)

#define pkt_a_name(packet)   (packet->dat+2)
#define pkt_a_inst(packet)   \
  (packet->dat+3+strlen((char *)pkt_a_name(packet)))
#define pkt_a_realm(packet)  \
  (pkt_a_inst(packet)+1+strlen((char *)pkt_a_inst(packet)))


#define pkt_err_code(packet) ( (char *) \
	      (packet->dat+9+strlen((char *)pkt_a_name(packet)) + \
	       strlen((char *)pkt_a_inst(packet)) + \
	       strlen((char *)pkt_a_realm(packet))))

#define         AUTH_MSG_KDC_REPLY                       2<<1
#define         AUTH_MSG_ERR_REPLY                       5<<1

#endif /* _KRB_PROT_H */
 
