blob: a371e37ef36311ef37c71be6f261d1ef754ea123 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _LINUX_TIPC_CONFIG_H_
20#define _LINUX_TIPC_CONFIG_H_
21#include <linux/types.h>
22#include <linux/string.h>
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070023#include <linux/tipc.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070024#include <asm/byteorder.h>
Greg Kaiser55b56392022-05-27 20:41:14 +000025#include <arpa/inet.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070026#define TIPC_CMD_NOOP 0x0000
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070027#define TIPC_CMD_GET_NODES 0x0001
Ben Cheng655a7c02013-10-16 16:09:24 -070028#define TIPC_CMD_GET_MEDIA_NAMES 0x0002
29#define TIPC_CMD_GET_BEARER_NAMES 0x0003
30#define TIPC_CMD_GET_LINKS 0x0004
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070031#define TIPC_CMD_SHOW_NAME_TABLE 0x0005
Ben Cheng655a7c02013-10-16 16:09:24 -070032#define TIPC_CMD_SHOW_PORTS 0x0006
33#define TIPC_CMD_SHOW_LINK_STATS 0x000B
34#define TIPC_CMD_SHOW_STATS 0x000F
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070035#define TIPC_CMD_GET_REMOTE_MNG 0x4003
Ben Cheng655a7c02013-10-16 16:09:24 -070036#define TIPC_CMD_GET_MAX_PORTS 0x4004
37#define TIPC_CMD_GET_MAX_PUBL 0x4005
38#define TIPC_CMD_GET_MAX_SUBSCR 0x4006
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070039#define TIPC_CMD_GET_MAX_ZONES 0x4007
Ben Cheng655a7c02013-10-16 16:09:24 -070040#define TIPC_CMD_GET_MAX_CLUSTERS 0x4008
41#define TIPC_CMD_GET_MAX_NODES 0x4009
42#define TIPC_CMD_GET_MAX_SLAVES 0x400A
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070043#define TIPC_CMD_GET_NETID 0x400B
Ben Cheng655a7c02013-10-16 16:09:24 -070044#define TIPC_CMD_ENABLE_BEARER 0x4101
45#define TIPC_CMD_DISABLE_BEARER 0x4102
46#define TIPC_CMD_SET_LINK_TOL 0x4107
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070047#define TIPC_CMD_SET_LINK_PRI 0x4108
Ben Cheng655a7c02013-10-16 16:09:24 -070048#define TIPC_CMD_SET_LINK_WINDOW 0x4109
49#define TIPC_CMD_SET_LOG_SIZE 0x410A
50#define TIPC_CMD_DUMP_LOG 0x410B
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070051#define TIPC_CMD_RESET_LINK_STATS 0x410C
Ben Cheng655a7c02013-10-16 16:09:24 -070052#define TIPC_CMD_SET_NODE_ADDR 0x8001
53#define TIPC_CMD_SET_REMOTE_MNG 0x8003
54#define TIPC_CMD_SET_MAX_PORTS 0x8004
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070055#define TIPC_CMD_SET_MAX_PUBL 0x8005
Ben Cheng655a7c02013-10-16 16:09:24 -070056#define TIPC_CMD_SET_MAX_SUBSCR 0x8006
57#define TIPC_CMD_SET_MAX_ZONES 0x8007
58#define TIPC_CMD_SET_MAX_CLUSTERS 0x8008
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070059#define TIPC_CMD_SET_MAX_NODES 0x8009
Ben Cheng655a7c02013-10-16 16:09:24 -070060#define TIPC_CMD_SET_MAX_SLAVES 0x800A
61#define TIPC_CMD_SET_NETID 0x800B
62#define TIPC_CMD_NOT_NET_ADMIN 0xC001
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070063#define TIPC_TLV_NONE 0
Ben Cheng655a7c02013-10-16 16:09:24 -070064#define TIPC_TLV_VOID 1
65#define TIPC_TLV_UNSIGNED 2
66#define TIPC_TLV_STRING 3
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070067#define TIPC_TLV_LARGE_STRING 4
Ben Cheng655a7c02013-10-16 16:09:24 -070068#define TIPC_TLV_ULTRA_STRING 5
69#define TIPC_TLV_ERROR_STRING 16
70#define TIPC_TLV_NET_ADDR 17
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070071#define TIPC_TLV_MEDIA_NAME 18
Ben Cheng655a7c02013-10-16 16:09:24 -070072#define TIPC_TLV_BEARER_NAME 19
73#define TIPC_TLV_LINK_NAME 20
74#define TIPC_TLV_NODE_INFO 21
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070075#define TIPC_TLV_LINK_INFO 22
Ben Cheng655a7c02013-10-16 16:09:24 -070076#define TIPC_TLV_BEARER_CONFIG 23
77#define TIPC_TLV_LINK_CONFIG 24
78#define TIPC_TLV_NAME_TBL_QUERY 25
79#define TIPC_TLV_PORT_REF 26
Ben Cheng655a7c02013-10-16 16:09:24 -070080#define TIPC_MIN_LINK_PRI 0
81#define TIPC_DEF_LINK_PRI 10
82#define TIPC_MAX_LINK_PRI 31
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070083#define TIPC_MEDIA_LINK_PRI (TIPC_MAX_LINK_PRI + 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070084#define TIPC_MIN_LINK_TOL 50
85#define TIPC_DEF_LINK_TOL 1500
86#define TIPC_MAX_LINK_TOL 30000
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070087#if TIPC_MIN_LINK_TOL < 16
Ben Cheng655a7c02013-10-16 16:09:24 -070088#error "TIPC_MIN_LINK_TOL is too small (abort limit may be NaN)"
89#endif
90#define TIPC_MIN_LINK_WIN 16
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070091#define TIPC_DEF_LINK_WIN 50
Christopher Ferris82d75042015-01-26 10:57:07 -080092#define TIPC_MAX_LINK_WIN 8191
Christopher Ferris9ce28842018-10-25 12:11:39 -070093#define TIPC_DEF_LINK_UDP_MTU 14000
Ben Cheng655a7c02013-10-16 16:09:24 -070094struct tipc_node_info {
Tao Baod7db5942015-01-28 10:07:51 -080095 __be32 addr;
Tao Baod7db5942015-01-28 10:07:51 -080096 __be32 up;
Ben Cheng655a7c02013-10-16 16:09:24 -070097};
98struct tipc_link_info {
Tao Baod7db5942015-01-28 10:07:51 -080099 __be32 dest;
Tao Baod7db5942015-01-28 10:07:51 -0800100 __be32 up;
101 char str[TIPC_MAX_LINK_NAME];
Ben Cheng655a7c02013-10-16 16:09:24 -0700102};
103struct tipc_bearer_config {
Tao Baod7db5942015-01-28 10:07:51 -0800104 __be32 priority;
105 __be32 disc_domain;
106 char name[TIPC_MAX_BEARER_NAME];
Ben Cheng655a7c02013-10-16 16:09:24 -0700107};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700108struct tipc_link_config {
Tao Baod7db5942015-01-28 10:07:51 -0800109 __be32 value;
110 char name[TIPC_MAX_LINK_NAME];
Ben Cheng655a7c02013-10-16 16:09:24 -0700111};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700112#define TIPC_NTQ_ALLTYPES 0x80000000
Ben Cheng655a7c02013-10-16 16:09:24 -0700113struct tipc_name_table_query {
Tao Baod7db5942015-01-28 10:07:51 -0800114 __be32 depth;
115 __be32 type;
Tao Baod7db5942015-01-28 10:07:51 -0800116 __be32 lowbound;
117 __be32 upbound;
Ben Cheng655a7c02013-10-16 16:09:24 -0700118};
119#define TIPC_CFG_TLV_ERROR "\x80"
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700120#define TIPC_CFG_NOT_NET_ADMIN "\x81"
Ben Cheng655a7c02013-10-16 16:09:24 -0700121#define TIPC_CFG_NOT_ZONE_MSTR "\x82"
122#define TIPC_CFG_NO_REMOTE "\x83"
123#define TIPC_CFG_NOT_SUPPORTED "\x84"
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700124#define TIPC_CFG_INVALID_VALUE "\x85"
Ben Cheng655a7c02013-10-16 16:09:24 -0700125struct tlv_desc {
Tao Baod7db5942015-01-28 10:07:51 -0800126 __be16 tlv_len;
127 __be16 tlv_type;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700128};
Ben Cheng655a7c02013-10-16 16:09:24 -0700129#define TLV_ALIGNTO 4
Tao Baod7db5942015-01-28 10:07:51 -0800130#define TLV_ALIGN(datalen) (((datalen) + (TLV_ALIGNTO - 1)) & ~(TLV_ALIGNTO - 1))
Ben Cheng655a7c02013-10-16 16:09:24 -0700131#define TLV_LENGTH(datalen) (sizeof(struct tlv_desc) + (datalen))
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700132#define TLV_SPACE(datalen) (TLV_ALIGN(TLV_LENGTH(datalen)))
Tao Baod7db5942015-01-28 10:07:51 -0800133#define TLV_DATA(tlv) ((void *) ((char *) (tlv) + TLV_LENGTH(0)))
Ben Cheng655a7c02013-10-16 16:09:24 -0700134struct tlv_list_desc {
Tao Baod7db5942015-01-28 10:07:51 -0800135 struct tlv_desc * tlv_ptr;
Tao Baod7db5942015-01-28 10:07:51 -0800136 __u32 tlv_space;
Ben Cheng655a7c02013-10-16 16:09:24 -0700137};
138#define TIPC_GENL_NAME "TIPC"
139#define TIPC_GENL_VERSION 0x1
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700140#define TIPC_GENL_CMD 0x1
Ben Cheng655a7c02013-10-16 16:09:24 -0700141struct tipc_genlmsghdr {
Tao Baod7db5942015-01-28 10:07:51 -0800142 __u32 dest;
143 __u16 cmd;
Tao Baod7db5942015-01-28 10:07:51 -0800144 __u16 reserved;
Ben Cheng655a7c02013-10-16 16:09:24 -0700145};
146#define TIPC_GENL_HDRLEN NLMSG_ALIGN(sizeof(struct tipc_genlmsghdr))
147struct tipc_cfg_msg_hdr {
Tao Baod7db5942015-01-28 10:07:51 -0800148 __be32 tcm_len;
149 __be16 tcm_type;
150 __be16 tcm_flags;
151 char tcm_reserved[8];
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700152};
Ben Cheng655a7c02013-10-16 16:09:24 -0700153#define TCM_F_REQUEST 0x1
154#define TCM_F_MORE 0x2
Tao Baod7db5942015-01-28 10:07:51 -0800155#define TCM_ALIGN(datalen) (((datalen) + 3) & ~3)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700156#define TCM_LENGTH(datalen) (sizeof(struct tipc_cfg_msg_hdr) + datalen)
Ben Cheng655a7c02013-10-16 16:09:24 -0700157#define TCM_SPACE(datalen) (TCM_ALIGN(TCM_LENGTH(datalen)))
Tao Baod7db5942015-01-28 10:07:51 -0800158#define TCM_DATA(tcm_hdr) ((void *) ((char *) (tcm_hdr) + TCM_LENGTH(0)))
Ben Cheng655a7c02013-10-16 16:09:24 -0700159#endif