forked from laocai/tcp-nginx-module
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathngx_tcp_export_data.h
46 lines (37 loc) · 1.2 KB
/
ngx_tcp_export_data.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef _NGX_TCP_EXPORT_DATA_H_
#define _NGX_TCP_EXPORT_DATA_H_
#include <ngx_tcp_export_type.h>
/* sizeof(struct sockaddr_un) less than 255 */
#define MAX_UNIX_URL_LEN 255
typedef struct {
u_char len;
u_char unix_url[MAX_UNIX_URL_LEN];
} unix_listening_info_t;
typedef void *socketfd_info_tag;
typedef struct {
/* Work process unix-listening info index.
* The index value is from ngx_process_slot.
*/
ngx_tcp_int_t listening_unix_info_i;
pid_t pid;
socketfd_info_tag tag;
} socketfd_info_t;
/* All the address is in shared memory. */
typedef struct {
/* Array of socketfd_info_t. Array index is socketfd. */
socketfd_info_t *socketfd_info;
/* Array of unix listening info. */
unix_listening_info_t *listening_unix_info;
} socketfd_shm_info_t;
struct ngx_tcp_process_info_s {
pid_t pid;
ngx_tcp_int_t process_slot;
ngx_tcp_int_t worker_processes;
};
typedef struct ngx_tcp_process_info_s ngx_tcp_process_info_t;
typedef struct {
ngx_tcp_process_info_t *process_info;
volatile uintptr_t *current_msec;
socketfd_shm_info_t *socketfd_shm_info;
} ngx_tcp_export_data_t;
#endif