1 2 #include "nx_api.h" 3 4 #ifdef __PRODUCT_NETXDUO__ 5 6 #include "netx_mdns_test.h" 7 8 /* Frame (76 bytes) */ 9 static const unsigned char pkt1[76] = { 10 0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ 11 0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ 12 0x00, 0x3e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ 13 0x90, 0xb2, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ 14 0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ 15 0xe3, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ 16 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ 17 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ 18 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ 19 0x00, 0x0c, 0x00, 0x01 /* .... */ 20 }; 21 22 /* Frame (255 bytes) */ 23 static const unsigned char pkt2[255] = { 24 0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ 25 0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ 26 0x00, 0xf1, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ 27 0x8f, 0xd9, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ 28 0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xdd, /* ........ */ 29 0x19, 0x0d, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ 30 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x05, 0x5f, /* ......._ */ 31 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ 32 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ 33 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, /* .......< */ 34 0x00, 0x24, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .$.Simpl */ 35 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ 36 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ 37 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ 38 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, /* local..S */ 39 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ 40 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ 41 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ 42 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ 43 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ 44 0x00, 0x3c, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .<...... */ 45 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ 46 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ 47 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ 48 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ 49 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ 50 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ 51 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ 52 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ 53 0x3c, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* <...pape */ 54 0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ 55 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ 56 }; 57 58 /* Frame (108 bytes) */ 59 static const unsigned char pkt3[108] = { 60 0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ 61 0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ 62 0x00, 0x5e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ 63 0x90, 0x92, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ 64 0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ 65 0x2e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ 66 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ 67 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ 68 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ 69 0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ 70 0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x14, /* .....<.. */ 71 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* .Simple */ 72 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ 73 0x65, 0x72, 0xc0, 0x0c /* er.. */ 74 }; 75 76 /* Frame (108 bytes) */ 77 static const unsigned char pkt4[108] = { 78 0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ 79 0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ 80 0x00, 0x5e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ 81 0x90, 0x92, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ 82 0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ 83 0x2e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ 84 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ 85 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ 86 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ 87 0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ 88 0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x14, /* .....<.. */ 89 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* .Simple */ 90 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ 91 0x65, 0x72, 0xc0, 0x0c /* er.. */ 92 }; 93 94 /* Frame (108 bytes) */ 95 static const unsigned char pkt5[108] = { 96 0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ 97 0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ 98 0x00, 0x5e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ 99 0x90, 0x92, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ 100 0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ 101 0x2e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ 102 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ 103 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ 104 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ 105 0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ 106 0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x14, /* .....<.. */ 107 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* .Simple */ 108 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ 109 0x65, 0x72, 0xc0, 0x0c /* er.. */ 110 }; 111 112 /* Frame (108 bytes) */ 113 static const unsigned char pkt6[108] = { 114 0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ 115 0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ 116 0x00, 0x5e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ 117 0x90, 0x92, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ 118 0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ 119 0x2e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ 120 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ 121 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ 122 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ 123 0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ 124 0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x14, /* .....<.. */ 125 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* .Simple */ 126 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ 127 0x65, 0x72, 0xc0, 0x0c /* er.. */ 128 }; 129 130 /* Frame (76 bytes) */ 131 static const unsigned char pkt7[76] = { 132 0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ 133 0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ 134 0x00, 0x3e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ 135 0x90, 0xb2, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ 136 0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ 137 0xe3, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ 138 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ 139 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ 140 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ 141 0x00, 0x0c, 0x00, 0x01 /* .... */ 142 }; 143 144 /* Frame (255 bytes) */ 145 static const unsigned char pkt8[255] = { 146 0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ 147 0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ 148 0x00, 0xf1, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* ....@... */ 149 0x8f, 0xd8, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ 150 0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xdd, /* ........ */ 151 0x19, 0x0d, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ 152 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x05, 0x5f, /* ......._ */ 153 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ 154 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ 155 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, /* .......< */ 156 0x00, 0x24, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .$.Simpl */ 157 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ 158 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ 159 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ 160 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, /* local..S */ 161 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ 162 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ 163 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ 164 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ 165 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ 166 0x00, 0x3c, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .<...... */ 167 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ 168 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ 169 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ 170 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ 171 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ 172 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ 173 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ 174 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ 175 0x3c, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* <...pape */ 176 0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ 177 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ 178 }; 179 180 MDNS_TEST_SEQ mdns_known_answer_ignored[] = { 181 {TITLE, "Known answer ignored", 20, 0}, 182 183 /* Inject the query with known answer. */ 184 {INJECT, (char*)&pkt3[0], sizeof(pkt3), 0}, 185 186 /* No RR should be stored. */ 187 {MDNS_CHECK_RR_COUNT_REMOTE, NX_NULL, 0, 0} 188 }; 189 190 int mdns_known_answer_ignored_size = sizeof(mdns_known_answer_ignored) / sizeof(MDNS_TEST_SEQ); 191 192 #endif /* __PRODUCT_NETXDUO__ */ 193 194