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