Lines Matching refs:nh

385 		    const struct nshhdr *nh)  in push_nsh()  argument
389 err = nsh_push(skb, nh); in push_nsh()
416 static void update_ip_l4_checksum(struct sk_buff *skb, struct iphdr *nh, in update_ip_l4_checksum() argument
421 if (nh->frag_off & htons(IP_OFFSET)) in update_ip_l4_checksum()
424 if (nh->protocol == IPPROTO_TCP) { in update_ip_l4_checksum()
428 } else if (nh->protocol == IPPROTO_UDP) { in update_ip_l4_checksum()
442 static void set_ip_addr(struct sk_buff *skb, struct iphdr *nh, in set_ip_addr() argument
445 update_ip_l4_checksum(skb, nh, *addr, new_addr); in set_ip_addr()
446 csum_replace4(&nh->check, *addr, new_addr); in set_ip_addr()
498 static void set_ipv6_fl(struct ipv6hdr *nh, u32 fl, u32 mask) in set_ipv6_fl() argument
501 OVS_SET_MASKED(nh->flow_lbl[0], (u8)(fl >> 16), (u8)(mask >> 16)); in set_ipv6_fl()
502 OVS_SET_MASKED(nh->flow_lbl[1], (u8)(fl >> 8), (u8)(mask >> 8)); in set_ipv6_fl()
503 OVS_SET_MASKED(nh->flow_lbl[2], (u8)fl, (u8)mask); in set_ipv6_fl()
506 static void set_ip_ttl(struct sk_buff *skb, struct iphdr *nh, u8 new_ttl, in set_ip_ttl() argument
509 new_ttl = OVS_MASKED(nh->ttl, new_ttl, mask); in set_ip_ttl()
511 csum_replace2(&nh->check, htons(nh->ttl << 8), htons(new_ttl << 8)); in set_ip_ttl()
512 nh->ttl = new_ttl; in set_ip_ttl()
519 struct iphdr *nh; in set_ipv4() local
528 nh = ip_hdr(skb); in set_ipv4()
535 new_addr = OVS_MASKED(nh->saddr, key->ipv4_src, mask->ipv4_src); in set_ipv4()
537 if (unlikely(new_addr != nh->saddr)) { in set_ipv4()
538 set_ip_addr(skb, nh, &nh->saddr, new_addr); in set_ipv4()
543 new_addr = OVS_MASKED(nh->daddr, key->ipv4_dst, mask->ipv4_dst); in set_ipv4()
545 if (unlikely(new_addr != nh->daddr)) { in set_ipv4()
546 set_ip_addr(skb, nh, &nh->daddr, new_addr); in set_ipv4()
551 ipv4_change_dsfield(nh, ~mask->ipv4_tos, key->ipv4_tos); in set_ipv4()
552 flow_key->ip.tos = nh->tos; in set_ipv4()
555 set_ip_ttl(skb, nh, key->ipv4_ttl, mask->ipv4_ttl); in set_ipv4()
556 flow_key->ip.ttl = nh->ttl; in set_ipv4()
571 struct ipv6hdr *nh; in set_ipv6() local
579 nh = ipv6_hdr(skb); in set_ipv6()
586 __be32 *saddr = (__be32 *)&nh->saddr; in set_ipv6()
602 __be32 *daddr = (__be32 *)&nh->daddr; in set_ipv6()
608 if (ipv6_ext_hdr(nh->nexthdr)) in set_ipv6()
621 ipv6_change_dsfield(nh, ~mask->ipv6_tclass, key->ipv6_tclass); in set_ipv6()
622 flow_key->ip.tos = ipv6_get_dsfield(nh); in set_ipv6()
625 set_ipv6_fl(nh, ntohl(key->ipv6_label), in set_ipv6()
628 *(__be32 *)nh & htonl(IPV6_FLOWINFO_FLOWLABEL); in set_ipv6()
631 OVS_SET_MASKED(nh->hop_limit, key->ipv6_hlimit, in set_ipv6()
633 flow_key->ip.ttl = nh->hop_limit; in set_ipv6()
641 struct nshhdr *nh; in set_nsh() local
659 nh = nsh_hdr(skb); in set_nsh()
660 length = nsh_hdr_len(nh); in set_nsh()
668 nh = nsh_hdr(skb); in set_nsh()
669 skb_postpull_rcsum(skb, nh, length); in set_nsh()
670 flags = nsh_get_flags(nh); in set_nsh()
673 ttl = nsh_get_ttl(nh); in set_nsh()
676 nsh_set_flags_and_ttl(nh, flags, ttl); in set_nsh()
677 nh->path_hdr = OVS_MASKED(nh->path_hdr, key.base.path_hdr, in set_nsh()
679 flow_key->nsh.base.path_hdr = nh->path_hdr; in set_nsh()
680 switch (nh->mdtype) { in set_nsh()
683 nh->md1.context[i] = in set_nsh()
684 OVS_MASKED(nh->md1.context[i], key.context[i], in set_nsh()
687 memcpy(flow_key->nsh.context, nh->md1.context, in set_nsh()
688 sizeof(nh->md1.context)); in set_nsh()
697 skb_postpush_rcsum(skb, nh, length); in set_nsh()
1342 struct nshhdr *nh = (struct nshhdr *)buffer; in do_execute_actions() local
1344 err = nsh_hdr_from_nlattr(nla_data(a), nh, in do_execute_actions()
1348 err = push_nsh(skb, key, nh); in do_execute_actions()