Mercurial > hg > nginx-quic
annotate src/core/ngx_inet.h @ 775:a452a0e13539
check nginx.pm version
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 12 Oct 2006 19:55:15 +0000 |
parents | 6d5c1535bb9d |
children | 472cd9768ac2 |
rev | line source |
---|---|
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
340
diff
changeset
|
1 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
340
diff
changeset
|
2 /* |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
441
diff
changeset
|
3 * Copyright (C) Igor Sysoev |
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
340
diff
changeset
|
4 */ |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
340
diff
changeset
|
5 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
340
diff
changeset
|
6 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
7 #ifndef _NGX_INET_H_INCLUDED_ |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
8 #define _NGX_INET_H_INCLUDED_ |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
9 |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
10 |
479 | 11 #include <ngx_config.h> |
12 #include <ngx_core.h> | |
13 | |
14 | |
651 | 15 #define NGX_PARSE_URL_INET 1 |
16 #define NGX_PARSE_URL_UNIX 2 | |
17 | |
18 | |
340
0bf903191ceb
nginx-0.0.3-2004-05-25-19:28:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
291
diff
changeset
|
19 typedef struct { |
0bf903191ceb
nginx-0.0.3-2004-05-25-19:28:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
291
diff
changeset
|
20 in_addr_t addr; |
0bf903191ceb
nginx-0.0.3-2004-05-25-19:28:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
291
diff
changeset
|
21 in_addr_t mask; |
0bf903191ceb
nginx-0.0.3-2004-05-25-19:28:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
291
diff
changeset
|
22 } ngx_inet_cidr_t; |
0bf903191ceb
nginx-0.0.3-2004-05-25-19:28:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
291
diff
changeset
|
23 |
0bf903191ceb
nginx-0.0.3-2004-05-25-19:28:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
291
diff
changeset
|
24 |
479 | 25 typedef struct { |
651 | 26 struct sockaddr *sockaddr; |
27 socklen_t socklen; | |
28 | |
29 ngx_str_t name; | |
30 char *uri_separator; | |
31 | |
663 | 32 ngx_uint_t current_weight; |
651 | 33 ngx_uint_t weight; |
34 | |
35 ngx_uint_t fails; | |
36 time_t accessed; | |
37 | |
38 ngx_uint_t max_fails; | |
39 time_t fail_timeout; | |
40 | |
41 #if (NGX_SSL) | |
42 ngx_ssl_session_t *ssl_session; | |
43 #endif | |
44 } ngx_peer_t; | |
45 | |
46 | |
47 struct ngx_peers_s { | |
48 ngx_uint_t current; | |
49 | |
50 ngx_uint_t number; | |
51 ngx_uint_t last_cached; | |
52 | |
53 /* ngx_mutex_t *mutex; */ | |
54 ngx_connection_t **cached; | |
55 | |
56 ngx_peer_t peer[1]; | |
57 }; | |
58 | |
59 | |
60 typedef struct { | |
61 ngx_int_t type; | |
62 | |
63 ngx_peers_t *peers; | |
64 | |
65 ngx_str_t url; | |
66 ngx_str_t host; | |
67 ngx_str_t host_header; | |
68 ngx_str_t port; | |
69 ngx_str_t uri; | |
70 | |
71 in_port_t portn; | |
72 in_port_t default_portn; | |
73 | |
74 unsigned listen:1; | |
75 unsigned uri_part:1; | |
76 unsigned upstream:1; | |
77 | |
78 unsigned default_port:1; | |
79 unsigned wildcard:1; | |
80 | |
81 char *err; | |
82 } ngx_url_t; | |
83 | |
84 | |
85 typedef struct { | |
479 | 86 ngx_str_t name; /* "schema:host:port/uri" */ |
87 ngx_str_t url; /* "host:port/uri" */ | |
88 ngx_str_t host; | |
89 ngx_str_t uri; | |
90 ngx_str_t host_header; /* "host:port" */ | |
91 ngx_str_t port_text; /* "port" */ | |
92 | |
93 in_port_t port; | |
94 | |
95 in_port_t default_port_value; | |
96 | |
97 unsigned default_port:1; | |
98 unsigned wildcard:1; | |
99 | |
100 unsigned uri_part:1; | |
101 unsigned port_only:1; | |
102 } ngx_inet_upstream_t; | |
103 | |
104 | |
105 size_t ngx_sock_ntop(int family, struct sockaddr *sa, u_char *text, | |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
57
diff
changeset
|
106 size_t len); |
291
117ccc7c4055
nginx-0.0.3-2004-03-16-16:35:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
290
diff
changeset
|
107 size_t ngx_inet_ntop(int family, void *addr, u_char *text, size_t len); |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
108 |
340
0bf903191ceb
nginx-0.0.3-2004-05-25-19:28:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
291
diff
changeset
|
109 ngx_int_t ngx_ptocidr(ngx_str_t *text, void *cidr); |
0bf903191ceb
nginx-0.0.3-2004-05-25-19:28:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
291
diff
changeset
|
110 |
479 | 111 ngx_peers_t *ngx_inet_upstream_parse(ngx_conf_t *cf, ngx_inet_upstream_t *u); |
651 | 112 ngx_peers_t *ngx_inet_resolve_peer(ngx_conf_t *cf, ngx_str_t *name, |
113 in_port_t port); | |
479 | 114 char *ngx_inet_parse_host_port(ngx_inet_upstream_t *u); |
651 | 115 ngx_int_t ngx_parse_url(ngx_conf_t *cf, ngx_url_t *u); |
479 | 116 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
117 |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
118 #endif /* _NGX_INET_H_INCLUDED_ */ |