Lines Matching refs:daddr

169 		struct in6_addr daddr;  in tcp_checksum()  member
175 struct in_addr daddr; in tcp_checksum() member
184 if (inet_pton(AF_INET6, addr6_dst, &ph6.daddr) != 1) in tcp_checksum()
193 if (inet_pton(AF_INET, addr4_dst, &ph4.daddr) != 1) in tcp_checksum()
235 if (inet_pton(AF_INET6, addr6_dst, &ip6h->daddr) != 1) in fill_networklayer()
249 if (inet_pton(AF_INET, addr4_dst, &iph->daddr) != 1) in fill_networklayer()
274 static void write_packet(int fd, char *buf, int len, struct sockaddr_ll *daddr) in write_packet() argument
278 ret = sendto(fd, buf, len, 0, (struct sockaddr *)daddr, sizeof(*daddr)); in write_packet()
297 static void send_flags(int fd, struct sockaddr_ll *daddr, int psh, int syn, in send_flags() argument
321 write_packet(fd, flag_buf, pkt_size, daddr); in send_flags()
325 write_packet(fd, buf, total_hdr_len + PAYLOAD_LEN, daddr); in send_flags()
332 static void send_data_pkts(int fd, struct sockaddr_ll *daddr, in send_data_pkts() argument
338 write_packet(fd, buf, total_hdr_len + payload_len1, daddr); in send_data_pkts()
340 write_packet(fd, buf, total_hdr_len + payload_len2, daddr); in send_data_pkts()
346 static void send_large(int fd, struct sockaddr_ll *daddr, int remainder) in send_large() argument
359 write_packet(fd, pkts[i], total_hdr_len + MSS, daddr); in send_large()
360 write_packet(fd, last, total_hdr_len + remainder, daddr); in send_large()
361 write_packet(fd, new_seg, total_hdr_len + remainder, daddr); in send_large()
365 static void send_ack(int fd, struct sockaddr_ll *daddr) in send_ack() argument
370 write_packet(fd, buf, total_hdr_len, daddr); in send_ack()
371 write_packet(fd, buf, total_hdr_len, daddr); in send_ack()
373 write_packet(fd, buf, total_hdr_len, daddr); in send_ack()
469 static void send_changed_checksum(int fd, struct sockaddr_ll *daddr) in send_changed_checksum() argument
476 write_packet(fd, buf, pkt_size, daddr); in send_changed_checksum()
480 write_packet(fd, buf, pkt_size, daddr); in send_changed_checksum()
484 static void send_changed_seq(int fd, struct sockaddr_ll *daddr) in send_changed_seq() argument
491 write_packet(fd, buf, pkt_size, daddr); in send_changed_seq()
497 write_packet(fd, buf, pkt_size, daddr); in send_changed_seq()
503 static void send_changed_ts(int fd, struct sockaddr_ll *daddr) in send_changed_ts() argument
511 write_packet(fd, extpkt, pkt_size, daddr); in send_changed_ts()
515 write_packet(fd, extpkt, pkt_size, daddr); in send_changed_ts()
519 write_packet(fd, extpkt, pkt_size, daddr); in send_changed_ts()
523 write_packet(fd, extpkt, pkt_size, daddr); in send_changed_ts()
527 write_packet(fd, extpkt, pkt_size, daddr); in send_changed_ts()
531 static void send_diff_opt(int fd, struct sockaddr_ll *daddr) in send_diff_opt() argument
541 write_packet(fd, extpkt1, extpkt1_size, daddr); in send_diff_opt()
545 write_packet(fd, extpkt1, extpkt1_size, daddr); in send_diff_opt()
551 write_packet(fd, extpkt2, extpkt2_size, daddr); in send_diff_opt()
580 static void send_ip_options(int fd, struct sockaddr_ll *daddr) in send_ip_options() argument
588 write_packet(fd, buf, total_hdr_len + PAYLOAD_LEN, daddr); in send_ip_options()
592 write_packet(fd, optpkt, pkt_size, daddr); in send_ip_options()
595 write_packet(fd, buf, total_hdr_len + PAYLOAD_LEN, daddr); in send_ip_options()
599 static void send_fragment4(int fd, struct sockaddr_ll *daddr) in send_fragment4() argument
606 write_packet(fd, buf, pkt_size, daddr); in send_fragment4()
620 write_packet(fd, buf, pkt_size, daddr); in send_fragment4()
624 static void send_changed_ttl(int fd, struct sockaddr_ll *daddr) in send_changed_ttl() argument
631 write_packet(fd, buf, pkt_size, daddr); in send_changed_ttl()
637 write_packet(fd, buf, pkt_size, daddr); in send_changed_ttl()
641 static void send_changed_tos(int fd, struct sockaddr_ll *daddr) in send_changed_tos() argument
649 write_packet(fd, buf, pkt_size, daddr); in send_changed_tos()
659 write_packet(fd, buf, pkt_size, daddr); in send_changed_tos()
663 static void send_changed_ECN(int fd, struct sockaddr_ll *daddr) in send_changed_ECN() argument
670 write_packet(fd, buf, pkt_size, daddr); in send_changed_ECN()
680 write_packet(fd, buf, pkt_size, daddr); in send_changed_ECN()
684 static void send_fragment6(int fd, struct sockaddr_ll *daddr) in send_fragment6() argument
698 write_packet(fd, buf, bufpkt_len, daddr); in send_fragment6()
711 write_packet(fd, extpkt, extpkt_len, daddr); in send_fragment6()
714 write_packet(fd, buf, bufpkt_len, daddr); in send_fragment6()
719 struct sockaddr_ll daddr = {}; in bind_packetsocket() local
721 daddr.sll_family = AF_PACKET; in bind_packetsocket()
722 daddr.sll_protocol = ethhdr_proto; in bind_packetsocket()
723 daddr.sll_ifindex = if_nametoindex(ifname); in bind_packetsocket()
724 if (daddr.sll_ifindex == 0) in bind_packetsocket()
727 if (bind(fd, (void *)&daddr, sizeof(daddr)) < 0) in bind_packetsocket()
806 struct sockaddr_ll daddr = {}; in gro_sender() local
813 memset(&daddr, 0, sizeof(daddr)); in gro_sender()
814 daddr.sll_ifindex = if_nametoindex(ifname); in gro_sender()
815 if (daddr.sll_ifindex == 0) in gro_sender()
817 daddr.sll_family = AF_PACKET; in gro_sender()
818 memcpy(daddr.sll_addr, dst_mac, ETH_ALEN); in gro_sender()
819 daddr.sll_halen = ETH_ALEN; in gro_sender()
823 send_data_pkts(txfd, &daddr, PAYLOAD_LEN, PAYLOAD_LEN); in gro_sender()
824 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); in gro_sender()
826 send_data_pkts(txfd, &daddr, PAYLOAD_LEN, PAYLOAD_LEN / 2); in gro_sender()
827 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); in gro_sender()
829 send_data_pkts(txfd, &daddr, PAYLOAD_LEN / 2, PAYLOAD_LEN); in gro_sender()
830 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); in gro_sender()
832 send_ack(txfd, &daddr); in gro_sender()
833 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); in gro_sender()
835 send_flags(txfd, &daddr, 1, 0, 0, 0); in gro_sender()
836 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); in gro_sender()
838 send_flags(txfd, &daddr, 0, 1, 0, 0); in gro_sender()
839 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); in gro_sender()
841 send_flags(txfd, &daddr, 0, 0, 1, 0); in gro_sender()
842 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); in gro_sender()
844 send_flags(txfd, &daddr, 0, 0, 0, 1); in gro_sender()
845 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); in gro_sender()
847 send_changed_checksum(txfd, &daddr); in gro_sender()
848 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); in gro_sender()
850 send_changed_seq(txfd, &daddr); in gro_sender()
851 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); in gro_sender()
853 send_changed_ts(txfd, &daddr); in gro_sender()
854 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); in gro_sender()
856 send_diff_opt(txfd, &daddr); in gro_sender()
857 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); in gro_sender()
859 send_changed_ECN(txfd, &daddr); in gro_sender()
860 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); in gro_sender()
862 send_changed_tos(txfd, &daddr); in gro_sender()
863 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); in gro_sender()
870 send_changed_ttl(txfd, &daddr); in gro_sender()
871 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); in gro_sender()
874 send_ip_options(txfd, &daddr); in gro_sender()
876 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); in gro_sender()
879 send_fragment4(txfd, &daddr); in gro_sender()
881 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); in gro_sender()
883 send_fragment6(txfd, &daddr); in gro_sender()
884 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); in gro_sender()
894 send_large(txfd, &daddr, remainder); in gro_sender()
895 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); in gro_sender()
897 send_large(txfd, &daddr, remainder + 1); in gro_sender()
898 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); in gro_sender()