Whamcloud - gitweb
LU-9680 net: Netlink improvements
[fs/lustre-release.git] / lnet / include / uapi / linux / lnet / lnet-nl.h
1 /*
2  * LGPL HEADER START
3  *
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library.
18  *
19  * LGPL HEADER END
20  *
21  */
22 /* Copyright (c) 2021,  UT-Battelle, LLC
23  *
24  * Author: James Simmons <jsimmons@infradead.org>
25  */
26
27 #ifndef __UAPI_LNET_NL_H__
28 #define __UAPI_LNET_NL_H__
29
30 #include <linux/types.h>
31
32 enum lnet_nl_key_format {
33         /* Is it FLOW or BLOCK */
34         LNKF_FLOW               = 1,
35         /* Is it SEQUENCE or MAPPING */
36         LNKF_MAPPING            = 2,
37         LNKF_SEQUENCE           = 4,
38 };
39
40 /**
41  * enum lnet_nl_scalar_attrs            - scalar LNet netlink attributes used
42  *                                        to compose messages for sending or
43  *                                        receiving.
44  *
45  * @LN_SCALAR_ATTR_UNSPEC:              unspecified attribute to catch errors
46  * @LN_SCALAR_ATTR_PAD:                 padding for 64-bit attributes, ignore
47  *
48  * @LN_SCALAR_ATTR_LIST:                List of scalar attributes (NLA_NESTED)
49  * @LN_SCALAR_ATTR_LIST_SIZE:           Number of items in scalar list (NLA_U16)
50  * @LN_SCALAR_ATTR_INDEX:               True Netlink attr value (NLA_U16)
51  * @LN_SCALAR_ATTR_NLA_TYPE:            Data format for value part of the pair
52  *                                      (NLA_U16)
53  * @LN_SCALAR_ATTR_VALUE:               String value of key part of the pair.
54  *                                      (NLA_NUL_STRING)
55  * @LN_SCALAR_ATTR_INT_VALUE:           Numeric value of key part of the pair.
56  *                                      (NLA_S64)
57  * @LN_SCALAR_ATTR_KEY_FORMAT:          LNKF_* format of the key value pair.
58  */
59 enum lnet_nl_scalar_attrs {
60         LN_SCALAR_ATTR_UNSPEC = 0,
61         LN_SCALAR_ATTR_PAD = LN_SCALAR_ATTR_UNSPEC,
62
63         LN_SCALAR_ATTR_LIST,
64         LN_SCALAR_ATTR_LIST_SIZE,
65         LN_SCALAR_ATTR_INDEX,
66         LN_SCALAR_ATTR_NLA_TYPE,
67         LN_SCALAR_ATTR_VALUE,
68         LN_SCALAR_ATTR_INT_VALUE,
69         LN_SCALAR_ATTR_KEY_FORMAT,
70
71         __LN_SCALAR_ATTR_MAX_PLUS_ONE,
72 };
73
74 #define LN_SCALAR_MAX (__LN_SCALAR_ATTR_MAX_PLUS_ONE - 1)
75
76 struct ln_key_props {
77         char                    *lkp_value;
78         __u16                   lkp_key_format;
79         __u16                   lkp_data_type;
80 };
81
82 struct ln_key_list {
83         __u16                   lkl_maxattr;
84         struct ln_key_props     lkl_list[];
85 };
86
87 #endif /* __UAPI_LNET_NL_H__ */