constants: Add provenance information and update. * netlink/constant.scm: Add provenance information. Update lists. Add genetlink constants.
netlink/constant.scm
1 | 1 | ;;;; This file is part of Guile Netlink | |
2 | 2 | ;;;; | |
3 | - | ;;;; Copyright (C) 2020 Julien Lepiller <julien@lepiller.eu> | |
3 | + | ;;;; Copyright (C) 2020, 2025 Julien Lepiller <julien@lepiller.eu> | |
4 | 4 | ;;;; | |
5 | 5 | ;;;; This library is free software: you can redistribute it and/or modify | |
6 | 6 | ;;;; it under the terms of the GNU General Public License as published by | |
… | |||
54 | 54 | (cond | |
55 | 55 | #,@(map (lambda (s) (getter #'num s)) (spec-names #'(name-spec ...)))))))))) | |
56 | 56 | ||
57 | + | ;; Defined in [kernel]/include/uapi/linux/if_link.h | |
57 | 58 | (define-enum int->link-attr-kind | |
58 | 59 | IFLA_UNSPEC IFLA_ADDRESS IFLA_BROADCAST IFLA_IFNAME IFLA_MTU | |
59 | 60 | IFLA_LINK IFLA_QDISC IFLA_STATS IFLA_COST IFLA_PRIORITY | |
… | |||
68 | 69 | IFLA_GSO_MAX_SEGS IFLA_GSO_MAX_SIZE IFLA_PAD IFLA_XDP | |
69 | 70 | IFLA_EVENT IFLA_NEW_NETNSID IFLA_IF_NETNSID IFLA_CARRIER_UP_COUNT | |
70 | 71 | IFLA_CARRIER_DOWN_COUNT IFLA_NEW_IFINDEX IFLA_MIN_MTU IFLA_MAX_MTU | |
71 | - | IFLA_PROP_LIST IFLA_ALT_IFNAME IFLA_PERM_ADDRESS) | |
72 | + | IFLA_PROP_LIST IFLA_ALT_IFNAME IFLA_PERM_ADDRESS IFLA_PROTO_DOWN_REASON | |
73 | + | IFLA_PARENT_DEV_NAME IFLA_PARENT_DEV_BUS_NAME IFLA_GRO_MAX_SIZE | |
74 | + | IFLA_TSO_MAX_SIZE IFLA_TSO_MAX_SEGS IFLA_ALLMULTI IFLA_DEVLINK_PORT | |
75 | + | IFLA_GSO_IPV4_MAX_SIZE IFLA_GRO_IPV4_MAX_SIZE IFLA_DPLL_PIN) | |
72 | 76 | (define-public IFLA_TARGET_NETNSID IFLA_IF_NETNSID) | |
73 | 77 | ||
78 | + | ;; Defined in [kernel]/include/uapi/linux/if_link.h | |
74 | 79 | (define-enum int->linkinfo | |
75 | 80 | IFLA_INFO_UNSPEC IFLA_INFO_KIND IFLA_INFO_DATA IFLA_INFO_XSTATS | |
76 | 81 | IFLA_INFO_SLAVE_KIND IFLA_INFO_SLAVE_DATA) | |
77 | 82 | ||
83 | + | ;; Defined in [kernel]/include/uapi/linux/veth.h | |
78 | 84 | (define-enum int->veth-linkinfo | |
79 | 85 | VETH_INFO_UNSPEC VETH_INFO_PEER) | |
80 | 86 | ||
87 | + | ;; Defined in [kernel]/include/uapi/linux/if_link.h | |
81 | 88 | (define-enum int->vlan-linkinfo | |
82 | 89 | IFLA_VLAN_UNSPEC IFLA_VLAN_ID IFLA_VLAN_FLAGS IFLA_VLAN_EGRESS_QOS | |
83 | 90 | IFLA_VLAN_INGRESS_QOS IFLA_VLAN_PROTOCOL) | |
84 | 91 | ||
92 | + | ;; Defined in [kernel]/include/uapi/linux/if_link.h | |
85 | 93 | (define-enum int->bond-linkinfo | |
86 | 94 | IFLA_BOND_UNSPEC IFLA_BOND_MODE IFLA_BOND_ACTIVE_SLAVE IFLA_BOND_MIIMON | |
87 | 95 | IFLA_BOND_UPDELAY IFLA_BOND_DOWNDELAY IFLA_BOND_USE_CARRIER IFLA_BOND_ARP_INTERVAL | |
… | |||
94 | 102 | IFLA_BOND_PEER_NOTIF_DELAY IFLA_BOND_AD_LACP_ACTIVE IFLA_BOND_MISSED_MAX IFLA_BOND_NS_IP6_TARGET) | |
95 | 103 | ||
96 | 104 | ;; see iproute2/ip/iplink_bond.c for mode_tbl | |
105 | + | ;; Defined in [kernel]/include/uapi/linux/if_bonding.h | |
97 | 106 | (define-enum int->bond-mode | |
98 | 107 | BOND_MODE_ROUNDROBIN BOND_MODE_ACTIVEBACKUP BOND_MODE_XOR BOND_MODE_BROADCAST | |
99 | 108 | BOND_MODE_8023AD BOND_MODE_TLB | |
100 | 109 | ;; TLB + RLB (receive load balancing) | |
101 | 110 | BOND_MODE_ALB) | |
102 | 111 | ||
103 | - | ;; see iproute2/ip/iplink_bond.c primary_reselect_tbl | |
112 | + | ;; Defined in [kernel]/include/net/bonding.h | |
104 | 113 | (define-public BOND_PRIMARY_RESELECT_ALWAYS 0) | |
105 | 114 | (define-public BOND_PRIMARY_RESELECT_BETTER 1) | |
106 | 115 | (define-public BOND_PRIMARY_RESELECT_FAILURE 2) | |
… | |||
109 | 118 | (define-public BOND_AD_LACP_ACTIVE_OFF 0) | |
110 | 119 | (define-public BOND_AD_LACP_ACTIVE_ON 1) | |
111 | 120 | ||
121 | + | ;; Defined in [kernel]/include/uapi/linux/if_addr.h | |
112 | 122 | (define-enum int->addr-attr-kind | |
113 | 123 | IFA_UNSPEC IFA_ADDRESS IFA_LOCAL IFA_LABEL IFA_BROADCAST | |
114 | 124 | IFA_ANYCAST IFA_CACHEINFO IFA_MULTICAST IFA_FLAGS | |
115 | - | IFA_RT_PRIORITY IFA_TARGET_NETNSID) | |
125 | + | IFA_RT_PRIORITY IFA_TARGET_NETNSID IFA_PROTO) | |
116 | 126 | ||
127 | + | ;; Defined in [kernel]/include/uapi/linux/rtnetlink.h | |
117 | 128 | (define-enum int->route-attr-kind | |
118 | 129 | RTA_UNSPEC RTA_DST RTA_SRC RTA_IIF RTA_OIF RTA_GATEWAY | |
119 | 130 | RTA_PRIORITY RTA_PREFSRC RTA_METRICS RTA_MULTIPATH | |
… | |||
125 | 136 | (define-public AF_NETLINK 16) | |
126 | 137 | (define-public AF_PACKET 17) | |
127 | 138 | ||
139 | + | ;; Defined in [kernel]/include/uapi/linux/netlink.h | |
128 | 140 | (define-enum int->protocol | |
129 | 141 | NETLINK_ROUTE NETLINK_UNUSED NETLINK_USERSOCK NETLINK_FIREWALL | |
130 | 142 | NETLINK_SOCK_DIAG NETLINK_NFLOG NETLINK_XFRM NETLINK_SELINUX | |
… | |||
135 | 147 | (define-public NETLINK_INET_DIAG NETLINK_SOCK_DIAG) | |
136 | 148 | ||
137 | 149 | (define-enum int->message-kind | |
150 | + | ;; Defined in [kernel]/include/uapi/linux/netlink.h | |
138 | 151 | (NLMSG_NOOP 1) | |
139 | 152 | NLMSG_ERROR | |
140 | 153 | NLMSG_DONE | |
141 | 154 | NLMSG_OVERUN | |
142 | 155 | ||
156 | + | ;; Defined in [kernel]/include/uapi/linux/rtnetlink.h | |
143 | 157 | (RTM_NEWLINK 16) | |
144 | 158 | RTM_DELLINK | |
145 | 159 | RTM_GETLINK | |
… | |||
225 | 239 | RTM_DELVLAN | |
226 | 240 | RTM_GETVLAN) | |
227 | 241 | ||
242 | + | ;; Defined in [kernel]/include/uapi/linux/netlink.h | |
228 | 243 | (define-public NLM_F_REQUEST #x01) | |
229 | 244 | (define-public NLM_F_MULTI #x02) | |
230 | 245 | (define-public NLM_F_ACK #x04) | |
… | |||
250 | 265 | (define-public NLM_F_ACK_TLVS #x200) | |
251 | 266 | ||
252 | 267 | ;; net_device_flags | |
268 | + | ;; Defined in [kernel]/include/uapi/linux/if.h | |
253 | 269 | (define-enum int->device-flags | |
254 | 270 | (IFF_UP 1) | |
255 | 271 | (IFF_BROADCAST 2) | |
… | |||
272 | 288 | (IFF_ECHO 262144)) | |
273 | 289 | ||
274 | 290 | ;; operstate | |
291 | + | ;; Defined in [kernel]/include/uapi/linux/if.h | |
275 | 292 | (define-enum int->operstate | |
276 | 293 | IF_OPER_UNKNOWN IF_OPER_NOTPRESENT IF_OPER_DOWN | |
277 | 294 | IF_OPER_LOWERLAYERDOWN IF_OPER_TESTING IF_OPER_DORMANT | |
278 | 295 | IF_OPER_UP) | |
279 | 296 | ||
280 | 297 | ;; ifa_flags | |
298 | + | ;; Defined in [kernel]/include/uapi/linux/if_addr.h | |
281 | 299 | (define-enum int->ifa-flag | |
282 | 300 | (IFA_F_SECONDARY #x01) | |
283 | 301 | (IFA_F_TEMPORARY #x01) | |
… | |||
295 | 313 | ||
296 | 314 | ||
297 | 315 | ;; rtm_type | |
316 | + | ;; Defined in [kernel]/include/uapi/linux/rtnetlink.h | |
298 | 317 | (define-enum int->rtm-type | |
299 | 318 | RTN_UNSPEC RTN_UNICAST RTN_LOCAL RTN_BROADCAST RTN_ANYCAST | |
300 | 319 | RTN_MULTICAST RTN_BLACKHOLE RTN_UNREACHABLE RTN_PROHIBIT | |
301 | 320 | RTN_THROW RTN_NAT RTN_XRESOLVE) | |
302 | 321 | ||
303 | 322 | ;; rtm_protocol | |
323 | + | ;; Defined in [kernel]/include/uapi/linux/rtnetlink.h | |
304 | 324 | (define-enum int->rtm-protocol | |
305 | 325 | RTPROT_UNSPEC RTPROT_REDIRECT RTPROT_KERNEL RTPROT_BOOT RTPROT_STATIC | |
306 | 326 | ;; not interpreted by the kernel, but returned anyway. | |
… | |||
313 | 333 | (RTPROT_EIGRP 192)) | |
314 | 334 | ||
315 | 335 | ;; rtm_scope | |
336 | + | ;; Defined in [kernel]/include/uapi/linux/rtnetlink.h | |
316 | 337 | (define-enum int->rtm-scope | |
317 | 338 | RT_SCOPE_UNIVERSE | |
318 | 339 | (RT_SCOPE_SITE 200) | |
… | |||
321 | 342 | (RT_SCOPE_NOWHERE 255)) | |
322 | 343 | ||
323 | 344 | ;; rtm_flags | |
345 | + | ;; Defined in [kernel]/include/uapi/linux/rtnetlink.h | |
324 | 346 | (define-enum int->rtm-flag | |
325 | 347 | (RTM_F_NOTIFY #x100) | |
326 | 348 | (RTM_F_CLONED #x200) | |
… | |||
333 | 355 | ||
334 | 356 | ||
335 | 357 | ;; rtm_table | |
358 | + | ;; Defined in [kernel]/include/uapi/linux/rtnetlink.h | |
336 | 359 | (define-enum int->rtm-table | |
337 | 360 | RT_TABLE_UNSPEC | |
338 | 361 | (RT_TABLE_COMPAT 252) | |
… | |||
341 | 364 | (RT_TABLE_LOCAL 255)) | |
342 | 365 | ||
343 | 366 | ;; link type | |
344 | - | ;; more at include/uapi/linux/if_arp.h | |
367 | + | ;; Defined in [kernel]/include/uapi/linux/if_arp.h | |
345 | 368 | (define-enum int->link-type | |
346 | 369 | (ARPHRD_ETHER 1) | |
347 | 370 | (ARPHRD_LOOPBACK 772)) | |
348 | 371 | ||
349 | 372 | ;; enum rtnetlink_groups | |
373 | + | ;; Defined in [kernel]/include/uapi/linux/rtnetlink.h | |
350 | 374 | (define-enum int->rtnetlink-group | |
351 | 375 | (RTNLGRP_NONE 0) | |
352 | 376 | RTNLGRP_LINK | |
… | |||
385 | 409 | RTNLGRP_MCTP_IFADDR | |
386 | 410 | RTNLGRP_TUNNEL | |
387 | 411 | RTNLGRP_STATS) | |
412 | + | ||
413 | + | ;; Defined in [kernel]/include/uapi/linux/genetlink.h | |
414 | + | (define-enum int->genetlink-command | |
415 | + | (CTRL_CMD_UNSPEC 0) | |
416 | + | CTRL_CMD_NEWFAMILY | |
417 | + | CTRL_CMD_DELFAMILY | |
418 | + | CTRL_CMD_GETFAMILY | |
419 | + | CTRL_CMD_NEWOPS | |
420 | + | CTRL_CMD_DELOPS | |
421 | + | CTRL_CMD_GETOPS | |
422 | + | CTRL_CMD_NEWMCAST_GRP | |
423 | + | CTRL_CMD_DELMCAST_GRP | |
424 | + | CTRL_CMD_GETMCAST_GRP | |
425 | + | CTRL_CMD_GETPOLICY) | |
426 | + | ||
427 | + | ;; Defined in [kernel]/include/uapi/linux/genetlink.h | |
428 | + | (define-enum int->genetlink-attr | |
429 | + | (CTRL_ATTR_UNSPEC 0) | |
430 | + | CTRL_ATTR_FAMILY_ID | |
431 | + | CTRL_ATTR_FAMILY_NAME | |
432 | + | CTRL_ATTR_VERSION | |
433 | + | CTRL_ATTR_HDRSIZE | |
434 | + | CTRL_ATTR_MAXATTR | |
435 | + | CTRL_ATTR_OPS | |
436 | + | CTRL_ATTR_MCAST_GROUPS | |
437 | + | CTRL_ATTR_POLICY | |
438 | + | CTRL_ATTR_OP_POLICY | |
439 | + | CTRL_ATTR_OP) | |
440 | + | ||
441 | + | ;; Defined in [kernel]/include/uapi/linux/genetlink.h | |
442 | + | (define-enum int->genetlink-attr-op | |
443 | + | (CTRL_ATTR_OP_UNSPEC 0) | |
444 | + | CTRL_ATTR_OP_ID | |
445 | + | CTRL_ATTR_OP_FLAGS) | |
446 | + | ||
447 | + | ;; Defined in [kernel]/include/uapi/linux/genetlink.h | |
448 | + | (define-enum int->genetlink-attr-mcast | |
449 | + | (CTRL_ATTR_MCAST_GRP_UNSPEC 0) | |
450 | + | CTRL_ATTR_MCAST_GRP_NAME | |
451 | + | CTRL_ATTR_MCAST_GRP_ID) | |
452 | + | ||
453 | + | ;; Defined in [kernel]/include/uapi/linux/genetlink.h | |
454 | + | (define-enum int->genetlink-attr-policy | |
455 | + | (CTRL_ATTR_POLICY_UNSPEC 0) | |
456 | + | CTRL_ATTR_POLICY_DO | |
457 | + | CTRL_ATTR_POLICY_DUMP) | |
458 | + | ||
459 | + | ;; Defined in [kernel]/include/uapi/linux/genetlink.h | |
460 | + | (define-enum int->genetlink-identifiers | |
461 | + | (GENL_ID_CTRL #x10) | |
462 | + | GENL_ID_VFS_DQUOT | |
463 | + | GENL_ID_PMCRAID) |