Log in | Back to darenet.org

DareNET P10

Admin (Talk | contribs)
(New page: __NOTOC__ The goal of this document is to be a complete reference of DareNET's extensions to the existing implementation of the P10 protocol. It is based on the P10 protocol and interface ...)
Newer edit →

Revision as of 02:41, 27 April 2009

The goal of this document is to be a complete reference of DareNET's extensions to the existing implementation of the P10 protocol. It is based on the P10 protocol and interface specification as of ircu 2.10.11, raw data sent by ircu and the ircu source code.

Terminology

Below is some of the terminology used within this document.

Term Definition
Byte A unit of 8 bits of data.
Character One byte, notated as a decimal number in the range of 0-255, or a printable ASCII character (example: 65, 'A').
Char Character.
String A sequence of bytes.
Parser The implementation which receives and processes the stream.
Generate Sending data which has not been received, as opposed to passing data on which has been received.
TS TimeStamp. An ASCII decimal notation of a date+time (number of seconds, not counting leap seconds, since Jan-1-1970, 00:00:00 UTC.
Nick Refers to a client's nickname.
Numnick Refers to a client's numeric nickname.

Keywords

MUST - This word, or the terms "REQUIRED" or "SHALL", mean that the definition is an absolute requirement of the specification.

MUST NOT - This phrase, or the phrase "SHALL NOT" or "DISALLOWED", mean that the definition is an absolute prohibition of the specification.

SHOULD - This word, or the adjective "RECOMMENDED", mean that there may exist valid reasons in particular circumstances to ignore a particular item, but the full implications must be understood and carefully weighed before choosing a different course.

SHOULD NOT - This phrase, or the phrase "NOT RECOMMENDED" mean that there may exist valid reasons in particular circumstances when the particular behavior is acceptable or even useful, but the full implications should be understood and the case carefully weighed before implementing any behavior described with this label.

Hexadecimals

Hexadecimal numbers within this document use the pascal notation: a $ prefix. The number of hex digits (nibbles) represents the size of the data, for example, a byte can be anything between $00 and $ff.

Stream of Data, Lines, Line Termination

P10 is a "text" protocol, that is, it is human readable/writable.

  • CR: Carriage Return. Character 13.
  • LF: Line feed. Chracter 10.
  • CRLF: <CRLF>
  • NULL: Chracter 0.
  • EOL: End of Line (line termination).

So the definition of the stream would be as follows:
<line><EOL><line><EOL> .... <garbage>

Line termination (EOL)

When sending, line termination may be either <CRLF> or <LF>. It must not be anything else.

The parser must accept <LF> and <CRLF> as line termination. It may accept any other sequence of <CR> and <LF> as EOL. It must not parse anything else as "line termination."

Line

A sequence of characters, minimum length 1 byte, maximum length 510 bytes, not including the EOL. If a parser encounters a line with a length of 0 bytes, it must be silently ignored, and it must not do anything else. A line which is longer than the maximum length is disallowed.

NULL, CR and LF are disallowed in a line, any other character is allowed.

NOTE on NULL character: A parser can encounter a line which contains a NULL character. It may terminate the line at the first NULL character (remove anything after and including the first NULL character from the line).

Garbage

Any data between the last EOL and the end of the stream. It must not be parsed as a line.