1 /* 2 * pwgen.h --- header file for password generator 3 * 4 * Copyright (C) 2001,2002 by Theodore Ts'o 5 * 6 * This file may be distributed under the terms of the GNU Public 7 * License. 8 */ 9 10 struct pw_element { 11 const char *str; 12 int flags; 13 }; 14 15 /* 16 * Flags for the pw_element 17 */ 18 #define CONSONANT 0x0001 19 #define VOWEL 0x0002 20 #define DIPTHONG 0x0004 21 #define NOT_FIRST 0x0008 22 23 /* 24 * Flags for the pwgen function 25 */ 26 #define PW_DIGITS 0x0001 /* At least one digit */ 27 #define PW_UPPERS 0x0002 /* At least one upper letter */ 28 #define PW_SYMBOLS 0x0004 29 #define PW_AMBIGUOUS 0x0008 30 #define PW_NO_VOWELS 0x0010 31 32 /* pointer to choose between random or sha1 pseudo random number generator */ 33 extern int (*pw_number)(int max_num); 34 35 extern const char *pw_symbols; 36 extern const char *pw_ambiguous; 37 38 /* Function prototypes */ 39 40 /* pw_phonemes.c */ 41 extern void pw_phonemes(char *buf, int size, int pw_flags, char *remove); 42 43 /* pw_rand.c */ 44 extern void pw_rand(char *buf, int size, int pw_flags, char *remove); 45 46 /* randnum.c */ 47 extern int pw_random_number(int max_num); 48 49 /* sha1num.c */ 50 extern void pw_sha1_init(char *sha1); 51 extern int pw_sha1_number(int max_num); 52