Mercurial > hg > nginx-quic
annotate src/core/ngx_inet.h @ 2384:ad3164baf636
bump version
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 09 Dec 2008 11:13:12 +0000 |
parents | 8e5bf1bc87e2 |
children | 2e91aecb9e57 |
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 | |
2197
74477ea8074f
*) remove zero termination in ngx_inet_ntop() and ngx_sock_ntop()
Igor Sysoev <igor@sysoev.ru>
parents:
1671
diff
changeset
|
15 #define NGX_INET_ADDRSTRLEN (sizeof("255.255.255.255") - 1) |
74477ea8074f
*) remove zero termination in ngx_inet_ntop() and ngx_sock_ntop()
Igor Sysoev <igor@sysoev.ru>
parents:
1671
diff
changeset
|
16 |
74477ea8074f
*) remove zero termination in ngx_inet_ntop() and ngx_sock_ntop()
Igor Sysoev <igor@sysoev.ru>
parents:
1671
diff
changeset
|
17 |
340
0bf903191ceb
nginx-0.0.3-2004-05-25-19:28:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
291
diff
changeset
|
18 typedef struct { |
884 | 19 in_addr_t addr; |
20 in_addr_t mask; | |
340
0bf903191ceb
nginx-0.0.3-2004-05-25-19:28:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
291
diff
changeset
|
21 } 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
|
22 |
0bf903191ceb
nginx-0.0.3-2004-05-25-19:28:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
291
diff
changeset
|
23 |
804
472cd9768ac2
now the "listen" directives use ngx_parse_url()
Igor Sysoev <igor@sysoev.ru>
parents:
663
diff
changeset
|
24 typedef union { |
884 | 25 in_addr_t in_addr; |
804
472cd9768ac2
now the "listen" directives use ngx_parse_url()
Igor Sysoev <igor@sysoev.ru>
parents:
663
diff
changeset
|
26 } ngx_url_addr_t; |
651 | 27 |
28 | |
804
472cd9768ac2
now the "listen" directives use ngx_parse_url()
Igor Sysoev <igor@sysoev.ru>
parents:
663
diff
changeset
|
29 typedef struct { |
884 | 30 struct sockaddr *sockaddr; |
31 socklen_t socklen; | |
32 ngx_str_t name; | |
33 } ngx_peer_addr_t; | |
804
472cd9768ac2
now the "listen" directives use ngx_parse_url()
Igor Sysoev <igor@sysoev.ru>
parents:
663
diff
changeset
|
34 |
651 | 35 |
884 | 36 typedef struct { |
37 ngx_str_t url; | |
38 ngx_str_t host; | |
1671
8075179cae21
ngx_parse_url() saves port text, this allows to use it in proxy host header
Igor Sysoev <igor@sysoev.ru>
parents:
1647
diff
changeset
|
39 ngx_str_t port_text; |
884 | 40 ngx_str_t uri; |
804
472cd9768ac2
now the "listen" directives use ngx_parse_url()
Igor Sysoev <igor@sysoev.ru>
parents:
663
diff
changeset
|
41 |
906 | 42 in_port_t port; |
43 in_port_t default_port; | |
2203
8e5bf1bc87e2
*) refactor ngx_parse_inet_url()
Igor Sysoev <igor@sysoev.ru>
parents:
2198
diff
changeset
|
44 int family; |
651 | 45 |
884 | 46 unsigned listen:1; |
47 unsigned uri_part:1; | |
48 unsigned no_resolve:1; | |
49 unsigned one_addr:1; | |
651 | 50 |
884 | 51 unsigned no_port:1; |
52 | |
53 ngx_url_addr_t addr; | |
651 | 54 |
884 | 55 ngx_peer_addr_t *addrs; |
56 ngx_uint_t naddrs; | |
804
472cd9768ac2
now the "listen" directives use ngx_parse_url()
Igor Sysoev <igor@sysoev.ru>
parents:
663
diff
changeset
|
57 |
884 | 58 char *err; |
651 | 59 } ngx_url_t; |
60 | |
61 | |
1647 | 62 in_addr_t ngx_inet_addr(u_char *text, size_t len); |
2198
5975975eedc0
ngx_sock_ntop() takes family from sockaddr, remove duplicate field
Igor Sysoev <igor@sysoev.ru>
parents:
2197
diff
changeset
|
63 size_t ngx_sock_ntop(struct sockaddr *sa, u_char *text, 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
|
64 size_t ngx_inet_ntop(int family, void *addr, u_char *text, size_t len); |
340
0bf903191ceb
nginx-0.0.3-2004-05-25-19:28:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
291
diff
changeset
|
65 ngx_int_t ngx_ptocidr(ngx_str_t *text, void *cidr); |
1559
fe11e2a3946d
use pool instead of ngx_conf_t
Igor Sysoev <igor@sysoev.ru>
parents:
906
diff
changeset
|
66 ngx_int_t ngx_parse_url(ngx_pool_t *pool, ngx_url_t *u); |
fe11e2a3946d
use pool instead of ngx_conf_t
Igor Sysoev <igor@sysoev.ru>
parents:
906
diff
changeset
|
67 ngx_int_t ngx_inet_resolve_host(ngx_pool_t *pool, ngx_url_t *u); |
884 | 68 |
479 | 69 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
70 |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
71 #endif /* _NGX_INET_H_INCLUDED_ */ |