1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
|
/*
* Program: $RCSfile: server.h,v $ $Revision: 4.6 $
*
* Purpose: Header file of the Internet "youbin" service.
*
* Author: K.Agusa agusa@nuie.nagoya-u.ac.jp
* S.Yamamoto yamamoto@nuie.nagoya-u.ac.jp
*
* Date: 1993/07/24
* Modified: $Date: 1995/03/26 13:39:35 $
*
* Copyright: K.Agusa and S.Yamamoto 1993 - 1995
*
* The X Consortium, and any party obtaining a copy of these files from
* the X Consortium, directly or indirectly, is granted, free of charge,
* a full and unrestricted irrevocable, world-wide, paid up, royalty-free,
* nonexclusive right and license to deal in this software and documentation
* files (the "Software"), including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons who receive copies from any such
* party to do so. This license includes without limitation a license to do
* the foregoing actions under any patents of the party supplying this
* software to the X Consortium.
*/
/*
* Constant definitions.
*/
#ifndef MAIL_SPOOL
#ifdef SVR4
#define MAIL_SPOOL "/usr/mail/"
#else
#define MAIL_SPOOL "/usr/spool/mail/"
#endif
#endif /* not MAIL_SPOOL */
/*
* Type definitions.
*/
enum vecs {ACKED, IDLE, WAIT, TO1, TO2, NOT_USED};
typedef struct _State *StateP;
typedef struct _User *UserP;
typedef struct _State {
enum vecs state;
SockAddr ca;
struct {
unsigned int biff : 1; /* Biff compatible mode. */
} mode;
UserP parent; /* To name structure. */
StateP next; /* If someone requests twice. */
} State;
typedef struct _User {
char name[USER_NAME_LEN];
long size; /* Size of user mail spool file. */
long time; /* Date of user mail spool file. */
StateP stat; /* Pointer to State. */
UserP next; /* Link to next User. */
} User;
/*
* External variables.
*/
extern char *NAK_reason;
extern char NAK_buff[MESS_LEN + 1];
extern SockAddr ca;
/* List structures. */
extern User users[MAX_USER];
extern State states[MAX_STATE];
extern UserP UserAlist;
extern User UserList;
extern StateP StateAlist;
/*
* Function declarations.
*/
void check_spool();
void get_mess();
void init();
int open_udp();
void print_addr();
void do_Wakeup();
void send_packet();
void send_Quit();
void periodic();
void sig_quit();
void sig_hup();
void sig_alarm();
/*
* Function declarations: "list.c".
*/
int is_trusted_user();
int check_ca();
void init_users();
StateP make_user();
UserP find_user();
UserP new_user();
void dispose_user();
void del_state();
StateP new_state();
void dispose_state();
StateP get_id();
/*
* Function declarations: "log.c".
*/
/*
* Variable argument list.
*/
#ifdef USE_STDARG
void debug_log(char *, ...);
void warn_log(char *, ...);
void info_log(char *, ...);
void error_log(char *, ...);
void trace(char *, ...);
#else /* USE_VARARGS */
void debug_log();
void warn_log();
void info_log();
void error_log();
void trace();
#endif /* USE_VARARGS */
void init_log();
void sys_error_log();
void output_log();
|