1 
2 #include "nx_api.h"
3 
4 #ifdef __PRODUCT_NETXDUO__
5 
6 #include "netx_mdns_test.h"
7 /* Frame (75 bytes) */
8 static const unsigned char pkt1[75] = {
9 0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */
10 0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */
11 0x00, 0x3d, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .=..@... */
12 0xd9, 0xc2, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */
13 0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x29, /* .......) */
14 0xb3, 0xf1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */
15 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */
16 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */
17 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */
18 0x0c, 0x00, 0x01                                /* ... */
19 };
20 
21 /* Frame (332 bytes) */
22 static const unsigned char pkt2[332] = {
23 0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */
24 0x73, 0x33, 0xc1, 0xbd, 0x08, 0x00, 0x45, 0x00, /* s3....E. */
25 0x01, 0x3e, 0x09, 0x17, 0x00, 0x00, 0xff, 0x11, /* .>...... */
26 0x0f, 0x8f, 0xc0, 0xa8, 0x00, 0x65, 0xe0, 0x00, /* .....e.. */
27 0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x2a, /* .......* */
28 0x56, 0xdc, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* V....... */
29 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x04, 0x5f, /* ......._ */
30 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */
31 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */
32 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */
33 0x0c, 0x09, 0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, /* ..Chenbo */
34 0x2d, 0x50, 0x43, 0xc0, 0x0c, 0x09, 0x43, 0x68, /* -PC...Ch */
35 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, 0x43, 0x0c, /* enbo-PC. */
36 0x5f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2d, /* _device- */
37 0x69, 0x6e, 0x66, 0x6f, 0xc0, 0x11, 0x00, 0x10, /* info.... */
38 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0e, /* ........ */
39 0x0d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x3d, 0x57, /* .model=W */
40 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0xc0, 0x27, /* indows.' */
41 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */
42 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x01, 0xbd, /* ........ */
43 0x09, 0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, /* .Chenbo- */
44 0x50, 0x43, 0xc0, 0x16, 0xc0, 0x27, 0x00, 0x10, /* PC...'.. */
45 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x23, /* .......# */
46 0x11, 0x6e, 0x65, 0x74, 0x62, 0x69, 0x6f, 0x73, /* .netbios */
47 0x3d, 0x43, 0x48, 0x45, 0x4e, 0x42, 0x4f, 0x2d, /* =CHENBO- */
48 0x50, 0x43, 0x10, 0x64, 0x6f, 0x6d, 0x61, 0x69, /* PC.domai */
49 0x6e, 0x3d, 0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, /* n=WORKGR */
50 0x4f, 0x55, 0x50, 0xc0, 0x76, 0x00, 0x01, 0x80, /* OUP.v... */
51 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, /* ....x... */
52 0xa8, 0x00, 0x65, 0xc0, 0x76, 0x00, 0x1c, 0x80, /* ..e.v... */
53 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0x20, /* ....x..  */
54 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
55 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0xc0, /* ......1. */
56 0x76, 0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, /* v....... */
57 0x78, 0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, /* x....... */
58 0x00, 0x00, 0x00, 0x01, 0x59, 0x44, 0x79, 0xe1, /* ....YDy. */
59 0x0a, 0xd7, 0xf4, 0xc0, 0x27, 0x00, 0x2f, 0x80, /* ....'./. */
60 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x09, 0xc0, /* ....x... */
61 0x27, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, /* '......@ */
62 0xc0, 0x76, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* .v./.... */
63 0x00, 0x78, 0x00, 0x08, 0xc0, 0x76, 0x00, 0x04, /* .x...v.. */
64 0x40, 0x00, 0x00, 0x08                          /* @... */
65 };
66 
67 /* Frame (129 bytes) */
68 static const unsigned char pkt3[129] = {
69 0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */
70 0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */
71 0x00, 0x73, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .s..@... */
72 0xd9, 0x8b, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */
73 0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x5f, /* ......._ */
74 0x9d, 0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */
75 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */
76 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */
77 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */
78 0x0c, 0x00, 0x01, 0x04, 0x5f, 0x73, 0x6d, 0x62, /* ...._smb */
79 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */
80 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */
81 0x00, 0x00, 0x11, 0x93, 0x00, 0x1b, 0x09, 0x43, /* .......C */
82 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, 0x43, /* henbo-PC */
83 0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */
84 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */
85 0x00                                            /* . */
86 };
87 
88 /* Frame (129 bytes) */
89 static const unsigned char pkt4[129] = {
90 0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */
91 0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */
92 0x00, 0x73, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* .s..@... */
93 0xd9, 0x8a, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */
94 0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x5f, /* ......._ */
95 0x9d, 0xeb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */
96 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */
97 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */
98 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */
99 0x0c, 0x00, 0x01, 0x04, 0x5f, 0x73, 0x6d, 0x62, /* ...._smb */
100 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */
101 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */
102 0x00, 0x00, 0x11, 0x91, 0x00, 0x1b, 0x09, 0x43, /* .......C */
103 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, 0x43, /* henbo-PC */
104 0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */
105 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */
106 0x00                                            /* . */
107 };
108 
109 static MDNS_QUERY_INFO mdns_query = {NX_NULL, "_smb._tcp", NX_NULL};
110 
111 MDNS_TEST_SEQ mdns_query_smb_tcp[] = {
112     {TITLE, "Query _smb._tcp", 15, 0},
113 
114     {MDNS_QUERY, (char*)&mdns_query, 0, 0},
115     {MDNS_CHECK_DATA_V4, (char*)&pkt1[0], sizeof(pkt1), 5},
116     {INJECT, (char*)&pkt2[0], sizeof(pkt2), 0},
117     {MDNS_CHECK_DATA_V4, (char*)&pkt3[0], sizeof(pkt3), 5},
118 };
119 
120 int mdns_query_smb_tcp_size = sizeof(mdns_query_smb_tcp) / sizeof(MDNS_TEST_SEQ);
121 
122 #endif /* __PRODUCT_NETXDUO__  */
123 
124