---
name: "Ixp9Srv"
section: "3"
platform: "linux"
package: "libixp-dev"
version: "0.6~20121202+hg148-5"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/Ixp9Srv"
---

# Ixp9Srv(3)

## NAME

Ixp9Srv, Ixp9Req, ixp\_serve9conn

## SYNOPSIS

```
#include <ixp.h>
typedef struct Ixp9Srv Ixp9Srv;
struct Ixp9Srv {
        void* aux;
        void (*attach)(Ixp9Req*);
        void (*clunk)(Ixp9Req*);
        void (*create)(Ixp9Req*);
        void (*flush)(Ixp9Req*);
        void (*open)(Ixp9Req*);
        void (*read)(Ixp9Req*);
        void (*remove)(Ixp9Req*);
        void (*stat)(Ixp9Req*);
        void (*walk)(Ixp9Req*);
        void (*write)(Ixp9Req*);
        void (*wstat)(Ixp9Req*);
        void (*freefid)(IxpFid*);
}
typedef struct Ixp9Req Ixp9Req;
struct Ixp9Req {
        Ixp9Srv*        srv;
        IxpFid*         fid;    /* Fid structure corresponding to IxpFHdr.fid */
        IxpFid*         newfid; /* Corresponds to IxpFTWStat.newfid */
        Ixp9Req*        oldreq; /* For TFlush requests, the original request. */
        IxpFcall        ifcall; /* The incoming request fcall. */
        IxpFcall        ofcall; /* The response fcall, to be filled by handler. */
        void*           aux;    /* Arbitrary pointer, to be used by handlers. */
        /* Private members */
        ...
}
void ixp_serve9conn(IxpConn *c);
```

## DESCRIPTION

The ixp\_serve9conn handles incoming 9P connections. It is ordinarily passed as the *read* member to **[ixp\_listen(3)](/ixp_listen/3.md)** with an Ixp9Srv structure passed as the *aux* member. The handlers defined in the Ixp9Srv structure are called whenever a matching Fcall type is received. The handlers are expected to call **[ixp\_respond(3)](/ixp_respond/3.md)** at some point, whether before they return or at some undefined point in the future. Whenever a client disconnects, libixp generates whatever flush and clunk events are required to leave the connection in a clean state and waits for all responses before freeing the connections associated data structures.

Whenever a file is closed and an **[IxpFid(3)](/IxpFid/3.md)** is about to be freed, the *freefid* member is called to perform any necessary cleanup and to free any associated resources.

## SEE ALSO

[ixp\_listen(3)](/ixp_listen/3.md), [ixp\_respond(3)](/ixp_respond/3.md), [ixp\_printfcall(3)](/ixp_printfcall/3.md), [IxpFcall(3)](/IxpFcall/3.md), [IxpFid(3)](/IxpFid/3.md)
