7 This file is part of avahi.
9 avahi is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Lesser General Public License as
11 published by the Free Software Foundation; either version 2.1 of the
12 License, or (at your option) any later version.
14 avahi is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
17 Public License for more details.
19 You should have received a copy of the GNU Lesser General Public
20 License along with avahi; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 /** \file core.h The Avahi Multicast DNS and DNS Service Discovery implmentation. */
27 /** \example core-publish-service.c Example how to register a DNS-SD
28 * service using an embedded mDNS stack. It behaves like a network
29 * printer registering both an IPP and a BSD LPR service. */
31 /** \example core-browse-services.c Example how to browse for DNS-SD
32 * services using an embedded mDNS stack. */
34 #include <avahi-common/cdecl.h>
36 #ifndef DOXYGEN_SHOULD_SKIP_THIS
40 /** An mDNS responder object */
41 typedef struct AvahiServer AvahiServer;
43 /** A group of locally registered DNS RRs */
44 typedef struct AvahiSEntryGroup AvahiSEntryGroup;
46 #ifndef DOXYGEN_SHOULD_SKIP_THIS
50 #include <avahi-core/rr.h>
51 #include <avahi-common/address.h>
52 #include <avahi-common/defs.h>
53 #include <avahi-common/watch.h>
55 #ifndef DOXYGEN_SHOULD_SKIP_THIS
59 /** Flags for server entries */
61 AVAHI_ENTRY_NULL = 0, /**< No special flags */
62 AVAHI_ENTRY_UNIQUE = 1, /**< The RRset is intended to be unique */
63 AVAHI_ENTRY_NOPROBE = 2, /**< Though the RRset is intended to be unique no probes shall be sent */
64 AVAHI_ENTRY_NOANNOUNCE = 4, /**< Do not announce this RR to other hosts */
65 AVAHI_ENTRY_ALLOWMUTIPLE = 8 /**< Allow multiple local records of this type, even if they are intended to be unique */
68 /** Prototype for callback functions which are called whenever the state of an AvahiServer object changes */
69 typedef void (*AvahiServerCallback) (AvahiServer *s, AvahiServerState state, void* userdata);
71 /** Prototype for callback functions which are called whenever the state of an AvahiSEntryGroup object changes */
72 typedef void (*AvahiSEntryGroupCallback) (AvahiServer *s, AvahiSEntryGroup *g, AvahiEntryGroupState state, void* userdata);
74 /** Stores configuration options for a server instance */
75 typedef struct AvahiServerConfig {
76 char *host_name; /**< Default host name. If left empty defaults to the result of gethostname(2) of the libc */
77 char *domain_name; /**< Default domain name. If left empty defaults to .local */
78 int use_ipv4; /**< Enable IPv4 support */
79 int use_ipv6; /**< Enable IPv6 support */
80 int publish_hinfo; /**< Register a HINFO record for the host containing the local OS and CPU type */
81 int publish_addresses; /**< Register A, AAAA and PTR records for all local IP addresses */
82 int publish_workstation; /**< Register a _workstation._tcp service */
83 int publish_domain; /**< Announce the local domain for browsing */
84 int check_response_ttl; /**< If enabled the server ignores all incoming responses with IP TTL != 255. Newer versions of the RFC do no longer contain this check, so it is disabled by default. */
85 int use_iff_running; /**< Require IFF_RUNNING on local network interfaces. This is the official way to check for link beat. Unfortunately this doesn't work with all drivers. So bettere leave this off. */
86 int enable_reflector; /**< Reflect incoming mDNS traffic to all local networks. This allows mDNS based network browsing beyond ethernet borders */
87 int reflect_ipv; /**< if enable_reflector is 1, enable/disable reflecting between IPv4 and IPv6 */
88 int add_service_cookie; /**< Add magic service cookie to all locally generated records implicitly */
91 /** Allocate a new mDNS responder object. */
92 AvahiServer *avahi_server_new(
93 const AvahiPoll *api, /**< The main loop adapter */
94 const AvahiServerConfig *sc, /**< If non-NULL a pointer to a configuration structure for the server. The server makes an internal deep copy of this structure, so you may free it using avahi_server_config_done() immediately after calling this function. */
95 AvahiServerCallback callback, /**< A callback which is called whenever the state of the server changes */
96 void* userdata, /**< An opaque pointer which is passed to the callback function */
99 /** Free an mDNS responder object */
100 void avahi_server_free(AvahiServer* s);
102 /** Fill in default values for a server configuration structure. If you
103 * make use of an AvahiServerConfig structure be sure to initialize
104 * it with this function for the sake of upwards library
105 * compatibility. This call may allocate strings on the heap. To
106 * release this memory make sure to call
107 * avahi_server_config_done(). If you want to replace any strings in
108 * the structure be sure to free the strings filled in by this
109 * function with avahi_free() first and allocate the replacements with
110 * g_malloc() (or g_strdup()).*/
111 AvahiServerConfig* avahi_server_config_init(
112 AvahiServerConfig *c /**< A structure which shall be filled in */ );
114 /** Make a deep copy of the configuration structure *c to *ret. */
115 AvahiServerConfig* avahi_server_config_copy(
116 AvahiServerConfig *ret /**< destination */,
117 const AvahiServerConfig *c /**< source */);
119 /** Free the data in a server configuration structure. */
120 void avahi_server_config_free(AvahiServerConfig *c);
122 /** Return the currently chosen domain name of the server object. The
123 * return value points to an internally allocated string. Be sure to
124 * make a copy of the string before calling any other library
126 const char* avahi_server_get_domain_name(AvahiServer *s);
128 /** Return the currently chosen host name. The return value points to a internally allocated string. */
129 const char* avahi_server_get_host_name(AvahiServer *s);
131 /** Return the currently chosen host name as a FQDN ("fully qualified
132 * domain name", i.e. the concatenation of the host and domain
133 * name). The return value points to a internally allocated string. */
134 const char* avahi_server_get_host_name_fqdn(AvahiServer *s);
136 /** Change the host name of a running mDNS responder. This will drop
137 all automicatilly generated RRs and readd them with the new
138 name. Since the responder has to probe for the new RRs this function
139 takes some time to take effect altough it returns immediately. This
140 function is intended to be called when a host name conflict is
141 reported using AvahiServerCallback. The caller should readd all user
142 defined RRs too since they otherwise continue to point to the outdated
144 int avahi_server_set_host_name(AvahiServer *s, const char *host_name);
146 /** Change the domain name of a running mDNS responder. The same rules
147 * as with avahi_server_set_host_name() apply. */
148 int avahi_server_set_domain_name(AvahiServer *s, const char *domain_name);
150 /** Return the opaque user data pointer attached to a server object */
151 void* avahi_server_get_data(AvahiServer *s);
153 /** Change the opaque user data pointer attached to a server object */
154 void avahi_server_set_data(AvahiServer *s, void* userdata);
156 /** Return the current state of the server object */
157 AvahiServerState avahi_server_get_state(AvahiServer *s);
159 /** Iterate through all local entries of the server. (when g is NULL)
160 * or of a specified entry group. At the first call state should point
161 * to a NULL initialized void pointer, That pointer is used to track
162 * the current iteration. It is not safe to call any other
163 * avahi_server_xxx() function during the iteration. If the last entry
164 * has been read, NULL is returned. */
165 const AvahiRecord *avahi_server_iterate(AvahiServer *s, AvahiSEntryGroup *g, void **state);
167 /** Callback prototype for avahi_server_dump() */
168 typedef void (*AvahiDumpCallback)(const char *text, void* userdata);
170 /** Dump the current server status by calling "callback" for each line. */
171 int avahi_server_dump(AvahiServer *s, AvahiDumpCallback callback, void* userdata);
173 /** Create a new entry group. The specified callback function is
174 * called whenever the state of the group changes. Use entry group
175 * objects to keep track of you RRs. Add new RRs to a group using
176 * avahi_server_add_xxx(). Make sure to call avahi_s_entry_group_commit()
177 * to start the registration process for your RRs */
178 AvahiSEntryGroup *avahi_s_entry_group_new(AvahiServer *s, AvahiSEntryGroupCallback callback, void* userdata);
180 /** Free an entry group. All RRs assigned to the group are removed from the server */
181 void avahi_s_entry_group_free(AvahiSEntryGroup *g);
183 /** Commit an entry group. This starts the probing and registration process for all RRs in the group */
184 int avahi_s_entry_group_commit(AvahiSEntryGroup *g);
186 /** Remove all entries from the entry group and reset the state to AVAHI_ENTRY_GROUP_UNCOMMITED. */
187 void avahi_s_entry_group_reset(AvahiSEntryGroup *g);
189 /** Return 1 if the entry group is empty, i.e. has no records attached. */
190 int avahi_s_entry_group_is_empty(AvahiSEntryGroup *g);
192 /** Return the current state of the specified entry group */
193 AvahiEntryGroupState avahi_s_entry_group_get_state(AvahiSEntryGroup *g);
195 /** Change the opaque user data pointer attached to an entry group object */
196 void avahi_s_entry_group_set_data(AvahiSEntryGroup *g, void* userdata);
198 /** Return the opaque user data pointer currently set for the entry group object */
199 void* avahi_s_entry_group_get_data(AvahiSEntryGroup *g);
201 /** Add a new resource record to the server. Returns 0 on success, negative otherwise. */
202 int avahi_server_add(
203 AvahiServer *s, /**< The server object to add this record to */
204 AvahiSEntryGroup *g, /**< An entry group object if this new record shall be attached to one, or NULL. If you plan to remove the record sometime later you a required to pass an entry group object here. */
205 AvahiIfIndex interface, /**< A numeric index of a network interface to attach this record to, or AVAHI_IF_UNSPEC to attach this record to all interfaces */
206 AvahiProtocol protocol, /**< A protocol family to attach this record to. One of the AVAHI_PROTO_xxx constants. Use AVAHI_PROTO_UNSPEC to make this record available on all protocols (wich means on both IPv4 and IPv6). */
207 AvahiEntryFlags flags, /**< Special flags for this record */
208 AvahiRecord *r /**< The record to add. This function increases the reference counter of this object. */ );
210 /** Add a PTR RR to the server. See avahi_server_add() for more information. */
211 int avahi_server_add_ptr(
214 AvahiIfIndex interface,
215 AvahiProtocol protocol,
216 AvahiEntryFlags flags,
217 uint32_t ttl, /**< DNS TTL for this record */
218 const char *name, /**< PTR record name */
219 const char *dest /**< pointer destination */ );
221 /** Add a PTR RR to the server. See avahi_server_add() for more information. */
222 int avahi_server_add_txt(
225 AvahiIfIndex interface,
226 AvahiProtocol protocol,
227 AvahiEntryFlags flags,
228 uint32_t ttl, /**< DNS TTL for this record */
229 const char *name, /**< TXT record name */
230 ... /**< Text record data, terminated by NULL */) AVAHI_GCC_SENTINEL;
232 /** Add a PTR RR to the server. Mostly identical to
233 * avahi_server_add_text but takes a va_list instead of a variable
234 * number of arguments */
235 int avahi_server_add_txt_va(
238 AvahiIfIndex interface,
239 AvahiProtocol protocol,
240 AvahiEntryFlags flags,
245 /** Add a PTR RR to the server. Mostly identical to
246 * avahi_server_add_text but takes an AvahiStringList record instead of a variable
247 * number of arguments. */
248 int avahi_server_add_txt_strlst(
251 AvahiIfIndex interface,
252 AvahiProtocol protocol,
253 AvahiEntryFlags flags,
256 AvahiStringList *strlst /**< TXT decord data as a AvahiString. This routine makes a deep copy of this object. */ );
258 /** Add an IP address mapping to the server. This will add both the
259 * host-name-to-address and the reverse mapping to the server. See
260 * avahi_server_add() for more information. If adding one of the RRs
261 * fails, the function returns with an error, but it is not defined if
262 * the other RR is deleted from the server or not. Therefore, you have
263 * to free the AvahiSEntryGroup and create a new one before
265 int avahi_server_add_address(
268 AvahiIfIndex interface,
269 AvahiProtocol protocol,
270 AvahiEntryFlags flags,
274 /** Add an DNS-SD service to the Server. This will add all required
275 * RRs to the server. See avahi_server_add() for more information. If
276 * adding one of the RRs fails, the function returns with an error,
277 * but it is not defined if the other RR is deleted from the server or
278 * not. Therefore, you have to free the AvahiSEntryGroup and create a
279 * new one before proceeding. */
280 int avahi_server_add_service(
283 AvahiIfIndex interface,
284 AvahiProtocol protocol,
285 const char *name, /**< Service name, e.g. "Lennart's Files" */
286 const char *type, /**< DNS-SD type, e.g. "_http._tcp" */
288 const char *host, /**< Host name where this servcie resides, or NULL if on the local host */
289 uint16_t port, /**< Port number of the service */
290 ... /**< Text records, terminated by NULL */) AVAHI_GCC_SENTINEL;
292 /** Mostly identical to avahi_server_add_service(), but takes an va_list for the TXT records. */
293 int avahi_server_add_service_va(
296 AvahiIfIndex interface,
297 AvahiProtocol protocol,
305 /** Mostly identical to avahi_server_add_service(), but takes an AvahiStringList object for the TXT records. The AvahiStringList object is copied. */
306 int avahi_server_add_service_strlst(
309 AvahiIfIndex interface,
310 AvahiProtocol protocol,
316 AvahiStringList *strlst);
318 /** The type of DNS server */
320 AVAHI_DNS_SERVER_RESOLVE, /**< Unicast DNS servers for normal resolves (_domain._udp)*/
321 AVAHI_DNS_SERVER_UPDATE /**< Unicast DNS servers for updates (_dns-update._udp)*/
322 } AvahiDNSServerType;
324 /** Publish the specified unicast DNS server address via mDNS. You may
325 * browse for records create this way wit
326 * avahi_s_dns_server_browser_new(). */
327 int avahi_server_add_dns_server_address(
330 AvahiIfIndex interface,
331 AvahiProtocol protocol,
333 AvahiDNSServerType type,
334 const AvahiAddress *address,
335 uint16_t port /** should be 53 */);
337 /** Similar to avahi_server_add_dns_server_address(), but specify a
338 host name instead of an address. The specified host name should be
339 resolvable via mDNS */
340 int avahi_server_add_dns_server_name(
343 AvahiIfIndex interface,
344 AvahiProtocol protocol,
346 AvahiDNSServerType type,
348 uint16_t port /** should be 53 */);
350 /** A browsing object for arbitrary RRs */
351 typedef struct AvahiSRecordBrowser AvahiSRecordBrowser;
353 /** Callback prototype for AvahiSRecordBrowser events */
354 typedef void (*AvahiSRecordBrowserCallback)(
355 AvahiSRecordBrowser *b, /**< The AvahiSRecordBrowser object that is emitting this callback */
356 AvahiIfIndex interface, /**< Logical OS network interface number the record was found on */
357 AvahiProtocol protocol, /**< Protocol number the record was found. */
358 AvahiBrowserEvent event, /**< Browsing event, either AVAHI_BROWSER_NEW or AVAHI_BROWSER_REMOVE */
359 AvahiRecord *record, /**< The record that was found */
360 void* userdata /**< Arbitrary user data passed to avahi_s_record_browser_new() */ );
362 /** Create a new browsing object for arbitrary RRs */
363 AvahiSRecordBrowser *avahi_s_record_browser_new(
364 AvahiServer *server, /**< The server object to which attach this query */
365 AvahiIfIndex interface, /**< Logical OS interface number where to look for the records, or AVAHI_IF_UNSPEC to look on interfaces */
366 AvahiProtocol protocol, /**< Protocol number to use when looking for the record, or AVAHI_PROTO_UNSPEC to look on all protocols */
367 AvahiKey *key, /**< The search key */
368 AvahiSRecordBrowserCallback callback, /**< The callback to call on browsing events */
369 void* userdata /**< Arbitrary use suppliable data which is passed to the callback */);
371 /** Free an AvahiSRecordBrowser object */
372 void avahi_s_record_browser_free(AvahiSRecordBrowser *b);
374 /** A host name to IP adddress resolver object */
375 typedef struct AvahiSHostNameResolver AvahiSHostNameResolver;
377 /** Callback prototype for AvahiSHostNameResolver events */
378 typedef void (*AvahiSHostNameResolverCallback)(
379 AvahiSHostNameResolver *r,
380 AvahiIfIndex interface,
381 AvahiProtocol protocol,
382 AvahiResolverEvent event, /**< Resolving event */
383 const char *host_name, /**< Host name which should be resolved. May differ in case from the query */
384 const AvahiAddress *a, /**< The address, or NULL if the host name couldn't be resolved. */
387 /** Create an AvahiSHostNameResolver object for resolving a host name to an adddress. See AvahiSRecordBrowser for more info on the paramters. */
388 AvahiSHostNameResolver *avahi_s_host_name_resolver_new(
390 AvahiIfIndex interface,
391 AvahiProtocol protocol,
392 const char *host_name, /**< The host name to look for */
393 AvahiProtocol aprotocol, /**< The address family of the desired address or AVAHI_PROTO_UNSPEC if doesn't matter. */
394 AvahiSHostNameResolverCallback calback,
397 /** Free a AvahiSHostNameResolver object */
398 void avahi_s_host_name_resolver_free(AvahiSHostNameResolver *r);
400 /** An IP address to host name resolver object ("reverse lookup") */
401 typedef struct AvahiSAddressResolver AvahiSAddressResolver;
403 /** Callback prototype for AvahiSAddressResolver events */
404 typedef void (*AvahiSAddressResolverCallback)(
405 AvahiSAddressResolver *r,
406 AvahiIfIndex interface,
407 AvahiProtocol protocol,
408 AvahiResolverEvent event,
409 const AvahiAddress *a,
410 const char *host_name, /**< A host name for the specified address, if one was found, i.e. event == AVAHI_RESOLVER_FOUND */
413 /** Create an AvahiSAddressResolver object. See AvahiSRecordBrowser for more info on the paramters. */
414 AvahiSAddressResolver *avahi_s_address_resolver_new(
416 AvahiIfIndex interface,
417 AvahiProtocol protocol,
418 const AvahiAddress *address,
419 AvahiSAddressResolverCallback calback,
422 /** Free an AvahiSAddressResolver object */
423 void avahi_s_address_resolver_free(AvahiSAddressResolver *r);
425 /** A local domain browsing object. May be used to enumerate domains used on the local LAN */
426 typedef struct AvahiSDomainBrowser AvahiSDomainBrowser;
428 /** Callback prototype for AvahiSDomainBrowser events */
429 typedef void (*AvahiSDomainBrowserCallback)(
430 AvahiSDomainBrowser *b,
431 AvahiIfIndex interface,
432 AvahiProtocol protocol,
433 AvahiBrowserEvent event,
437 /** Create a new AvahiSDomainBrowser object */
438 AvahiSDomainBrowser *avahi_s_domain_browser_new(
440 AvahiIfIndex interface,
441 AvahiProtocol protocol,
443 AvahiDomainBrowserType type,
444 AvahiSDomainBrowserCallback callback,
447 /** Free an AvahiSDomainBrowser object */
448 void avahi_s_domain_browser_free(AvahiSDomainBrowser *b);
450 /** A DNS-SD service type browsing object. May be used to enumerate the service types of all available services on the local LAN */
451 typedef struct AvahiSServiceTypeBrowser AvahiSServiceTypeBrowser;
453 /** Callback prototype for AvahiSServiceTypeBrowser events */
454 typedef void (*AvahiSServiceTypeBrowserCallback)(
455 AvahiSServiceTypeBrowser *b,
456 AvahiIfIndex interface,
457 AvahiProtocol protocol,
458 AvahiBrowserEvent event,
463 /** Create a new AvahiSServiceTypeBrowser object. */
464 AvahiSServiceTypeBrowser *avahi_s_service_type_browser_new(
466 AvahiIfIndex interface,
467 AvahiProtocol protocol,
469 AvahiSServiceTypeBrowserCallback callback,
472 /** Free an AvahiSServiceTypeBrowser object */
473 void avahi_s_service_type_browser_free(AvahiSServiceTypeBrowser *b);
475 /** A DNS-SD service browser. Use this to enumerate available services of a certain kind on the local LAN. Use AvahiSServiceResolver to get specific service data like address and port for a service. */
476 typedef struct AvahiSServiceBrowser AvahiSServiceBrowser;
478 /** Callback prototype for AvahiSServiceBrowser events */
479 typedef void (*AvahiSServiceBrowserCallback)(
480 AvahiSServiceBrowser *b,
481 AvahiIfIndex interface,
482 AvahiProtocol protocol,
483 AvahiBrowserEvent event,
484 const char *name /**< Service name, e.g. "Lennart's Files" */,
485 const char *type /**< DNS-SD type, e.g. "_http._tcp" */,
486 const char *domain /**< Domain of this service, e.g. "local" */,
489 /** Create a new AvahiSServiceBrowser object. */
490 AvahiSServiceBrowser *avahi_s_service_browser_new(
492 AvahiIfIndex interface,
493 AvahiProtocol protocol,
494 const char *service_type /** DNS-SD service type, e.g. "_http._tcp" */,
496 AvahiSServiceBrowserCallback callback,
499 /** Free an AvahiSServiceBrowser object */
500 void avahi_s_service_browser_free(AvahiSServiceBrowser *b);
502 /** A DNS-SD service resolver. Use this to retrieve addres, port and TXT data for a DNS-SD service */
503 typedef struct AvahiSServiceResolver AvahiSServiceResolver;
505 /** Callback prototype for AvahiSServiceResolver events */
506 typedef void (*AvahiSServiceResolverCallback)(
507 AvahiSServiceResolver *r,
508 AvahiIfIndex interface,
509 AvahiProtocol protocol,
510 AvahiResolverEvent event, /**< Is AVAHI_RESOLVER_FOUND when the service was resolved successfully, and everytime it changes. Is AVAHI_RESOLVER_TIMOUT when the service failed to resolve or disappeared. */
511 const char *name, /**< Service name */
512 const char *type, /**< Service Type */
514 const char *host_name, /**< Host name of the service */
515 const AvahiAddress *a, /**< The resolved host name */
516 uint16_t port, /**< Service name */
517 AvahiStringList *txt, /**< TXT record data */
520 /** Create a new AvahiSServiceResolver object. The specified callback function will be called with the resolved service data. */
521 AvahiSServiceResolver *avahi_s_service_resolver_new(
523 AvahiIfIndex interface,
524 AvahiProtocol protocol,
528 AvahiProtocol aprotocol, /**< Address family of the desired service address. Use AVAHI_PROTO_UNSPEC if you don't care */
529 AvahiSServiceResolverCallback calback,
532 /** Free an AvahiSServiceResolver object */
533 void avahi_s_service_resolver_free(AvahiSServiceResolver *r);
535 /** A domain service browser object. Use this to browse for
536 * conventional unicast DNS servers which may be used to resolve
537 * conventional domain names */
538 typedef struct AvahiSDNSServerBrowser AvahiSDNSServerBrowser;
540 /** Callback prototype for AvahiSDNSServerBrowser events */
541 typedef void (*AvahiSDNSServerBrowserCallback)(
542 AvahiSDNSServerBrowser *b,
543 AvahiIfIndex interface,
544 AvahiProtocol protocol,
545 AvahiBrowserEvent event,
546 const char *host_name, /**< Host name of the DNS server, probably useless */
547 const AvahiAddress *a, /**< Address of the DNS server */
548 uint16_t port, /**< Port number of the DNS servers, probably 53 */
551 /** Create a new AvahiSDNSServerBrowser object */
552 AvahiSDNSServerBrowser *avahi_s_dns_server_browser_new(
554 AvahiIfIndex interface,
555 AvahiProtocol protocol,
557 AvahiDNSServerType type,
558 AvahiProtocol aprotocol, /**< Address protocol for the DNS server */
559 AvahiSDNSServerBrowserCallback callback,
562 /** Free an AvahiSDNSServerBrowser object */
563 void avahi_s_dns_server_browser_free(AvahiSDNSServerBrowser *b);
565 /** Return the last error code */
566 int avahi_server_errno(AvahiServer *s);
568 /** Return the local service cookie */
569 uint32_t avahi_server_get_local_service_cookie(AvahiServer *s);
571 /** Return 1 if there is a local service with the specified credentials registeresd. Return 0 if not, negative on failure */
572 int avahi_server_is_service_local(AvahiServer *s, AvahiIfIndex, AvahiProtocol protocol, const char *name, const char *type, const char*domain);
574 #ifndef DOXYGEN_SHOULD_SKIP_THIS