Mercurial > hg > index.cgi
annotate docs/extension-pingpong.txt @ 10:36c4cda4b6c4
Add extension support with the PINGPONG extension
Add extension support. There are two ways to add extensions:
1. as a shared object which will be loaded with ext=<filename> as a
parameter to lwwire. See the lwwire_pingpong.c file for details.
2. By doing basically the same thing as a shared object but linking it into
the main binary and calling lwwire_register_extension() appropriately.
author | William Astle <lost@l-w.ca> |
---|---|
date | Sat, 30 Jul 2016 13:16:39 -0600 |
parents | |
children |
rev | line source |
---|---|
10
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
1 This document describes an extension to the LWWire protocol which provides |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
2 a "PINGPONG" facility. It does not provide a generally useful service. |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
3 However, it does serve to show how a basic extension can be defined. It also |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
4 gives clients an option to enable an extension and use that to determine if |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
5 the server has reset or otherwise got into a mixed up state. For instance, |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
6 the client could negotiate the PINGPONG extension and then periodically send |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
7 a PINGPONG_PING operation. If it doesn't get the appropriate response, it |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
8 can then assume that the server has reset and it should re-initialize its |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
9 drivers. |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
10 |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
11 LWWire Protocol Extension |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
12 ========================= |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
13 |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
14 This extension is called PINGPONG and is assigned extension number DF. It |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
15 defines the following operations in its extension space. |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
16 |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
17 00 PINGPONG_PING |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
18 |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
19 This does just what it's name implies. It does nothing except reply to the |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
20 client. |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
21 |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
22 Request: |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
23 |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
24 Octet Meaning |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
25 ----- ------- |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
26 0-2 F3 DF 00 |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
27 |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
28 Response: |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
29 |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
30 Octet Meaning |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
31 ----- ------- |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
32 0 42 |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
33 |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
34 The response will always be 42. |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
35 |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
36 01 PINGPONG_PONG |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
37 |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
38 This is exactly like PINGPONG_PING. It's provided for humour value. |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
39 |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
40 Request: |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
41 |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
42 Octet Meaning |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
43 ----- ------- |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
44 0-2 F3 DF 01 |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
45 |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
46 Response: |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
47 |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
48 Octet Meaning |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
49 ----- ------- |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
50 0 42 |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
51 |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
52 The response will always be 42. |
36c4cda4b6c4
Add extension support with the PINGPONG extension
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
53 |