1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (C) 2001 Cluster File Systems, Inc. <braam@clusterfs.com>
6 * This file is part of Lustre, http://www.lustre.org.
8 * Lustre is free software; you can redistribute it and/or
9 * modify it under the terms of version 2 of the GNU General Public
10 * License as published by the Free Software Foundation.
12 * Lustre is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Lustre; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * Basic library routines.
25 #ifndef __LIBCFS_LINUX_CFS_TCP_H__
26 #define __LIBCFS_LINUX_CFS_TCP_H__
28 #ifndef __LIBCFS_LIBCFS_H__
29 #error Do not #include this file directly. #include <libcfs/libcfs.h> instead
35 typedef struct socket cfs_socket_t;
37 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,72))
38 # define sk_allocation allocation
39 # define sk_data_ready data_ready
40 # define sk_write_space write_space
41 # define sk_user_data user_data
43 # define sk_sndbuf sndbuf
44 # define sk_rcvbuf rcvbuf
45 # define sk_socket socket
46 # define sk_sleep sleep
49 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0))
50 # define sk_wmem_queued wmem_queued
52 # define sk_route_caps route_caps
55 #define SOCK_SNDBUF(so) ((so)->sk->sk_sndbuf)
56 #define SOCK_WMEM_QUEUED(so) ((so)->sk->sk_wmem_queued)
57 #define SOCK_ERROR(so) ((so)->sk->sk_err)
58 #define SOCK_TEST_NOSPACE(so) test_bit(SOCK_NOSPACE, &(so)->flags)
60 #else /* !__KERNEL__ */
62 #include "../user-tcpip.h"
64 #endif /* __KERNEL__ */