1/*++
2/* NAME
3/*	mail_command_server 3
4/* SUMMARY
5/*	single-command server
6/* SYNOPSIS
7/*	#include <mail_proto.h>
8/*
9/*	int	mail_command_server(stream, type, name, ...)
10/*	VSTREAM	*stream;
11/*	int	type;
12/*	const char *name;
13/* DESCRIPTION
14/*	This module implements the server interface for single-command
15/*	requests: a clients sends a single command and expects a single
16/*	completion status code.
17/*
18/*	Arguments:
19/* .IP stream
20/*	Server endpoint.
21/* .IP "type, name, ..."
22/*	Attribute list as defined in attr_scan(3).
23/* DIAGNOSTICS
24/*	Fatal: out of memory.
25/* SEE ALSO
26/*	attr_scan(3)
27/*	mail_command_client(3) client interface
28/*	mail_proto(3h), client-server protocol
29#include <mail_proto.h>
30/* LICENSE
31/* .ad
32/* .fi
33/*	The Secure Mailer license must be distributed with this software.
34/* AUTHOR(S)
35/*	Wietse Venema
36/*	IBM T.J. Watson Research
37/*	P.O. Box 704
38/*	Yorktown Heights, NY 10598, USA
39/*--*/
40
41/* System library. */
42
43#include <sys_defs.h>
44#include <stdlib.h>		/* 44BSD stdarg.h uses abort() */
45#include <stdarg.h>
46#include <string.h>
47
48/* Utility library. */
49
50#include <vstream.h>
51
52/* Global library. */
53
54#include "mail_proto.h"
55
56/* mail_command_server - read single-command request */
57
58int     mail_command_server(VSTREAM *stream,...)
59{
60    va_list ap;
61    int     count;
62
63    va_start(ap, stream);
64    count = attr_vscan(stream, ATTR_FLAG_MISSING, ap);
65    va_end(ap);
66    return (count);
67}
68