| /drivers/net/ethernet/mellanox/mlx5/core/ |
| A D | en_selftest.c | 86 struct iphdr *iph; in mlx5e_test_get_udp_skb() local 120 iph->ihl = 5; in mlx5e_test_get_udp_skb() 121 iph->ttl = 32; in mlx5e_test_get_udp_skb() 122 iph->version = 4; in mlx5e_test_get_udp_skb() 127 iph->frag_off = 0; in mlx5e_test_get_udp_skb() 128 iph->saddr = 0; in mlx5e_test_get_udp_skb() 129 iph->daddr = 0; in mlx5e_test_get_udp_skb() 130 iph->tos = 0; in mlx5e_test_get_udp_skb() 131 iph->id = 0; in mlx5e_test_get_udp_skb() 141 udp4_hwcsum(skb, iph->saddr, iph->daddr); in mlx5e_test_get_udp_skb() [all …]
|
| /drivers/net/ |
| A D | amt.c | 519 struct iphdr *iph; in amt_build_igmp_gq() local 540 iph->version = 4; in amt_build_igmp_gq() 543 iph->tot_len = htons(sizeof(*iph) + AMT_IPHDR_OPTS + sizeof(*ihv3)); in amt_build_igmp_gq() 545 iph->ttl = 1; in amt_build_igmp_gq() 546 iph->id = 0; in amt_build_igmp_gq() 618 struct iphdr *iph; in amt_send_discovery() local 678 iph->version = 4; in amt_send_discovery() 681 iph->frag_off = 0; in amt_send_discovery() 707 struct iphdr *iph; in amt_send_request() local 769 iph->version = 4; in amt_send_request() [all …]
|
| A D | gtp.c | 234 struct iphdr *iph; in gtp_check_ms_ipv4() local 434 rt = ip4_route_output_gtp(&fl4, gtp->sk0, iph->saddr, iph->daddr); in gtp0_send_echo_resp_ip() 437 &iph->saddr); in gtp0_send_echo_resp_ip() 443 iph->tos, in gtp0_send_echo_resp_ip() 659 struct iphdr *iph; in gtp1u_send_echo_resp() local 688 iph = ip_hdr(skb); in gtp1u_send_echo_resp() 693 rt = ip4_route_output_gtp(&fl4, gtp->sk1u, iph->saddr, iph->daddr); in gtp1u_send_echo_resp() 696 &iph->saddr); in gtp1u_send_echo_resp() 702 iph->tos, in gtp1u_send_echo_resp() 1195 iph->tos, iph->frag_off); in gtp_build_skb_ip4() [all …]
|
| A D | vrf.c | 414 const struct ipv6hdr *iph; in vrf_process_v6_outbound() local 424 iph = ipv6_hdr(skb); in vrf_process_v6_outbound() 430 fl6.daddr = iph->daddr; in vrf_process_v6_outbound() 431 fl6.saddr = iph->saddr; in vrf_process_v6_outbound() 432 fl6.flowlabel = ip6_flowinfo(iph); in vrf_process_v6_outbound() 434 fl6.flowi6_proto = iph->nexthdr; in vrf_process_v6_outbound() 1254 if (iph->nexthdr == NEXTHDR_ICMP) { in ipv6_ndisc_frame() 1297 .flowi6_proto = iph->nexthdr, in vrf_ip6_input_dst() 1298 .daddr = iph->daddr, in vrf_ip6_input_dst() 1299 .saddr = iph->saddr, in vrf_ip6_input_dst() [all …]
|
| /drivers/net/netdevsim/ |
| A D | psample.c | 44 struct iphdr *iph; in nsim_dev_psample_skb_build() local 60 iph->protocol = IPPROTO_UDP; in nsim_dev_psample_skb_build() 61 iph->saddr = in_aton("192.0.2.1"); in nsim_dev_psample_skb_build() 63 iph->version = 0x4; in nsim_dev_psample_skb_build() 64 iph->frag_off = 0; in nsim_dev_psample_skb_build() 65 iph->ihl = 0x5; in nsim_dev_psample_skb_build() 66 iph->tot_len = htons(tot_len); in nsim_dev_psample_skb_build() 67 iph->id = 0; in nsim_dev_psample_skb_build() 68 iph->ttl = 100; in nsim_dev_psample_skb_build() 69 iph->check = 0; in nsim_dev_psample_skb_build() [all …]
|
| A D | dev.c | 761 struct iphdr *iph; in nsim_dev_trap_skb_build() local 777 iph->protocol = IPPROTO_UDP; in nsim_dev_trap_skb_build() 778 iph->saddr = in_aton("192.0.2.1"); in nsim_dev_trap_skb_build() 779 iph->daddr = in_aton("198.51.100.1"); in nsim_dev_trap_skb_build() 780 iph->version = 0x4; in nsim_dev_trap_skb_build() 781 iph->frag_off = 0; in nsim_dev_trap_skb_build() 782 iph->ihl = 0x5; in nsim_dev_trap_skb_build() 783 iph->tot_len = htons(tot_len); in nsim_dev_trap_skb_build() 784 iph->ttl = 100; in nsim_dev_trap_skb_build() 785 iph->check = 0; in nsim_dev_trap_skb_build() [all …]
|
| /drivers/infiniband/core/ |
| A D | lag.c | 17 struct iphdr *iph; in rdma_build_skb() local 44 iph = ip_hdr(skb); in rdma_build_skb() 45 iph->frag_off = 0; in rdma_build_skb() 46 iph->version = 4; in rdma_build_skb() 47 iph->protocol = IPPROTO_UDP; in rdma_build_skb() 48 iph->ihl = 0x5; in rdma_build_skb() 49 iph->tot_len = htons(sizeof(struct udphdr) + sizeof(struct in rdma_build_skb() 51 memcpy(&iph->saddr, ah_attr->grh.sgid_attr->gid.raw + 12, in rdma_build_skb() 53 memcpy(&iph->daddr, ah_attr->grh.dgid.raw + 12, in rdma_build_skb()
|
| A D | ud_header.c | 285 struct iphdr iph; in ib_ud_ip4_csum() local 287 iph.ihl = 5; in ib_ud_ip4_csum() 288 iph.version = 4; in ib_ud_ip4_csum() 289 iph.tos = header->ip4.tos; in ib_ud_ip4_csum() 290 iph.tot_len = header->ip4.tot_len; in ib_ud_ip4_csum() 291 iph.id = header->ip4.id; in ib_ud_ip4_csum() 293 iph.ttl = header->ip4.ttl; in ib_ud_ip4_csum() 295 iph.check = 0; in ib_ud_ip4_csum() 296 iph.saddr = header->ip4.saddr; in ib_ud_ip4_csum() 297 iph.daddr = header->ip4.daddr; in ib_ud_ip4_csum() [all …]
|
| /drivers/net/ppp/ |
| A D | pptp.c | 164 struct iphdr *iph; in pptp_xmit() local 235 skb_push(skb, sizeof(*iph)); in pptp_xmit() 240 iph = ip_hdr(skb); in pptp_xmit() 241 iph->version = 4; in pptp_xmit() 246 iph->frag_off = 0; in pptp_xmit() 248 iph->tos = 0; in pptp_xmit() 249 iph->daddr = fl4.daddr; in pptp_xmit() 250 iph->saddr = fl4.saddr; in pptp_xmit() 261 ip_send_check(iph); in pptp_xmit() 354 struct iphdr *iph; in pptp_rcv() local [all …]
|
| /drivers/infiniband/sw/rxe/ |
| A D | rxe_net.c | 230 struct iphdr *iph; in prepare_ipv4_hdr() local 241 iph = ip_hdr(skb); in prepare_ipv4_hdr() 243 iph->version = IPVERSION; in prepare_ipv4_hdr() 244 iph->ihl = sizeof(struct iphdr) >> 2; in prepare_ipv4_hdr() 245 iph->tot_len = htons(skb->len); in prepare_ipv4_hdr() 246 iph->frag_off = df; in prepare_ipv4_hdr() 247 iph->protocol = proto; in prepare_ipv4_hdr() 248 iph->tos = tos; in prepare_ipv4_hdr() 249 iph->daddr = daddr; in prepare_ipv4_hdr() 250 iph->saddr = saddr; in prepare_ipv4_hdr() [all …]
|
| /drivers/net/ethernet/intel/iavf/ |
| A D | iavf_fdir.c | 316 struct iphdr *iph = (struct iphdr *)hdr->buffer; in iavf_fill_fdir_ip4_hdr() local 321 iph->tos = fltr->ip_data.tos; in iavf_fill_fdir_ip4_hdr() 326 iph->protocol = fltr->ip_data.proto; in iavf_fill_fdir_ip4_hdr() 331 iph->saddr = fltr->ip_data.v4_addrs.src_ip; in iavf_fill_fdir_ip4_hdr() 336 iph->daddr = fltr->ip_data.v4_addrs.dst_ip; in iavf_fill_fdir_ip4_hdr() 355 struct ipv6hdr *iph = (struct ipv6hdr *)hdr->buffer; in iavf_fill_fdir_ip6_hdr() local 360 iph->priority = (fltr->ip_data.tclass >> 4) & 0xF; in iavf_fill_fdir_ip6_hdr() 361 iph->flow_lbl[0] = FIELD_PREP(0xF0, fltr->ip_data.tclass); in iavf_fill_fdir_ip6_hdr() 366 iph->nexthdr = fltr->ip_data.proto; in iavf_fill_fdir_ip6_hdr() 372 memcpy(&iph->saddr, &fltr->ip_data.v6_addrs.src_ip, in iavf_fill_fdir_ip6_hdr() [all …]
|
| /drivers/net/slip/ |
| A D | slhc.c | 648 struct iphdr *iph; in slhc_remember() local 660 iph = (struct iphdr *)icp; in slhc_remember() 662 ihl = iph->ihl; in slhc_remember() 670 index = iph->protocol; in slhc_remember() 671 iph->protocol = IPPROTO_TCP; in slhc_remember() 690 memcpy(&cs->cs_ip, iph, sizeof(*iph)); in slhc_remember() 693 memcpy(cs->cs_ipopt, &iph[1], (ihl - 5) * 4); in slhc_remember()
|
| /drivers/net/usb/ |
| A D | cdc_mbim.c | 311 struct ipv6hdr *iph = (void *)buf; in do_neigh_solicit() local 312 struct nd_msg *msg = (void *)(iph + 1); in do_neigh_solicit() 320 if (!ipv6_addr_is_solict_mult(&iph->daddr) || in do_neigh_solicit() 321 !(ipv6_addr_type(&iph->saddr) & IPV6_ADDR_UNICAST)) in do_neigh_solicit() 346 ipv6_stub->ndisc_send_na(netdev, &iph->saddr, &msg->target, in do_neigh_solicit() 357 struct ipv6hdr *iph = (void *)buf; in is_neigh_solicit() local 358 struct nd_msg *msg = (void *)(iph + 1); in is_neigh_solicit() 361 iph->nexthdr == IPPROTO_ICMPV6 && in is_neigh_solicit()
|
| /drivers/infiniband/hw/irdma/ |
| A D | utils.c | 1305 struct iphdr *iph = (struct iphdr *)buf->iph; in irdma_ieq_get_qp() local 1308 if (iph->version == 4) { in irdma_ieq_get_qp() 1354 struct iphdr *iph; in irdma_puda_ieq_get_ah_info() local 1369 iph = (struct iphdr *)buf->iph; in irdma_puda_ieq_get_ah_info() 1370 ah_info->hop_ttl = iph->ttl; in irdma_puda_ieq_get_ah_info() 1371 ah_info->tc_tos = iph->tos; in irdma_puda_ieq_get_ah_info() 1400 struct iphdr *iph; in irdma_gen1_ieq_update_tcpip_info() local 1442 struct iphdr *iph; in irdma_gen1_puda_get_tcpip_info() local 1459 buf->iph = mem + buf->maclen; in irdma_gen1_puda_get_tcpip_info() 1460 iph = (struct iphdr *)buf->iph; in irdma_gen1_puda_get_tcpip_info() [all …]
|
| A D | cm.c | 421 struct iphdr *iph; in irdma_form_uda_cm_frame() local 472 iph = (struct iphdr *)buf; in irdma_form_uda_cm_frame() 473 buf += sizeof(*iph); in irdma_form_uda_cm_frame() 492 iph->version = IPVERSION; in irdma_form_uda_cm_frame() 494 iph->tos = cm_node->tos; in irdma_form_uda_cm_frame() 495 iph->tot_len = htons(pktsize); in irdma_form_uda_cm_frame() 499 iph->ttl = 0x40; in irdma_form_uda_cm_frame() 500 iph->protocol = IPPROTO_TCP; in irdma_form_uda_cm_frame() 3142 struct iphdr *iph; in irdma_receive_ilq() local 3152 iph = (struct iphdr *)rbuf->iph; in irdma_receive_ilq() [all …]
|
| /drivers/net/ethernet/netronome/nfp/nfdk/ |
| A D | ipsec.c | 12 struct iphdr *iph = ip_hdr(skb); in nfp_nfdk_ipsec_tx() local 15 if (iph->version == 4) in nfp_nfdk_ipsec_tx()
|
| /drivers/net/ethernet/sun/ |
| A D | sunvnet_common.c | 310 struct iphdr *iph = ip_hdr(skb); in vnet_fullcsum_ipv4() local 315 if (iph->protocol != IPPROTO_TCP && in vnet_fullcsum_ipv4() 316 iph->protocol != IPPROTO_UDP) in vnet_fullcsum_ipv4() 321 if (iph->protocol == IPPROTO_TCP) { in vnet_fullcsum_ipv4() 326 ptcp->check = csum_tcpudp_magic(iph->saddr, iph->daddr, in vnet_fullcsum_ipv4() 334 pudp->check = csum_tcpudp_magic(iph->saddr, iph->daddr, in vnet_fullcsum_ipv4() 423 iph->check = 0; in vnet_rx_one() 424 ip_send_check(iph); in vnet_rx_one() 431 int ihl = iph->ihl * 4; in vnet_rx_one() 1181 iph->daddr, in vnet_skb_shape() [all …]
|
| /drivers/net/ethernet/netronome/nfp/nfd3/ |
| A D | ipsec.c | 14 struct iphdr *iph = ip_hdr(skb); in nfp_nfd3_ipsec_tx() local 20 if (iph->version == 4) in nfp_nfd3_ipsec_tx()
|
| /drivers/net/ethernet/qualcomm/rmnet/ |
| A D | rmnet_map_data.c | 256 void *iph = ip_hdr(skb); in rmnet_map_v5_checksum_uplink_packet() local 262 u16 ip_len = ((struct iphdr *)iph)->ihl * 4; in rmnet_map_v5_checksum_uplink_packet() 264 proto = ((struct iphdr *)iph)->protocol; in rmnet_map_v5_checksum_uplink_packet() 265 trans = iph + ip_len; in rmnet_map_v5_checksum_uplink_packet() 270 proto = ((struct ipv6hdr *)iph)->nexthdr; in rmnet_map_v5_checksum_uplink_packet() 271 trans = iph + ip_len; in rmnet_map_v5_checksum_uplink_packet()
|
| /drivers/net/ethernet/ibm/ |
| A D | ibmveth.c | 1343 offset = iph->ihl * 4; in ibmveth_rx_mss_helper() 1382 struct iphdr *iph = NULL; in ibmveth_rx_csum_helper() local 1392 iph = (struct iphdr *)skb->data; in ibmveth_rx_csum_helper() 1397 if (iph->check == 0xffff) { in ibmveth_rx_csum_helper() 1398 iph->check = 0; in ibmveth_rx_csum_helper() 1399 iph->check = ip_fast_csum((unsigned char *)iph, in ibmveth_rx_csum_helper() 1400 iph->ihl); in ibmveth_rx_csum_helper() 1403 iphlen = iph->ihl * 4; in ibmveth_rx_csum_helper() 1404 iph_proto = iph->protocol; in ibmveth_rx_csum_helper() 1434 ~csum_tcpudp_magic(iph->saddr, in ibmveth_rx_csum_helper() [all …]
|
| /drivers/net/ethernet/mellanox/mlx5/core/en_accel/ |
| A D | ktls_rx.c | 489 struct iphdr *iph; in resync_update_sn() local 495 iph = (struct iphdr *)(skb->data + depth); in resync_update_sn() 497 if (iph->version == 4) { in resync_update_sn() 499 th = (void *)iph + sizeof(struct iphdr); in resync_update_sn() 502 iph->saddr, th->source, iph->daddr, in resync_update_sn() 506 struct ipv6hdr *ipv6h = (struct ipv6hdr *)iph; in resync_update_sn()
|
| /drivers/net/ethernet/netronome/nfp/crypto/ |
| A D | tls.c | 480 struct iphdr *iph; in nfp_net_tls_rx_resync_req() local 485 iph = pkt + req->l3_offset; in nfp_net_tls_rx_resync_req() 499 iph->saddr, th->source, iph->daddr, in nfp_net_tls_rx_resync_req() 512 req->l3_offset, req->l4_offset, iph->version); in nfp_net_tls_rx_resync_req()
|
| /drivers/net/ethernet/chelsio/inline_crypto/chtls/ |
| A D | chtls_cm.c | 1117 const struct iphdr *iph; in chtls_recv_sock() local 1189 if (iph->version == 0x4) { in chtls_recv_sock() 1190 newinet->inet_daddr = iph->saddr; in chtls_recv_sock() 1192 newinet->inet_saddr = iph->daddr; in chtls_recv_sock() 1302 struct iphdr *iph; in chtls_pass_accept_request() local 1343 iph = (struct iphdr *)(eh + 1); in chtls_pass_accept_request() 1353 if (iph->version == 0x4) { in chtls_pass_accept_request() 1354 tcph = (struct tcphdr *)(iph + 1); in chtls_pass_accept_request() 1375 if (iph->version == 0x4) { in chtls_pass_accept_request() 1376 chtls_set_req_addr(oreq, iph->daddr, iph->saddr); in chtls_pass_accept_request() [all …]
|
| /drivers/net/ethernet/qlogic/qlcnic/ |
| A D | qlcnic_io.c | 1269 struct iphdr *iph; in qlcnic_process_lro() local 1327 iph = (struct iphdr *)skb->data; in qlcnic_process_lro() 1328 th = (struct tcphdr *)(skb->data + (iph->ihl << 2)); in qlcnic_process_lro() 1329 length = (iph->ihl << 2) + (th->doff << 2) + lro_length; in qlcnic_process_lro() 1330 csum_replace2(&iph->check, iph->tot_len, htons(length)); in qlcnic_process_lro() 1331 iph->tot_len = htons(length); in qlcnic_process_lro() 1790 struct iphdr *iph; in qlcnic_83xx_process_lro() local 1849 iph = (struct iphdr *)skb->data; in qlcnic_83xx_process_lro() 1850 th = (struct tcphdr *)(skb->data + (iph->ihl << 2)); in qlcnic_83xx_process_lro() 1852 csum_replace2(&iph->check, iph->tot_len, htons(length)); in qlcnic_83xx_process_lro() [all …]
|
| /drivers/net/ethernet/mellanox/mlxsw/ |
| A D | spectrum_ipip.c | 76 return (union mlxsw_sp_l3addr) { .addr4 = parms->iph.saddr }; in mlxsw_sp_ipip_parms4_saddr() 88 return (union mlxsw_sp_l3addr) { .addr4 = parms->iph.daddr }; in mlxsw_sp_ipip_parms4_daddr() 245 bool inherit_ttl = tunnel->parms.iph.ttl == 0; in mlxsw_sp_ipip_can_offload_gre4() 246 bool inherit_tos = tunnel->parms.iph.tos & 0x1; in mlxsw_sp_ipip_can_offload_gre4()
|