#ifndef _LVE_API_H_

#define _LVE_API_H_

#ifndef __user
#define __user
#endif

#define open_cookie_size 10

struct open_cookie {
	char	data[open_cookie_size];
};


typedef enum {
	DEFAULT_PARAMS,
	ENTER_VE,
	LEAVE_VE,
	CREATE_VE,
	DESTROY_VE,
	SETUP_VE,
	FLUSH_VE,
	API_VER, /* return api version to the caller */
	INFO_VE, /* return info about LVE context */
} ve_op;

struct ve_enter {
	int32_t		uid;	/* user id, -1 if switch not need */
	int32_t		gid;	/* group id, -1 if switch not need */
	uint32_t __user	*cookie; /* pointer to enter cookie */
	/* for set groups */
	int 		grp_size;
	gid_t __user 	*grp_list;
};

struct ve_leave {
	uint32_t __user	*cookie; /* */
};

struct lve_flush {
	uint32_t	all;	/* flush all context's or only default cloned */
};

struct ve_config {
	int32_t		cpu; /* -1 if don't set */
	int32_t		io;  /* -1 if don't set */
	int32_t		enters; /* -1 if don't set */
	char __user	*chroot;
};

struct ve_ioctl {
	uint32_t	id;
	uint32_t	cookie[4];
	void __user	*data;
};

#define LVE_KMOD_API_MAJOR	0
#define LVE_KMOD_API_MINOR	3

#define LVE_API_VERSION(a,b) (((a) << 16) + (b))

#define LVE_DEV_NAME	"lve"

#endif
