|
Lines 209-214
Link Here
|
| 209 |
if (!stralloc_cats(&line,".:")) return 0; |
209 |
if (!stralloc_cats(&line,".:")) return 0; |
| 210 |
if (!stralloc_catulong0(&line,dist,0)) return 0; |
210 |
if (!stralloc_catulong0(&line,dist,0)) return 0; |
| 211 |
} |
211 |
} |
|
|
212 |
else if (byte_equal(data,2,DNS_T_SRV)) { |
| 213 |
uint16 dist, weight, port; |
| 214 |
if (!stralloc_copys(&line,"S")) return 0; |
| 215 |
if (!dns_domain_todot_cat(&line,d1)) return 0; |
| 216 |
if (!stralloc_cats(&line,"::")) return 0; |
| 217 |
pos = x_copy(buf,len,pos,data,2); |
| 218 |
uint16_unpack_big(data,&dist); |
| 219 |
pos = x_copy(buf,len,pos,data,2); |
| 220 |
uint16_unpack_big(data,&weight); |
| 221 |
pos = x_copy(buf,len,pos,data,2); |
| 222 |
uint16_unpack_big(data,&port); |
| 223 |
x_getname(buf,len,pos,&d1); |
| 224 |
if (!dns_domain_todot_cat(&line,d1)) return 0; |
| 225 |
if (!stralloc_cats(&line,".:")) return 0; |
| 226 |
if (!stralloc_catulong0(&line,dist,0)) return 0; |
| 227 |
if (!stralloc_cats(&line,":")) return 0; |
| 228 |
if (!stralloc_catulong0(&line,weight,0)) return 0; |
| 229 |
if (!stralloc_cats(&line,":")) return 0; |
| 230 |
if (!stralloc_catulong0(&line,port,0)) return 0; |
| 231 |
} |
| 212 |
else if (byte_equal(data,2,DNS_T_A) && (dlen == 4)) { |
232 |
else if (byte_equal(data,2,DNS_T_A) && (dlen == 4)) { |
| 213 |
char ipstr[IP4_FMT]; |
233 |
char ipstr[IP4_FMT]; |
| 214 |
if (!stralloc_copys(&line,"+")) return 0; |
234 |
if (!stralloc_copys(&line,"+")) return 0; |
|
Lines 216-221
Link Here
|
| 216 |
if (!stralloc_cats(&line,":")) return 0; |
236 |
if (!stralloc_cats(&line,":")) return 0; |
| 217 |
x_copy(buf,len,pos,data,4); |
237 |
x_copy(buf,len,pos,data,4); |
| 218 |
if (!stralloc_catb(&line,ipstr,ip4_fmt(ipstr,data))) return 0; |
238 |
if (!stralloc_catb(&line,ipstr,ip4_fmt(ipstr,data))) return 0; |
|
|
239 |
} |
| 240 |
else if (byte_equal(data,2,DNS_T_PTR)) { |
| 241 |
if (!stralloc_copys(&line,"^")) return 0; |
| 242 |
if (!dns_domain_todot_cat(&line,d1)) return 0; |
| 243 |
if (!stralloc_cats(&line,":")) return 0; |
| 244 |
x_getname(buf,len,pos,&d1); |
| 245 |
if (!dns_domain_todot_cat(&line,d1)) return 0; |
| 246 |
if (!stralloc_cats(&line,".")) return 0; |
| 219 |
} |
247 |
} |
| 220 |
else { |
248 |
else { |
| 221 |
unsigned char ch; |
249 |
unsigned char ch; |