111Sigor@sysoev.ru 211Sigor@sysoev.ru /* 311Sigor@sysoev.ru * Copyright (C) Igor Sysoev 411Sigor@sysoev.ru * Copyright (C) NGINX, Inc. 511Sigor@sysoev.ru */ 611Sigor@sysoev.ru 711Sigor@sysoev.ru #ifndef _NXT_PORT_H_INCLUDED_ 811Sigor@sysoev.ru #define _NXT_PORT_H_INCLUDED_ 911Sigor@sysoev.ru 1011Sigor@sysoev.ru 11320Smax.romanov@nginx.com struct nxt_port_handlers_s { 12320Smax.romanov@nginx.com /* RPC responses. */ 13320Smax.romanov@nginx.com nxt_port_handler_t rpc_ready; 14320Smax.romanov@nginx.com nxt_port_handler_t rpc_error; 15320Smax.romanov@nginx.com 16320Smax.romanov@nginx.com /* Main process RPC requests. */ 171488St.nateldemoura@f5.com nxt_port_handler_t start_process; 18320Smax.romanov@nginx.com nxt_port_handler_t socket; 19320Smax.romanov@nginx.com nxt_port_handler_t modules; 20320Smax.romanov@nginx.com nxt_port_handler_t conf_store; 21774Svbart@nginx.com nxt_port_handler_t cert_get; 22774Svbart@nginx.com nxt_port_handler_t cert_delete; 23630Svbart@nginx.com nxt_port_handler_t access_log; 24320Smax.romanov@nginx.com 25320Smax.romanov@nginx.com /* File descriptor exchange. */ 26320Smax.romanov@nginx.com nxt_port_handler_t change_file; 27320Smax.romanov@nginx.com nxt_port_handler_t new_port; 281545Smax.romanov@nginx.com nxt_port_handler_t get_port; 291666Smax.romanov@nginx.com nxt_port_handler_t port_ack; 30320Smax.romanov@nginx.com nxt_port_handler_t mmap; 311546Smax.romanov@nginx.com nxt_port_handler_t get_mmap; 32320Smax.romanov@nginx.com 331488St.nateldemoura@f5.com /* New process */ 341488St.nateldemoura@f5.com nxt_port_handler_t process_created; 35320Smax.romanov@nginx.com nxt_port_handler_t process_ready; 36320Smax.romanov@nginx.com 37320Smax.romanov@nginx.com /* Process exit/crash notification. */ 38320Smax.romanov@nginx.com nxt_port_handler_t remove_pid; 39320Smax.romanov@nginx.com 40320Smax.romanov@nginx.com /* Stop process command. */ 41320Smax.romanov@nginx.com nxt_port_handler_t quit; 42320Smax.romanov@nginx.com 431131Smax.romanov@nginx.com /* Request headers. */ 441131Smax.romanov@nginx.com nxt_port_handler_t req_headers; 451547Smax.romanov@nginx.com nxt_port_handler_t req_headers_ack; 461555Smax.romanov@nginx.com nxt_port_handler_t req_body; 471131Smax.romanov@nginx.com 481131Smax.romanov@nginx.com /* Websocket frame. */ 491131Smax.romanov@nginx.com nxt_port_handler_t websocket_frame; 501131Smax.romanov@nginx.com 51320Smax.romanov@nginx.com /* Various data. */ 52320Smax.romanov@nginx.com nxt_port_handler_t data; 53*1926Smax.romanov@nginx.com nxt_port_handler_t app_restart; 541321Smax.romanov@nginx.com 551321Smax.romanov@nginx.com nxt_port_handler_t oosm; 561321Smax.romanov@nginx.com nxt_port_handler_t shm_ack; 571555Smax.romanov@nginx.com nxt_port_handler_t read_queue; 581555Smax.romanov@nginx.com nxt_port_handler_t read_socket; 59320Smax.romanov@nginx.com }; 60320Smax.romanov@nginx.com 61320Smax.romanov@nginx.com 62320Smax.romanov@nginx.com #define nxt_port_handler_idx(name) \ 63389Smax.romanov@nginx.com ( offsetof(nxt_port_handlers_t, name) / sizeof(nxt_port_handler_t) ) 64320Smax.romanov@nginx.com 651488St.nateldemoura@f5.com #define nxt_msg_last(handler) \ 661488St.nateldemoura@f5.com (handler | NXT_PORT_MSG_LAST) 67320Smax.romanov@nginx.com 6842Smax.romanov@nginx.com typedef enum { 691488St.nateldemoura@f5.com NXT_PORT_MSG_LAST = 0x100, 701488St.nateldemoura@f5.com NXT_PORT_MSG_CLOSE_FD = 0x200, 711488St.nateldemoura@f5.com NXT_PORT_MSG_SYNC = 0x400, 72189Smax.romanov@nginx.com 731488St.nateldemoura@f5.com NXT_PORT_MSG_MASK = 0xFF, 74189Smax.romanov@nginx.com 751488St.nateldemoura@f5.com _NXT_PORT_MSG_RPC_READY = nxt_port_handler_idx(rpc_ready), 761488St.nateldemoura@f5.com _NXT_PORT_MSG_RPC_ERROR = nxt_port_handler_idx(rpc_error), 77320Smax.romanov@nginx.com 781488St.nateldemoura@f5.com _NXT_PORT_MSG_START_PROCESS = nxt_port_handler_idx(start_process), 791488St.nateldemoura@f5.com _NXT_PORT_MSG_SOCKET = nxt_port_handler_idx(socket), 801488St.nateldemoura@f5.com _NXT_PORT_MSG_MODULES = nxt_port_handler_idx(modules), 811488St.nateldemoura@f5.com _NXT_PORT_MSG_CONF_STORE = nxt_port_handler_idx(conf_store), 821488St.nateldemoura@f5.com _NXT_PORT_MSG_CERT_GET = nxt_port_handler_idx(cert_get), 831488St.nateldemoura@f5.com _NXT_PORT_MSG_CERT_DELETE = nxt_port_handler_idx(cert_delete), 841488St.nateldemoura@f5.com _NXT_PORT_MSG_ACCESS_LOG = nxt_port_handler_idx(access_log), 8542Smax.romanov@nginx.com 861488St.nateldemoura@f5.com _NXT_PORT_MSG_CHANGE_FILE = nxt_port_handler_idx(change_file), 871488St.nateldemoura@f5.com _NXT_PORT_MSG_NEW_PORT = nxt_port_handler_idx(new_port), 881545Smax.romanov@nginx.com _NXT_PORT_MSG_GET_PORT = nxt_port_handler_idx(get_port), 891666Smax.romanov@nginx.com _NXT_PORT_MSG_PORT_ACK = nxt_port_handler_idx(port_ack), 901488St.nateldemoura@f5.com _NXT_PORT_MSG_MMAP = nxt_port_handler_idx(mmap), 911546Smax.romanov@nginx.com _NXT_PORT_MSG_GET_MMAP = nxt_port_handler_idx(get_mmap), 92320Smax.romanov@nginx.com 931488St.nateldemoura@f5.com _NXT_PORT_MSG_PROCESS_CREATED = nxt_port_handler_idx(process_created), 941488St.nateldemoura@f5.com _NXT_PORT_MSG_PROCESS_READY = nxt_port_handler_idx(process_ready), 951488St.nateldemoura@f5.com _NXT_PORT_MSG_REMOVE_PID = nxt_port_handler_idx(remove_pid), 961488St.nateldemoura@f5.com _NXT_PORT_MSG_QUIT = nxt_port_handler_idx(quit), 971131Smax.romanov@nginx.com 981488St.nateldemoura@f5.com _NXT_PORT_MSG_REQ_HEADERS = nxt_port_handler_idx(req_headers), 991547Smax.romanov@nginx.com _NXT_PORT_MSG_REQ_HEADERS_ACK = nxt_port_handler_idx(req_headers_ack), 1001555Smax.romanov@nginx.com _NXT_PORT_MSG_REQ_BODY = nxt_port_handler_idx(req_body), 1011488St.nateldemoura@f5.com _NXT_PORT_MSG_WEBSOCKET = nxt_port_handler_idx(websocket_frame), 102189Smax.romanov@nginx.com 1031488St.nateldemoura@f5.com _NXT_PORT_MSG_DATA = nxt_port_handler_idx(data), 104*1926Smax.romanov@nginx.com _NXT_PORT_MSG_APP_RESTART = nxt_port_handler_idx(app_restart), 1051321Smax.romanov@nginx.com 1061488St.nateldemoura@f5.com _NXT_PORT_MSG_OOSM = nxt_port_handler_idx(oosm), 1071488St.nateldemoura@f5.com _NXT_PORT_MSG_SHM_ACK = nxt_port_handler_idx(shm_ack), 1081555Smax.romanov@nginx.com _NXT_PORT_MSG_READ_QUEUE = nxt_port_handler_idx(read_queue), 1091555Smax.romanov@nginx.com _NXT_PORT_MSG_READ_SOCKET = nxt_port_handler_idx(read_socket), 110320Smax.romanov@nginx.com 1111488St.nateldemoura@f5.com NXT_PORT_MSG_MAX = sizeof(nxt_port_handlers_t) 1121488St.nateldemoura@f5.com / sizeof(nxt_port_handler_t), 113320Smax.romanov@nginx.com 1141488St.nateldemoura@f5.com NXT_PORT_MSG_RPC_READY = _NXT_PORT_MSG_RPC_READY, 1151488St.nateldemoura@f5.com NXT_PORT_MSG_RPC_READY_LAST = nxt_msg_last(_NXT_PORT_MSG_RPC_READY), 1161488St.nateldemoura@f5.com NXT_PORT_MSG_RPC_ERROR = nxt_msg_last(_NXT_PORT_MSG_RPC_ERROR), 1171488St.nateldemoura@f5.com NXT_PORT_MSG_START_PROCESS = nxt_msg_last(_NXT_PORT_MSG_START_PROCESS), 1181488St.nateldemoura@f5.com NXT_PORT_MSG_SOCKET = nxt_msg_last(_NXT_PORT_MSG_SOCKET), 1191488St.nateldemoura@f5.com NXT_PORT_MSG_MODULES = nxt_msg_last(_NXT_PORT_MSG_MODULES), 1201488St.nateldemoura@f5.com NXT_PORT_MSG_CONF_STORE = nxt_msg_last(_NXT_PORT_MSG_CONF_STORE), 1211488St.nateldemoura@f5.com NXT_PORT_MSG_CERT_GET = nxt_msg_last(_NXT_PORT_MSG_CERT_GET), 1221488St.nateldemoura@f5.com NXT_PORT_MSG_CERT_DELETE = nxt_msg_last(_NXT_PORT_MSG_CERT_DELETE), 1231488St.nateldemoura@f5.com NXT_PORT_MSG_ACCESS_LOG = nxt_msg_last(_NXT_PORT_MSG_ACCESS_LOG), 1241488St.nateldemoura@f5.com NXT_PORT_MSG_CHANGE_FILE = nxt_msg_last(_NXT_PORT_MSG_CHANGE_FILE), 1251488St.nateldemoura@f5.com NXT_PORT_MSG_NEW_PORT = nxt_msg_last(_NXT_PORT_MSG_NEW_PORT), 1261545Smax.romanov@nginx.com NXT_PORT_MSG_GET_PORT = nxt_msg_last(_NXT_PORT_MSG_GET_PORT), 1271666Smax.romanov@nginx.com NXT_PORT_MSG_PORT_ACK = nxt_msg_last(_NXT_PORT_MSG_PORT_ACK), 1281488St.nateldemoura@f5.com NXT_PORT_MSG_MMAP = nxt_msg_last(_NXT_PORT_MSG_MMAP) 1291547Smax.romanov@nginx.com | NXT_PORT_MSG_SYNC, 1301547Smax.romanov@nginx.com NXT_PORT_MSG_GET_MMAP = nxt_msg_last(_NXT_PORT_MSG_GET_MMAP), 131320Smax.romanov@nginx.com 1321488St.nateldemoura@f5.com NXT_PORT_MSG_PROCESS_CREATED = nxt_msg_last(_NXT_PORT_MSG_PROCESS_CREATED), 1331488St.nateldemoura@f5.com NXT_PORT_MSG_PROCESS_READY = nxt_msg_last(_NXT_PORT_MSG_PROCESS_READY), 1341488St.nateldemoura@f5.com NXT_PORT_MSG_QUIT = nxt_msg_last(_NXT_PORT_MSG_QUIT), 1351488St.nateldemoura@f5.com NXT_PORT_MSG_REMOVE_PID = nxt_msg_last(_NXT_PORT_MSG_REMOVE_PID), 1361131Smax.romanov@nginx.com 1371488St.nateldemoura@f5.com NXT_PORT_MSG_REQ_HEADERS = _NXT_PORT_MSG_REQ_HEADERS, 1381555Smax.romanov@nginx.com NXT_PORT_MSG_REQ_BODY = _NXT_PORT_MSG_REQ_BODY, 1391488St.nateldemoura@f5.com NXT_PORT_MSG_WEBSOCKET = _NXT_PORT_MSG_WEBSOCKET, 1401488St.nateldemoura@f5.com NXT_PORT_MSG_WEBSOCKET_LAST = nxt_msg_last(_NXT_PORT_MSG_WEBSOCKET), 1411321Smax.romanov@nginx.com 1421488St.nateldemoura@f5.com NXT_PORT_MSG_DATA = _NXT_PORT_MSG_DATA, 1431488St.nateldemoura@f5.com NXT_PORT_MSG_DATA_LAST = nxt_msg_last(_NXT_PORT_MSG_DATA), 144*1926Smax.romanov@nginx.com NXT_PORT_MSG_APP_RESTART = nxt_msg_last(_NXT_PORT_MSG_APP_RESTART), 1451488St.nateldemoura@f5.com 1461488St.nateldemoura@f5.com NXT_PORT_MSG_OOSM = nxt_msg_last(_NXT_PORT_MSG_OOSM), 1471488St.nateldemoura@f5.com NXT_PORT_MSG_SHM_ACK = nxt_msg_last(_NXT_PORT_MSG_SHM_ACK), 1481555Smax.romanov@nginx.com NXT_PORT_MSG_READ_QUEUE = _NXT_PORT_MSG_READ_QUEUE, 1491555Smax.romanov@nginx.com NXT_PORT_MSG_READ_SOCKET = _NXT_PORT_MSG_READ_SOCKET, 150125Smax.romanov@nginx.com } nxt_port_msg_type_t; 15142Smax.romanov@nginx.com 15214Sigor@sysoev.ru 15342Smax.romanov@nginx.com /* Passed as a first iov chunk. */ 15442Smax.romanov@nginx.com typedef struct { 15542Smax.romanov@nginx.com uint32_t stream; 15642Smax.romanov@nginx.com nxt_pid_t pid; 15742Smax.romanov@nginx.com nxt_port_id_t reply_port; 15842Smax.romanov@nginx.com 159189Smax.romanov@nginx.com uint8_t type; 160423Smax.romanov@nginx.com 161423Smax.romanov@nginx.com /* Last message for this stream. */ 16242Smax.romanov@nginx.com uint8_t last; /* 1 bit */ 16342Smax.romanov@nginx.com 16442Smax.romanov@nginx.com /* Message data send using mmap, next chunk is a nxt_port_mmap_msg_t. */ 16542Smax.romanov@nginx.com uint8_t mmap; /* 1 bit */ 166352Smax.romanov@nginx.com 167423Smax.romanov@nginx.com /* Non-First fragment in fragmented message sequence. */ 168423Smax.romanov@nginx.com uint8_t nf; /* 1 bit */ 169423Smax.romanov@nginx.com 170423Smax.romanov@nginx.com /* More Fragments followed. */ 171423Smax.romanov@nginx.com uint8_t mf; /* 1 bit */ 172423Smax.romanov@nginx.com 173423Smax.romanov@nginx.com /* Message delivery tracking enabled, next chunk is tracking msg. */ 174423Smax.romanov@nginx.com uint8_t tracking; /* 1 bit */ 175168Svbart@nginx.com } nxt_port_msg_t; 17614Sigor@sysoev.ru 17714Sigor@sysoev.ru 17814Sigor@sysoev.ru typedef struct { 17914Sigor@sysoev.ru nxt_queue_link_t link; 18014Sigor@sysoev.ru nxt_buf_t *buf; 18114Sigor@sysoev.ru size_t share; 1821558Smax.romanov@nginx.com nxt_fd_t fd[2]; 18314Sigor@sysoev.ru nxt_port_msg_t port_msg; 184423Smax.romanov@nginx.com uint32_t tracking_msg[2]; 1851125Smax.romanov@nginx.com uint8_t close_fd; /* 1 bit */ 1861125Smax.romanov@nginx.com uint8_t allocated; /* 1 bit */ 18714Sigor@sysoev.ru } nxt_port_send_msg_t; 18814Sigor@sysoev.ru 18914Sigor@sysoev.ru 19020Sigor@sysoev.ru struct nxt_port_recv_msg_s { 1911558Smax.romanov@nginx.com nxt_fd_t fd[2]; 19214Sigor@sysoev.ru nxt_buf_t *buf; 19314Sigor@sysoev.ru nxt_port_t *port; 19442Smax.romanov@nginx.com nxt_port_msg_t port_msg; 19582Smax.romanov@nginx.com size_t size; 196423Smax.romanov@nginx.com nxt_bool_t cancelled; 197347Smax.romanov@nginx.com union { 198347Smax.romanov@nginx.com nxt_port_t *new_port; 199347Smax.romanov@nginx.com nxt_pid_t removed_pid; 200347Smax.romanov@nginx.com void *data; 201347Smax.romanov@nginx.com } u; 20220Sigor@sysoev.ru }; 20314Sigor@sysoev.ru 204141Smax.romanov@nginx.com typedef struct nxt_app_s nxt_app_t; 20514Sigor@sysoev.ru 20614Sigor@sysoev.ru struct nxt_port_s { 20714Sigor@sysoev.ru nxt_fd_event_t socket; 20814Sigor@sysoev.ru 209125Smax.romanov@nginx.com nxt_queue_link_t link; /* for nxt_process_t.ports */ 210141Smax.romanov@nginx.com nxt_process_t *process; 211141Smax.romanov@nginx.com 212141Smax.romanov@nginx.com nxt_queue_link_t app_link; /* for nxt_app_t.ports */ 213141Smax.romanov@nginx.com nxt_app_t *app; 2141547Smax.romanov@nginx.com nxt_port_t *main_app_port; 21542Smax.romanov@nginx.com 216507Smax.romanov@nginx.com nxt_queue_link_t idle_link; /* for nxt_app_t.idle_ports */ 217507Smax.romanov@nginx.com nxt_msec_t idle_start; 218507Smax.romanov@nginx.com 21914Sigor@sysoev.ru nxt_queue_t messages; /* of nxt_port_send_msg_t */ 220343Smax.romanov@nginx.com nxt_thread_mutex_t write_mutex; 22114Sigor@sysoev.ru 22214Sigor@sysoev.ru /* Maximum size of message part. */ 22314Sigor@sysoev.ru uint32_t max_size; 22414Sigor@sysoev.ru /* Maximum interleave of message parts. */ 22514Sigor@sysoev.ru uint32_t max_share; 226343Smax.romanov@nginx.com 227343Smax.romanov@nginx.com uint32_t app_responses; 22814Sigor@sysoev.ru 2291547Smax.romanov@nginx.com uint32_t active_websockets; 2301547Smax.romanov@nginx.com uint32_t active_requests; 2311131Smax.romanov@nginx.com 23214Sigor@sysoev.ru nxt_port_handler_t handler; 233141Smax.romanov@nginx.com nxt_port_handler_t *data; 23414Sigor@sysoev.ru 23565Sigor@sysoev.ru nxt_mp_t *mem_pool; 236141Smax.romanov@nginx.com nxt_event_engine_t *engine; 237141Smax.romanov@nginx.com 23814Sigor@sysoev.ru nxt_buf_t *free_bufs; 23914Sigor@sysoev.ru nxt_socket_t pair[2]; 24014Sigor@sysoev.ru 24142Smax.romanov@nginx.com nxt_port_id_t id; 24214Sigor@sysoev.ru nxt_pid_t pid; 24342Smax.romanov@nginx.com 244190Smax.romanov@nginx.com nxt_lvlhsh_t rpc_streams; /* stream to nxt_port_rpc_reg_t */ 245190Smax.romanov@nginx.com nxt_lvlhsh_t rpc_peers; /* peer to queue of nxt_port_rpc_reg_t */ 246190Smax.romanov@nginx.com 247352Smax.romanov@nginx.com nxt_lvlhsh_t frags; 248352Smax.romanov@nginx.com 249343Smax.romanov@nginx.com nxt_atomic_t use_count; 250343Smax.romanov@nginx.com 251141Smax.romanov@nginx.com nxt_process_type_t type; 2521555Smax.romanov@nginx.com 2531555Smax.romanov@nginx.com nxt_fd_t queue_fd; 2541555Smax.romanov@nginx.com void *queue; 2551555Smax.romanov@nginx.com 2561555Smax.romanov@nginx.com void *socket_msg; 2571555Smax.romanov@nginx.com int from_socket; 25814Sigor@sysoev.ru }; 25914Sigor@sysoev.ru 26014Sigor@sysoev.ru 26111Sigor@sysoev.ru typedef struct { 26242Smax.romanov@nginx.com nxt_port_id_t id; 26314Sigor@sysoev.ru nxt_pid_t pid; 26414Sigor@sysoev.ru size_t max_size; 26514Sigor@sysoev.ru size_t max_share; 26642Smax.romanov@nginx.com nxt_process_type_t type:8; 267168Svbart@nginx.com } nxt_port_msg_new_port_t; 26811Sigor@sysoev.ru 26911Sigor@sysoev.ru 2701545Smax.romanov@nginx.com typedef struct { 2711545Smax.romanov@nginx.com nxt_port_id_t id; 2721545Smax.romanov@nginx.com nxt_pid_t pid; 2731545Smax.romanov@nginx.com } nxt_port_msg_get_port_t; 2741545Smax.romanov@nginx.com 2751545Smax.romanov@nginx.com 2761546Smax.romanov@nginx.com typedef struct { 2771546Smax.romanov@nginx.com uint32_t id; 2781546Smax.romanov@nginx.com } nxt_port_msg_get_mmap_t; 2791546Smax.romanov@nginx.com 2801546Smax.romanov@nginx.com 28111Sigor@sysoev.ru /* 28214Sigor@sysoev.ru * nxt_port_data_t size is allocation size 28314Sigor@sysoev.ru * which enables effective reuse of memory pool cache. 28411Sigor@sysoev.ru */ 28511Sigor@sysoev.ru typedef union { 28611Sigor@sysoev.ru nxt_buf_t buf; 28714Sigor@sysoev.ru nxt_port_msg_new_port_t new_port; 28814Sigor@sysoev.ru } nxt_port_data_t; 28911Sigor@sysoev.ru 29011Sigor@sysoev.ru 291343Smax.romanov@nginx.com typedef void (*nxt_port_post_handler_t)(nxt_task_t *task, nxt_port_t *port, 292343Smax.romanov@nginx.com void *data); 293343Smax.romanov@nginx.com 294197Smax.romanov@nginx.com nxt_port_t *nxt_port_new(nxt_task_t *task, nxt_port_id_t id, nxt_pid_t pid, 295163Smax.romanov@nginx.com nxt_process_type_t type); 296163Smax.romanov@nginx.com 297141Smax.romanov@nginx.com nxt_port_id_t nxt_port_get_next_id(void); 298141Smax.romanov@nginx.com void nxt_port_reset_next_id(void); 299141Smax.romanov@nginx.com 30014Sigor@sysoev.ru nxt_int_t nxt_port_socket_init(nxt_task_t *task, nxt_port_t *port, 30114Sigor@sysoev.ru size_t max_size); 30214Sigor@sysoev.ru void nxt_port_destroy(nxt_port_t *port); 303343Smax.romanov@nginx.com void nxt_port_close(nxt_task_t *task, nxt_port_t *port); 30414Sigor@sysoev.ru void nxt_port_write_enable(nxt_task_t *task, nxt_port_t *port); 30514Sigor@sysoev.ru void nxt_port_write_close(nxt_port_t *port); 30614Sigor@sysoev.ru void nxt_port_read_enable(nxt_task_t *task, nxt_port_t *port); 30714Sigor@sysoev.ru void nxt_port_read_close(nxt_port_t *port); 3081555Smax.romanov@nginx.com nxt_int_t nxt_port_socket_write2(nxt_task_t *task, nxt_port_t *port, 3091555Smax.romanov@nginx.com nxt_uint_t type, nxt_fd_t fd, nxt_fd_t fd2, uint32_t stream, 3101555Smax.romanov@nginx.com nxt_port_id_t reply_port, nxt_buf_t *b); 311423Smax.romanov@nginx.com 312423Smax.romanov@nginx.com nxt_inline nxt_int_t 313423Smax.romanov@nginx.com nxt_port_socket_write(nxt_task_t *task, nxt_port_t *port, 314423Smax.romanov@nginx.com nxt_uint_t type, nxt_fd_t fd, uint32_t stream, nxt_port_id_t reply_port, 315423Smax.romanov@nginx.com nxt_buf_t *b) 316423Smax.romanov@nginx.com { 3171555Smax.romanov@nginx.com return nxt_port_socket_write2(task, port, type, fd, -1, stream, reply_port, 3181555Smax.romanov@nginx.com b); 319423Smax.romanov@nginx.com } 32014Sigor@sysoev.ru 321141Smax.romanov@nginx.com void nxt_port_enable(nxt_task_t *task, nxt_port_t *port, 3221302St.nateldemoura@f5.com const nxt_port_handlers_t *handlers); 32381Smax.romanov@nginx.com nxt_int_t nxt_port_send_port(nxt_task_t *task, nxt_port_t *port, 324141Smax.romanov@nginx.com nxt_port_t *new_port, uint32_t stream); 32520Sigor@sysoev.ru void nxt_port_change_log_file(nxt_task_t *task, nxt_runtime_t *rt, 32611Sigor@sysoev.ru nxt_uint_t slot, nxt_fd_t fd); 32711Sigor@sysoev.ru 32814Sigor@sysoev.ru void nxt_port_quit_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg); 32914Sigor@sysoev.ru void nxt_port_new_port_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg); 330320Smax.romanov@nginx.com void nxt_port_process_ready_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg); 33114Sigor@sysoev.ru void nxt_port_change_log_file_handler(nxt_task_t *task, 33211Sigor@sysoev.ru nxt_port_recv_msg_t *msg); 33342Smax.romanov@nginx.com void nxt_port_mmap_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg); 33414Sigor@sysoev.ru void nxt_port_data_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg); 335125Smax.romanov@nginx.com void nxt_port_remove_pid_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg); 33614Sigor@sysoev.ru void nxt_port_empty_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg); 33711Sigor@sysoev.ru 338343Smax.romanov@nginx.com nxt_int_t nxt_port_post(nxt_task_t *task, nxt_port_t *port, 339343Smax.romanov@nginx.com nxt_port_post_handler_t handler, void *data); 340343Smax.romanov@nginx.com void nxt_port_use(nxt_task_t *task, nxt_port_t *port, int i); 34111Sigor@sysoev.ru 342425Smax.romanov@nginx.com nxt_inline void nxt_port_inc_use(nxt_port_t *port) 343425Smax.romanov@nginx.com { 344425Smax.romanov@nginx.com nxt_atomic_fetch_add(&port->use_count, 1); 345425Smax.romanov@nginx.com } 346425Smax.romanov@nginx.com 34711Sigor@sysoev.ru #endif /* _NXT_PORT_H_INCLUDED_ */ 348