Lines Matching refs:tpi
120 const struct tnl_ptk_info *tpi) in ipgre_err() argument
144 if (tpi->proto == htons(ETH_P_TEB)) in ipgre_err()
146 else if (tpi->proto == htons(ETH_P_ERSPAN) || in ipgre_err()
147 tpi->proto == htons(ETH_P_ERSPAN2)) in ipgre_err()
153 t = ip_tunnel_lookup(itn, skb->dev->ifindex, tpi->flags, in ipgre_err()
154 iph->daddr, iph->saddr, tpi->key); in ipgre_err()
190 if (tpi->proto == htons(ETH_P_IPV6) && in ipgre_err()
191 !ip6_err_gen_icmpv6_unreach(skb, iph->ihl * 4 + tpi->hdr_len, in ipgre_err()
231 struct tnl_ptk_info tpi; in gre_err() local
233 if (gre_parse_header(skb, &tpi, NULL, htons(ETH_P_IP), in gre_err()
248 ipgre_err(skb, info, &tpi); in gre_err()
260 static int erspan_rcv(struct sk_buff *skb, struct tnl_ptk_info *tpi, in erspan_rcv() argument
278 tpi->flags | TUNNEL_NO_KEY, in erspan_rcv()
284 tpi->flags | TUNNEL_KEY, in erspan_rcv()
285 iph->saddr, iph->daddr, tpi->key); in erspan_rcv()
310 tpi->flags |= TUNNEL_KEY; in erspan_rcv()
311 flags = tpi->flags; in erspan_rcv()
312 tun_id = key32_to_tunnel_id(tpi->key); in erspan_rcv()
339 ip_tunnel_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error); in erspan_rcv()
349 static int __ipgre_rcv(struct sk_buff *skb, const struct tnl_ptk_info *tpi, in __ipgre_rcv() argument
357 tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex, tpi->flags, in __ipgre_rcv()
358 iph->saddr, iph->daddr, tpi->key); in __ipgre_rcv()
363 if (__iptunnel_pull_header(skb, hdr_len, tpi->proto, in __ipgre_rcv()
377 flags = tpi->flags & (TUNNEL_CSUM | TUNNEL_KEY); in __ipgre_rcv()
378 tun_id = key32_to_tunnel_id(tpi->key); in __ipgre_rcv()
384 ip_tunnel_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error); in __ipgre_rcv()
394 static int ipgre_rcv(struct sk_buff *skb, const struct tnl_ptk_info *tpi, in ipgre_rcv() argument
401 if (tpi->proto == htons(ETH_P_TEB)) in ipgre_rcv()
406 res = __ipgre_rcv(skb, tpi, itn, hdr_len, false); in ipgre_rcv()
407 if (res == PACKET_NEXT && tpi->proto == htons(ETH_P_TEB)) { in ipgre_rcv()
412 res = __ipgre_rcv(skb, tpi, itn, hdr_len, true); in ipgre_rcv()
419 struct tnl_ptk_info tpi; in gre_rcv() local
431 hdr_len = gre_parse_header(skb, &tpi, &csum_err, htons(ETH_P_IP), 0); in gre_rcv()
435 if (unlikely(tpi.proto == htons(ETH_P_ERSPAN) || in gre_rcv()
436 tpi.proto == htons(ETH_P_ERSPAN2))) { in gre_rcv()
437 if (erspan_rcv(skb, &tpi, hdr_len) == PACKET_RCVD) in gre_rcv()
442 if (ipgre_rcv(skb, &tpi, hdr_len) == PACKET_RCVD) in gre_rcv()