Journal davecb's Journal: ARPA result codes 1
One very handy pair was the ARPA command and return-code standard.
A command was four letters or less at the beginning of a line (record, packet), often monocase, so it could be treated as a 4-byte integer and switched on.
For example, smtp starts ups with
helo localhost
250 froggy Hello localhost [127.0.0.1], pleased to meet you
The "HELO" is the command, and the next line the response.
the first character is an ascii digit, where
1 means "informational message", and is rare
2 means permanent success
3 means partial success, as in a series of steps.
4 means temporary failure, such as "no space", and
5 means permanent failure
The second digit is 5 for "this app" and 9 for "the OS"
The third digit is the severity, so
599 I must close down, my CPU is on fire
is a very sever and permanent error (:-))
The fourth character is an ascii blank if the reply is
complete on this line, a "-" if it continues to additional lines.
For example, smtp has a help command:
help
214-2.0.0 This is sendmail version 8.12.8+Sun
214-2.0.0 Topics:
214-2.0.0 HELO EHLO MAIL RCPT DATA
214-2.0.0 RSET NOOP QUIT HELP VRFY
214-2.0.0 EXPN VERB ETRN DSN
214-2.0.0 For more info use "HELP ".
214-2.0.0 To report bugs in the implementation contact Sun Microsystems
214-2.0.0 Technical Support.
214-2.0.0 For local information send email to Postmaster at your site.
214 2.0.0 End of HELP info
The three digits and the "-" for continuation allows one to write as simple or as complex a DFA as you like, by doing trivial masking on fixed-length strings.
A pity XML wasn't around in those days. (Score:2)
<response>
<message_type>Permanent success</message_type>
<message_source>Application</message_source>
<message_severity>0</message_severity>
<server>froggy</server>
<content>
Hello localhost [127.0.0.1], pleased to meet you
</content>
</response>