VENTI-SERVER(3)

πŸ“¦ version 0_git20260208, in alpine 3.24, arch rolling, nixos 26.05, nixpkgs unstable

✨ NAME ✨

vtsrvhello, vtlisten, vtgetreq, vtrespond β€” Venti server energy. Okay so this is VENTI-SERVER(3) from the Library Functions Manual, and we’re doing the server-side bestie route πŸ’…


🌸 SYNOPSIS 🌸

#include <u.h>
#include <libc.h>
#include <venti.h>

typedef struct VtReq
{
       VtFcall tx;
       VtFcall rx;
       ...
} VtReq;

int    vtsrvhello(VtConn *z)

VtSrv* vtlisten(char *addr)

VtReq* vtgetreq(VtSrv *srv)

void   vtrespond(VtReq *req)

πŸ’– DESCRIPTION πŸ’–

These routines execute the server side of the venti(7) protocol. Periodt. They’re the server-side girlies of the whole operation 🫢

  • vtsrvhello β€” executes the server side of the initial hello transaction. It sets z->uid with the user name claimed by the other side. Each new connection must be initialized by running vtversion and then vtsrvhello. The framework below takes care of this detail automatically; vtsrvhello is provided for programs that do not use the functions below.
  • vtlisten, vtgetreq, and vtrespond β€” provide a simple framework for writing Venti servers. Iconic little trio, no cap ✨

vtlisten announces at the network address addr, returning a fresh VtSrv structure representing the service. It’s giving β€œnew server just dropped” 🌈

vtgetreq waits for and returns the next read, write, sync, or ping request from any client connected to the service srv. Hello and goodbye 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 tx field of the returned VtReq.

Once a request has been served and a response stored in r->rx, the server should call vtrespond to send the response to the client. Vtrespond frees the structure r as well as the packets r->tx.data and r->rx.data. Cleanup queen behavior πŸ’…

bestie, don’t sleep on the vtversion + vtsrvhello order β€” that’s a must for every new connection πŸ’–

πŸ¦‹ EXAMPLE πŸ¦‹

/src/venti/cmd contains two simple Venti servers ro.c and devnull.c written using these routines. Ro is a read-only Venti proxy (it rejects write requests). Devnull is a dangerous write-only Venti server: it discards all blocks written to it and returns error on all reads. Like… literally read the danger warning, bestie 😭


πŸŽ€ SOURCE πŸŽ€

/src/libventi


⭐ SEE ALSO ⭐

venti(3), venti-conn(3), venti-packet(3), venti(7), venti(8)


okay that’s the whole page, bestie πŸ’– source is /src/libventi, the footer’s only tag is VENTI-SERVER(3), and there’s no date listed on this page β€” so that’s all the sign-off info we got πŸ«Άβœ¨πŸŽ€