• Home
  • Raw
  • Download

Lines Matching refs:nh

312 		    const struct nshhdr *nh)  in push_nsh()  argument
316 err = nsh_push(skb, nh); in push_nsh()
343 static void update_ip_l4_checksum(struct sk_buff *skb, struct iphdr *nh, in update_ip_l4_checksum() argument
348 if (nh->frag_off & htons(IP_OFFSET)) in update_ip_l4_checksum()
351 if (nh->protocol == IPPROTO_TCP) { in update_ip_l4_checksum()
355 } else if (nh->protocol == IPPROTO_UDP) { in update_ip_l4_checksum()
369 static void set_ip_addr(struct sk_buff *skb, struct iphdr *nh, in set_ip_addr() argument
372 update_ip_l4_checksum(skb, nh, *addr, new_addr); in set_ip_addr()
373 csum_replace4(&nh->check, *addr, new_addr); in set_ip_addr()
427 static void set_ipv6_dsfield(struct sk_buff *skb, struct ipv6hdr *nh, u8 ipv6_tclass, u8 mask) in set_ipv6_dsfield() argument
429 u8 old_ipv6_tclass = ipv6_get_dsfield(nh); in set_ipv6_dsfield()
437 ipv6_change_dsfield(nh, ~mask, ipv6_tclass); in set_ipv6_dsfield()
440 static void set_ipv6_fl(struct sk_buff *skb, struct ipv6hdr *nh, u32 fl, u32 mask) in set_ipv6_fl() argument
444 ofl = nh->flow_lbl[0] << 16 | nh->flow_lbl[1] << 8 | nh->flow_lbl[2]; in set_ipv6_fl()
448 nh->flow_lbl[0] = (u8)(fl >> 16); in set_ipv6_fl()
449 nh->flow_lbl[1] = (u8)(fl >> 8); in set_ipv6_fl()
450 nh->flow_lbl[2] = (u8)fl; in set_ipv6_fl()
456 static void set_ipv6_ttl(struct sk_buff *skb, struct ipv6hdr *nh, u8 new_ttl, u8 mask) in set_ipv6_ttl() argument
458 new_ttl = OVS_MASKED(nh->hop_limit, new_ttl, mask); in set_ipv6_ttl()
461 csum_replace(&skb->csum, (__force __wsum)(nh->hop_limit << 8), in set_ipv6_ttl()
463 nh->hop_limit = new_ttl; in set_ipv6_ttl()
466 static void set_ip_ttl(struct sk_buff *skb, struct iphdr *nh, u8 new_ttl, in set_ip_ttl() argument
469 new_ttl = OVS_MASKED(nh->ttl, new_ttl, mask); in set_ip_ttl()
471 csum_replace2(&nh->check, htons(nh->ttl << 8), htons(new_ttl << 8)); in set_ip_ttl()
472 nh->ttl = new_ttl; in set_ip_ttl()
479 struct iphdr *nh; in set_ipv4() local
488 nh = ip_hdr(skb); in set_ipv4()
495 new_addr = OVS_MASKED(nh->saddr, key->ipv4_src, mask->ipv4_src); in set_ipv4()
497 if (unlikely(new_addr != nh->saddr)) { in set_ipv4()
498 set_ip_addr(skb, nh, &nh->saddr, new_addr); in set_ipv4()
503 new_addr = OVS_MASKED(nh->daddr, key->ipv4_dst, mask->ipv4_dst); in set_ipv4()
505 if (unlikely(new_addr != nh->daddr)) { in set_ipv4()
506 set_ip_addr(skb, nh, &nh->daddr, new_addr); in set_ipv4()
511 ipv4_change_dsfield(nh, ~mask->ipv4_tos, key->ipv4_tos); in set_ipv4()
512 flow_key->ip.tos = nh->tos; in set_ipv4()
515 set_ip_ttl(skb, nh, key->ipv4_ttl, mask->ipv4_ttl); in set_ipv4()
516 flow_key->ip.ttl = nh->ttl; in set_ipv4()
531 struct ipv6hdr *nh; in set_ipv6() local
539 nh = ipv6_hdr(skb); in set_ipv6()
546 __be32 *saddr = (__be32 *)&nh->saddr; in set_ipv6()
562 __be32 *daddr = (__be32 *)&nh->daddr; in set_ipv6()
568 if (ipv6_ext_hdr(nh->nexthdr)) in set_ipv6()
581 set_ipv6_dsfield(skb, nh, key->ipv6_tclass, mask->ipv6_tclass); in set_ipv6()
582 flow_key->ip.tos = ipv6_get_dsfield(nh); in set_ipv6()
585 set_ipv6_fl(skb, nh, ntohl(key->ipv6_label), in set_ipv6()
588 *(__be32 *)nh & htonl(IPV6_FLOWINFO_FLOWLABEL); in set_ipv6()
591 set_ipv6_ttl(skb, nh, key->ipv6_hlimit, mask->ipv6_hlimit); in set_ipv6()
592 flow_key->ip.ttl = nh->hop_limit; in set_ipv6()
600 struct nshhdr *nh; in set_nsh() local
618 nh = nsh_hdr(skb); in set_nsh()
619 length = nsh_hdr_len(nh); in set_nsh()
627 nh = nsh_hdr(skb); in set_nsh()
628 skb_postpull_rcsum(skb, nh, length); in set_nsh()
629 flags = nsh_get_flags(nh); in set_nsh()
632 ttl = nsh_get_ttl(nh); in set_nsh()
635 nsh_set_flags_and_ttl(nh, flags, ttl); in set_nsh()
636 nh->path_hdr = OVS_MASKED(nh->path_hdr, key.base.path_hdr, in set_nsh()
638 flow_key->nsh.base.path_hdr = nh->path_hdr; in set_nsh()
639 switch (nh->mdtype) { in set_nsh()
642 nh->md1.context[i] = in set_nsh()
643 OVS_MASKED(nh->md1.context[i], key.context[i], in set_nsh()
646 memcpy(flow_key->nsh.context, nh->md1.context, in set_nsh()
647 sizeof(nh->md1.context)); in set_nsh()
656 skb_postpush_rcsum(skb, nh, length); in set_nsh()
1235 struct ipv6hdr *nh; in execute_dec_ttl() local
1238 sizeof(*nh)); in execute_dec_ttl()
1242 nh = ipv6_hdr(skb); in execute_dec_ttl()
1244 if (nh->hop_limit <= 1) in execute_dec_ttl()
1247 key->ip.ttl = --nh->hop_limit; in execute_dec_ttl()
1249 struct iphdr *nh; in execute_dec_ttl() local
1253 sizeof(*nh)); in execute_dec_ttl()
1257 nh = ip_hdr(skb); in execute_dec_ttl()
1258 if (nh->ttl <= 1) in execute_dec_ttl()
1261 old_ttl = nh->ttl--; in execute_dec_ttl()
1262 csum_replace2(&nh->check, htons(old_ttl << 8), in execute_dec_ttl()
1263 htons(nh->ttl << 8)); in execute_dec_ttl()
1264 key->ip.ttl = nh->ttl; in execute_dec_ttl()
1414 struct nshhdr *nh = (struct nshhdr *)buffer; in do_execute_actions() local
1416 err = nsh_hdr_from_nlattr(nla_data(a), nh, in do_execute_actions()
1420 err = push_nsh(skb, key, nh); in do_execute_actions()