xref: /aosp_15_r20/external/libwebsockets/lib/system/smd/README.md (revision 1c60b9aca93fdbc9b5f19b2d2194c91294b22281)
1*1c60b9acSAndroid Build Coastguard Worker# LWS System Message Distribution
2*1c60b9acSAndroid Build Coastguard Worker
3*1c60b9acSAndroid Build Coastguard Worker## Overview
4*1c60b9acSAndroid Build Coastguard Worker
5*1c60b9acSAndroid Build Coastguard WorkerIndependent pieces of a system may need to become aware of events and state
6*1c60b9acSAndroid Build Coastguard Workerchanges in the other pieces quickly, along with the new state if it is small.
7*1c60b9acSAndroid Build Coastguard WorkerThese messages are local to inside a system, although they may be triggered by
8*1c60b9acSAndroid Build Coastguard Workerevents outside of it.  Examples include keypresses, or networking state changes.
9*1c60b9acSAndroid Build Coastguard WorkerIndividual OSes and frameworks typically have their own fragmented apis for
10*1c60b9acSAndroid Build Coastguard Workermessage-passing, but the lws apis operate the same across any platforms
11*1c60b9acSAndroid Build Coastguard Workerincluding, eg, Windows and RTOS and allow crossplatform code to be written once.
12*1c60b9acSAndroid Build Coastguard Worker
13*1c60b9acSAndroid Build Coastguard WorkerMessage payloads are short, less than 384 bytes, below system limits for atomic
14*1c60b9acSAndroid Build Coastguard Workerpipe or UDS datagrams and consistent with heap usage on smaller systems, but
15*1c60b9acSAndroid Build Coastguard Workerlarge enough to carry JSON usefully.  Messages are typically low duty cycle.
16*1c60b9acSAndroid Build Coastguard Worker
17*1c60b9acSAndroid Build Coastguard Worker![SMD message](/doc-assets/smd-message.png)
18*1c60b9acSAndroid Build Coastguard Worker
19*1c60b9acSAndroid Build Coastguard WorkerMessages may be sent by any registered participant, they are allocated on heap
20*1c60b9acSAndroid Build Coastguard Workerin a linked-list, and delivered to all other registered participants for that
21*1c60b9acSAndroid Build Coastguard Workermessage class no sooner than next time around the event loop.  This retains the
22*1c60b9acSAndroid Build Coastguard Workerability to handle multiple event queuing in one event loop trip while
23*1c60b9acSAndroid Build Coastguard Workerguaranteeing message handling is nonrecursive and so with modest stack usage.
24*1c60b9acSAndroid Build Coastguard WorkerMessages are passed to all other registered participants before being destroyed.
25*1c60b9acSAndroid Build Coastguard Worker
26*1c60b9acSAndroid Build Coastguard WorkerMessages are delivered to all particpants on the same lws_context by default.
27*1c60b9acSAndroid Build Coastguard Worker
28*1c60b9acSAndroid Build Coastguard Worker![SMD message](/doc-assets/smd-single-process.png)
29*1c60b9acSAndroid Build Coastguard Worker
30*1c60b9acSAndroid Build Coastguard Worker`lws_smd` apis allow publication and subscription of message objects between
31*1c60b9acSAndroid Build Coastguard Workerparticipants that are in a single process and are informed by callback from lws
32*1c60b9acSAndroid Build Coastguard Workerservice thread context.
33*1c60b9acSAndroid Build Coastguard Worker
34*1c60b9acSAndroid Build Coastguard WorkerSMD messages can also broadcast between particpants in different lws_contexts in
35*1c60b9acSAndroid Build Coastguard Workerdifferent processes, using existing Secure Streams proxying.  In this way
36*1c60b9acSAndroid Build Coastguard Workerdifferent application processes can intercommunicate and all observe any system
37*1c60b9acSAndroid Build Coastguard Workersmd messages they are interested in.
38*1c60b9acSAndroid Build Coastguard Worker
39*1c60b9acSAndroid Build Coastguard Worker![SMD message](/doc-assets/smd-proxy.png)
40*1c60b9acSAndroid Build Coastguard Worker
41*1c60b9acSAndroid Build Coastguard WorkerRegistering as a participant and sending messages are threadsafe APIs.
42*1c60b9acSAndroid Build Coastguard Worker
43*1c60b9acSAndroid Build Coastguard Worker## Message Class
44*1c60b9acSAndroid Build Coastguard Worker
45*1c60b9acSAndroid Build Coastguard WorkerMessage class is a bitfield messages use to indicate their general type, eg,
46*1c60b9acSAndroid Build Coastguard Workernetwork status, or UI event like a keypress.  Participants set a bitmask to
47*1c60b9acSAndroid Build Coastguard Workerfilter what kind of messages they care about, classes that are 0 in the peer's
48*1c60b9acSAndroid Build Coastguard Workerfilter are never delivered to the peer.   A message usually indicates it is a
49*1c60b9acSAndroid Build Coastguard Workersingle class, but it's possible to set multiple class bits and match on any.  If
50*1c60b9acSAndroid Build Coastguard Workerso, care must be taken the payload can be parsed by readers expecting any of the
51*1c60b9acSAndroid Build Coastguard Workerindicated classes, eg, by using JSON.
52*1c60b9acSAndroid Build Coastguard Worker
53*1c60b9acSAndroid Build Coastguard Worker`lws_smd` tracks a global union mask for all participants' class mask.  Requests
54*1c60b9acSAndroid Build Coastguard Workerto allocate a message of a class that no participant listens for are rejected,
55*1c60b9acSAndroid Build Coastguard Workernot at distribution-time but at message allocation-time, so no heap or cpu is
56*1c60b9acSAndroid Build Coastguard Workerwasted on things that are not currently interesting; but such messages start to
57*1c60b9acSAndroid Build Coastguard Workerappear as soon as a participant appears that wants them.  The message generation
58*1c60b9acSAndroid Build Coastguard Workeraction should be bypassed without error in the case lws_smd_msg_alloc()
59*1c60b9acSAndroid Build Coastguard Workerreturns NULL.
60*1c60b9acSAndroid Build Coastguard Worker
61*1c60b9acSAndroid Build Coastguard WorkerVarious well-known high level classes are defined but also a bit index
62*1c60b9acSAndroid Build Coastguard Worker`LWSSMDCL_USER_BASE_BITNUM`, which can be used by user code to define up to 8
63*1c60b9acSAndroid Build Coastguard Workerprivate classes, with class bit values `(1 << LWSSMDCL_USER_BASE_BITNUM)` thru
64*1c60b9acSAndroid Build Coastguard Worker`(1 << (LWSSMDCL_USER_BASE_BITNUM + 7))`
65*1c60b9acSAndroid Build Coastguard Worker
66*1c60b9acSAndroid Build Coastguard Worker## Messaging guarantees
67*1c60b9acSAndroid Build Coastguard Worker
68*1c60b9acSAndroid Build Coastguard WorkerSent messages are delivered to all registered participants whose class mask
69*1c60b9acSAndroid Build Coastguard Workerindicates they want it, including the sender.  The send apis are threadsafe.
70*1c60b9acSAndroid Build Coastguard Worker
71*1c60b9acSAndroid Build Coastguard WorkerLocally-delivered message delivery callbacks occur from lws event loop thread
72*1c60b9acSAndroid Build Coastguard Workercontext 0 (the only one in the default case `LWS_MAX_SMP` = 1).  Clients in
73*1c60b9acSAndroid Build Coastguard Workerdifferent processes receive callbacks from the thread context of their UDS
74*1c60b9acSAndroid Build Coastguard Workernetworking thread.
75*1c60b9acSAndroid Build Coastguard Worker
76*1c60b9acSAndroid Build Coastguard WorkerThe message payload may be destroyed immediately when you return from the
77*1c60b9acSAndroid Build Coastguard Workercallback, you can't store references to it or expect it to be there later.
78*1c60b9acSAndroid Build Coastguard Worker
79*1c60b9acSAndroid Build Coastguard WorkerMessages are timestamped with a systemwide monotonic timestamp.  When
80*1c60b9acSAndroid Build Coastguard Workerparticipants are on the lws event loop, messages are delivered in-order.  When
81*1c60b9acSAndroid Build Coastguard Workerparticipants are on different threads, delivery order depends on platform lock
82*1c60b9acSAndroid Build Coastguard Workeracquisition.  External process participants are connected by the Unix Domain
83*1c60b9acSAndroid Build Coastguard WorkerSocket capability of Secure Streams, and may be delivered out-of-order;
84*1c60b9acSAndroid Build Coastguard Workerreceivers that care must consult the message creation timestamps.
85*1c60b9acSAndroid Build Coastguard Worker
86*1c60b9acSAndroid Build Coastguard Worker## Message Refcounting
87*1c60b9acSAndroid Build Coastguard Worker
88*1c60b9acSAndroid Build Coastguard WorkerTo avoid keeping a list of the length of the number of participants for each
89*1c60b9acSAndroid Build Coastguard Workermessage, a refcount is used in the message, computed at the time the message
90*1c60b9acSAndroid Build Coastguard Workerarrived considering the number of active participants that indicated a desire to
91*1c60b9acSAndroid Build Coastguard Workerreceive messages of that class.
92*1c60b9acSAndroid Build Coastguard Worker
93*1c60b9acSAndroid Build Coastguard WorkerSince peers may detach / close their link asynchronously, the logical peer
94*1c60b9acSAndroid Build Coastguard Workerobjects at the distributor defer destroying themselves until there is no more
95*1c60b9acSAndroid Build Coastguard Workerpossibility of messages arriving timestamped with the period they were active.
96*1c60b9acSAndroid Build Coastguard WorkerA grace period (default 2s) is used to ensure departing peers correctly account
97*1c60b9acSAndroid Build Coastguard Workerfor message refcounts before being destroyed.
98*1c60b9acSAndroid Build Coastguard Worker
99*1c60b9acSAndroid Build Coastguard Worker## Message creation
100*1c60b9acSAndroid Build Coastguard Worker
101*1c60b9acSAndroid Build Coastguard WorkerMessages may contain arbitrary text or binary data depending on the class.  JSON
102*1c60b9acSAndroid Build Coastguard Workeris recommended since lws_smd messages are small and low duty cycle but have
103*1c60b9acSAndroid Build Coastguard Workeropen-ended content: JSON is maintainable, extensible, debuggable and self-
104*1c60b9acSAndroid Build Coastguard Workerdocumenting and avoids, eg, fragile dependencies on header versions shared
105*1c60b9acSAndroid Build Coastguard Workerbetween teams.  To simplify issuing JSON, a threadsafe api to create and send
106*1c60b9acSAndroid Build Coastguard Workermessages in one step using format strings is provided:
107*1c60b9acSAndroid Build Coastguard Worker
108*1c60b9acSAndroid Build Coastguard Worker```
109*1c60b9acSAndroid Build Coastguard Workerint
110*1c60b9acSAndroid Build Coastguard Workerlws_smd_msg_printf(struct lws_context *ctx, lws_smd_class_t _class,
111*1c60b9acSAndroid Build Coastguard Worker		   const char *format, ...);
112*1c60b9acSAndroid Build Coastguard Worker```
113*1c60b9acSAndroid Build Coastguard Worker
114*1c60b9acSAndroid Build Coastguard Worker## Secure Streams `lws_smd` streamtype
115*1c60b9acSAndroid Build Coastguard Worker
116*1c60b9acSAndroid Build Coastguard WorkerWhen built with LWS_WITH_SECURE_STREAMS, lws_smd exposes a built-in streamtype
117*1c60b9acSAndroid Build Coastguard Worker`_lws_smd` which user Secure Streams may use to interoperate with lws_smd using
118*1c60b9acSAndroid Build Coastguard WorkerSS payload semantics.
119*1c60b9acSAndroid Build Coastguard Worker
120*1c60b9acSAndroid Build Coastguard WorkerWhen using `_lws_smd`, the SS info struct member `manual_initial_tx_credit`
121*1c60b9acSAndroid Build Coastguard Workerprovided by the user when creating the Secure Stream is overloaded to be used as
122*1c60b9acSAndroid Build Coastguard Workerthe RX class mask for the SMD connection associated with the Secure Stream.
123*1c60b9acSAndroid Build Coastguard Worker
124*1c60b9acSAndroid Build Coastguard WorkerBoth RX and TX payloads have a 16-byte binary header before the actual payload.
125*1c60b9acSAndroid Build Coastguard WorkerFor TX, although the header is 16-bytes, only the first 64-bit class bitfield
126*1c60b9acSAndroid Build Coastguard Workerneeds setting, the timestamp is fetched and added by lws.
127*1c60b9acSAndroid Build Coastguard Worker
128*1c60b9acSAndroid Build Coastguard Worker - MSB-first 64-bit class bitfield (currently only 32 least-sig in use)
129*1c60b9acSAndroid Build Coastguard Worker - MSB-First Order 64-bit us-resolution timestamp
130*1c60b9acSAndroid Build Coastguard Worker
131*1c60b9acSAndroid Build Coastguard WorkerA helper `lws_smd_ss_msg_printf()` is provided to format and create and smd
132*1c60b9acSAndroid Build Coastguard Workermessage from the SS tx() callback in one step, using the same api layout as
133*1c60b9acSAndroid Build Coastguard Workerfor direct messages via `lws_smd_msg_printf()`
134*1c60b9acSAndroid Build Coastguard Worker
135*1c60b9acSAndroid Build Coastguard Worker```
136*1c60b9acSAndroid Build Coastguard Workerint
137*1c60b9acSAndroid Build Coastguard Workerlws_smd_ss_msg_printf(const char *tag, uint8_t *buf, size_t *len,
138*1c60b9acSAndroid Build Coastguard Worker		      lws_smd_class_t _class, const char *format, ...);
139*1c60b9acSAndroid Build Coastguard Worker```
140*1c60b9acSAndroid Build Coastguard Worker
141*1c60b9acSAndroid Build Coastguard Worker## Well-known message schema
142*1c60b9acSAndroid Build Coastguard Worker
143*1c60b9acSAndroid Build Coastguard WorkerClass|Schema
144*1c60b9acSAndroid Build Coastguard Worker---|---
145*1c60b9acSAndroid Build Coastguard WorkerLWSSMDCL_INTERACTION|lws_button events
146*1c60b9acSAndroid Build Coastguard WorkerLWSSMDCL_NETWORK|captive portal detection requests and results
147*1c60b9acSAndroid Build Coastguard WorkerLWSSMDCL_SYSTEM_STATE|lws_system state progression
148*1c60b9acSAndroid Build Coastguard Worker
149*1c60b9acSAndroid Build Coastguard Worker### User interaction Button events
150*1c60b9acSAndroid Build Coastguard Worker
151*1c60b9acSAndroid Build Coastguard WorkerClass: `LWSSMDCL_INTERACTION`
152*1c60b9acSAndroid Build Coastguard Worker
153*1c60b9acSAndroid Build Coastguard WorkerProduced by lws_button when a user interacts with a defined button.
154*1c60b9acSAndroid Build Coastguard Worker
155*1c60b9acSAndroid Build Coastguard WorkerClick-related events are produced alongside up and down related events, the
156*1c60b9acSAndroid Build Coastguard Workerparticipant can choose which to attend to according to the meaning of the
157*1c60b9acSAndroid Build Coastguard Workerinteraction.
158*1c60b9acSAndroid Build Coastguard Worker
159*1c60b9acSAndroid Build Coastguard WorkerBoth kinds of event go through sophisticated filtering before being issued, see
160*1c60b9acSAndroid Build Coastguard Worker`./lib/drivers/button/README.md` for details.
161*1c60b9acSAndroid Build Coastguard Worker
162*1c60b9acSAndroid Build Coastguard Worker#### SMD Button interaction event
163*1c60b9acSAndroid Build Coastguard Worker
164*1c60b9acSAndroid Build Coastguard WorkerSchema:
165*1c60b9acSAndroid Build Coastguard Worker```
166*1c60b9acSAndroid Build Coastguard Worker{
167*1c60b9acSAndroid Build Coastguard Worker	"type":  "button",
168*1c60b9acSAndroid Build Coastguard Worker	"src":   "<controller-name>/<button-name>",
169*1c60b9acSAndroid Build Coastguard Worker	"event": "<event-name>"
170*1c60b9acSAndroid Build Coastguard Worker}
171*1c60b9acSAndroid Build Coastguard Worker```
172*1c60b9acSAndroid Build Coastguard Worker
173*1c60b9acSAndroid Build Coastguard WorkerFor example, `{"type":"button","src":"bc/user","event":"doubleclick"}`
174*1c60b9acSAndroid Build Coastguard Worker
175*1c60b9acSAndroid Build Coastguard WorkerEvent name|Meaning
176*1c60b9acSAndroid Build Coastguard Worker---|---
177*1c60b9acSAndroid Build Coastguard Workerdown|The button passes a filter for being down, useful for duration-based response
178*1c60b9acSAndroid Build Coastguard Workerup|The button has come up, useful for duration-based response
179*1c60b9acSAndroid Build Coastguard Workerclick|The button activity resulted in a classification as a single-click
180*1c60b9acSAndroid Build Coastguard Workerlongclick|The button activity resulted in a classification as a long-click
181*1c60b9acSAndroid Build Coastguard Workerdoubleclick|The button activity resulted in a classification as a double-click
182*1c60b9acSAndroid Build Coastguard Worker
183*1c60b9acSAndroid Build Coastguard Worker### Routing Table Change
184*1c60b9acSAndroid Build Coastguard Worker
185*1c60b9acSAndroid Build Coastguard WorkerClass: `LWSSMDCL_NETWORK`
186*1c60b9acSAndroid Build Coastguard Worker
187*1c60b9acSAndroid Build Coastguard WorkerIf able to subscribe to OS routing table changes (eg, by rtnetlink on Linux
188*1c60b9acSAndroid Build Coastguard Workerwhich is supported), lws announces there have been changes using SMD.
189*1c60b9acSAndroid Build Coastguard Worker
190*1c60b9acSAndroid Build Coastguard WorkerIf Captive Portal Detect is enabled, and routing tables changes can be seen,
191*1c60b9acSAndroid Build Coastguard Workerthen a new CPD is requested automatically and the results will be seen over SMD
192*1c60b9acSAndroid Build Coastguard Workerwhen that completes.
193*1c60b9acSAndroid Build Coastguard Worker
194*1c60b9acSAndroid Build Coastguard WorkerSchema:
195*1c60b9acSAndroid Build Coastguard Worker
196*1c60b9acSAndroid Build Coastguard Worker```
197*1c60b9acSAndroid Build Coastguard Worker	{
198*1c60b9acSAndroid Build Coastguard Worker	  "rt":      "add|del",   "add" if being added
199*1c60b9acSAndroid Build Coastguard Worker	}
200*1c60b9acSAndroid Build Coastguard Worker```
201*1c60b9acSAndroid Build Coastguard Worker
202*1c60b9acSAndroid Build Coastguard WorkerWhen the context / pts are created, if linux then lws attempts to get the
203*1c60b9acSAndroid Build Coastguard Workerrouting table sent, which requires root.  This is done before the permissions
204*1c60b9acSAndroid Build Coastguard Workerare dropped after protocols init.
205*1c60b9acSAndroid Build Coastguard Worker
206*1c60b9acSAndroid Build Coastguard WorkerLws maintains a cache of the routing table in each pt.  Upon changes, existing
207*1c60b9acSAndroid Build Coastguard Workerconnections are reassessed to see if their peer can still be routed to, if not
208*1c60b9acSAndroid Build Coastguard Workerthe connection is closed.
209*1c60b9acSAndroid Build Coastguard Worker
210*1c60b9acSAndroid Build Coastguard WorkerIf a gateway route changes, `{"trigger":"cpdcheck","src":"gw-change"}` is
211*1c60b9acSAndroid Build Coastguard Workerissued on SMD as well.
212*1c60b9acSAndroid Build Coastguard Worker
213*1c60b9acSAndroid Build Coastguard Worker### Captive Portal Detection
214*1c60b9acSAndroid Build Coastguard Worker
215*1c60b9acSAndroid Build Coastguard WorkerClass: `LWSSMDCL_NETWORK`
216*1c60b9acSAndroid Build Coastguard Worker
217*1c60b9acSAndroid Build Coastguard WorkerActively detects if the network can reach the internet or if it is
218*1c60b9acSAndroid Build Coastguard Workerintercepted by a captive portal.  The detection steps are programmable
219*1c60b9acSAndroid Build Coastguard Workervia the Secure Streams Policy for a streamtype `captive_portal_detect`, eg
220*1c60b9acSAndroid Build Coastguard Worker
221*1c60b9acSAndroid Build Coastguard Worker```
222*1c60b9acSAndroid Build Coastguard Worker	"captive_portal_detect": {
223*1c60b9acSAndroid Build Coastguard Worker		"endpoint":		"connectivitycheck.android.com",
224*1c60b9acSAndroid Build Coastguard Worker		"http_url":		"generate_204",
225*1c60b9acSAndroid Build Coastguard Worker		"port":			80,
226*1c60b9acSAndroid Build Coastguard Worker		"protocol":		"h1",
227*1c60b9acSAndroid Build Coastguard Worker		"http_method":		"GET",
228*1c60b9acSAndroid Build Coastguard Worker		"opportunistic":	true,
229*1c60b9acSAndroid Build Coastguard Worker		"http_expect":		204,
230*1c60b9acSAndroid Build Coastguard Worker		"http_fail_redirect":	true
231*1c60b9acSAndroid Build Coastguard Worker	}
232*1c60b9acSAndroid Build Coastguard Worker```
233*1c60b9acSAndroid Build Coastguard Worker
234*1c60b9acSAndroid Build Coastguard Worker#### SMD Report Result
235*1c60b9acSAndroid Build Coastguard Worker
236*1c60b9acSAndroid Build Coastguard WorkerSchema: `{"type": "cpd", "result":"<result>"}`
237*1c60b9acSAndroid Build Coastguard Worker
238*1c60b9acSAndroid Build Coastguard Workerresult|meaning
239*1c60b9acSAndroid Build Coastguard Worker---|---
240*1c60b9acSAndroid Build Coastguard WorkerOK|Internet is reachable
241*1c60b9acSAndroid Build Coastguard WorkerCaptive|Internet is behind a captive portal
242*1c60b9acSAndroid Build Coastguard WorkerNo internet|There is no connectivity
243*1c60b9acSAndroid Build Coastguard Worker
244*1c60b9acSAndroid Build Coastguard Worker#### SMD Request re-detection
245*1c60b9acSAndroid Build Coastguard Worker
246*1c60b9acSAndroid Build Coastguard WorkerSchema: `{"trigger": "cpdcheck"}`
247*1c60b9acSAndroid Build Coastguard Worker
248*1c60b9acSAndroid Build Coastguard Worker### lws_system state progression
249*1c60b9acSAndroid Build Coastguard Worker
250*1c60b9acSAndroid Build Coastguard WorkerClass: `LWSSMDCL_SYSTEM_STATE`
251*1c60b9acSAndroid Build Coastguard Worker
252*1c60b9acSAndroid Build Coastguard WorkerLws system state changes are forwarded to lws_smd messages so participants not
253*1c60b9acSAndroid Build Coastguard Workeron the lws event loop directly can be aware of progress.  Code registering a
254*1c60b9acSAndroid Build Coastguard Workerlws_system notifier callback, on the main lws loop, can synchronously veto state
255*1c60b9acSAndroid Build Coastguard Workerchanges and hook proposed state changes, lws_smd events are asynchronous
256*1c60b9acSAndroid Build Coastguard Workernotifications of state changes after they were decided only... however they are
257*1c60b9acSAndroid Build Coastguard Workeravailable over the whole system.
258*1c60b9acSAndroid Build Coastguard Worker
259*1c60b9acSAndroid Build Coastguard WorkerIt's not possible to make validated TLS connections until the system has
260*1c60b9acSAndroid Build Coastguard Workeracquired the date as well as acquired an IP on a non-captive portal connection,
261*1c60b9acSAndroid Build Coastguard Workerfor that reason user code will usually be dependent on the system reaching
262*1c60b9acSAndroid Build Coastguard Worker"OPERATIONAL" state if lws is responsible for managing the boot process.
263*1c60b9acSAndroid Build Coastguard Worker
264*1c60b9acSAndroid Build Coastguard Worker#### System state event
265*1c60b9acSAndroid Build Coastguard Worker
266*1c60b9acSAndroid Build Coastguard WorkerSchema: `{"state":"<state>"}"`
267*1c60b9acSAndroid Build Coastguard Worker
268*1c60b9acSAndroid Build Coastguard WorkerState|Meaning
269*1c60b9acSAndroid Build Coastguard Worker---|---
270*1c60b9acSAndroid Build Coastguard WorkerCONTEXT_CREATED|We're creating the lws_context
271*1c60b9acSAndroid Build Coastguard WorkerINITIALIZED|Initial vhosts and protocols initialized
272*1c60b9acSAndroid Build Coastguard WorkerIFACE_COLDPLUG|Network interfaces discovered
273*1c60b9acSAndroid Build Coastguard WorkerDHCP|DHCP acquired
274*1c60b9acSAndroid Build Coastguard WorkerCPD_PRE_TIME|Captive portal detect hook before we have system time
275*1c60b9acSAndroid Build Coastguard WorkerTIME_VALID|Ntpclient has run
276*1c60b9acSAndroid Build Coastguard WorkerCPD_POST_TIME|Captive portal detect hook after system time (tls-based check)
277*1c60b9acSAndroid Build Coastguard WorkerPOLICY_VALID|The system policy has been acquired and parsed
278*1c60b9acSAndroid Build Coastguard WorkerREGISTERED|This device is registered with an authority
279*1c60b9acSAndroid Build Coastguard WorkerAUTH1|We acquired auth1 from the authority using our registration info
280*1c60b9acSAndroid Build Coastguard WorkerAUTH2|We acquired auth2 from the authority using our registration info
281*1c60b9acSAndroid Build Coastguard WorkerOPERATIONAL|We are active and able to make authenticated tls connections
282*1c60b9acSAndroid Build Coastguard WorkerPOLICY_INVALID|The policy is being changed
283