[avahi] The purpose and usage of the TXT field

Lennart Poettering lennart at poettering.net
Tue Aug 19 05:10:53 PDT 2008


On Tue, 19.08.08 10:49, Nathan Huesken (avahi at lonely-star.org) wrote:

> Hi, The avahi_entry_group_add_service last 3 parameters are, I
> guess, for the "TXT information". I can not find any documentation 
> for them and so I wonder:

Uh? avahi_entry_group_add_service() is a variadic function. It takes
an arbitrary number of arguments. Speaking of the "last 3" doesn't
really make sense:

http://avahi.org/download/doxygen/publish_8h.html#cb05a7d3d23a3b825ca77cb1c7d00ce4

The list needs to be terminated with a NULL sentinel.

> a) How to use them? Why are there 3? What does every single one of
> them?

There are as many as you wish but at most 255 (if I remember
correctly). The order is not relevant.

> b) What is the idea of TXT field and what should it be used for?

You can attach any information to a service you want. For printers
this might be paper size as one example, or whether it's a color/bw
printer and so on.

See chapter 6 of the DNS-SD spec:

http://files.dns-sd.org/draft-cheshire-dnsext-dns-sd.txt

Stuart's list of service types also lists a few TXT fields that are
known for each type:

http://www.dns-sd.org/ServiceTypes.html

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net         ICQ# 11060553
http://0pointer.net/lennart/           GnuPG 0x1A015CC4


More information about the avahi mailing list