42 static const u8_t data[] = { 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't', 0x00 };
50 p->payload = (
void *)(
size_t)
data;
61 static const u8_t data[] = { 0x05, 0x00, 0xFF, 0x08, 0xc0, 0x0f, 0x04, 0x7f, 0x80, 0x82, 0x88, 0x00 };
69 p->payload = (
void *)(
size_t)
data;
80 static const u8_t data[] = { 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a' };
88 p->payload = (
void *)(
size_t)
data;
91 fail_unless(
offset == MDNS_READNAME_ERROR);
98 0x05,
'm',
'u',
'l',
't',
'i',
99 0x52,
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
100 'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
101 'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
102 'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
103 'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
104 'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a', 0x00
107 struct mdns_domain
domain;
113 p->payload = (
void *)(
size_t)
data;
116 fail_unless(
offset == MDNS_READNAME_ERROR);
123 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
124 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
125 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
126 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
127 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
128 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
129 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
130 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
131 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
132 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
133 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
134 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
135 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
136 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
137 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
138 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
139 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
140 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
141 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
142 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
143 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
144 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
145 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
146 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
147 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
148 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
149 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
150 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
151 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
152 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
153 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
154 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
155 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
156 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
157 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
158 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
159 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
163 struct mdns_domain
domain;
169 p->payload = (
void *)(
size_t)
data;
172 fail_unless(
offset == MDNS_READNAME_ERROR);
180 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
181 0x0f, 0x0e, 0x05,
'l',
'o',
'c',
'a',
'l', 0x00, 0xab,
182 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't', 0xc0, 0x0c
185 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't', 0x05,
'l',
'o',
'c',
'a',
'l', 0x00
188 struct mdns_domain
domain;
194 p->payload = (
void *)(
size_t)
data;
208 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
209 0x00, 0x00, 0x00, 0x00, 0x03, 0x0b, 0x0a, 0xf2,
210 0x04,
'c',
'a',
's',
't', 0x00, 0xc0, 0x10,
211 0x05,
'm',
'u',
'l',
't',
'i', 0xc0, 0x16
214 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't', 0x00
217 struct mdns_domain
domain;
223 p->payload = (
void *)(
size_t)
data;
237 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
238 0x00, 0x00, 0x00, 0x00, 0x03, 0x0b, 0x0a, 0xf2,
239 0x04,
'n',
'a',
'm',
'e', 0xc0, 0x27, 0x03,
240 0x03,
'd',
'n',
's', 0xc0, 0x10, 0xc0, 0x10,
241 0x04,
'd',
'e',
'e',
'p', 0xc0, 0x18, 0x00,
242 0x04,
'c',
'a',
's',
't', 0xc0, 0x20, 0xb0,
243 0x05,
'm',
'u',
'l',
't',
'i', 0xc0, 0x28
246 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't',
247 0x04,
'd',
'e',
'e',
'p', 0x03,
'd',
'n',
's',
248 0x04,
'n',
'a',
'm',
'e', 0x00
251 struct mdns_domain
domain;
257 p->payload = (
void *)(
size_t)
data;
270 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't', 0xc0, 0x10, 0x00, 0x01, 0x40,
271 0x05,
'l',
'o',
'c',
'a',
'l', 0x00, 0xab
274 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't', 0x05,
'l',
'o',
'c',
'a',
'l', 0x00
277 struct mdns_domain
domain;
283 p->payload = (
void *)(
size_t)
data;
286 fail_unless(
offset == 13);
296 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't', 0xc0
299 struct mdns_domain
domain;
305 p->payload = (
void *)(
size_t)
data;
308 fail_unless(
offset == MDNS_READNAME_ERROR);
315 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't', 0xc2, 0x10, 0x00, 0x01, 0x40
318 struct mdns_domain
domain;
324 p->payload = (
void *)(
size_t)
data;
327 fail_unless(
offset == MDNS_READNAME_ERROR);
334 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
335 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't', 0xc0, 0x10
338 struct mdns_domain
domain;
344 p->payload = (
void *)(
size_t)
data;
347 fail_unless(
offset == MDNS_READNAME_ERROR);
354 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
355 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't', 0xc0, 0x15
358 struct mdns_domain
domain;
364 p->payload = (
void *)(
size_t)
data;
367 fail_unless(
offset == MDNS_READNAME_ERROR);
373 static const u8_t data[] = { 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't', 0x00 };
374 struct mdns_domain
domain;
379 res = mdns_domain_add_label(&
domain,
"multi", 5);
381 res = mdns_domain_add_label(&
domain,
"cast", 4);
392 static const char *toolong =
"abcdefghijklmnopqrstuvwxyz0123456789-abcdefghijklmnopqrstuvwxyz0123456789-abcdefghijklmnopqrstuvwxyz0123456789-";
393 struct mdns_domain
domain;
398 res = mdns_domain_add_label(&
domain,
"multi", 5);
407 static const char *
label =
"0123456789abcdef0123456789abcdef";
408 struct mdns_domain
domain;
415 fail_unless(
domain.length == 33);
418 fail_unless(
domain.length == 66);
421 fail_unless(
domain.length == 99);
424 fail_unless(
domain.length == 132);
427 fail_unless(
domain.length == 165);
430 fail_unless(
domain.length == 198);
433 fail_unless(
domain.length == 231);
436 fail_unless(
domain.length == 231);
439 fail_unless(
domain.length == 231);
442 fail_unless(
domain.length == 231);
445 fail_unless(
domain.length == 255);
448 fail_unless(
domain.length == 256);
451 fail_unless(
domain.length == 256);
458 0x05,
'm',
'u',
'l',
't',
'i', 0x04,
'c',
'a',
's',
't', 0x00
460 struct mdns_domain domain1, domain2;
464 memset(&domain1, 0,
sizeof(domain1));
465 res = mdns_domain_add_label(&domain1,
"multi", 5);
467 res = mdns_domain_add_label(&domain1,
"cast", 4);
469 res = mdns_domain_add_label(&domain1,
NULL, 0);
471 fail_unless(domain1.length ==
sizeof(
data));
473 memset(&domain2, 0,
sizeof(domain2));
474 res = mdns_domain_add_label(&domain2,
"multi", 5);
476 res = mdns_domain_add_label(&domain2,
"cast", 4);
478 res = mdns_domain_add_label(&domain2,
NULL, 0);
481 fail_unless(mdns_domain_eq(&domain1, &domain2));
487 struct mdns_domain domain1, domain2;
491 memset(&domain1, 0,
sizeof(domain1));
492 res = mdns_domain_add_label(&domain1,
"multi", 5);
494 res = mdns_domain_add_label(&domain1,
"base", 4);
496 res = mdns_domain_add_label(&domain1,
NULL, 0);
499 memset(&domain2, 0,
sizeof(domain2));
500 res = mdns_domain_add_label(&domain2,
"multi", 5);
502 res = mdns_domain_add_label(&domain2,
"cast", 4);
504 res = mdns_domain_add_label(&domain2,
NULL, 0);
507 fail_if(mdns_domain_eq(&domain1, &domain2));
513 struct mdns_domain domain1, domain2;
517 memset(&domain1, 0,
sizeof(domain1));
518 res = mdns_domain_add_label(&domain1,
"multi", 5);
520 res = mdns_domain_add_label(&domain1,
"cast", 4);
522 res = mdns_domain_add_label(&domain1,
NULL, 0);
525 memset(&domain2, 0,
sizeof(domain2));
526 res = mdns_domain_add_label(&domain2,
"MulTI", 5);
528 res = mdns_domain_add_label(&domain2,
"casT", 4);
530 res = mdns_domain_add_label(&domain2,
NULL, 0);
533 fail_unless(mdns_domain_eq(&domain1, &domain2));
539 static const u8_t data1[] = { 0x05, 0xcc, 0xdc, 0x00, 0xa0 };
540 static const u8_t data2[] = { 0x7f, 0x8c, 0x01, 0xff, 0xcf };
541 struct mdns_domain domain1, domain2;
545 memset(&domain1, 0,
sizeof(domain1));
546 res = mdns_domain_add_label(&domain1, (
const char*)
data1,
sizeof(
data1));
548 res = mdns_domain_add_label(&domain1,
"cast", 4);
550 res = mdns_domain_add_label(&domain1, (
const char*)
data2,
sizeof(
data2));
552 res = mdns_domain_add_label(&domain1,
NULL, 0);
555 memset(&domain2, 0,
sizeof(domain2));
556 res = mdns_domain_add_label(&domain2, (
const char*)
data1,
sizeof(
data1));
558 res = mdns_domain_add_label(&domain2,
"casT", 4);
560 res = mdns_domain_add_label(&domain2, (
const char*)
data2,
sizeof(
data2));
562 res = mdns_domain_add_label(&domain2,
NULL, 0);
565 fail_unless(mdns_domain_eq(&domain1, &domain2));
571 struct mdns_domain domain1, domain2;
575 memset(&domain1, 0,
sizeof(domain1));
576 memset(domain1.name, 0xAA,
sizeof(MDNS_DOMAIN_MAXLEN));
577 res = mdns_domain_add_label(&domain1,
"multi", 5);
579 res = mdns_domain_add_label(&domain1,
"cast", 4);
582 memset(&domain2, 0,
sizeof(domain2));
583 memset(domain2.name, 0xBB,
sizeof(MDNS_DOMAIN_MAXLEN));
584 res = mdns_domain_add_label(&domain2,
"multi", 5);
586 res = mdns_domain_add_label(&domain2,
"cast", 4);
589 fail_unless(mdns_domain_eq(&domain1, &domain2));
597 0x06,
'f',
'o',
'o',
'b',
'a',
'r', 0x05,
'l',
'o',
'c',
'a',
'l', 0x00
600 struct mdns_domain
domain;
608 p->payload = (
void *)(
size_t)
data;
611 res = mdns_domain_add_label(&
domain,
"foobar", 6);
613 res = mdns_domain_add_label(&
domain,
"local", 5);
632 0x02,
'g',
'o', 0x06,
'f',
'o',
'o',
'b',
'a',
'r', 0x05,
'l',
'o',
'c',
'a',
'l', 0x00
635 struct mdns_domain
domain;
643 p->payload = (
void *)(
size_t)
data;
646 res = mdns_domain_add_label(&
domain,
"foobar", 6);
648 res = mdns_domain_add_label(&
domain,
"local", 5);
666 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
667 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
668 0x04,
'l',
'w',
'i',
'p', 0x05,
'l',
'o',
'c',
'a',
'l', 0x00, 0xc0, 0x00, 0x02, 0x00,
669 0x06,
'f',
'o',
'o',
'b',
'a',
'r', 0xc0, 0x15
672 struct mdns_domain
domain;
680 p->payload = (
void *)(
size_t)
data;
683 res = mdns_domain_add_label(&
domain,
"foobar", 6);
685 res = mdns_domain_add_label(&
domain,
"local", 5);
694 fail_unless(
offset == 0x20);
704 0x04,
'l',
'w',
'i',
'p', 0x05,
'w',
'i',
'k',
'i',
'a', 0x03,
'c',
'o',
'm', 0x00
707 struct mdns_domain
domain;
715 p->payload = (
void *)(
size_t)
data;
718 res = mdns_domain_add_label(&
domain,
"foobar", 6);
720 res = mdns_domain_add_label(&
domain,
"local", 5);
738 0x06,
'f',
'o',
'o',
'b',
'a',
'r', 0x05,
'l',
'o',
'c',
'a',
'l', 0x00
741 struct mdns_domain
domain;
749 p->payload = (
void *)(
size_t)
data;
752 res = mdns_domain_add_label(&
domain,
"lwip", 4);
754 res = mdns_domain_add_label(&
domain,
"local", 5);
773 0x04,
'l',
'w',
'i',
'p', 0x05,
'l',
'o',
'c',
'a',
'l', 0x00
776 struct mdns_domain
domain;
784 p->payload = (
void *)(
size_t)
data;
787 res = mdns_domain_add_label(&
domain,
"foobar", 6);
789 res = mdns_domain_add_label(&
domain,
"local", 5);
807 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
808 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
809 0x04,
'l',
'w',
'i',
'p', 0x05,
'l',
'o',
'c',
'a',
'l', 0x00, 0xc0, 0x00, 0x02, 0x00,
810 0x07,
'b',
'a',
'n',
'a',
'n',
'a',
's', 0xc0, 0x15
813 struct mdns_domain
domain;
821 p->payload = (
void *)(
size_t)
data;
824 res = mdns_domain_add_label(&
domain,
"foobar", 6);
826 res = mdns_domain_add_label(&
domain,
"local", 5);
840 fail_unless(
offset == 0x15);
850 0x06,
'f',
'o',
'o',
'b',
'a',
'r', 0x05,
'l',
'o',
'c',
'a',
'l', 0x03,
'c',
'o',
'm', 0x00
853 struct mdns_domain
domain;
861 p->payload = (
void *)(
size_t)
data;
864 res = mdns_domain_add_label(&
domain,
"foobar", 6);
866 res = mdns_domain_add_label(&
domain,
"local", 5);
888 TESTFUNC(readname_jump_earlier_jump),
907 TESTFUNC(compress_full_match_subset),
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLuint GLsizei GLsizei * length
#define LWIP_UNUSED_ARG(x)
struct pbuf * pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
u8_t pbuf_free(struct pbuf *p)
Suite * create_suite(const char *name, testfunc *tests, size_t num_tests, SFun setup, SFun teardown)
static struct test_info tests[]
static const WCHAR label[]
END_TEST Suite * mdns_suite(void)