Last update 18-Sep-1999

# mbsed - MBSE BBS Deamon

###

SYNOPSIS

mbsed

###

DESCRIPTION

mbsed is the global trafic agent, or manager for the whole MBSE BBS system. This deamon keeps track of all client actions, does the logging for the clients, does database locking, authorizes clients, set/resets users "do not disturb flags", sends and receives chat messages, keeps track of Zone Mail Hour and the BBS open/close status. Communication between mbsed and the client programs is done via internet streams sockets. The protocol used to communicate between mbsed and the clients is explained later. At this moment mbsed and all clients must run on the same host, this will be changed later. The main mbsed must be started from one of your system startup files. When clients connect to mbsed a child mbsed is spawned for each client.

###

ENVIRONMENT

In order to run mbsed you must set the global variable $MBSE_ROOT. This variable must point to the root directory of the bbs structure. The main configuration file config.data must be present in the ~/etc directory.

###

COMMUNICATIONS

Communication between the server and the clients is established by internet streams and datagram sockets. There should be only 1 server running.

The server will accept calls from all ofer the world if your system is not behind a firewall. For security reasons, only clients who know the password are able to use the server. The password is transmitted as a 32 bit crc value and is different for each client process.

There is no real limit for the amount of clients that can connect to the server, the limits are dependent of the os, amount of ram and the kernel limits.

Normal commands from the clients to the server are transmitted via tcp stream sockets. The responses are transmitted back through the same sockets.

All commands are 4 capital letters followed by a colon, a number indicating how much data fields will follow. If that number is higher than zero, the data fields will follow seperated with commas. The command is terminated with a ; character. Examples are:

    GCLO:0;			Zero datafields command.
    DOPE:1,dbname;		One datafield command.

All commands will receive a reply as soon as possible. If a resource is temporary not available, a reply will follow too, telling this condition. Replies can also contain optional data. Examples:

    100:0;			Response 100, no data.
    200:1,Syntax error;	One datafield.

The server has a 10 minute timeout for receiving data when a connection is established. The clients need to "ping" the server at regular intervals to prevent a disconnect.

The commands are divided in 26 catagories, most unused at this time.

    Catagories:

    Cat.	Description
    ----	-------------------------------------------
    Axxx	Accounting, system monitor info etc.
    Cxxx	Chatting
    Gxxx	Global commands.
    Sxxx	Status commands.

    	Group A, Accounting.

    Command and options.		Description.
    ------------------------------	----------------------------------------------
    AINI:5,pid,tty,uid,prg,city;	Initialize connection, and who am I.
    AAUT:2,pid,crc32;		Authorize my access.
    ADOI:2,pid,doing;		What am I doing right now.
    ACLO:1,pid;			Close my connection.
    ALOG:5,fil,prg,pid,grade,txt;	Write a line of text in logfile with grade.
    AUSR:3,pid,uid,city;		Set username and city
    ADIS:2,pid,flag;		Set Do Not Disturb flag.
    ATIM:1,time;			Set new Client/Server timer in seconds.
    ADEF:0;				Set Client/Server timer to default.
    ATTY:2,pid,tty;			Set new tty name.

    	Group C, Chatting (just some ideas).

    Command and options.		Description.
    ------------------------------  ----------------------------------------------
    CIPM:1,pid;			Is Personal Message present.
    CSPM:3,fromuser,touser,txt;	Send personal message to user.
    -CBPM:2,fromuser,txt;		Broadcast message to all users.
    -CJCH:2,pid,channel;		Join Channel
    -CCCH:2,pid,channel;		Close Channel
    -CAML:2,channel,text;		Add textline to channel
    -CIML:1,channel;		Is new textline present
    -CSSP:1,user,reason;		Send Sysop Page
    -CESP:1,user;			Retract Sysop Page
    -CRSP:1,user;			Reject user Page
    -CFCH:2,channel,user;		Force user in chatmode (for Sysop chat).
    -CKCH:2,channel,user;		Kill user chatmode (for Sysops and moderators).

    	Group G, Global commands.

    Command and options.		Description.
    ------------------------------	----------------------------------------------
    GNOP:0;				No OPerations.
    GPNG:1,data;			Ping, echo data.
    GVER:0;				Give server version.
    GSTA:0;				Get complete status record. (13 fields)
    GMON:0;				Get first registration info line
    GMNE:0;				Get next registration info line
    GDST:0;				Get filesystem status (see note below).

    	Group S, Status commands.

    Command and options.		Description.
    ------------------------------	----------------------------------------------
    SBBS:0;				Get BBS Status (open, zmh, shutdown).
    SOPE:0;				Open the BBS.
    SCLO:1,mesage;			Close the BBS with reason.
    SFRE:0;				Is the BBS Free.
    SSEQ:0;				Get next sequence number.
    SZMH:0;				return 101:0; if Zone Mail Hour, else 100:0;

    	Resposes.

    Response and options.		Description.
    ------------------------------	----------------------------------------------
    100:n,data,...;			All is well, with optional data field(s).
    101:0;				Zone Mail Hour is true.
    101:1,message;			BBS closed with reason.
    102:1,message;			BBS not free, see message.
    104:0;				Authorize failed.
    107:0;				Connection is closed after now.
    200:1,msg;			Syntax error in command.
    201:1,errno;			Unix/Linux error, errno is standard errno.
    300:7,pid,tty,uid,prg,city,does,start;	Registration information line.
    301:0;				No more registration data.

Note: in reply of GDST the reply is 100:n,size free mountpoint fstype,..... where n = 1 for 1 filesystem, and 10 for a total of 10 filesystems. There will never be a reply for more then 10 filesystems. The reported filesystems are retrieved from /etc/mtab which is the actual mountstatus.

###

EXAMPLE CONFIGURATION

The line CLIENT in mbsed.conf suggests that you can enter more than one client line in there. At this moment that isn't supported but will be in the future. This will then allow you to run mbmon from another system.

    # $MBSE_ROOT/etc/mbsed.conf
    #
    # Name of all clients who may connect the server.
    #
    CLIENT		localhost
    #
    # Authorisation code for Client/Server connections.
    # Just put some random characters here. Put the same
    # characters in client.conf or it doesn't work!
    #
    AUTHCODE	abcdefgh
    #
    # Log Client/Server transactions. This option is only needed
    # for clients development, the logfile grows VERY fast!
    #
    LOGTRANS	0
    #
    # Log Levels:	Grade	Level	Meaning
    #		-----	-----	---------------------
    #		?	0	Errors, log always
    #		!	1	Attention
    #		+	2	Normal messages
    #		-	3	Non vital messages
    #		#	4	Heavy debug messages
    #
    LOGDEBUG	4
    #
    # Zone mail hour in UTC, start and endtime.
    #
    ZMHS		02:30
    ZMHE		03:30
    #
    # The end.

    # $MBSE_ROOT/etc/client.conf
    #
    # System name where the server lives.
    #
    SERVER		localhost
    #
    # Authorisation code for Client/Server connections.
    # Just put some random characters here. Must be the
    # same as in mbsed.conf
    #
    AUTHCODE	abcdefgh
    #
    # The end.

###

BUGS

If you find any bugs, mispelled documentation etc, please contact the author: Michiel Broek at 2:2801/16@Fidonet or Michiel_Broek@f16.n2801.z2.fidonet.org

Back to index Back to Main index