/* The first few definitions are used at compile to to determine what options */
/* should be used. The use_account_name field determines if we should trans-  */
/* late the username in the PIF to an account name. We do this because on some*/
/* machines the username can change where the account name is constant.       */
/* The second field determines if BDM uses the li server to get the ident     */
/* (group) number.                                                            */
#define use_account_name 1
#define use_li_server    1



#define CREATE_COMMAND	1
#define DESTROY_COMMAND	2
#define ADD_COMMAND	3
#define MODIFY_COMMAND	4
#define REMOVE_COMMAND	5
#define VERIFY_COMMAND	6
#define MOUNT_COMMAND	7
#define REPORT_COMMAND	8
#define SHOW_COMMAND	9
#define EXPIRE_COMMAND	10


#define PNAMESIZE	10
#define PDESCSIZE	50
#define ACCOUNTNAMESIZE	10
#define LOCATIONSIZE	40
#define VOLNAMESIZE	20
#define IDENTSIZE	20
#define TYPESIZE	5
#define PSIZESIZE	8	 /* Size of the partition size */
#define EXCEPTIONSIZE	40
#define REMOTESIZE	10
#define EXPIRESIZE	11	/* Size of the expiration record */

#define USERNAMESIZE	12

#define TRUE		1
#define FALSE		0

struct pif_record {
  char rtype;
  union {
    struct {
      char accountname[ACCOUNTNAMESIZE];
      char access;
    } acc;
    struct {
      char part_name[PNAMESIZE];
      char part_desc[PDESCSIZE];
    } part;
    struct {
      char location[LOCATIONSIZE];
      char vol_name[VOLNAMESIZE];
    } loc;
    struct {
      char ident[IDENTSIZE];
      char idtype;
    } id;
    char psize[PSIZESIZE];
    char type[TYPESIZE];
    char exception[EXCEPTIONSIZE];
    char remote[REMOTESIZE];
    char expire[EXPIRESIZE];
  } pr_union;
};

struct anode {
  char accountname[ACCOUNTNAMESIZE];
  char access;
  struct anode *prev;
  struct anode *next;
};

struct sys_user_node {
  char accountname[ACCOUNTNAMESIZE];
  int  in_pif;
  struct sys_user_node *next;
};

struct sys_ident_node {
  char ident_name[IDENTSIZE+2];
  int  in_pif;				/* Flag, 0=not in pif, 1=in pif */
  struct sys_user_node *u_node;
  struct sys_ident_node *next;
};

/* The plist structure contains all the information about a single partition */
struct plist_type {
  char plistname[PNAMESIZE];		/* Name of partition */
  char plistdesc[PDESCSIZE];		/* Description of partition */
  char plistowner[ACCOUNTNAMESIZE];	/* Owner of partition */
  char plistexpire[EXPIRESIZE]; 	/* Date to expire partition */
  struct {
    char plistloc[LOCATIONSIZE];	/* Location of partition */
    char plistvol[VOLNAMESIZE];		/* Volume name of partition */
  } ploc;
  struct {
    char plistident[IDENTSIZE];		/* Identifier prefix assigned to part */
    char plistidtype;			/* Identifier type */
  } pid;
  int  plistsize;			/* Size of partition */
  char plisttype[TYPESIZE];		/* Partition type */
  char plistexception[EXCEPTIONSIZE];	/* Exception record */
  char plistremote[REMOTESIZE];		/* Remote record */
  struct anode *adminlist;		/* List of partition administrators */
  struct anode *userlist;		/* List of partition users */
};
