xref: /unit/src/nxt_upstream.h (revision 0:a63ceefd6ab0)
1 
2 /*
3  * Copyright (C) Igor Sysoev
4  * Copyright (C) NGINX, Inc.
5  */
6 
7 #ifndef _NXT_UPSTREAM_H_INCLUDED_
8 #define _NXT_UPSTREAM_H_INCLUDED_
9 
10 
11 typedef struct nxt_upstream_peer_s    nxt_upstream_peer_t;
12 
13 
14 struct nxt_upstream_peer_s {
15     /* STUB */
16     void            *upstream;
17     void            *data;
18     /**/
19 
20     nxt_sockaddr_t  *sockaddr;
21     nxt_nsec_t      delay;
22 
23     uint32_t        tries;
24     in_port_t       port;
25 
26     nxt_str_t       addr;
27     nxt_mem_pool_t  *mem_pool;
28     void            (*ready_handler)(nxt_upstream_peer_t *up);
29 
30     void            (*protocol_handler)(nxt_upstream_source_t *us);
31 };
32 
33 
34 typedef struct {
35     void                        (*ready_handler)(void *data);
36     nxt_work_handler_t          completion_handler;
37     nxt_work_handler_t          error_handler;
38 } nxt_upstream_state_t;
39 
40 
41 /* STUB */
42 NXT_EXPORT void nxt_upstream_round_robin_peer(nxt_upstream_peer_t *up);
43 /**/
44 
45 
46 #endif /* _NXT_UPSTREAM_H_INCLUDED_ */
47