]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - include/net/sock.h
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
[karo-tx-linux.git] / include / net / sock.h
index 7ef5c58f3f49ab4ea0477d3b9fc0509b9f283eee..f84be9ed6110fd474b4061c599845bcb4f54d041 100644 (file)
@@ -357,6 +357,7 @@ struct sock {
        struct page             *sk_sndmsg_page;
        struct sk_buff          *sk_send_head;
        __u32                   sk_sndmsg_off;
+       __s32                   sk_peek_off;
        int                     sk_write_pending;
 #ifdef CONFIG_SECURITY
        void                    *sk_security;
@@ -373,6 +374,30 @@ struct sock {
        void                    (*sk_destruct)(struct sock *sk);
 };
 
+static inline int sk_peek_offset(struct sock *sk, int flags)
+{
+       if ((flags & MSG_PEEK) && (sk->sk_peek_off >= 0))
+               return sk->sk_peek_off;
+       else
+               return 0;
+}
+
+static inline void sk_peek_offset_bwd(struct sock *sk, int val)
+{
+       if (sk->sk_peek_off >= 0) {
+               if (sk->sk_peek_off >= val)
+                       sk->sk_peek_off -= val;
+               else
+                       sk->sk_peek_off = 0;
+       }
+}
+
+static inline void sk_peek_offset_fwd(struct sock *sk, int val)
+{
+       if (sk->sk_peek_off >= 0)
+               sk->sk_peek_off += val;
+}
+
 /*
  * Hashed lists helper routines
  */
@@ -590,6 +615,10 @@ enum sock_flags {
        SOCK_RXQ_OVFL,
        SOCK_ZEROCOPY, /* buffers from userspace */
        SOCK_WIFI_STATUS, /* push wifi status to userspace */
+       SOCK_NOFCS, /* Tell NIC not to do the Ethernet FCS.
+                    * Will use last 4 bytes of packet sent from
+                    * user-space instead.
+                    */
 };
 
 static inline void sock_copy_flags(struct sock *nsk, struct sock *osk)