1 diff -Nurd avahi-0.1.orig/avahi-daemon/static-services.c avahi-0.1/avahi-daemon/static-services.c
2 --- avahi-0.1.orig/avahi-daemon/static-services.c 2005-08-21 23:27:09 +0200
3 +++ avahi-0.1/avahi-daemon/static-services.c 2005-08-28 00:34:50 +0200
13 u->group->replace_wildcards = strcmp(attr[1], "yes") == 0;
24 } else if (u->current_tag == XML_TAG_SERVICE_GROUP && strcmp(el, "service") == 0) {
27 + u->current_tag = XML_TAG_SERVICE;
30 u->service = static_service_new(u->group);
32 - u->current_tag = XML_TAG_SERVICE;
34 + if (strcmp(attr[0], "protocol") == 0) {
35 + AvahiProtocol protocol;
37 + if (strcmp(attr[1], "ipv4") == 0) {
38 + protocol = AVAHI_PROTO_INET;
39 + } else if (strcmp(attr[1], "ipv6") == 0) {
40 + protocol = AVAHI_PROTO_INET6;
41 + } else if (strcmp(attr[1], "any") == 0) {
42 + protocol = AVAHI_PROTO_UNSPEC;
44 + avahi_log_error("%s: parse failure: invalid protocol specification \"%s\".", u->group->filename, attr[1]);
49 + u->service->protocol = protocol;
57 } else if (u->current_tag == XML_TAG_SERVICE && strcmp(el, "type") == 0) {
63 u->current_tag = XML_TAG_PORT;
64 - } else if (u->current_tag == XML_TAG_SERVICE && strcmp(el, "protocol") == 0) {
68 - u->current_tag = XML_TAG_PROTOCOL;
69 } else if (u->current_tag == XML_TAG_SERVICE && strcmp(el, "txt-record") == 0) {
76 - case XML_TAG_PROTOCOL: {
80 - if (u->buf && strcasecmp (u->buf, "ipv4") == 0) {
81 - protocol = AVAHI_PROTO_INET;
82 - } else if (u->buf && strcasecmp (u->buf, "ipv6") == 0) {
83 - protocol = AVAHI_PROTO_INET6;
84 - } else if (u->buf && strcasecmp (u->buf, "any") == 0) {
85 - protocol = AVAHI_PROTO_UNSPEC;
87 - avahi_log_error("%s: parse failure: invalid protocol specification \"%s\".", u->group->filename, u->buf);
92 - u->service->protocol = protocol;
93 - u->current_tag = XML_TAG_SERVICE;
97 case XML_TAG_TXT_RECORD: {
104 - case XML_TAG_PROTOCOL:
105 case XML_TAG_TXT_RECORD:
107 u->buf = append_cdata(u->buf, s, len);
108 diff -Nurd avahi-0.1.orig/avahi-daemon/example.service avahi-0.1/avahi-daemon/example.service
109 --- avahi-0.1.orig/avahi-daemon/example.service 2005-08-21 23:27:09 +0200
110 +++ avahi-0.1/avahi-daemon/example.service 2005-08-28 00:34:50 +0200
116 + <service protocol="ipv6">
117 <type>_uberprinter._tcp</type>
118 <domain-name>local</domain-name>
119 <host-name>quux.local</host-name>
121 - <protocol>any</protocol>
122 <txt-record>this=is</txt-record>
123 <txt-record>a=really</txt-record>
124 <txt-record>bad=example</txt-record>
125 diff -Nurd avahi-0.1.orig/avahi-daemon/avahi-service.dtd avahi-0.1/avahi-daemon/avahi-service.dtd
126 --- avahi-0.1.orig/avahi-daemon/avahi-service.dtd 2005-08-21 23:27:09 +0200
127 +++ avahi-0.1/avahi-daemon/avahi-service.dtd 2005-08-28 00:34:50 +0200
129 <!ELEMENT name (#PCDATA)>
130 <!ATTLIST name replace-wildcards (yes|no) "no">
131 <!ELEMENT service (type,domain-name?,host-name?,port,txt-record*)>
133 +<!ATTLIST service protocol (ipv4|ipv6|any) "any">
134 <!ELEMENT type (#PCDATA)>
136 <!ELEMENT domain-name (#PCDATA)>
139 <!ELEMENT port (#PCDATA)>
141 -<!ELEMENT protocol (#PCDATA)>
143 <!ELEMENT txt-record (#PCDATA)>
144 <!ATTLIST txt-record>
145 diff -Nurd avahi-0.1.orig/man/avahi.service.5.xml.in avahi-0.1/man/avahi.service.5.xml.in
146 --- avahi-0.1.orig/man/avahi.service.5.xml.in 2005-08-21 23:27:10 +0200
147 +++ avahi-0.1/man/avahi.service.5.xml.in 2005-08-28 00:34:50 +0200
152 - <p><opt><name replace-wildcards="yes|no"/></opt> The
153 + <p><opt><name replace-wildcards="yes|no"></opt> The
154 service name. If <opt>replace-wildcards</opt> is "yes", any
155 occurence of the string "%h" will be replaced by the local
156 host name. This can be used for service names like "Remote
161 - <p><opt><service></opt> Contains the service information
162 - for exactly one service type. Should contain one
163 - <opt><type></opt> and one <opt><port></opt>
164 - element. Optionally it may contain one
165 + <p><opt><service protocol="ipv4|ipv6|any"></opt>
166 + Contains the service information for exactly one service
167 + type. Should contain one <opt><type></opt> and one
168 + <opt><port></opt> element. Optionally it may contain one
169 <opt><domain-name></opt>, one
170 <opt><host-name></opt> and multiple
171 - <opt><txt-record></opt> elements.</p>
172 + <opt><txt-record></opt> elements. The attribute
173 + <opt>protocol</opt> specifies the protocol to
174 + advertise the service on. If <opt>any</opt> is used (which is
175 + the default), the service will be advertised on both IPv4 and
181 <p><opt><type></opt> Contains the DNS-SD service type for this service. e.g. "_http._tcp".</p>
187 - <p><opt><protocol></opt> The protocol to advertise the service on, can be any of <opt>ipv4</opt>, <opt>ipv6</opt> or <opt>any</opt>.</p>
191 <p><opt><txt-record></opt> DNS-SD TXT record data.</p>