nxt_port.h (168:3111bdfbb23f) nxt_port.h (189:3806ffda59cb)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#ifndef _NXT_PORT_H_INCLUDED_
8#define _NXT_PORT_H_INCLUDED_
9
10
11typedef enum {
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#ifndef _NXT_PORT_H_INCLUDED_
8#define _NXT_PORT_H_INCLUDED_
9
10
11typedef enum {
12 NXT_PORT_MSG_QUIT = 0,
13 NXT_PORT_MSG_NEW_PORT,
14 NXT_PORT_MSG_CHANGE_FILE,
15 NXT_PORT_MSG_MMAP,
16 NXT_PORT_MSG_DATA,
17 NXT_PORT_MSG_REMOVE_PID,
18 NXT_PORT_MSG_READY,
12 NXT_PORT_MSG_LAST = 0x100,
13 NXT_PORT_MSG_CLOSE_FD = 0x200,
19
14
15 NXT_PORT_MSG_MASK = 0xFF,
16
17 _NXT_PORT_MSG_QUIT = 0,
18 _NXT_PORT_MSG_NEW_PORT,
19 _NXT_PORT_MSG_CHANGE_FILE,
20 _NXT_PORT_MSG_MMAP,
21 _NXT_PORT_MSG_DATA,
22 _NXT_PORT_MSG_REMOVE_PID,
23 _NXT_PORT_MSG_READY,
24
20 NXT_PORT_MSG_MAX,
25 NXT_PORT_MSG_MAX,
26
27 NXT_PORT_MSG_QUIT = _NXT_PORT_MSG_QUIT | NXT_PORT_MSG_LAST,
28 NXT_PORT_MSG_NEW_PORT = _NXT_PORT_MSG_NEW_PORT | NXT_PORT_MSG_LAST,
29 NXT_PORT_MSG_CHANGE_FILE = _NXT_PORT_MSG_CHANGE_FILE | NXT_PORT_MSG_LAST,
30 NXT_PORT_MSG_MMAP = _NXT_PORT_MSG_MMAP | NXT_PORT_MSG_LAST |
31 NXT_PORT_MSG_CLOSE_FD,
32 NXT_PORT_MSG_DATA = _NXT_PORT_MSG_DATA,
33 NXT_PORT_MSG_DATA_LAST = _NXT_PORT_MSG_DATA | NXT_PORT_MSG_LAST,
34 NXT_PORT_MSG_REMOVE_PID = _NXT_PORT_MSG_REMOVE_PID | NXT_PORT_MSG_LAST,
35 NXT_PORT_MSG_READY = _NXT_PORT_MSG_READY | NXT_PORT_MSG_LAST,
21} nxt_port_msg_type_t;
22
23
24/* Passed as a first iov chunk. */
25typedef struct {
26 uint32_t stream;
27 nxt_pid_t pid;
28 nxt_port_id_t reply_port;
29
36} nxt_port_msg_type_t;
37
38
39/* Passed as a first iov chunk. */
40typedef struct {
41 uint32_t stream;
42 nxt_pid_t pid;
43 nxt_port_id_t reply_port;
44
30 nxt_port_msg_type_t type:8;
45 uint8_t type;
31 uint8_t last; /* 1 bit */
32
33 /* Message data send using mmap, next chunk is a nxt_port_mmap_msg_t. */
34 uint8_t mmap; /* 1 bit */
35} nxt_port_msg_t;
36
37
38typedef struct {
39 nxt_queue_link_t link;
40 nxt_buf_t *buf;
41 size_t share;
42 nxt_fd_t fd;
46 uint8_t last; /* 1 bit */
47
48 /* Message data send using mmap, next chunk is a nxt_port_mmap_msg_t. */
49 uint8_t mmap; /* 1 bit */
50} nxt_port_msg_t;
51
52
53typedef struct {
54 nxt_queue_link_t link;
55 nxt_buf_t *buf;
56 size_t share;
57 nxt_fd_t fd;
58 nxt_bool_t close_fd;
43 nxt_port_msg_t port_msg;
44
45 nxt_work_t work;
46 nxt_event_engine_t *engine;
47 nxt_mp_t *mem_pool;
48} nxt_port_send_msg_t;
49
50

--- 105 unchanged lines hidden ---
59 nxt_port_msg_t port_msg;
60
61 nxt_work_t work;
62 nxt_event_engine_t *engine;
63 nxt_mp_t *mem_pool;
64} nxt_port_send_msg_t;
65
66

--- 105 unchanged lines hidden ---