nxt_sockaddr.h (99:f7ff1263f690) nxt_sockaddr.h (110:b367ad00650d)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#ifndef _NXT_SOCKADDR_H_INCLUDED_
8#define _NXT_SOCKADDR_H_INCLUDED_

--- 24 unchanged lines hidden (view full) ---

33 /*
34 * Textual address representation, e.g: "127.0.0.1", "::1",
35 * and "unix:/path/to/socket".
36 */
37 uint8_t address_start;
38 uint8_t address_length;
39 /*
40 * Textual port representation, e.g. "8000".
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#ifndef _NXT_SOCKADDR_H_INCLUDED_
8#define _NXT_SOCKADDR_H_INCLUDED_

--- 24 unchanged lines hidden (view full) ---

33 /*
34 * Textual address representation, e.g: "127.0.0.1", "::1",
35 * and "unix:/path/to/socket".
36 */
37 uint8_t address_start;
38 uint8_t address_length;
39 /*
40 * Textual port representation, e.g. "8000".
41 * Port length is length - port_start.
41 * Port length is (start + length) - port_start.
42 */
43 uint8_t port_start;
44 /*
45 * Size of the whole structure: struct sockaddr union and maximal textual
46 * representation, used to place sockaddr into appropriate free list.
47 */
48 uint8_t sockaddr_size;
49

--- 51 unchanged lines hidden (view full) ---

101
102#define NXT_INET6_ADDR_STR_LEN \
103 (sizeof("[ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff]:65535") - 1)
104
105
106#define nxt_sockaddr_start(sa) nxt_pointer_to(sa, (sa)->start)
107#define nxt_sockaddr_address(sa) nxt_pointer_to(sa, (sa)->address_start)
108#define nxt_sockaddr_port(sa) nxt_pointer_to(sa, (sa)->port_start)
42 */
43 uint8_t port_start;
44 /*
45 * Size of the whole structure: struct sockaddr union and maximal textual
46 * representation, used to place sockaddr into appropriate free list.
47 */
48 uint8_t sockaddr_size;
49

--- 51 unchanged lines hidden (view full) ---

101
102#define NXT_INET6_ADDR_STR_LEN \
103 (sizeof("[ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff]:65535") - 1)
104
105
106#define nxt_sockaddr_start(sa) nxt_pointer_to(sa, (sa)->start)
107#define nxt_sockaddr_address(sa) nxt_pointer_to(sa, (sa)->address_start)
108#define nxt_sockaddr_port(sa) nxt_pointer_to(sa, (sa)->port_start)
109#define nxt_sockaddr_length(sa) ((sa)->length - (sa)->port_start)
109#define nxt_sockaddr_port_length(sa) \
110 (((sa)->start + (sa)->length) - (sa)->port_start)
110
111
112#endif /* _NXT_SOCKADDR_H_INCLUDED_ */
111
112
113#endif /* _NXT_SOCKADDR_H_INCLUDED_ */