#ifndef	_RADIUS_IF_H
#define	_RADIUS_IF_H

#include "./radius_pub.h"

typedef struct _RADIUS_NAS_INFORMATION
{
	DWORD		nas_ip;
	BYTE		share_key[RADIUS_MAX_LEN_OF_SHARE_KEY];
	BYTE		password[RADIUS_MAX_LEN_OF_PASSWORD];
}__attribute__((packed)) RADIUS_NAS_INFORMATION;//be used for up layer interface struct

int radius_set_nas_info(BYTE sap_index, BYTE id, RADIUS_NAS_INFORMATION *nas_information);
int radius_delet_nas_info(BYTE sap_index, BYTE id);

int radius_send_access_request(BYTE sap_index, WORD usr_pid, RADIUS_MSG *msg_pdu, RADIUS_ADDR *addr);
int radius_send_access_accept(BYTE sap_index, WORD pid, WORD usr_pid, RADIUS_MSG *msg_pdu);
int radius_send_access_reject(BYTE sap_index, WORD pid, WORD usr_pid, RADIUS_MSG *msg_pdu);
int radius_send_accounting_response(BYTE sap_index, WORD pid, WORD usr_pid, RADIUS_MSG *msg_pdu);
int radius_send_disconnect_request(BYTE sap_index, WORD usr_pid, RADIUS_MSG *msg_pdu, RADIUS_ADDR *addr);

int radius_calculate_chap_password(BYTE *auth, BYTE chap_id, const BYTE *password, const BYTE *chap_challenge, int chap_len);
int radius_encrypt_user_password(BYTE *encrypt_password, BYTE *password, BYTE *authenticator, BYTE *share_key);

#endif

