]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/net.h
[NET]: NPROTO is redundant; it's equal to AF_MAX/PF_MAX.
[linux-2.6-omap-h63xx.git] / include / linux / net.h
index c136abce7ef628291325c5ce00a49a1763db6101..71f7dd55928580065f3581898a1657d9cea2b944 100644 (file)
 #define _LINUX_NET_H
 
 #include <linux/wait.h>
+#include <linux/socket.h>
 #include <asm/socket.h>
 
 struct poll_table_struct;
+struct pipe_inode_info;
 struct inode;
 struct net;
 
-#define NPROTO         34              /* should be enough for now..   */
+#define NPROTO         AF_MAX
 
 #define SYS_SOCKET     1               /* sys_socket(2)                */
 #define SYS_BIND       2               /* sys_bind(2)                  */
@@ -95,6 +97,12 @@ enum sock_type {
 
 #endif /* ARCH_HAS_SOCKET_TYPES */
 
+enum sock_shutdown_cmd {
+       SHUT_RD         = 0,
+       SHUT_WR         = 1,
+       SHUT_RDWR       = 2,
+};
+
 /**
  *  struct socket - general BSD socket
  *  @state: socket state (%SS_CONNECTED, etc)
@@ -166,6 +174,8 @@ struct proto_ops {
                                      struct vm_area_struct * vma);
        ssize_t         (*sendpage)  (struct socket *sock, struct page *page,
                                      int offset, size_t size, int flags);
+       ssize_t         (*splice_read)(struct socket *sock,  loff_t *ppos,
+                                      struct pipe_inode_info *pipe, size_t len, unsigned int flags);
 };
 
 struct net_proto_family {
@@ -177,6 +187,13 @@ struct net_proto_family {
 struct iovec;
 struct kvec;
 
+enum {
+       SOCK_WAKE_IO,
+       SOCK_WAKE_WAITD,
+       SOCK_WAKE_SPACE,
+       SOCK_WAKE_URG,
+};
+
 extern int          sock_wake_async(struct socket *sk, int how, int band);
 extern int          sock_register(const struct net_proto_family *fam);
 extern void         sock_unregister(int family);
@@ -223,6 +240,8 @@ extern int kernel_setsockopt(struct socket *sock, int level, int optname,
 extern int kernel_sendpage(struct socket *sock, struct page *page, int offset,
                           size_t size, int flags);
 extern int kernel_sock_ioctl(struct socket *sock, int cmd, unsigned long arg);
+extern int kernel_sock_shutdown(struct socket *sock,
+                               enum sock_shutdown_cmd how);
 
 #ifndef CONFIG_SMP
 #define SOCKOPS_WRAPPED(name) name
@@ -313,9 +332,12 @@ static const struct proto_ops name##_ops = {                       \
 #define MODULE_ALIAS_NET_PF_PROTO(pf, proto) \
        MODULE_ALIAS("net-pf-" __stringify(pf) "-proto-" __stringify(proto))
 
+#define MODULE_ALIAS_NET_PF_PROTO_TYPE(pf, proto, type) \
+       MODULE_ALIAS("net-pf-" __stringify(pf) "-proto-" __stringify(proto) \
+                    "-type-" __stringify(type))
+
 #ifdef CONFIG_SYSCTL
 #include <linux/sysctl.h>
-extern ctl_table net_table[];
 extern int net_msg_cost;
 extern int net_msg_burst;
 #endif