Commit ff7ebeaa authored by David Byers's avatar David Byers
Browse files

Documentation: Protocol-A.texi is now nearly complete.

               Documented the aux-item definition file format.
               Updated the database format documentation.

Server:        Implemented aux-items.
               Checked error returns and set error-status to something
                   useful in most cases.
               New RPC calls:
                   create-text
                   create-anonymous-text
                   create-conf
                   create-person
                   get-text-stat
                   get-conf-stat
                   modify-text-info
                   modify-conf-info
                   get-info
                   modify-server-info
                   get-collate-table
                   set-expire
                   query-unread-texts
               New asynchronous messages:
                   new-text
                   deleted-text
parent 36cbe853
Sat Sep 13 15:07:32 1997 David Byers <davby@ida.liu.se>
* run-support/aux-items.conf: New file. This is the aux-item
definition file.
* src/server/aux-items.h: New file. Include this when using
aux-items.
* src/server/aux-items.c: New file. Implements most of the
functionality associated with aux-items.
* src/server/aux-item-def.l: New file. Implements the scanner for
the aux-item definition file parser.
* src/server/aux-item-def.y: New file. Implements the aux-item
definition file parser.
* src/server/text.c: Added support for aux-items. Set err_stat
whenever kom_errno is set.
(create_text_old): Renamed from create_text. Use do_create_text.
(create_text): New RPC function.
(create_anonymous_text): New RPC function.
(create_anonymous_text_old): Renamed from create_anonymous_text.
Use do_create_text.
(do_create_text): New function similar to old create_text, but
with aux-item support.
(count_recipients): Handle bcc-recpt.
(find_recipient): Handle bcc-recpt.
(do_add_bcc_recpt): New function to add bcc-recipient.
(do_delete_misc): Handle bcc_recpt.
(do_sub_recpt): Handle bcc_recpt.
(sender): Handle bcc_recpt.
(is_sender): Handle bcc_recpt.
(is_comm_sender): Handle bcc_recpt.
(skip_recp): Handle bcc_recpt.
(is_member_in_recpt): Handle bcc_recpt.
(filter_secret_info): Handle bcc_recpt.
(text_read_access): Handle bcc_recpt.
(do_delete_text): Handle bcc_recpt.
(check_double_subm): Handle bcc_recpt.
(check_double_comm): Handle bcc_recpt.
(create_text_check_misc): Handle bcc_recpt.
(create_text_add_miscs): Handle bcc_recpt.
(add_recipient): Handle bcc_recpt.
(filter_secret_info): Filter aux-items as well as misc-info.
(create_text_add_aux): New function.
(send_async_new_text_old): Renamed from send_async_new_text.
(send_async_new_text): New function.
(get_text_stat_old): Renamed from get_text_stat.
(get_text_stat): New RPC function.
(modify_text_info): New RPC function.
(do_delete_text): Send async deleted text.
* src/server/text-garb.c (garb_text): Handle bcc-recpt.
* src/server/simple-cache.c: Set err_stat whenever kom_errno is
set.
(cached_lookup_name): Set kom_errno to KOM_INTERNAL_ERROR is
parse() fails.
(pre_sync): Write version 2 data file.
(cached_delete_conf): Delete conference name from small_conf_arr.
(pre_sync): Use foutput_info instead of writing it here.
(init_cache): Return KOM_INTERNAL_ERROR on problems with the
files. Prettier handling of datafile versions (switch instead of
testing for one single version.) Call set_input_format to set the
input format. Use fparse_info to read info instead of parsing it
here. If we encounter an unknown key, print its offset.
* src/server/session.c: Set err_stat whenever kom_errno is set.
(accept_async): Return KOM_UNKNOWN_ASYNC if an unknown async
message is requested.
(login_old): Test wheel bit (test removed from is_supervisor.)
(login): Test wheel bit (test removed from is_supervisor.)
(disconnect): Test wheel bit (test removed from is_supervisor.)
* src/server/server-config.c (parameters): Add max_add_aux and
max_delete_aux.
(toplevel): Set AUX_DEF_FILE constant.
* src/server/send-async.h: Declare new functions in send-async.c
* src/server/send-async.c (async_new_text_old): Renamed from
async_new_text.
(async_new_text): New function to send new new-text async.
(async_send_group_message): Return KOM_MESSAGE_NOT_SENT on failure
because of no accepting recipient. Return KOM_FEATURE_DISABLED if
messages are disabled. Return INTERNAL_ERROR on an internal error.
(async_deleted_text): New function to send new deleted-text async.
* src/server/regex-match.c (lookup_regexp): Set err_stat when
kom_errno is set.
* src/server/ramkomd.c:
(initialize): Initialize aux-item definitions.
(main): Handle -a and -c options, and user-selectable aux-item
definition file.
* src/server/ram-parse.h: Declare new function in ram-parse.c
* src/server/ram-parse.c: Better support for reading different
input formats by using solution similar to that in ram-output.c.
New variable input_format controls input format.
(set_input_format): New function selects input format.
(fparse_info_0): New function.
(fparse_info_2): New function.
(fparse_info): New function.
(fparse_conference_2): New function.
(fparse_conference_0): New function.
(fparse_conference): New function.
(fparse_person_0): New function.
(fparse_person_2): New function.
(fparse_person): New function.
(fparse_text_stat_2): New function.
(fparse_text_stat_0): New function.
(fparse_text_stat): New function.
(fparse_aux_item_flags): New function to read aux-item flags.
(fparse_aux_item): New function to read an aux-item.
(fparse_aux_item_list): New function to read an aux-item-list.
(fparse_misc_info): Parse bcc-recpt.
* src/server/ram-output.h: Declare new functions in ram-output.c
* src/server/ram-output.c: Better support for writing different
output formats by using foutput_something_<version> and a switch
in foutput_something. New variable output_format selects output
format.
(set_output_format): New function to select output format.
(foutput_info_0): New function.
(foutput_info_2): New function.
(foutput_info): New function.
(foutput_person_0): New function.
(foutput_person_2): New function.
(foutput_person): New function.
(foutput_conference_2): New function.
(foutput_conference): New function.
(foutput_text_stat_0): New function.
(foutput_text_stat_2): New function.
(foutput_text_stat): New function.
(foutput_aux_flags): New function to output aux-item flags.
(foutput_aux_item): New function to output aux-items.
(foutput_aux_item_list): New function to output aux-item-lists.
(foutput_misc_info): Output bcc-recpt.
* src/server/prot-a.c (prot_a_reply): Added support for new and
renamed return types: rt_conference, rt_conference_old,
rt_text_stat, rt_text_stat_old, rt_info, rt_info_old.
(prot_a_init): Initialize aux_item_list of Connection.
(prot_a_destruct): Clear the aux_item_list in Connection.
(prot_a_is_legal_fnc): Add support for new and changed RPC calls
(see entry for fncdef.txt.)
* src/server/prot-a-send-async.h: Declare new functions in
prot-a-send-async.c
* src/server/prot-a-send-async.c (prot_a_async_new_text_old):
Renamed from prot_a_async_new_text.
(prot_a_async_new_text): New async message function.
(prot_a_async_deleted_text): New async message function.
* src/server/prot-a-parse.h: Declare new functions in
prot-a-parse.c
* src/server/prot-a-parse.c (prot_a_parse_aux_item_flags): New
function.
(prot_a_parse_aux_item): New function.
(prot_a_parse_aux_item_list): New function.
(prot_a_parse_misc_info): Parse bcc_recpt info type.
* src/server/prot-a-output.h: Declare new functions in
prot-a-output.c
* src/server/prot-a-output.c (prot_a_output_conference): New
output function.
(prot_a_output_conference_old): Renamed from old
prot_a_output_conference.
(prot_a_output_aux_item_flags): New function.
(prot_a_output_aux_item): New function.
(prot_a_output_text_stat_old): Renamed from
prot_a_output_text_stat.
(prot_a_output_aux_item_list): New function.
(prot_a_output_text_stat): New function.
(prot_a_output_info): New function.
(prot_a_output_info_old): Renamed from prot_a_output_info.
(prot_a_output_misc_info): Output bcc_recpt misc type.
* src/server/person.c: Added support for aux-items. Set err_stat
whenever kom_errno is set.
(create_person_generic): Moved all generic create_person code to
this function.
(create_person_old): Renamed from create_person, use
create_person_generic.
(create_person): New RPC function.
(set_passwd): Test wheel bit when doing is_supervisor (test
removed from is_supervisor.)
* src/server/param.h: Added max_delete_aux, max_add_aux to struct
kom_par.
* src/server/memory.c (free_aux_item_list): New function to free
all data in an Aux_item_list.
* src/server/membership.c: Set err_stat whenever kom_errno is set.
(access_perm): Test wheel bit (test removed from is_supervisor.)
(add_member): Test wheel bit (test removed from is_supervisor.)
* src/server/manipulate.h: Set err_stat whenever kom_errno is set.
Declare is_strictly_supervisor.
* src/server/kom-memory.h: Declare free_aux_item_list.
* src/server/internal-connections.c (init_connection): Clear
aux_item and aux_item_list fields of Connection. Clear
aux_item_list field of Info.
* src/server/fncdef.txt: Added comments to separate protocol
versions. New calls: get_collate_table, create_text,
create_anonymous_text, create_conf, create_person, get_text_stat,
get_conf_stat, modify_text_info, modify_conf_info, get_info,
modify_server_info, query_predefined_aux_items, set_expire.
Renamed calls: get_text_stat to get_text_stat_old,
get_conf_stat_old to get_conf_stat_older, get_conf_stat to
get_conf_stat_old, get_info to get_info_old, create_conf to
create_conf_old, create_pers to create_pers_old, create_text to
create_text_old, create_anonymous_text to
create_anonymous_text_old.
* src/server/dbck.c (check_misc_infos): Handle m_bcc_recpt.
(is_recipient): Handle bcc_recpt.
(main): Use set_output_format to select the output format.
* src/server/dbck-cache.c: Set err_stat whenever kom_errno is set.
(cache_sync): Use foutput_info instead of outputting the info
here.
(cache_sync): Call foutput_conference, not foutput_conference_old.
ram-output now takes care of selecting the correct version to
write.
(init_cache): Use fparse_info instead of reading the info here.
* src/server/connections.h: (Connection): Add aux_item_list and
aux_item.
(Res_type): Renamed return types: rt_conference to
rt_conference_old. rt_text_stat to rt_text_stat_old, rt_info to
rt_info_old. Addet rt_conference, rt_text_stat and rt_info.
(Result_holder): Added conference_old, text_stat_old and info_old.
* src/server/connections.c: Include kom-memory.h. Set err_stat
whenever kom_errno is set.
(free_parsed): Free data in aux_item and aux_item_list.
* src/server/conference.c: Added support for aux-items. Set
err_stat whenever kom_errno is set.
(is_strictly_supervisor): New function.
(is_supervisor): Use is_strictly_supervisor. Don't test the wheel
bit of ACTPERS.
(create_conf_generic): Moved generic create_conf code here.
(create_conf_old): Renamed from create_conf. Use
create_conf_generic.
(create_conf): New RPC function.
(get_conf_stat): New RPC function.
(get_conf_stat_old): Renamed from get_conf_stat
(modify_conf_info): New RPC function.
(set_expire): New RPC function.
* src/server/call-switch.awk: Parse aux_item_list.
* src/server/async.h: Added ay_new_text, ay_deleted_text. Renamed
old ay_new_text to ay_new_text_old.
* src/server/admin.c (modify_server_info): New RPC function.
(toplevel): Update initializer for kom_info.
(all): Set err_stat whenever kom_errno is set.
(get_info): New function. Old get_info is not get_info_old.
(get_collate_table): New RPC function.
* src/server/Makefile.src: Added the new files to source lists.
Rules to build aux-item-parser and scanner added.
* src/libraries/libcommon/misc-parser.h: Added m_bcc_recpt to
Misc_struct_type. Added bcc_recipient to Misc_info_group struct.
* src/include/services.h: Declared all new RPC functions and
renamed the now obsolete ones. New functions are: create_person,
create_conf, create_text, get_conf_stat, get_text_stat,
create_anonymous_text, modify_conf_info, modify_text_info,
get_info, modify_server_info, get_collate_table, set_expire,
query_predefined_aux_items
* src/include/kom-errno.h (KOM_err): Added KOM_ILL_AUX,
KOM_AUX_PERM, KOM_UNKNOWN_ASYNC, KOM_INTERNAL_ERROR,
KOM_FEATURE_DISABLED, KOM_MESSAGE_NOT_SENT.
* src/include/config.h: Added AUX_DEF_FILE.
* run-support/Makefile.src: Install aux-items.conf.
* doc/man/lyskomd.8: Documented aux-item related settings.
* doc/lyskomd-database-format: Documented data file version 2.
* doc/Protocol-A.texi: Completed all calls, asynch messages, data
structures, error codes. Documented protocol version 10.
* db-crypt/db/lyskomd-data: Updated to data file version 2.
* configure.in: Check for bison and flex (can't use the regular
YACC and LEX tests since we need bison and flex specifically.)
* INSTALL: Mention that bison and flex may be needed for
installation.
Sun Jul 20 16:04:23 1997 Per Cederqvist <ceder@lysator.liu.se>
The regexp code could use the wrong collate table.
......
# INSTALL -- installation instructions for the LysKOM server
#
# $Id: INSTALL,v 1.25 1996/08/04 02:22:01 ceder Exp $
# $Id: INSTALL,v 1.26 1997/09/13 15:31:20 byers Exp $
# Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
#
# This file is part of the LysKOM server.
......@@ -80,6 +80,12 @@ if you succeed in compiling it with another machine/OS/compiler.
We use the "include" statement in our Makefiles. Get GNU make if your
make does not support it.
1.3 Bison and flex
You may need the Gnu tools bison and flex. The standard lex and yacc
are not flexible enough. You should have bison version 1.25 or later
and flex version 2.5.4 or later.
2. INSTALLING (quick version)
--------------------------
......
This diff is collapsed.
dnl $Id: configure.in,v 1.41 1997/06/06 21:37:05 ceder Exp $
dnl $Id: configure.in,v 1.42 1997/09/13 15:31:24 byers Exp $
dnl Configuration for LysKOM
dnl Copyright (C) 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
dnl
......@@ -18,7 +18,7 @@ dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
dnl
dnl Please mail bug reports to bug-lyskom@lysator.liu.se.
dnl
AC_REVISION($Revision: 1.41 $)
AC_REVISION($Revision: 1.42 $)
AC_INIT(src/server/lyskomd.h)
AC_ARG_WITH([gnu-malloc],
[ --with-gnu-malloc use GNU malloc],
......@@ -141,6 +141,8 @@ AC_PROG_AWK
AC_PROG_LN_S
AC_PROG_YACC
AC_PROG_LEX
AC_CHECK_PROGS(BISON, bison)
AC_CHECK_PROGS(FLEX, flex)
AC_CHECK_PROGS(SED, sed)
AC_CHECK_HEADERS(string.h memory.h strings.h sys/param.h sys/time.h)
AC_CHECK_HEADERS(stdarg.h stdlib.h stddef.h locale.h sys/resource.h)
......
No preview for this file type
This diff is collapsed.
1. Adding new predefined aux items
New items are added to the file run-support/aux-items.conf, unless
they need to be compiled into the server, in which case they need to
be added to compiled_aux_item_definitions in src/server/aux-items.c
Remember to document all predefined aux items in doc/Protocol-A.texi.
2. aux-items.conf
Each entry in this file has the following format:
tag : name ( target, target, ... )
{
field = value;
field = value;
...
}
Tag is an integer, the aux-item's tag. The last definition of a tag
overrides all previous definitions of that tag. Each target is one of
`server', `text', `conference' or `letterbox', and defines which kind
of object the item can be attached to. If `server' is listed, items
with this tag can be attached to the server information. If `text' is
listed, items with this tag can be attached to texts; if `conference'
is listed, they can be attached to conferences; if `letterbox' is
listed, but `conference' is not, they can be attached to letterbox
conferences. Field is an identifier (see below). Value is a boolean
constant (`true', `false', `yes', `no', `on' or `off'); an integer; or
a string enclosed in double quotes (C-style escapes are probably
supported.) Some items have trillian values. They can be set to
boolean values in the file, but the default is some other value.
The following fields can be assigned to:
author-only Boolean, default false. When true, only the author
of a text or supervisor of a conference can create
items with this tag.
supervisor-only Boolean, default false. When true, only the
supervisors of the author or letterbox can create
items with this tag. In all likelihood, the
implementation of this flag is screwed up.
permanent Boolean, default false. When true, items with this
tag cannot be deleted once they have been created.
unique Boolean, default false. When true, there can only
be one non-deleted item with this tag per creator.
inherit-limit Integer, default 0. The maximum number of times
items with this tag can be inherited, plus one.
Zero means an unlimited number of times, one means
no times, 2 means once and so forth. This number
overrides the inherit-limit set by the client only
if that number is higher than this one.
inherit Trillian. When set, the inherit bit on new items
with this tag is forced to the specified value.
secret Trillian. When set, the secret bit on new items
with this tag is forced to the specified value.
hide-creator Trillian. When set, the hide-creator bit on new
items with this tag is forced to the specified
value.
validate String, default none. When set, this specifies a
regexp that must match the data field in newly
created items with this tag. If the regexp fails
to match, then the item will not be created.
......@@ -12,8 +12,12 @@ number of lines of conferences, followed by the same number of
persons. Next is a single integer on a single line followed by that
number of text-stat records.
DATABASE ::= HEADER '\n' NEXT-FREE-NUM '\n' CONFS PERSONS \
NEXT-TEXT-NUM '\n' TEXTS
DATABASE ::= HEADER '\n'
NEXT-FREE-NUM '\n'
CONFS
PERSONS
NEXT-TEXT-NUM '\n'
TEXTS
;
HEADER ::= 'CLEAN'
......@@ -47,6 +51,7 @@ TEXT ::= EMPTY-RECORD
EMPTY-RECORD ::= '@\n'
Notes
o Records are stored sequentially; e.g. the eighteenth conference
......@@ -126,3 +131,10 @@ o The NEXT-TEXT-NUM record denotes the highest test number in the
o A conference or text must have a number lower than the closest
NEXT-FREE-NUM or NEXT-TEXT-NUM before it.
DATABASE VERSION 2
Identical to version 1, but SERVER-INFO, CONF-RECORD, PERSON-RECORD
and TEXT-RECORD also include the highest_aux_no and aux_item_list
fields of the data structure, and CONF-RECORD has the expire field.
.\" $Id: lyskomd.8,v 1.24 1996/08/03 01:29:06 ceder Exp $
.\" $Id: lyskomd.8,v 1.25 1997/09/13 15:31:34 byers Exp $
.\" Copyright (C) 1991, 1994 Lysator Academic Computer Association.
.\"
.\" This file is part of the LysKOM server.
......@@ -21,18 +21,27 @@
.\"
.\" Please mail bug reports to bug-lyskom@lysator.liu.se.
.\"
.\" $Id: lyskomd.8,v 1.24 1996/08/03 01:29:06 ceder Exp $
.\" $Date: 1996/08/03 01:29:06 $
.\" $Id: lyskomd.8,v 1.25 1997/09/13 15:31:34 byers Exp $
.\" $Date: 1997/09/13 15:31:34 $
.TH lyskomd 8 "January 12, 1994" "Lysator"
.SH NAME
lyskomd - LysKOM server
.SH SYNOPSIS
.B /usr/lyskom/bin/lyskomd
.B lyskomd
[
.B -d ...
] [
.B config-file
]
.PP
.B lyskomd
[
.B -d
] [
.B -c config-file
] [
.B -a aux-item-defs
]
.SH DESCRIPTION
This documents lyskomd release 1.9.0. lyskomd is a LysKOM server.
.PP
......@@ -57,6 +66,12 @@ make the process print a
for every timeout, a message for every person that is connecting or
disconnecting and a message for every successful or unsuccessful
communication to the process.
.TP
.B \-c config-file
Selects which configuration file to use (see CONFIGURATION below).
.TP
.B \-a aux-item-defs
Selects which file to read definitions of aux-items from.
.SH CONFIGURATION
The configuration file is line oriented.
Each line consists of one
......@@ -288,6 +303,15 @@ significant, even if this number is much larger.
.TP
.B Max super_conf loop: int
.TP
.B Max accept_async len: int
Maximum length of list accepted in the accept_async call.
.TP
.B Max aux_items deleted per call: int
Maximum number of aux_items that can be deleted in one call.
.TP
.B Max aux_items added per call: int
Maximum number of aux_items that can be added at once.
.TP
.B Default garb nice: int
Each conference has a lifetime for texts written in it.
The lifetime is counted in days, and can be set for each conference by
......@@ -436,8 +460,6 @@ There is no practical handling of security.
.PP
The choice of asynchronously issued messages is not very good.
.PP
The so called "data base" is a joke.
.PP
It uses too much memory.
.SH HISTORY
In 1990, Per Cederqvist <ceder@lysator.liu.se> and Peter Eriksson
......
......@@ -113,6 +113,8 @@ binaries: FORCE
install: FORCE
test -f $(etcdir)/config \
|| $(INSTALL_DATA) $(srcdir)/config $(etcdir)/config
test -f $(etcdir)/aux-items.conf \
|| $(INSTALL_DATA) $(srcdir)/aux-items.conf $(etcdir)/aux-items.conf
for i in $(SCRIPTS); do \
$(INSTALL_PROGRAM) $$i $(bindir); \
done
......
#
# $Id: Makefile.src,v 1.10 1996/08/04 02:03:46 ceder Exp $
# $Id: Makefile.src,v 1.11 1997/09/13 15:31:36 byers Exp $
# Copyright (C) 1994, 1995, 1996 Lysator Academic Computer Association.
#
# This file is part of the LysKOM server.
......@@ -29,5 +29,7 @@ LK_SCRIPTS([komrunning savecore])
define([doinstall],
[LK_cmd([test -f $(etcdir)/config \
|| $(INSTALL_DATA) $(srcdir)/config $(etcdir)/config])]dnl
[LK_cmd([test -f $(etcdir)/aux-items.conf \
|| $(INSTALL_DATA) $(srcdir)/aux-items.conf $(etcdir)/aux-items.conf])]dnl
LK_QUOTE(doinstall))dnl
LK_DESCEND
#
# $Id: aux-items.conf,v 1.1 1997/09/13 15:31:37 byers Exp $
# Copyright (C) 1994, 1995, 1996 Lysator Academic Computer Association.
#
# This file is part of the LysKOM server.
#
# LysKOM is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 1, or (at your option)
# any later version.
#
# LysKOM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with LysKOM; see the file COPYING. If not, write to
# Lysator, c/o ISY, Linkoping University, S-581 83 Linkoping, SWEDEN,
# or the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
# MA 02139, USA.
#
# Please mail bug reports to bug-lyskom@lysator.liu.se.
#
#
# If you make an addition to this file that you feel is useful
# you should contact the LysKOM developers to reserve a number
# and to get the change incorporated into the server distribution.
#
#
# Content type of a text (MIME type)
#
1 : content-type (text)
{
author-only = true;
unique = true;
secret = false;
hide-creator = false;
inherit = false;
inherit-limit = 1;
validate = "^.*/.*$";
}
#
# Quick reply to a text
#
2 : fast-reply (text)
{
secret = false;
hide-creator = false;
inherit = false;
inherit-limit = 1;
}
#
# Cross reference from one object to another
#
3 : cross-reference (text, conference)
{
inherit = false;
inherit-limit = 1;
validate = "^[CTP][0-9]+ ";
}
#
# Request for no comments to a text
#