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()
425 static void set_ipv6_fl(struct ipv6hdr *nh, u32 fl, u32 mask) in set_ipv6_fl() argument
428 OVS_SET_MASKED(nh->flow_lbl[0], (u8)(fl >> 16), (u8)(mask >> 16)); in set_ipv6_fl()
429 OVS_SET_MASKED(nh->flow_lbl[1], (u8)(fl >> 8), (u8)(mask >> 8)); in set_ipv6_fl()
430 OVS_SET_MASKED(nh->flow_lbl[2], (u8)fl, (u8)mask); in set_ipv6_fl()
433 static void set_ip_ttl(struct sk_buff *skb, struct iphdr *nh, u8 new_ttl, in set_ip_ttl() argument
436 new_ttl = OVS_MASKED(nh->ttl, new_ttl, mask); in set_ip_ttl()
438 csum_replace2(&nh->check, htons(nh->ttl << 8), htons(new_ttl << 8)); in set_ip_ttl()
439 nh->ttl = new_ttl; in set_ip_ttl()
446 struct iphdr *nh; in set_ipv4() local
455 nh = ip_hdr(skb); in set_ipv4()
462 new_addr = OVS_MASKED(nh->saddr, key->ipv4_src, mask->ipv4_src); in set_ipv4()
464 if (unlikely(new_addr != nh->saddr)) { in set_ipv4()
465 set_ip_addr(skb, nh, &nh->saddr, new_addr); in set_ipv4()
470 new_addr = OVS_MASKED(nh->daddr, key->ipv4_dst, mask->ipv4_dst); in set_ipv4()
472 if (unlikely(new_addr != nh->daddr)) { in set_ipv4()
473 set_ip_addr(skb, nh, &nh->daddr, new_addr); in set_ipv4()
478 ipv4_change_dsfield(nh, ~mask->ipv4_tos, key->ipv4_tos); in set_ipv4()
479 flow_key->ip.tos = nh->tos; in set_ipv4()
482 set_ip_ttl(skb, nh, key->ipv4_ttl, mask->ipv4_ttl); in set_ipv4()
483 flow_key->ip.ttl = nh->ttl; in set_ipv4()
498 struct ipv6hdr *nh; in set_ipv6() local
506 nh = ipv6_hdr(skb); in set_ipv6()
513 __be32 *saddr = (__be32 *)&nh->saddr; in set_ipv6()
529 __be32 *daddr = (__be32 *)&nh->daddr; in set_ipv6()
535 if (ipv6_ext_hdr(nh->nexthdr)) in set_ipv6()
548 ipv6_change_dsfield(nh, ~mask->ipv6_tclass, key->ipv6_tclass); in set_ipv6()
549 flow_key->ip.tos = ipv6_get_dsfield(nh); in set_ipv6()
552 set_ipv6_fl(nh, ntohl(key->ipv6_label), in set_ipv6()
555 *(__be32 *)nh & htonl(IPV6_FLOWINFO_FLOWLABEL); in set_ipv6()
558 OVS_SET_MASKED(nh->hop_limit, key->ipv6_hlimit, in set_ipv6()
560 flow_key->ip.ttl = nh->hop_limit; in set_ipv6()
568 struct nshhdr *nh; in set_nsh() local
586 nh = nsh_hdr(skb); in set_nsh()
587 length = nsh_hdr_len(nh); in set_nsh()
595 nh = nsh_hdr(skb); in set_nsh()
596 skb_postpull_rcsum(skb, nh, length); in set_nsh()
597 flags = nsh_get_flags(nh); in set_nsh()
600 ttl = nsh_get_ttl(nh); in set_nsh()
603 nsh_set_flags_and_ttl(nh, flags, ttl); in set_nsh()
604 nh->path_hdr = OVS_MASKED(nh->path_hdr, key.base.path_hdr, in set_nsh()
606 flow_key->nsh.base.path_hdr = nh->path_hdr; in set_nsh()
607 switch (nh->mdtype) { in set_nsh()
610 nh->md1.context[i] = in set_nsh()
611 OVS_MASKED(nh->md1.context[i], key.context[i], in set_nsh()
614 memcpy(flow_key->nsh.context, nh->md1.context, in set_nsh()
615 sizeof(nh->md1.context)); in set_nsh()
624 skb_postpush_rcsum(skb, nh, length); in set_nsh()
1202 struct ipv6hdr *nh; in execute_dec_ttl() local
1205 sizeof(*nh)); in execute_dec_ttl()
1209 nh = ipv6_hdr(skb); in execute_dec_ttl()
1211 if (nh->hop_limit <= 1) in execute_dec_ttl()
1214 key->ip.ttl = --nh->hop_limit; in execute_dec_ttl()
1216 struct iphdr *nh; in execute_dec_ttl() local
1220 sizeof(*nh)); in execute_dec_ttl()
1224 nh = ip_hdr(skb); in execute_dec_ttl()
1225 if (nh->ttl <= 1) in execute_dec_ttl()
1228 old_ttl = nh->ttl--; in execute_dec_ttl()
1229 csum_replace2(&nh->check, htons(old_ttl << 8), in execute_dec_ttl()
1230 htons(nh->ttl << 8)); in execute_dec_ttl()
1231 key->ip.ttl = nh->ttl; in execute_dec_ttl()
1381 struct nshhdr *nh = (struct nshhdr *)buffer; in do_execute_actions() local
1383 err = nsh_hdr_from_nlattr(nla_data(a), nh, in do_execute_actions()
1387 err = push_nsh(skb, key, nh); in do_execute_actions()