vtsrvhello, vtlisten, vtgetreq, vtrespond – Venti server
typedef struct VtReq
int vtsrvhello(VtConn *z)
VtSrv* vtlisten(char *addr)
VtReq* vtgetreq(VtSrv *srv)
void vtrespond(VtReq *req)
These routines execute the server side of the
executes the server side of the initial
with the user name claimed by the other side.
Each new connection must be initialized by running
The framework below takes care of this detail automatically;
is provided for programs that do not use the functions below.
provide a simple framework for writing Venti servers.
announces at the network address
returning a fresh
structure representing the service.
waits for and returns
request from any client connected to
messages are handled internally and not returned to the client.
The interface does not distinguish between the
different clients that may be connected at any given time.
The request can be found in the
field of the returned
Once a request has been served and a response stored in
the server should call
to send the response to the client.
frees the structure
as well as the packets
contains two simple Venti servers
written using these routines.
is a read-only Venti proxy (it rejects
is a dangerous write-only Venti server: it discards all
blocks written to it and returns error on all reads.