Lines Matching refs:iph
76 static inline int IP_ECN_set_ce(struct iphdr *iph) in IP_ECN_set_ce() argument
78 u32 check = (__force u32)iph->check; in IP_ECN_set_ce()
79 u32 ecn = (iph->tos + 1) & INET_ECN_MASK; in IP_ECN_set_ce()
98 iph->check = (__force __sum16)(check + (check>=0xFFFF)); in IP_ECN_set_ce()
99 iph->tos |= INET_ECN_CE; in IP_ECN_set_ce()
103 static inline int IP_ECN_set_ect1(struct iphdr *iph) in IP_ECN_set_ect1() argument
105 u32 check = (__force u32)iph->check; in IP_ECN_set_ect1()
107 if ((iph->tos & INET_ECN_MASK) != INET_ECN_ECT_0) in IP_ECN_set_ect1()
112 iph->check = (__force __sum16)(check + (check>=0xFFFF)); in IP_ECN_set_ect1()
113 iph->tos ^= INET_ECN_MASK; in IP_ECN_set_ect1()
117 static inline void IP_ECN_clear(struct iphdr *iph) in IP_ECN_clear() argument
119 iph->tos &= ~INET_ECN_MASK; in IP_ECN_clear()
136 static inline int IP6_ECN_set_ce(struct sk_buff *skb, struct ipv6hdr *iph) in IP6_ECN_set_ce() argument
140 if (INET_ECN_is_not_ect(ipv6_get_dsfield(iph))) in IP6_ECN_set_ce()
143 from = *(__be32 *)iph; in IP6_ECN_set_ce()
145 *(__be32 *)iph = to; in IP6_ECN_set_ce()
152 static inline int IP6_ECN_set_ect1(struct sk_buff *skb, struct ipv6hdr *iph) in IP6_ECN_set_ect1() argument
156 if ((ipv6_get_dsfield(iph) & INET_ECN_MASK) != INET_ECN_ECT_0) in IP6_ECN_set_ect1()
159 from = *(__be32 *)iph; in IP6_ECN_set_ect1()
161 *(__be32 *)iph = to; in IP6_ECN_set_ect1()