Lines Matching refs:nh

313 		    const struct nshhdr *nh)  in push_nsh()  argument
317 err = nsh_push(skb, nh); in push_nsh()
344 static void update_ip_l4_checksum(struct sk_buff *skb, struct iphdr *nh, in update_ip_l4_checksum() argument
349 if (nh->frag_off & htons(IP_OFFSET)) in update_ip_l4_checksum()
352 if (nh->protocol == IPPROTO_TCP) { in update_ip_l4_checksum()
356 } else if (nh->protocol == IPPROTO_UDP) { in update_ip_l4_checksum()
370 static void set_ip_addr(struct sk_buff *skb, struct iphdr *nh, in set_ip_addr() argument
373 update_ip_l4_checksum(skb, nh, *addr, new_addr); in set_ip_addr()
374 csum_replace4(&nh->check, *addr, new_addr); in set_ip_addr()
426 static void set_ipv6_fl(struct ipv6hdr *nh, u32 fl, u32 mask) in set_ipv6_fl() argument
429 OVS_SET_MASKED(nh->flow_lbl[0], (u8)(fl >> 16), (u8)(mask >> 16)); in set_ipv6_fl()
430 OVS_SET_MASKED(nh->flow_lbl[1], (u8)(fl >> 8), (u8)(mask >> 8)); in set_ipv6_fl()
431 OVS_SET_MASKED(nh->flow_lbl[2], (u8)fl, (u8)mask); in set_ipv6_fl()
434 static void set_ip_ttl(struct sk_buff *skb, struct iphdr *nh, u8 new_ttl, in set_ip_ttl() argument
437 new_ttl = OVS_MASKED(nh->ttl, new_ttl, mask); in set_ip_ttl()
439 csum_replace2(&nh->check, htons(nh->ttl << 8), htons(new_ttl << 8)); in set_ip_ttl()
440 nh->ttl = new_ttl; in set_ip_ttl()
447 struct iphdr *nh; in set_ipv4() local
456 nh = ip_hdr(skb); in set_ipv4()
463 new_addr = OVS_MASKED(nh->saddr, key->ipv4_src, mask->ipv4_src); in set_ipv4()
465 if (unlikely(new_addr != nh->saddr)) { in set_ipv4()
466 set_ip_addr(skb, nh, &nh->saddr, new_addr); in set_ipv4()
471 new_addr = OVS_MASKED(nh->daddr, key->ipv4_dst, mask->ipv4_dst); in set_ipv4()
473 if (unlikely(new_addr != nh->daddr)) { in set_ipv4()
474 set_ip_addr(skb, nh, &nh->daddr, new_addr); in set_ipv4()
479 ipv4_change_dsfield(nh, ~mask->ipv4_tos, key->ipv4_tos); in set_ipv4()
480 flow_key->ip.tos = nh->tos; in set_ipv4()
483 set_ip_ttl(skb, nh, key->ipv4_ttl, mask->ipv4_ttl); in set_ipv4()
484 flow_key->ip.ttl = nh->ttl; in set_ipv4()
499 struct ipv6hdr *nh; in set_ipv6() local
507 nh = ipv6_hdr(skb); in set_ipv6()
514 __be32 *saddr = (__be32 *)&nh->saddr; in set_ipv6()
530 __be32 *daddr = (__be32 *)&nh->daddr; in set_ipv6()
536 if (ipv6_ext_hdr(nh->nexthdr)) in set_ipv6()
549 ipv6_change_dsfield(nh, ~mask->ipv6_tclass, key->ipv6_tclass); in set_ipv6()
550 flow_key->ip.tos = ipv6_get_dsfield(nh); in set_ipv6()
553 set_ipv6_fl(nh, ntohl(key->ipv6_label), in set_ipv6()
556 *(__be32 *)nh & htonl(IPV6_FLOWINFO_FLOWLABEL); in set_ipv6()
559 OVS_SET_MASKED(nh->hop_limit, key->ipv6_hlimit, in set_ipv6()
561 flow_key->ip.ttl = nh->hop_limit; in set_ipv6()
569 struct nshhdr *nh; in set_nsh() local
587 nh = nsh_hdr(skb); in set_nsh()
588 length = nsh_hdr_len(nh); in set_nsh()
596 nh = nsh_hdr(skb); in set_nsh()
597 skb_postpull_rcsum(skb, nh, length); in set_nsh()
598 flags = nsh_get_flags(nh); in set_nsh()
601 ttl = nsh_get_ttl(nh); in set_nsh()
604 nsh_set_flags_and_ttl(nh, flags, ttl); in set_nsh()
605 nh->path_hdr = OVS_MASKED(nh->path_hdr, key.base.path_hdr, in set_nsh()
607 flow_key->nsh.base.path_hdr = nh->path_hdr; in set_nsh()
608 switch (nh->mdtype) { in set_nsh()
611 nh->md1.context[i] = in set_nsh()
612 OVS_MASKED(nh->md1.context[i], key.context[i], in set_nsh()
615 memcpy(flow_key->nsh.context, nh->md1.context, in set_nsh()
616 sizeof(nh->md1.context)); in set_nsh()
625 skb_postpush_rcsum(skb, nh, length); in set_nsh()
1206 struct ipv6hdr *nh; in execute_dec_ttl() local
1209 sizeof(*nh)); in execute_dec_ttl()
1213 nh = ipv6_hdr(skb); in execute_dec_ttl()
1215 if (nh->hop_limit <= 1) in execute_dec_ttl()
1218 key->ip.ttl = --nh->hop_limit; in execute_dec_ttl()
1220 struct iphdr *nh; in execute_dec_ttl() local
1224 sizeof(*nh)); in execute_dec_ttl()
1228 nh = ip_hdr(skb); in execute_dec_ttl()
1229 if (nh->ttl <= 1) in execute_dec_ttl()
1232 old_ttl = nh->ttl--; in execute_dec_ttl()
1233 csum_replace2(&nh->check, htons(old_ttl << 8), in execute_dec_ttl()
1234 htons(nh->ttl << 8)); in execute_dec_ttl()
1235 key->ip.ttl = nh->ttl; in execute_dec_ttl()
1388 struct nshhdr *nh = (struct nshhdr *)buffer; in do_execute_actions() local
1390 err = nsh_hdr_from_nlattr(nla_data(a), nh, in do_execute_actions()
1394 err = push_nsh(skb, key, nh); in do_execute_actions()