s3:libsmb: abstract the incoming dispatch function via a function pointer
[idra/samba.git] / source3 / include / client.h
index f44e52f8f6d60e38a33d39856bf505b9acc3d732..79ce709069c5c5bbe8cfbe3891c4a5fd94172129 100644 (file)
@@ -128,6 +128,17 @@ struct cli_state {
                struct tevent_req *read_smb_req;
                struct tevent_queue *outgoing;
                struct tevent_req **pending;
+               /*
+                * The incoming dispatch function should return:
+                * - NT_STATUS_RETRY, if more incoming PDUs are expected.
+                * - NT_STATUS_OK, if no more processing is desired, e.g.
+                *                 the dispatch function called
+                *                 tevent_req_done().
+                * - All other return values disconnect the connection.
+                */
+               NTSTATUS (*dispatch_incoming)(struct cli_state *cli,
+                                             TALLOC_CTX *frame,
+                                             uint8_t *inbuf);
        } conn;
 
        struct {