Home
last modified time | relevance | path

Searched refs:iph (Results 1 – 17 of 17) sorted by relevance

/include/net/netfilter/
Dnf_tables_ipv4.h21 struct iphdr *iph, _iph; in __nft_set_pktinfo_ipv4_validate() local
24 iph = skb_header_pointer(pkt->skb, skb_network_offset(pkt->skb), in __nft_set_pktinfo_ipv4_validate()
25 sizeof(*iph), &_iph); in __nft_set_pktinfo_ipv4_validate()
26 if (!iph) in __nft_set_pktinfo_ipv4_validate()
29 if (iph->ihl < 5 || iph->version != 4) in __nft_set_pktinfo_ipv4_validate()
32 len = iph_totlen(pkt->skb, iph); in __nft_set_pktinfo_ipv4_validate()
33 thoff = skb_network_offset(pkt->skb) + (iph->ihl * 4); in __nft_set_pktinfo_ipv4_validate()
38 else if (thoff < sizeof(*iph)) in __nft_set_pktinfo_ipv4_validate()
42 pkt->tprot = iph->protocol; in __nft_set_pktinfo_ipv4_validate()
44 pkt->fragoff = ntohs(iph->frag_off) & IP_OFFSET; in __nft_set_pktinfo_ipv4_validate()
[all …]
Dnf_queue.h49 static inline u32 hash_v4(const struct iphdr *iph, u32 initval) in hash_v4() argument
52 if ((__force u32)iph->saddr < (__force u32)iph->daddr) in hash_v4()
53 return jhash_3words((__force u32)iph->saddr, in hash_v4()
54 (__force u32)iph->daddr, iph->protocol, initval); in hash_v4()
56 return jhash_3words((__force u32)iph->daddr, in hash_v4()
57 (__force u32)iph->saddr, iph->protocol, initval); in hash_v4()
85 struct iphdr *iph, _iph; in hash_bridge() local
89 iph = skb_header_pointer(skb, skb_network_offset(skb), in hash_bridge()
90 sizeof(*iph), &_iph); in hash_bridge()
91 if (iph) in hash_bridge()
[all …]
/include/net/
Ddsfield.h16 static inline __u8 ipv4_get_dsfield(const struct iphdr *iph) in ipv4_get_dsfield() argument
18 return iph->tos; in ipv4_get_dsfield()
28 static inline void ipv4_change_dsfield(struct iphdr *iph,__u8 mask, in ipv4_change_dsfield() argument
31 __u32 check = ntohs((__force __be16)iph->check); in ipv4_change_dsfield()
34 dsfield = (iph->tos & mask) | value; in ipv4_change_dsfield()
35 check += iph->tos; in ipv4_change_dsfield()
39 iph->check = (__force __sum16)htons(check); in ipv4_change_dsfield()
40 iph->tos = dsfield; in ipv4_change_dsfield()
Dinet_ecn.h77 static inline int IP_ECN_set_ce(struct iphdr *iph) in IP_ECN_set_ce() argument
79 u32 ecn = (iph->tos + 1) & INET_ECN_MASK; in IP_ECN_set_ce()
100 iph->check = csum16_add(iph->check, check_add); in IP_ECN_set_ce()
101 iph->tos |= INET_ECN_CE; in IP_ECN_set_ce()
105 static inline int IP_ECN_set_ect1(struct iphdr *iph) in IP_ECN_set_ect1() argument
107 if ((iph->tos & INET_ECN_MASK) != INET_ECN_ECT_0) in IP_ECN_set_ect1()
110 iph->check = csum16_add(iph->check, htons(0x1)); in IP_ECN_set_ect1()
111 iph->tos ^= INET_ECN_MASK; in IP_ECN_set_ect1()
115 static inline void IP_ECN_clear(struct iphdr *iph) in IP_ECN_clear() argument
117 iph->tos &= ~INET_ECN_MASK; in IP_ECN_clear()
[all …]
Dip_vs.h80 const struct ipv6hdr *iph = skb_header_pointer( in ip_vs_fill_iph_skb_off() local
82 if (!iph) in ip_vs_fill_iph_skb_off()
85 iphdr->saddr.in6 = iph->saddr; in ip_vs_fill_iph_skb_off()
86 iphdr->daddr.in6 = iph->daddr; in ip_vs_fill_iph_skb_off()
99 const struct iphdr *iph = skb_header_pointer( in ip_vs_fill_iph_skb_off() local
101 if (!iph) in ip_vs_fill_iph_skb_off()
104 iphdr->len = offset + iph->ihl * 4; in ip_vs_fill_iph_skb_off()
106 iphdr->protocol = iph->protocol; in ip_vs_fill_iph_skb_off()
107 iphdr->saddr.ip = iph->saddr; in ip_vs_fill_iph_skb_off()
108 iphdr->daddr.ip = iph->daddr; in ip_vs_fill_iph_skb_off()
[all …]
Dip.h177 struct iphdr *iph; member
182 void ip_fraglist_init(struct sk_buff *skb, struct iphdr *iph,
401 static inline bool ip_is_fragment(const struct iphdr *iph) in ip_is_fragment() argument
403 return (iph->frag_off & htons(IP_MF | IP_OFFSET)) != 0; in ip_is_fragment()
412 int ip_decrease_ttl(struct iphdr *iph) in ip_decrease_ttl() argument
414 u32 check = (__force u32)iph->check; in ip_decrease_ttl()
416 iph->check = (__force __sum16)(check + (check>=0xFFFF)); in ip_decrease_ttl()
417 return --iph->ttl; in ip_decrease_ttl()
533 void __ip_select_ident(struct net *net, struct iphdr *iph, int segs);
538 struct iphdr *iph = ip_hdr(skb); in ip_select_ident_segs() local
[all …]
Ddst_metadata.h222 const struct iphdr *iph = ip_hdr(skb); in ip_tun_rx_dst() local
224 return __ip_tun_set_dst(iph->saddr, iph->daddr, iph->tos, iph->ttl, in ip_tun_rx_dst()
Dip_tunnels.h440 static inline u8 ip_tunnel_get_dsfield(const struct iphdr *iph, in ip_tunnel_get_dsfield() argument
446 return iph->tos; in ip_tunnel_get_dsfield()
448 return ipv6_get_dsfield((const struct ipv6hdr *)iph); in ip_tunnel_get_dsfield()
453 static inline u8 ip_tunnel_get_ttl(const struct iphdr *iph, in ip_tunnel_get_ttl() argument
459 return iph->ttl; in ip_tunnel_get_ttl()
461 return ((const struct ipv6hdr *)iph)->hop_limit; in ip_tunnel_get_ttl()
467 static inline u8 ip_tunnel_ecn_encap(u8 tos, const struct iphdr *iph, in ip_tunnel_ecn_encap() argument
470 u8 inner = ip_tunnel_get_dsfield(iph, skb); in ip_tunnel_ecn_encap()
Dgro.h197 const struct iphdr *iph = skb_gro_network_header(skb); in inet_gro_compute_pseudo() local
199 return csum_tcpudp_nofold(iph->saddr, iph->daddr, in inet_gro_compute_pseudo()
435 const struct ipv6hdr *iph = skb_gro_network_header(skb); in ip6_gro_compute_pseudo() local
437 return ~csum_unfold(csum_ipv6_magic(&iph->saddr, &iph->daddr, in ip6_gro_compute_pseudo()
Dinet_hashtables.h501 const struct iphdr *iph = ip_hdr(skb); in __inet_lookup_skb() local
504 sk = inet_steal_sock(net, skb, doff, iph->saddr, sport, iph->daddr, dport, in __inet_lookup_skb()
512 doff, iph->saddr, sport, in __inet_lookup_skb()
513 iph->daddr, dport, inet_iif(skb), sdif, in __inet_lookup_skb()
Dtcp.h437 u16 tcp_v4_get_syncookie(struct sock *sk, struct iphdr *iph,
439 u16 tcp_v6_get_syncookie(struct sock *sk, struct ipv6hdr *iph,
486 int __cookie_v4_check(const struct iphdr *iph, const struct tcphdr *th,
571 u32 __cookie_v4_init_sequence(const struct iphdr *iph, const struct tcphdr *th,
581 int __cookie_v6_check(const struct ipv6hdr *iph, const struct tcphdr *th,
585 u32 __cookie_v6_init_sequence(const struct ipv6hdr *iph,
Dipv6.h930 const struct ipv6hdr *iph) in iph_to_flow_copy_v6addrs() argument
935 memcpy(&flow->addrs.v6addrs, &iph->addrs, sizeof(flow->addrs.v6addrs)); in iph_to_flow_copy_v6addrs()
/include/linux/
Dip.h39 static inline unsigned int iph_totlen(const struct sk_buff *skb, const struct iphdr *iph) in iph_totlen() argument
41 u32 len = ntohs(iph->tot_len); in iph_totlen()
55 static inline void iph_set_totlen(struct iphdr *iph, unsigned int len) in iph_set_totlen() argument
57 iph->tot_len = len <= IP_MAX_MTU ? htons(len) : 0; in iph_set_totlen()
Dnetfilter_ipv6.h52 u32 (*cookie_init_sequence)(const struct ipv6hdr *iph,
54 int (*cookie_v6_check)(const struct ipv6hdr *iph,
167 static inline u32 nf_ipv6_cookie_init_sequence(const struct ipv6hdr *iph, in nf_ipv6_cookie_init_sequence() argument
176 return v6_ops->cookie_init_sequence(iph, th, mssp); in nf_ipv6_cookie_init_sequence()
178 return __cookie_v6_init_sequence(iph, th, mssp); in nf_ipv6_cookie_init_sequence()
184 static inline int nf_cookie_v6_check(const struct ipv6hdr *iph, in nf_cookie_v6_check() argument
192 return v6_ops->cookie_v6_check(iph, th, cookie); in nf_cookie_v6_check()
194 return __cookie_v6_check(iph, th, cookie); in nf_cookie_v6_check()
/include/asm-generic/
Dchecksum.h24 extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl);
/include/uapi/linux/
Dif_tunnel.h55 struct iphdr iph; member
/include/trace/events/
Dtcp.h316 const struct iphdr *iph = ip_hdr(skb); \
318 if (iph->version == 6) { \