#ifndef	_CONV_PREFIX_H
#define	_CONV_PREFIX_H

#include <sys/types.h>

#define	MAX_CONV_PREFIX	128
#define	MAX_CLI_PREFIX	64
#define	MAX_PREFIX_LEN	16
#define	MAX_NAME_LEN	8

#define MAX_PLAT_NAME_LEN	24
#define MAX_PLAT_NAME_INSTANCE 256

typedef	struct	conv_prefix_record
{
	u_char	used_flag;
	char	prefix[MAX_PREFIX_LEN];
	char	delete_length;
	char	add_length;
	char	add_digits[MAX_PREFIX_LEN];
	u_char	valid_length;
}_conv_prefix_record;

typedef	struct	cli_prefix
{
	u_char	in_property;
	char	prefix[MAX_PREFIX_LEN];
	char	delete_length;
	u_char	out_property;
	char	add_length;
	char	add_digits[MAX_PREFIX_LEN-1];
	u_char    used_flag;
	u_char	valid_length;
}_cli_prefix;

typedef struct xapp_group_prefix
{
	char	startNumber[MAX_PREFIX_LEN+1];
	char	endNumber[MAX_PREFIX_LEN+1];
	u_char	repStartDigit;
	u_char	repEndDigit;
	char	repDigitWith[MAX_PREFIX_LEN+1];
	u_char	status; /* 0=unlock, 1=lock */
	u_char	used_flag;
	char	cReserved[MAX_PREFIX_LEN-1];
}_xapp_group_prefix;

typedef	struct	conv_prefix
{
	_conv_prefix_record	conv_prefix[MAX_CONV_PREFIX];
	_cli_prefix	cli_prefix[MAX_CLI_PREFIX];
	char		conv_name[MAX_CONV_PREFIX][MAX_NAME_LEN];
	char		cli_name[MAX_CLI_PREFIX][MAX_NAME_LEN];
	char		plat_name[MAX_PLAT_NAME_INSTANCE][MAX_PLAT_NAME_LEN];
	_xapp_group_prefix	group_conv_prefix[MAX_CONV_PREFIX];
}_conv_prefix;

int msisdnUnkToInt(char *msisdn_unk, char *msisdn_int);

/* return value: 
	-1 = error length;
	 0 = cannn't find appropriate prefix;
	 1 = conv. succeed
*/

#endif
