diff options
Diffstat (limited to 'include/net/inet_sock.h')
| -rw-r--r-- | include/net/inet_sock.h | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index a829b77523cf..eb16c7beed1e 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
| @@ -16,7 +16,7 @@ | |||
| 16 | #ifndef _INET_SOCK_H | 16 | #ifndef _INET_SOCK_H |
| 17 | #define _INET_SOCK_H | 17 | #define _INET_SOCK_H |
| 18 | 18 | ||
| 19 | 19 | #include <linux/bitops.h> | |
| 20 | #include <linux/kmemcheck.h> | 20 | #include <linux/kmemcheck.h> |
| 21 | #include <linux/string.h> | 21 | #include <linux/string.h> |
| 22 | #include <linux/types.h> | 22 | #include <linux/types.h> |
| @@ -184,6 +184,7 @@ struct inet_sock { | |||
| 184 | mc_all:1, | 184 | mc_all:1, |
| 185 | nodefrag:1; | 185 | nodefrag:1; |
| 186 | __u8 rcv_tos; | 186 | __u8 rcv_tos; |
| 187 | __u8 convert_csum; | ||
| 187 | int uc_index; | 188 | int uc_index; |
| 188 | int mc_index; | 189 | int mc_index; |
| 189 | __be32 mc_addr; | 190 | __be32 mc_addr; |
| @@ -194,6 +195,16 @@ struct inet_sock { | |||
| 194 | #define IPCORK_OPT 1 /* ip-options has been held in ipcork.opt */ | 195 | #define IPCORK_OPT 1 /* ip-options has been held in ipcork.opt */ |
| 195 | #define IPCORK_ALLFRAG 2 /* always fragment (for ipv6 for now) */ | 196 | #define IPCORK_ALLFRAG 2 /* always fragment (for ipv6 for now) */ |
| 196 | 197 | ||
| 198 | /* cmsg flags for inet */ | ||
| 199 | #define IP_CMSG_PKTINFO BIT(0) | ||
| 200 | #define IP_CMSG_TTL BIT(1) | ||
| 201 | #define IP_CMSG_TOS BIT(2) | ||
| 202 | #define IP_CMSG_RECVOPTS BIT(3) | ||
| 203 | #define IP_CMSG_RETOPTS BIT(4) | ||
| 204 | #define IP_CMSG_PASSSEC BIT(5) | ||
| 205 | #define IP_CMSG_ORIGDSTADDR BIT(6) | ||
| 206 | #define IP_CMSG_CHECKSUM BIT(7) | ||
| 207 | |||
| 197 | static inline struct inet_sock *inet_sk(const struct sock *sk) | 208 | static inline struct inet_sock *inet_sk(const struct sock *sk) |
| 198 | { | 209 | { |
| 199 | return (struct inet_sock *)sk; | 210 | return (struct inet_sock *)sk; |
| @@ -250,4 +261,20 @@ static inline __u8 inet_sk_flowi_flags(const struct sock *sk) | |||
| 250 | return flags; | 261 | return flags; |
| 251 | } | 262 | } |
| 252 | 263 | ||
| 264 | static inline void inet_inc_convert_csum(struct sock *sk) | ||
| 265 | { | ||
| 266 | inet_sk(sk)->convert_csum++; | ||
| 267 | } | ||
| 268 | |||
| 269 | static inline void inet_dec_convert_csum(struct sock *sk) | ||
| 270 | { | ||
| 271 | if (inet_sk(sk)->convert_csum > 0) | ||
| 272 | inet_sk(sk)->convert_csum--; | ||
| 273 | } | ||
| 274 | |||
| 275 | static inline bool inet_get_convert_csum(struct sock *sk) | ||
| 276 | { | ||
| 277 | return !!inet_sk(sk)->convert_csum; | ||
| 278 | } | ||
| 279 | |||
| 253 | #endif /* _INET_SOCK_H */ | 280 | #endif /* _INET_SOCK_H */ |
