libwebsockets
Lightweight C library for HTML5 websockets
Toggle main menu visibility
class="ui-resizable-handle">
Loading...
Searching...
No Matches
lws-conmon.h
Go to the documentation of this file.
1
/*
2
* libwebsockets - small server side websockets and web server implementation
3
*
4
* Copyright (C) 2010 - 2021 Andy Green <andy@warmcat.com>
5
*
6
* Permission is hereby granted, free of charge, to any person obtaining a copy
7
* of this software and associated documentation files (the "Software"), to
8
* deal in the Software without restriction, including without limitation the
9
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10
* sell copies of the Software, and to permit persons to whom the Software is
11
* furnished to do so, subject to the following conditions:
12
*
13
* The above copyright notice and this permission notice shall be included in
14
* all copies or substantial portions of the Software.
15
*
16
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22
* IN THE SOFTWARE.
23
*/
24
33
34
/* enough for 4191s, or just over an hour */
35
typedef
uint32_t
lws_conmon_interval_us_t
;
36
37
/*
38
* Connection latency information... note that not all wsi actually make
39
* connections, for example h2 streams after the initial one will have 0
40
* for everything except ciu_txn_resp.
41
*
42
* If represented in JSON, it should look like this
43
*
44
* {
45
* "peer": "46.105.127.147",
46
* "dns_us": 1234,
47
* "dns_disp": 1,
48
* "sockconn_us": 1234,
49
* "tls_us": 1234,
50
* "txn_resp_us": 1234,
51
* "dns":["46.105.127.147", "2001:41d0:2:ee93::1"],
52
* "prot_specific": {
53
* "protocol": "http",
54
* "resp": 200
55
* }
56
* }
57
*
58
* The indexes in "dns_disp" are declared in lws_conmon_dns_disposition_t
59
* below.
60
*
61
* "prot_specific" may not be present if the protocol doesn't have anything
62
* to report or is not supported.
63
*/
64
65
typedef
enum
lws_conmon_pcol
{
66
LWSCONMON_PCOL_NONE
,
67
LWSCONMON_PCOL_HTTP
,
/* .protocol_specific.http is valid */
68
}
lws_conmon_pcol_t
;
69
70
typedef
enum
lws_conmon_dns_disposition
{
71
LWSCONMON_DNS_NONE
,
73
LWSCONMON_DNS_OK
= 1,
75
LWSCONMON_DNS_SERVER_UNREACHABLE
= 2,
77
LWSCONMON_DNS_NO_RESULT
= 3
79
}
lws_conmon_dns_disposition_t
;
80
81
struct
lws_conmon
{
82
lws_sockaddr46
peer46
;
85
86
union
{
87
struct
{
88
int
response
;
90
} http;
91
}
protocol_specific
;
92
96
97
struct
addrinfo *
dns_results_copy
;
101
102
lws_conmon_interval_us_t
ciu_dns
;
106
lws_conmon_interval_us_t
ciu_sockconn
;
109
lws_conmon_interval_us_t
ciu_tls
;
111
lws_conmon_interval_us_t
ciu_txn_resp
;
115
116
lws_conmon_pcol_t
pcol
;
119
120
lws_conmon_dns_disposition_t
dns_disposition
;
122
};
123
140
LWS_VISIBLE
LWS_EXTERN
void
141
lws_conmon_wsi_take
(
struct
lws *wsi,
struct
lws_conmon
*dest);
142
152
LWS_VISIBLE
LWS_EXTERN
void
153
lws_conmon_release
(
struct
lws_conmon
*conmon);
154
lws_conmon.protocol_specific.http::response
int response
lws_conmon_wsi_take
LWS_VISIBLE LWS_EXTERN void lws_conmon_wsi_take(struct lws *wsi, struct lws_conmon *dest)
lws_conmon_release
LWS_VISIBLE LWS_EXTERN void lws_conmon_release(struct lws_conmon *conmon)
lws_conmon_pcol_t
enum lws_conmon_pcol lws_conmon_pcol_t
lws_conmon_interval_us_t
uint32_t lws_conmon_interval_us_t
Definition
lws-conmon.h:35
lws_conmon_dns_disposition
lws_conmon_dns_disposition
Definition
lws-conmon.h:70
lws_conmon_dns_disposition_t
enum lws_conmon_dns_disposition lws_conmon_dns_disposition_t
lws_conmon_pcol
lws_conmon_pcol
Definition
lws-conmon.h:65
LWSCONMON_DNS_SERVER_UNREACHABLE
@ LWSCONMON_DNS_SERVER_UNREACHABLE
Definition
lws-conmon.h:75
LWSCONMON_DNS_NONE
@ LWSCONMON_DNS_NONE
Definition
lws-conmon.h:71
LWSCONMON_DNS_NO_RESULT
@ LWSCONMON_DNS_NO_RESULT
Definition
lws-conmon.h:77
LWSCONMON_DNS_OK
@ LWSCONMON_DNS_OK
Definition
lws-conmon.h:73
LWSCONMON_PCOL_HTTP
@ LWSCONMON_PCOL_HTTP
Definition
lws-conmon.h:67
LWSCONMON_PCOL_NONE
@ LWSCONMON_PCOL_NONE
Definition
lws-conmon.h:66
lws_sockaddr46
Definition
lws-adopt.h:87
uint32_t
unsigned int uint32_t
Definition
libwebsockets.h:695
LWS_EXTERN
#define LWS_EXTERN
Definition
libwebsockets.h:296
LWS_VISIBLE
#define LWS_VISIBLE
Definition
libwebsockets.h:291
lws_conmon
Definition
lws-conmon.h:81
lws_conmon::ciu_txn_resp
lws_conmon_interval_us_t ciu_txn_resp
Definition
lws-conmon.h:111
lws_conmon::ciu_tls
lws_conmon_interval_us_t ciu_tls
Definition
lws-conmon.h:109
lws_conmon::pcol
lws_conmon_pcol_t pcol
Definition
lws-conmon.h:116
lws_conmon::dns_disposition
lws_conmon_dns_disposition_t dns_disposition
Definition
lws-conmon.h:120
lws_conmon::ciu_sockconn
lws_conmon_interval_us_t ciu_sockconn
Definition
lws-conmon.h:106
lws_conmon::ciu_dns
lws_conmon_interval_us_t ciu_dns
Definition
lws-conmon.h:102
lws_conmon::protocol_specific
union lws_conmon::@233101302240205277004131031275146223103242250146 protocol_specific
lws_conmon::dns_results_copy
struct addrinfo * dns_results_copy
Definition
lws-conmon.h:97
lws_conmon::peer46
lws_sockaddr46 peer46
Definition
lws-conmon.h:82
include
libwebsockets
lws-conmon.h
Generated on
for libwebsockets by
1.18.0