mbsed
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. 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.
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.
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:1,n; Get registration info line, 1=First, 0=the rest. GDST:0; Get filesystem status (see note below). GLCC:0; Get Lastcallers count GLCR:1,recno; Get Lastcaller record 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. Resposes. Response and options. Description. ------------------------------ ---------------------------------------------- 100:n,data,...; All is well, with optional data field(s). 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.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.
# $MBSE_ROOT/etc/mbsed.conf # # Name of all clients and authorization codes who may # connect to this server. Note: you must at least have # a localhost entry. Only mbmon can connect from other # hosts. # CLIENT localhost abcdefgh CLIENT some.host.nl abcdefgh # # Log Client/Server transactions. This option is only needed # for clients development, the logfile grows VERY fast! # LOGTRANS 0 # # Zone mail hour in UTC, start and endtime. # ZMHS 02:30 ZMHE 03:30 # # The end. # $MBSE_ROOT/etc/client.conf # # The system and authorization codes of the mbsed server. # Note: you MUST ate least have a localhost entry. Only # mbmon will use multiple entries. # SERVER localhost abcdefgh SERVER other.host.com ijklmnop # # The end.
If you find any bugs, mispelled documentation etc, please contact the author: Michiel Broek at 2:280/2802@fidonet or Michiel_Broek@f2802.n280.z2.fidonet.org