4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 only,
8 * as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License version 2 for more details (a copy is included
14 * in the LICENSE file that accompanied this code).
16 * You should have received a copy of the GNU General Public License
17 * version 2 along with this program; If not, see
18 * http://www.gnu.org/licenses/gpl-2.0.html
23 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Use is subject to license terms.
27 * This file is part of Lustre, http://www.lustre.org/
28 * Lustre is a trademark of Sun Microsystems, Inc.
30 * lnet/include/lnet/socklnd.h
32 #ifndef __LNET_LNET_SOCKLND_H__
33 #define __LNET_LNET_SOCKLND_H__
35 #include <uapi/linux/lnet/lnet-types.h>
36 #include <uapi/linux/lnet/socklnd.h>
38 struct ksock_hello_msg {
39 __u32 kshm_magic; /* magic number of socklnd message */
40 __u32 kshm_version; /* version of socklnd message */
41 lnet_nid_t kshm_src_nid; /* sender's nid */
42 lnet_nid_t kshm_dst_nid; /* destination nid */
43 lnet_pid_t kshm_src_pid; /* sender's pid */
44 lnet_pid_t kshm_dst_pid; /* destination pid */
45 __u64 kshm_src_incarnation; /* sender's incarnation */
46 __u64 kshm_dst_incarnation; /* destination's incarnation */
47 __u32 kshm_ctype; /* connection type */
48 __u32 kshm_nips; /* # IP addrs */
49 __u32 kshm_ips[0]; /* IP addrs */
52 struct ksock_lnet_msg {
53 struct lnet_hdr ksnm_hdr; /* lnet hdr */
56 * ksnm_payload is removed because of winnt compiler's limitation:
57 * zero-sized array can only be placed at the tail of [nested]
58 * structure definitions. lnet payload will be stored just after
59 * the body of structure struct ksock_lnet_msg
64 __u32 ksm_type; /* type of socklnd message */
65 __u32 ksm_csum; /* checksum if != 0 */
66 __u64 ksm_zc_cookies[2]; /* Zero-Copy request/ACK cookie */
68 struct ksock_lnet_msg lnetmsg; /* lnet message, it's empty if it's NOOP */
72 #define KSOCK_MSG_NOOP 0xc0 /* ksm_u empty */
73 #define KSOCK_MSG_LNET 0xc1 /* lnet msg */
75 /* We need to know this number to parse hello msg from ksocklnd in
76 * other LND (usocklnd, for example) */
77 #define KSOCK_PROTO_V2 2
78 #define KSOCK_PROTO_V3 3