/* Copyright (C) 2002 Mitsuru KANDA */
#ifndef __CHAP_H__
#define __CHAP_H__ 1

#define CHAP_HASH_LEN 16

struct chap_id {
	char *username;
	char *password;
	char *challenge;
	unsigned char hash[CHAP_HASH_LEN*2+1];
};

/* caller must free challenge */
char *chap_gen_challenge(int len);

/* calculate chap response value */
int chap_response(struct chap_id *pci);

/* client parse chap challenge */
char *get_chap_challenge(int sockfd);
#endif /* __CHAP_H__ */
