]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/avahi/avahi-0.1/static-services-protocol.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / avahi / avahi-0.1 / static-services-protocol.patch
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
4 @@ -251,7 +251,6 @@
5      XML_TAG_DOMAIN_NAME,
6      XML_TAG_HOST_NAME,
7      XML_TAG_PORT,
8 -    XML_TAG_PROTOCOL,
9      XML_TAG_TXT_RECORD
10  } xml_tag_name;
11  
12 @@ -285,19 +284,41 @@
13                  u->group->replace_wildcards = strcmp(attr[1], "yes") == 0;
14              else
15                  goto invalid_attr;
16 -        }
17  
18 -        if (attr[2])
19 -            goto invalid_attr;
20 +            if (attr[2])
21 +                goto invalid_attr;
22 +        }
23          
24      } else if (u->current_tag == XML_TAG_SERVICE_GROUP && strcmp(el, "service") == 0) {
25 -        if (attr[0])
26 -            goto invalid_attr;
27 +        u->current_tag = XML_TAG_SERVICE;
28  
29          assert(!u->service);
30          u->service = static_service_new(u->group);
31  
32 -        u->current_tag = XML_TAG_SERVICE;
33 +        if (attr[0]) {
34 +            if (strcmp(attr[0], "protocol") == 0) {
35 +                AvahiProtocol protocol;
36 +                
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;
43 +                } else {
44 +                    avahi_log_error("%s: parse failure: invalid protocol specification \"%s\".", u->group->filename, attr[1]);
45 +                    u->failed = 1;
46 +                    return;
47 +                }
48 +
49 +                u->service->protocol = protocol;
50 +            } else
51 +                goto invalid_attr;
52 +
53 +            if (attr[2])
54 +                goto invalid_attr;
55 +        }
56 +
57      } else if (u->current_tag == XML_TAG_SERVICE && strcmp(el, "type") == 0) {
58          if (attr[0])
59              goto invalid_attr;
60 @@ -318,11 +339,6 @@
61              goto invalid_attr;
62          
63          u->current_tag = XML_TAG_PORT;
64 -    } else if (u->current_tag == XML_TAG_SERVICE && strcmp(el, "protocol") == 0) {
65 -        if (attr[0])
66 -            goto invalid_attr;
67 -
68 -        u->current_tag = XML_TAG_PROTOCOL;
69      } else if (u->current_tag == XML_TAG_SERVICE && strcmp(el, "txt-record") == 0) {
70          if (attr[0])
71              goto invalid_attr;
72 @@ -394,27 +410,6 @@
73              break;
74          }
75  
76 -        case XML_TAG_PROTOCOL: {
77 -            int protocol;
78 -            assert(u->service);
79 -
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;
86 -            } else {
87 -                avahi_log_error("%s: parse failure: invalid protocol specification \"%s\".", u->group->filename, u->buf);
88 -                u->failed = 1;
89 -                return;
90 -            }
91 -
92 -            u->service->protocol = protocol;
93 -           u->current_tag = XML_TAG_SERVICE;
94 -            break;
95 -        }
96 -
97          case XML_TAG_TXT_RECORD: {
98              assert(u->service);
99              
100 @@ -484,7 +479,6 @@
101              break;
102  
103          case XML_TAG_PORT:
104 -        case XML_TAG_PROTOCOL:
105          case XML_TAG_TXT_RECORD:
106              assert(u->service);
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
111 @@ -16,12 +16,11 @@
112      <port>631</port>
113    </service>
114  
115 -  <service>
116 +  <service protocol="ipv6">
117      <type>_uberprinter._tcp</type>
118      <domain-name>local</domain-name>
119      <host-name>quux.local</host-name>
120      <port>4711</port>
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
128 @@ -5,7 +5,7 @@
129  <!ELEMENT name (#PCDATA)>
130  <!ATTLIST name replace-wildcards (yes|no) "no">
131  <!ELEMENT service (type,domain-name?,host-name?,port,txt-record*)>
132 -<!ATTLIST service>
133 +<!ATTLIST service protocol (ipv4|ipv6|any) "any">
134  <!ELEMENT type (#PCDATA)>
135  <!ATTLIST type>
136  <!ELEMENT domain-name (#PCDATA)>
137 @@ -14,7 +14,5 @@
138  <!ATTLIST host-name>
139  <!ELEMENT port (#PCDATA)>
140  <!ATTLIST port>
141 -<!ELEMENT protocol (#PCDATA)>
142 -<!ATTLIST protocol>
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
148 @@ -45,7 +45,7 @@
149        </option>
150  
151        <option>
152 -        <p><opt>&lt;name replace-wildcards="yes|no"/&gt;</opt> The
153 +        <p><opt>&lt;name replace-wildcards="yes|no"&gt;</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
157 @@ -54,16 +54,19 @@
158        </option>
159  
160        <option>
161 -        <p><opt>&lt;service&gt;</opt> Contains the service information
162 -        for exactly one service type. Should contain one
163 -        <opt>&lt;type&gt;</opt> and one <opt>&lt;port&gt;</opt>
164 -        element. Optionally it may contain one
165 +        <p><opt>&lt;service protocol="ipv4|ipv6|any"&gt;</opt>
166 +        Contains the service information for exactly one service
167 +        type. Should contain one <opt>&lt;type&gt;</opt> and one
168 +        <opt>&lt;port&gt;</opt> element. Optionally it may contain one
169          <opt>&lt;domain-name&gt;</opt>, one
170          <opt>&lt;host-name&gt;</opt> and multiple
171 -        <opt>&lt;txt-record&gt;</opt> elements.</p>
172 +        <opt>&lt;txt-record&gt;</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
176 +        IPv6.</p>
177        </option>
178  
179 -
180        <option>
181          <p><opt>&lt;type&gt;</opt> Contains the DNS-SD service type for this service. e.g. "_http._tcp".</p>
182        </option>
183 @@ -88,10 +91,6 @@
184        </option>
185  
186        <option>
187 -        <p><opt>&lt;protocol&gt;</opt> The protocol to advertise the service on, can be any of <opt>ipv4</opt>, <opt>ipv6</opt> or <opt>any</opt>.</p>
188 -      </option>
189 -
190 -      <option>
191          <p><opt>&lt;txt-record&gt;</opt> DNS-SD TXT record data.</p>
192        </option>
193