nmdb: Use the appropriate type for storing send() return value
[nmdb.git] / nmdb / req.h
blob3660d86f67472242875f86baacace97b407eceaf
2 #ifndef _REQ_H
3 #define _REQ_H
5 #include <stdint.h> /* uint32_t */
6 #include <sys/types.h> /* size_t */
7 #include <sys/socket.h> /* socklen_t */
10 /* req_info types, according to the protocol */
11 #define REQTYPE_TIPC 1
12 #define REQTYPE_TCP 2
13 #define REQTYPE_UDP 3
14 #define REQTYPE_SCTP 4
17 struct req_info {
18 /* network information */
19 int fd;
20 int type;
22 struct sockaddr *clisa;
23 socklen_t clilen;
25 /* operation information */
26 uint32_t id;
27 uint16_t cmd;
28 uint16_t flags;
29 const unsigned char *payload;
30 size_t psize;
32 /* operations */
33 void (*reply_mini)(const struct req_info *req, uint32_t reply);
34 void (*reply_err)(const struct req_info *req, uint32_t reply);
35 void (*reply_long)(const struct req_info *req, uint32_t reply,
36 unsigned char *val, size_t vsize);
39 #endif