control.c (73188) | control.c (77349) |
---|---|
1/* 2 * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers. 3 * All rights reserved. 4 * 5 * By using this file, you agree to the terms and conditions set 6 * forth in the LICENSE file which can be found at the top level of 7 * the sendmail distribution. 8 * 9 */ 10 11#ifndef lint | 1/* 2 * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers. 3 * All rights reserved. 4 * 5 * By using this file, you agree to the terms and conditions set 6 * forth in the LICENSE file which can be found at the top level of 7 * the sendmail distribution. 8 * 9 */ 10 11#ifndef lint |
12static char id[] = "@(#)$Id: control.c,v 8.44.14.15 2001/01/22 19:00:22 gshapiro Exp $"; | 12static char id[] = "@(#)$Id: control.c,v 8.44.14.20 2001/05/03 17:24:03 gshapiro Exp $"; |
13#endif /* ! lint */ 14 15#include <sendmail.h> 16 | 13#endif /* ! lint */ 14 15#include <sendmail.h> 16 |
17/* values for cmd_code */ 18# define CMDERROR 0 /* bad command */ 19# define CMDRESTART 1 /* restart daemon */ 20# define CMDSHUTDOWN 2 /* end daemon */ 21# define CMDHELP 3 /* help */ 22# define CMDSTATUS 4 /* daemon status */ |
|
17 | 23 |
24struct cmd 25{ 26 char *cmd_name; /* command name */ 27 int cmd_code; /* internal code, see below */ 28}; 29 30static struct cmd CmdTab[] = 31{ 32 { "help", CMDHELP }, 33 { "restart", CMDRESTART }, 34 { "shutdown", CMDSHUTDOWN }, 35 { "status", CMDSTATUS }, 36 { NULL, CMDERROR } 37}; 38 39 |
|
18int ControlSocket = -1; 19 20/* 21** OPENCONTROLSOCKET -- create/open the daemon control named socket 22** 23** Creates and opens a named socket for external control over 24** the sendmail daemon. 25** --- 177 unchanged lines hidden (view full) --- 203** Parameters: 204** sock -- the opened socket from getrequests() 205** e -- the current envelope 206** 207** Returns: 208** none. 209*/ 210 | 40int ControlSocket = -1; 41 42/* 43** OPENCONTROLSOCKET -- create/open the daemon control named socket 44** 45** Creates and opens a named socket for external control over 46** the sendmail daemon. 47** --- 177 unchanged lines hidden (view full) --- 225** Parameters: 226** sock -- the opened socket from getrequests() 227** e -- the current envelope 228** 229** Returns: 230** none. 231*/ 232 |
211struct cmd 212{ 213 char *cmd_name; /* command name */ 214 int cmd_code; /* internal code, see below */ 215}; 216 217/* values for cmd_code */ 218# define CMDERROR 0 /* bad command */ 219# define CMDRESTART 1 /* restart daemon */ 220# define CMDSHUTDOWN 2 /* end daemon */ 221# define CMDHELP 3 /* help */ 222# define CMDSTATUS 4 /* daemon status */ 223 224static struct cmd CmdTab[] = 225{ 226 { "help", CMDHELP }, 227 { "restart", CMDRESTART }, 228 { "shutdown", CMDSHUTDOWN }, 229 { "status", CMDSTATUS }, 230 { NULL, CMDERROR } 231}; 232 | |
233static jmp_buf CtxControlTimeout; 234 235static void 236controltimeout(timeout) 237 time_t timeout; 238{ | 233static jmp_buf CtxControlTimeout; 234 235static void 236controltimeout(timeout) 237 time_t timeout; 238{ |
239 /* 240 ** NOTE: THIS CAN BE CALLED FROM A SIGNAL HANDLER. DO NOT ADD 241 ** ANYTHING TO THIS ROUTINE UNLESS YOU KNOW WHAT YOU ARE 242 ** DOING. 243 */ 244 245 errno = ETIMEDOUT; |
|
239 longjmp(CtxControlTimeout, 1); 240} 241 242void 243control_command(sock, e) 244 int sock; 245 ENVELOPE *e; 246{ --- 126 unchanged lines hidden --- | 246 longjmp(CtxControlTimeout, 1); 247} 248 249void 250control_command(sock, e) 251 int sock; 252 ENVELOPE *e; 253{ --- 126 unchanged lines hidden --- |