xref: /linux/Documentation/netlink/specs/nlctrl.yaml (revision 4b660dbd9ee2059850fd30e0df420ca7a38a1856)
1# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2
3name: nlctrl
4protocol: genetlink-legacy
5uapi-header: linux/genetlink.h
6
7doc: |
8  genetlink meta-family that exposes information about all genetlink
9  families registered in the kernel (including itself).
10
11definitions:
12  -
13    name: op-flags
14    type: flags
15    enum-name:
16    entries:
17      - admin-perm
18      - cmd-cap-do
19      - cmd-cap-dump
20      - cmd-cap-haspol
21      - uns-admin-perm
22  -
23    name: attr-type
24    enum-name: netlink-attribute-type
25    type: enum
26    entries:
27      - invalid
28      - flag
29      - u8
30      - u16
31      - u32
32      - u64
33      - s8
34      - s16
35      - s32
36      - s64
37      - binary
38      - string
39      - nul-string
40      - nested
41      - nested-array
42      - bitfield32
43      - sint
44      - uint
45
46attribute-sets:
47  -
48    name: ctrl-attrs
49    name-prefix: ctrl-attr-
50    attributes:
51      -
52        name: family-id
53        type: u16
54      -
55        name: family-name
56        type: string
57      -
58        name: version
59        type: u32
60      -
61        name: hdrsize
62        type: u32
63      -
64        name: maxattr
65        type: u32
66      -
67        name: ops
68        type: array-nest
69        nested-attributes: op-attrs
70      -
71        name: mcast-groups
72        type: array-nest
73        nested-attributes: mcast-group-attrs
74      -
75        name: policy
76        type: nest-type-value
77        type-value: [ policy-id, attr-id ]
78        nested-attributes: policy-attrs
79      -
80        name: op-policy
81        type: nest-type-value
82        type-value: [ op-id ]
83        nested-attributes: op-policy-attrs
84      -
85        name: op
86        type: u32
87  -
88    name: mcast-group-attrs
89    name-prefix: ctrl-attr-mcast-grp-
90    enum-name:
91    attributes:
92      -
93        name: name
94        type: string
95      -
96        name: id
97        type: u32
98  -
99    name: op-attrs
100    name-prefix: ctrl-attr-op-
101    enum-name:
102    attributes:
103      -
104        name: id
105        type: u32
106      -
107        name: flags
108        type: u32
109        enum: op-flags
110        enum-as-flags: true
111  -
112    name: policy-attrs
113    name-prefix: nl-policy-type-attr-
114    enum-name:
115    attributes:
116      -
117        name: type
118        type: u32
119        enum: attr-type
120      -
121        name: min-value-s
122        type: s64
123      -
124        name: max-value-s
125        type: s64
126      -
127        name: min-value-u
128        type: u64
129      -
130        name: max-value-u
131        type: u64
132      -
133        name: min-length
134        type: u32
135      -
136        name: max-length
137        type: u32
138      -
139        name: policy-idx
140        type: u32
141      -
142        name: policy-maxtype
143        type: u32
144      -
145        name: bitfield32-mask
146        type: u32
147      -
148        name: mask
149        type: u64
150      -
151        name: pad
152        type: pad
153  -
154    name: op-policy-attrs
155    name-prefix: ctrl-attr-policy-
156    enum-name:
157    attributes:
158      -
159        name: do
160        type: u32
161      -
162        name: dump
163        type: u32
164
165operations:
166  enum-model: directional
167  name-prefix: ctrl-cmd-
168  list:
169    -
170      name: getfamily
171      doc: Get / dump genetlink families
172      attribute-set: ctrl-attrs
173      do:
174        request:
175          value: 3
176          attributes:
177            - family-name
178        reply: &all-attrs
179          value: 1
180          attributes:
181            - family-id
182            - family-name
183            - hdrsize
184            - maxattr
185            - mcast-groups
186            - ops
187            - version
188      dump:
189        reply: *all-attrs
190    -
191      name: getpolicy
192      doc: Get / dump genetlink policies
193      attribute-set: ctrl-attrs
194      dump:
195        request:
196          value: 10
197          attributes:
198            - family-name
199            - family-id
200            - op
201        reply:
202          value: 10
203          attributes:
204            - family-id
205            - op-policy
206            - policy
207