Lines Matching refs:ip
94 ip_test1(char *dev, int mtu, ip_t *ip, struct in_addr gwip, int ptest) in ip_test1() argument
104 IP_HL_A(ip, sizeof(*ip) >> 2); in ip_test1()
105 IP_V_A(ip, IPVERSION); in ip_test1()
106 ip->ip_tos = 0; in ip_test1()
107 ip->ip_off = 0; in ip_test1()
108 ip->ip_ttl = 60; in ip_test1()
109 ip->ip_p = IPPROTO_UDP; in ip_test1()
110 ip->ip_sum = 0; in ip_test1()
111 u = (udphdr_t *)(ip + 1); in ip_test1()
116 ip->ip_len = sizeof(*ip) + ntohs(u->uh_ulen); in ip_test1()
117 len = ip->ip_len; in ip_test1()
127 ip->ip_id = 0; in ip_test1()
129 for (i = 0; i < ((sizeof(*ip) + ntohs(u->uh_ulen)) >> 2); i++) { in ip_test1()
130 IP_HL_A(ip, i >> 2); in ip_test1()
131 (void) send_ip(nfd, 1500, ip, gwip, 1); in ip_test1()
143 ip->ip_id = 0; in ip_test1()
145 for (; i < ((sizeof(*ip) * 2 + ntohs(u->uh_ulen)) >> 2); i++) { in ip_test1()
146 IP_HL_A(ip, i >> 2); in ip_test1()
147 (void) send_ip(nfd, 1500, ip, gwip, 1); in ip_test1()
159 ip->ip_id = 0; in ip_test1()
161 IP_HL_A(ip, sizeof(*ip) >> 2); in ip_test1()
163 IP_V_A(ip, i); in ip_test1()
164 (void) send_ip(nfd, 1500, ip, gwip, 1); in ip_test1()
176 ip->ip_id = 0; in ip_test1()
179 IP_V_A(ip, i); in ip_test1()
180 (void) send_ip(nfd, 1500, ip, gwip, 1); in ip_test1()
192 ip->ip_id = 0; in ip_test1()
193 IP_V_A(ip, IPVERSION); in ip_test1()
194 i = ip->ip_len + 1; in ip_test1()
196 for (; i < (ip->ip_len * 2); i++) { in ip_test1()
197 ip->ip_id = htons(id++); in ip_test1()
198 ip->ip_sum = 0; in ip_test1()
199 ip->ip_sum = chksum((u_short *)ip, IP_HL(ip) << 2); in ip_test1()
200 (void) send_ether(nfd, (char *)ip, i, gwip); in ip_test1()
208 ip->ip_id = htons(id++); in ip_test1()
209 ip->ip_len = i; in ip_test1()
210 ip->ip_sum = 0; in ip_test1()
211 ip->ip_sum = chksum((u_short *)ip, IP_HL(ip) << 2); in ip_test1()
212 (void) send_ether(nfd, (char *)ip, len, gwip); in ip_test1()
224 ip->ip_id = 0; in ip_test1()
227 ip->ip_id = htons(id++); in ip_test1()
228 ip->ip_len = i; in ip_test1()
229 ip->ip_sum = 0; in ip_test1()
230 ip->ip_sum = chksum((u_short *)ip, IP_HL(ip) << 2); in ip_test1()
231 (void) send_ether(nfd, (char *)ip, len, gwip); in ip_test1()
237 ip->ip_len = len; in ip_test1()
240 ip->ip_id = htons(id++); in ip_test1()
241 ip->ip_sum = 0; in ip_test1()
242 ip->ip_sum = chksum((u_short *)ip, IP_HL(ip) << 2); in ip_test1()
243 (void) send_ether(nfd, (char *)ip, i, gwip); in ip_test1()
256 ip->ip_id = 0; in ip_test1()
257 ip->ip_len = sizeof(*ip); in ip_test1()
258 ip->ip_off = htons(IP_MF); in ip_test1()
259 (void) send_ip(nfd, mtu, ip, gwip, 1); in ip_test1()
264 ip->ip_id = 0; in ip_test1()
265 ip->ip_len = sizeof(*ip); in ip_test1()
266 ip->ip_off = htons(IP_MF); in ip_test1()
267 (void) send_ip(nfd, mtu, ip, gwip, 1); in ip_test1()
272 ip->ip_id = 0; in ip_test1()
273 ip->ip_len = sizeof(*ip); in ip_test1()
274 ip->ip_off = htons(0xa000); in ip_test1()
275 (void) send_ip(nfd, mtu, ip, gwip, 1); in ip_test1()
280 ip->ip_id = 0; in ip_test1()
281 ip->ip_len = sizeof(*ip); in ip_test1()
282 ip->ip_off = htons(0x0100); in ip_test1()
283 (void) send_ip(nfd, mtu, ip, gwip, 1); in ip_test1()
299 ip->ip_p = IPPROTO_ICMP; in ip_test1()
300 ip->ip_off = htons(IP_MF); in ip_test1()
302 ip->ip_id = htons(id++); in ip_test1()
304 ip->ip_len = 768 + 20 + 8; in ip_test1()
305 (void) send_ip(nfd, mtu, ip, gwip, 1); in ip_test1()
308 ip->ip_len = MIN(768 + 20, mtu - 68); in ip_test1()
311 ip->ip_off = htons(IP_MF | (i >> 3)); in ip_test1()
312 (void) send_ip(nfd, mtu, ip, gwip, 1); in ip_test1()
317 ip->ip_len = 896 + 20; in ip_test1()
318 ip->ip_off = htons(i >> 3); in ip_test1()
319 (void) send_ip(nfd, mtu, ip, gwip, 1); in ip_test1()
330 ip->ip_p = IPPROTO_ICMP; in ip_test1()
331 ip->ip_off = htons(IP_MF); in ip_test1()
333 ip->ip_id = htons(id++); in ip_test1()
335 ip->ip_len = 768 + 20 + 8; in ip_test1()
337 (void) send_ip(nfd, mtu, ip, gwip, 1); in ip_test1()
342 ip->ip_len = MIN(768 + 20, mtu - 68); in ip_test1()
345 ip->ip_off = htons(IP_MF | (i >> 3)); in ip_test1()
347 (void) send_ip(nfd, mtu, ip, gwip, 1); in ip_test1()
354 ip->ip_len = 896 + 20; in ip_test1()
355 ip->ip_off = htons(i >> 3); in ip_test1()
357 (void) send_ip(nfd, mtu, ip, gwip, 1); in ip_test1()
370 ip->ip_p = IPPROTO_ICMP; in ip_test1()
371 ip->ip_off = htons(IP_MF); in ip_test1()
373 ip->ip_id = htons(id++); in ip_test1()
375 ip->ip_len = 768 + 20 + 8; in ip_test1()
376 (void) send_ip(nfd, mtu, ip, gwip, 1); in ip_test1()
379 ip->ip_len = MIN(768 + 20, mtu - 68); in ip_test1()
382 ip->ip_off = htons(IP_MF | (i >> 3)); in ip_test1()
383 (void) send_ip(nfd, mtu, ip, gwip, 1); in ip_test1()
388 ip->ip_len = 896 + 20; in ip_test1()
389 ip->ip_off = htons(i >> 3); in ip_test1()
390 (void) send_ip(nfd, mtu, ip, gwip, 1); in ip_test1()
396 ip->ip_len = len; in ip_test1()
397 ip->ip_off = 0; in ip_test1()
402 ip->ip_id = 0; in ip_test1()
403 ip->ip_off = htons(0x8000); in ip_test1()
405 (void) send_ip(nfd, mtu, ip, gwip, 1); in ip_test1()
410 ip->ip_off = 0; in ip_test1()
416 ip->ip_id = 0; in ip_test1()
417 ip->ip_ttl = 255; in ip_test1()
419 (void) send_ip(nfd, mtu, ip, gwip, 1); in ip_test1()
423 ip->ip_ttl = 128; in ip_test1()
425 (void) send_ip(nfd, mtu, ip, gwip, 1); in ip_test1()
429 ip->ip_ttl = 0; in ip_test1()
431 (void) send_ip(nfd, mtu, ip, gwip, 1); in ip_test1()
440 void ip_test2(dev, mtu, ip, gwip, ptest) in ip_test2() argument
443 ip_t *ip;
460 IP_HL_A(ip, 6);
461 ip->ip_len = IP_HL(ip) << 2;
462 s = (u_char *)(ip + 1);
473 ip->ip_p = IPPROTO_IP;
475 (void) send_ip(nfd, mtu, ip, gwip, 1);
480 IP_HL_A(ip, 7);
481 ip->ip_len = IP_HL(ip) << 2;
489 (void) send_ip(nfd, mtu, ip, gwip, 1);
496 (void) send_ip(nfd, mtu, ip, gwip, 1);
503 (void) send_ip(nfd, mtu, ip, gwip, 1);
510 (void) send_ip(nfd, mtu, ip, gwip, 1);
517 (void) send_ip(nfd, mtu, ip, gwip, 1);
524 (void) send_ip(nfd, mtu, ip, gwip, 1);
537 ip_test3(char *dev, int mtu, ip_t *ip, struct in_addr gwip, int ptest) in ip_test3() argument
549 IP_HL_A(ip, sizeof(*ip) >> 2); in ip_test3()
550 IP_V_A(ip, IPVERSION); in ip_test3()
551 ip->ip_tos = 0; in ip_test3()
552 ip->ip_off = 0; in ip_test3()
553 ip->ip_ttl = 60; in ip_test3()
554 ip->ip_p = IPPROTO_ICMP; in ip_test3()
555 ip->ip_sum = 0; in ip_test3()
556 ip->ip_len = sizeof(*ip) + sizeof(*icp); in ip_test3()
557 icp = (struct icmp *)((char *)ip + (IP_HL(ip) << 2)); in ip_test3()
570 (void) send_icmp(nfd, mtu, ip, gwip); in ip_test3()
575 (void) send_icmp(nfd, mtu, ip, gwip); in ip_test3()
588 (void) send_icmp(nfd, mtu, ip, gwip); in ip_test3()
600 (void) send_icmp(nfd, mtu, ip, gwip); in ip_test3()
604 (void) send_icmp(nfd, mtu, ip, gwip); in ip_test3()
608 (void) send_icmp(nfd, mtu, ip, gwip); in ip_test3()
612 (void) send_icmp(nfd, mtu, ip, gwip); in ip_test3()
623 (void) send_icmp(nfd, mtu, ip, gwip); in ip_test3()
627 (void) send_icmp(nfd, mtu, ip, gwip); in ip_test3()
631 (void) send_icmp(nfd, mtu, ip, gwip); in ip_test3()
635 (void) send_icmp(nfd, mtu, ip, gwip); in ip_test3()
647 (void) send_icmp(nfd, mtu, ip, gwip); in ip_test3()
652 (void) send_icmp(nfd, mtu, ip, gwip); in ip_test3()
657 (void) send_icmp(nfd, mtu, ip, gwip); in ip_test3()
662 (void) send_icmp(nfd, mtu, ip, gwip); in ip_test3()
676 (void) send_icmp(nfd, mtu, ip, gwip); in ip_test3()
680 (void) send_icmp(nfd, mtu, ip, gwip); in ip_test3()
684 (void) send_icmp(nfd, mtu, ip, gwip); in ip_test3()
688 (void) send_icmp(nfd, mtu, ip, gwip); in ip_test3()
692 (void) send_icmp(nfd, mtu, ip, gwip); in ip_test3()
702 ip->ip_len = sizeof(*ip) + sizeof(*icp) / 2; in ip_test3()
706 (void) send_icmp(nfd, mtu, ip, gwip); in ip_test3()
711 (void) send_icmp(nfd, mtu, ip, gwip); in ip_test3()
716 (void) send_icmp(nfd, mtu, ip, gwip); in ip_test3()
721 (void) send_icmp(nfd, mtu, ip, gwip); in ip_test3()
734 ip_test4(char *dev, int mtu, ip_t *ip, struct in_addr gwip, int ptest) in ip_test4() argument
745 IP_HL_A(ip, sizeof(*ip) >> 2); in ip_test4()
746 IP_V_A(ip, IPVERSION); in ip_test4()
747 ip->ip_tos = 0; in ip_test4()
748 ip->ip_off = 0; in ip_test4()
749 ip->ip_ttl = 60; in ip_test4()
750 ip->ip_p = IPPROTO_UDP; in ip_test4()
751 ip->ip_sum = 0; in ip_test4()
752 u = (udphdr_t *)((char *)ip + (IP_HL(ip) << 2)); in ip_test4()
766 ip->ip_len = (IP_HL(ip) << 2) + ntohs(u->uh_ulen); in ip_test4()
770 (void) send_udp(nfd, 1500, ip, gwip); in ip_test4()
783 ip->ip_len = (IP_HL(ip) << 2) + ntohs(u->uh_ulen); in ip_test4()
786 ip->ip_len = i; in ip_test4()
787 (void) send_udp(nfd, 1500, ip, gwip); in ip_test4()
801 ip->ip_len = (IP_HL(ip) << 2) + ntohs(u->uh_ulen); in ip_test4()
804 (void) send_udp(nfd, 1500, ip, gwip); in ip_test4()
810 (void) send_udp(nfd, 1500, ip, gwip); in ip_test4()
816 (void) send_udp(nfd, 1500, ip, gwip); in ip_test4()
822 (void) send_udp(nfd, 1500, ip, gwip); in ip_test4()
829 (void) send_udp(nfd, 1500, ip, gwip); in ip_test4()
842 ip->ip_len = (IP_HL(ip) << 2) + ntohs(u->uh_ulen); in ip_test4()
845 (void) send_udp(nfd, 1500, ip, gwip); in ip_test4()
851 (void) send_udp(nfd, 1500, ip, gwip); in ip_test4()
857 (void) send_udp(nfd, 1500, ip, gwip); in ip_test4()
863 (void) send_udp(nfd, 1500, ip, gwip); in ip_test4()
869 (void) send_udp(nfd, 1500, ip, gwip); in ip_test4()
881 for (i = sizeof(*ip); i <= ntohs(u->uh_ulen); i++) { in ip_test4()
882 (void) send_udp(nfd, i, ip, gwip); in ip_test4()
895 ip_test5(char *dev, int mtu, ip_t *ip, struct in_addr gwip, int ptest) in ip_test5() argument
905 t = (tcphdr_t *)((char *)ip + (IP_HL(ip) << 2)); in ip_test5()
915 ip->ip_len = sizeof(ip_t) + sizeof(tcphdr_t); in ip_test5()
930 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
946 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
952 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
958 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
964 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
970 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
976 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
989 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
995 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
1001 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
1007 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
1013 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
1019 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
1031 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
1037 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
1043 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
1062 sin.sin_addr.s_addr = ip->ip_dst.s_addr; in ip_test5()
1073 inet_ntoa(ip->ip_dst)); in ip_test5()
1077 bcopy((char *)ip, (char *)&ti, sizeof(*ip)); in ip_test5()
1099 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
1103 ip->ip_len = sizeof(ip_t) + sizeof(tcphdr_t) + 1; in ip_test5()
1105 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
1108 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
1111 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
1115 ip->ip_len = sizeof(ip_t) + sizeof(tcphdr_t); in ip_test5()
1126 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
1132 ip->ip_len = sizeof(ip_t) + sizeof(tcphdr_t); in ip_test5()
1151 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
1157 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
1163 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
1169 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
1175 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
1189 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
1195 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
1201 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
1207 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
1213 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
1225 ip->ip_src = ip->ip_dst; in ip_test5()
1226 (void) send_tcp(nfd, mtu, ip, gwip); in ip_test5()
1239 ip_test6(char *dev, int mtu, ip_t *ip, struct in_addr gwip, int ptest) in ip_test6() argument
1249 IP_V_A(ip, IPVERSION); in ip_test6()
1250 ip->ip_tos = 0; in ip_test6()
1251 ip->ip_off = 0; in ip_test6()
1252 ip->ip_ttl = 60; in ip_test6()
1253 ip->ip_p = IPPROTO_UDP; in ip_test6()
1254 ip->ip_sum = 0; in ip_test6()
1255 u = (udphdr_t *)(ip + 1); in ip_test6()
1273 ip->ip_len = sizeof(*ip) + 768 + sizeof(*u); in ip_test6()
1274 IP_HL_A(ip, sizeof(*ip) >> 2); in ip_test6()
1275 ip->ip_off = htons(IP_MF); in ip_test6()
1276 (void) send_ip(nfd, 1500, ip, gwip, 1); in ip_test6()
1283 ip->ip_len = sizeof(*ip) + 128 + sizeof(*u); in ip_test6()
1284 ip->ip_off = htons(IP_MF); in ip_test6()
1285 (void) send_ip(nfd, 1500, ip, gwip, 1); in ip_test6()
1291 ip->ip_len = sizeof(*ip) + 768; in ip_test6()
1292 ip->ip_off = htons(IP_MF|(j>>3)); in ip_test6()
1293 (void) send_ip(nfd, 1500, ip, gwip, 1); in ip_test6()
1298 ip->ip_len = sizeof(*ip) + 128; in ip_test6()
1300 ip->ip_off = htons(IP_MF|(k>>3)); in ip_test6()
1301 (void) send_ip(nfd, 1500, ip, gwip, 1); in ip_test6()
1317 ip_test7(char *dev, int mtu, ip_t *ip, struct in_addr gwip, int ptest) in ip_test7() argument
1342 bcopy((char *)&ip->ip_dst, (char *)&pip->ip_dst, in ip_test7()
1358 bcopy((char *)&ip->ip_dst, (char *)&pip->ip_dst, in ip_test7()