packer.h revision c7402f0767d7a0360fabd0bd449c6baf9b282074
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _PACKER_H
#define _PACKER_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* This program is copyright Alec Muffett 1993. The author disclaims all
* responsibility or liability with respect to it's usage or its effect
* upon hardware or computer systems, and maintains copyright as set out
* in the "LICENCE" document which accompanies distributions of Crack v4.0
* and upwards.
*/
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <stdlib.h>
#include <limits.h>
#include <fcntl.h>
#include <synch.h>
#include <syslog.h>
#define STRINGSIZE PATH_MAX
#ifndef NUMWORDS
#define NUMWORDS 16
#endif
#define MAXWORDLEN 32
struct pi_header
{
};
typedef struct
{
#define PFOR_WRITE 0x0001
#define PFOR_FLUSH 0x0002
#define PFOR_USEHWMS 0x0004
} PWDICT;
#define PIH_MAGIC 0x70775632
void PWRemove(char *);
char *Mangle(char *, char *);
char *Trim(register char *);
char Chop(register char *);
char Chomp(register char *);
#define DATABASE_OPEN_FAIL -1
#define DICTIONARY_WORD 2
#define REVERSE_DICTIONARY_WORD 3
/* Dictionary database dir and prefix */
#define CRACK_DICTPATH "/var/passwd/pw_dict"
#define DICT_DATABASE_HWM "pw_dict.hwm"
#define DICT_DATABASE_PWD "pw_dict.pwd"
#define DICT_DATABASE_PWI "pw_dict.pwi"
int packer(char *, char *);
char *Reverse(char *);
char *Lowercase(char *);
int DictCheck(char *, char *);
int make_dict_database(char *, char *);
int build_dict_database(char *, char *);
int lock_db(char *);
void unlock_db();
/* Return values for dictionary database checks */
#define NO_DICTDATABASE 1
#define UPDATE_DICTDATABASE 2
#define DICTFILE_ERR -1
#define DICTPATH_ERR -2
#define DICTDATABASE_BUILD_ERR -3
#ifdef __cplusplus
}
#endif
#endif /* _PACKER_H */