Lines Matching refs:tcp

170 	tcphdr_t	th, *tcp = &th;
177 bzero((char *)ip, MAX(sizeof(*tcp), sizeof(*ic)) + sizeof(*ip));
178 bzero((char *)tcp, sizeof(*tcp));
219 if (!strcasecmp(*cpp, "tcp") || !strcasecmp(*cpp, "udp") ||
224 tx_proto = "tcp";
248 fprintf(stderr, "tcp/udp with no source port\n");
252 tcp->th_sport = htons(tx_portnum(last));
254 tcp->th_win = htons(4096);
255 TCP_OFF_A(tcp, sizeof(*tcp) >> 2);
268 fprintf(stderr, "tcp/udp with no destination port\n");
272 tcp->th_dport = htons(tx_portnum(last));
280 tcp->th_flags = 0;
283 tcp->th_flags |= myflags[t-myflagset];
284 if (tcp->th_flags)
288 if (tcp->th_flags & TH_URG)
289 tcp->th_urp = htons(1);
292 tcp->th_seq = htonl(atoi(*cpp + 4));
297 tcp->th_ack = htonl(atoi(*cpp + 4));
331 bcopy((char *)tcp, ((char *)ip) + (IP_HL(ip) << 2),
332 sizeof(*tcp));
348 tcphdr_t th, *tcp = &th;
351 bzero((char *)ip6, MAX(sizeof(*tcp), sizeof(*ic6)) + sizeof(*ip6));
352 bzero((char *)tcp, sizeof(*tcp));
370 if (!strcasecmp(*cpp, "tcp")) {
372 tx_proto = "tcp";
411 fprintf(stderr, "tcp/udp with no source port\n");
415 tcp->th_sport = htons(tx_portnum(last));
417 tcp->th_win = htons(4096);
418 TCP_OFF_A(tcp, sizeof(*tcp) >> 2);
436 fprintf(stderr, "tcp/udp with no destination port\n");
440 tcp->th_dport = htons(tx_portnum(last));
454 tcp->th_flags = 0;
457 tcp->th_flags |= myflags[t-myflagset];
458 if (tcp->th_flags)
462 if (tcp->th_flags & TH_URG)
463 tcp->th_urp = htons(1);
466 tcp->th_seq = htonl(atoi(*cpp + 4));
471 tcp->th_ack = htonl(atoi(*cpp + 4));
494 bcopy((char *)tcp, (char *)ip6 + sizeof(*ip6),
495 sizeof(*tcp));