/* *This is the root component of the SqueakEasy. *[Header with internal data structures and information] * * Copyright 2003 Joseph Pingenot This program 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 2 of the License, or (at your option) any later version. This program 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * */ /*Our protocol versions.*/ #define SQKRT_SUBJ_BADPROTO 0 #define SQKRT_SUBJ_PROTOV1 1 /*Our protocol version 1 command numbers*/ #define SQKRT_SUBJ_BADCMD 0 #define SQKRT_SUBJ_QUIT 1 /*Returns a negative protocol version acknowledgement to the client.*/ void nak_subj_proto(int proto, int fd); /*Returns a negative cmmand acknowledgement to the client.*/ void nak_subj_cmd(int proto, int fd); /*Get the subject command from the line they sent *RETURNS: * command number or BADCMD */ int get_subj_cmd(int proto, char *line, long int len); /*Verify that the protocol version is one we know.*/ int subjectproto_isvalid(int proto); /*Acknowledge the client's quit request.*/ void ack_subj_quit(int proto, int fd); /*This opens up the conversation and checks the protcol version. *RETURNS: * protcol version or BADPROTO */ int do_subject_pleasantries(int fd); /*This processes the subject's command. It acts as a central dispatch * routine to other internal handlers. *RETURNS: * command actually processed (NOTE: this can return QUIT command or * BADCMD even though it didn't necessarily come as a QUIT or * BADCMD from get_subj_cmd!!!! */ int process_subj_cmd(int proto, int cmd_type, int fd);