From 2358fd9353e91bc2291c165a679af9b3a1b7fb3a Mon Sep 17 00:00:00 2001 From: Michael Graff Date: Tue, 29 Feb 2000 20:10:49 +0000 Subject: [PATCH] add a bfew (pretty general) notes about lwres protocol --- doc/design/lwres | 80 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 doc/design/lwres diff --git a/doc/design/lwres b/doc/design/lwres new file mode 100644 index 0000000000..1b4fef5d4a --- /dev/null +++ b/doc/design/lwres @@ -0,0 +1,80 @@ +$Id: lwres,v 1.1 2000/02/29 20:10:49 explorer Exp $ + +General design: + +The lwres library converts structures into wire-format packets for +transmission, and unmarshalls them on receive. + + +Marshalling and unmarshalling: + +Each structure will have two functions defined, one to take a +wire-format packet and convert it into a structure, and another to +take a structure and convert it into a wire-format packet. There +is a structure cleanup function that will take the unmarshalled +structure and free any dynamically allocated elements. + + +Wire formats: + +All integer values are in network byte order. + +All addresses are in network byte order. That is, they are directly +usable and do not need to be byte swapped, at least for ipv4 and ipv6. + +All character strings are prefixed with a length, and are NUL +terminated C strings. This is a concession for structure handling on +the receive side, and allows a mapping structure to point to data +contained in the actual receive buffer, eliminating copying. + + +NOOP (aka ping) packet format: + + lwres_lwpacket_t header; + isc_uint16_t datalength; + < datalength bytes > + +The server simply returns the entire data region in the reply. This +allows the client to determine if the server is operational. + + +GETADDRSBYNAME: + + lwres_lwpacket_t header; + + isc_uint16_t naliases; + + isc_uint16_t naddrs; + + isc_uint16_t real_name_len; + < real_name_len bytes of name > + isc_uint8_t \0 + + < naliases of + isc_uint16_t len; + < len bytes of name > + isc_uint8_t \0 + > + + < naddrs of + isc_uint32_t family; + isc_uint16_t len; + < len bytes of address > + > + + +GETNAMEBYADDR: + + lwres_lwpacket_t header; + + isc_uint16_t naliases; + + isc_uint16_t real_name_len; + < real_name_len bytes of name > + isc_uint8_t \0 + + < naliases of + isc_uint16_t len; + < len bytes of name > + isc_uint8_t \0 + >