Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/linux
File: tipc.h
/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
[0] Fix | Delete
/*
[1] Fix | Delete
* include/uapi/linux/tipc.h: Header for TIPC socket interface
[2] Fix | Delete
*
[3] Fix | Delete
* Copyright (c) 2003-2006, 2015-2016 Ericsson AB
[4] Fix | Delete
* Copyright (c) 2005, 2010-2011, Wind River Systems
[5] Fix | Delete
* All rights reserved.
[6] Fix | Delete
*
[7] Fix | Delete
* Redistribution and use in source and binary forms, with or without
[8] Fix | Delete
* modification, are permitted provided that the following conditions are met:
[9] Fix | Delete
*
[10] Fix | Delete
* 1. Redistributions of source code must retain the above copyright
[11] Fix | Delete
* notice, this list of conditions and the following disclaimer.
[12] Fix | Delete
* 2. Redistributions in binary form must reproduce the above copyright
[13] Fix | Delete
* notice, this list of conditions and the following disclaimer in the
[14] Fix | Delete
* documentation and/or other materials provided with the distribution.
[15] Fix | Delete
* 3. Neither the names of the copyright holders nor the names of its
[16] Fix | Delete
* contributors may be used to endorse or promote products derived from
[17] Fix | Delete
* this software without specific prior written permission.
[18] Fix | Delete
*
[19] Fix | Delete
* Alternatively, this software may be distributed under the terms of the
[20] Fix | Delete
* GNU General Public License ("GPL") version 2 as published by the Free
[21] Fix | Delete
* Software Foundation.
[22] Fix | Delete
*
[23] Fix | Delete
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
[24] Fix | Delete
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
[25] Fix | Delete
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
[26] Fix | Delete
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
[27] Fix | Delete
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
[28] Fix | Delete
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
[29] Fix | Delete
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
[30] Fix | Delete
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
[31] Fix | Delete
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
[32] Fix | Delete
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
[33] Fix | Delete
* POSSIBILITY OF SUCH DAMAGE.
[34] Fix | Delete
*/
[35] Fix | Delete
[36] Fix | Delete
#ifndef _LINUX_TIPC_H_
[37] Fix | Delete
#define _LINUX_TIPC_H_
[38] Fix | Delete
[39] Fix | Delete
#include <linux/types.h>
[40] Fix | Delete
#include <linux/sockios.h>
[41] Fix | Delete
[42] Fix | Delete
/*
[43] Fix | Delete
* TIPC addressing primitives
[44] Fix | Delete
*/
[45] Fix | Delete
[46] Fix | Delete
struct tipc_socket_addr {
[47] Fix | Delete
__u32 ref;
[48] Fix | Delete
__u32 node;
[49] Fix | Delete
};
[50] Fix | Delete
[51] Fix | Delete
struct tipc_service_addr {
[52] Fix | Delete
__u32 type;
[53] Fix | Delete
__u32 instance;
[54] Fix | Delete
};
[55] Fix | Delete
[56] Fix | Delete
struct tipc_service_range {
[57] Fix | Delete
__u32 type;
[58] Fix | Delete
__u32 lower;
[59] Fix | Delete
__u32 upper;
[60] Fix | Delete
};
[61] Fix | Delete
[62] Fix | Delete
/*
[63] Fix | Delete
* Application-accessible service types
[64] Fix | Delete
*/
[65] Fix | Delete
[66] Fix | Delete
#define TIPC_NODE_STATE 0 /* node state service type */
[67] Fix | Delete
#define TIPC_TOP_SRV 1 /* topology server service type */
[68] Fix | Delete
#define TIPC_LINK_STATE 2 /* link state service type */
[69] Fix | Delete
#define TIPC_RESERVED_TYPES 64 /* lowest user-allowed service type */
[70] Fix | Delete
[71] Fix | Delete
/*
[72] Fix | Delete
* Publication scopes when binding service / service range
[73] Fix | Delete
*/
[74] Fix | Delete
enum tipc_scope {
[75] Fix | Delete
TIPC_CLUSTER_SCOPE = 2, /* 0 can also be used */
[76] Fix | Delete
TIPC_NODE_SCOPE = 3
[77] Fix | Delete
};
[78] Fix | Delete
[79] Fix | Delete
/*
[80] Fix | Delete
* Limiting values for messages
[81] Fix | Delete
*/
[82] Fix | Delete
[83] Fix | Delete
#define TIPC_MAX_USER_MSG_SIZE 66000U
[84] Fix | Delete
[85] Fix | Delete
/*
[86] Fix | Delete
* Message importance levels
[87] Fix | Delete
*/
[88] Fix | Delete
[89] Fix | Delete
#define TIPC_LOW_IMPORTANCE 0
[90] Fix | Delete
#define TIPC_MEDIUM_IMPORTANCE 1
[91] Fix | Delete
#define TIPC_HIGH_IMPORTANCE 2
[92] Fix | Delete
#define TIPC_CRITICAL_IMPORTANCE 3
[93] Fix | Delete
[94] Fix | Delete
/*
[95] Fix | Delete
* Msg rejection/connection shutdown reasons
[96] Fix | Delete
*/
[97] Fix | Delete
[98] Fix | Delete
#define TIPC_OK 0
[99] Fix | Delete
#define TIPC_ERR_NO_NAME 1
[100] Fix | Delete
#define TIPC_ERR_NO_PORT 2
[101] Fix | Delete
#define TIPC_ERR_NO_NODE 3
[102] Fix | Delete
#define TIPC_ERR_OVERLOAD 4
[103] Fix | Delete
#define TIPC_CONN_SHUTDOWN 5
[104] Fix | Delete
[105] Fix | Delete
/*
[106] Fix | Delete
* TIPC topology subscription service definitions
[107] Fix | Delete
*/
[108] Fix | Delete
[109] Fix | Delete
#define TIPC_SUB_PORTS 0x01 /* filter: evt at each match */
[110] Fix | Delete
#define TIPC_SUB_SERVICE 0x02 /* filter: evt at first up/last down */
[111] Fix | Delete
#define TIPC_SUB_CANCEL 0x04 /* filter: cancel a subscription */
[112] Fix | Delete
[113] Fix | Delete
#define TIPC_WAIT_FOREVER (~0) /* timeout for permanent subscription */
[114] Fix | Delete
[115] Fix | Delete
struct tipc_subscr {
[116] Fix | Delete
struct tipc_service_range seq; /* range of interest */
[117] Fix | Delete
__u32 timeout; /* subscription duration (in ms) */
[118] Fix | Delete
__u32 filter; /* bitmask of filter options */
[119] Fix | Delete
char usr_handle[8]; /* available for subscriber use */
[120] Fix | Delete
};
[121] Fix | Delete
[122] Fix | Delete
#define TIPC_PUBLISHED 1 /* publication event */
[123] Fix | Delete
#define TIPC_WITHDRAWN 2 /* withdrawal event */
[124] Fix | Delete
#define TIPC_SUBSCR_TIMEOUT 3 /* subscription timeout event */
[125] Fix | Delete
[126] Fix | Delete
struct tipc_event {
[127] Fix | Delete
__u32 event; /* event type */
[128] Fix | Delete
__u32 found_lower; /* matching range */
[129] Fix | Delete
__u32 found_upper; /* " " */
[130] Fix | Delete
struct tipc_socket_addr port; /* associated socket */
[131] Fix | Delete
struct tipc_subscr s; /* associated subscription */
[132] Fix | Delete
};
[133] Fix | Delete
[134] Fix | Delete
/*
[135] Fix | Delete
* Socket API
[136] Fix | Delete
*/
[137] Fix | Delete
[138] Fix | Delete
#ifndef AF_TIPC
[139] Fix | Delete
#define AF_TIPC 30
[140] Fix | Delete
#endif
[141] Fix | Delete
[142] Fix | Delete
#ifndef PF_TIPC
[143] Fix | Delete
#define PF_TIPC AF_TIPC
[144] Fix | Delete
#endif
[145] Fix | Delete
[146] Fix | Delete
#ifndef SOL_TIPC
[147] Fix | Delete
#define SOL_TIPC 271
[148] Fix | Delete
#endif
[149] Fix | Delete
[150] Fix | Delete
#define TIPC_ADDR_MCAST 1
[151] Fix | Delete
#define TIPC_SERVICE_RANGE 1
[152] Fix | Delete
#define TIPC_SERVICE_ADDR 2
[153] Fix | Delete
#define TIPC_SOCKET_ADDR 3
[154] Fix | Delete
[155] Fix | Delete
struct sockaddr_tipc {
[156] Fix | Delete
unsigned short family;
[157] Fix | Delete
unsigned char addrtype;
[158] Fix | Delete
signed char scope;
[159] Fix | Delete
union {
[160] Fix | Delete
struct tipc_socket_addr id;
[161] Fix | Delete
struct tipc_service_range nameseq;
[162] Fix | Delete
struct {
[163] Fix | Delete
struct tipc_service_addr name;
[164] Fix | Delete
__u32 domain;
[165] Fix | Delete
} name;
[166] Fix | Delete
} addr;
[167] Fix | Delete
};
[168] Fix | Delete
[169] Fix | Delete
/*
[170] Fix | Delete
* Ancillary data objects supported by recvmsg()
[171] Fix | Delete
*/
[172] Fix | Delete
[173] Fix | Delete
#define TIPC_ERRINFO 1 /* error info */
[174] Fix | Delete
#define TIPC_RETDATA 2 /* returned data */
[175] Fix | Delete
#define TIPC_DESTNAME 3 /* destination name */
[176] Fix | Delete
[177] Fix | Delete
/*
[178] Fix | Delete
* TIPC-specific socket option names
[179] Fix | Delete
*/
[180] Fix | Delete
[181] Fix | Delete
#define TIPC_IMPORTANCE 127 /* Default: TIPC_LOW_IMPORTANCE */
[182] Fix | Delete
#define TIPC_SRC_DROPPABLE 128 /* Default: based on socket type */
[183] Fix | Delete
#define TIPC_DEST_DROPPABLE 129 /* Default: based on socket type */
[184] Fix | Delete
#define TIPC_CONN_TIMEOUT 130 /* Default: 8000 (ms) */
[185] Fix | Delete
#define TIPC_NODE_RECVQ_DEPTH 131 /* Default: none (read only) */
[186] Fix | Delete
#define TIPC_SOCK_RECVQ_DEPTH 132 /* Default: none (read only) */
[187] Fix | Delete
#define TIPC_MCAST_BROADCAST 133 /* Default: TIPC selects. No arg */
[188] Fix | Delete
#define TIPC_MCAST_REPLICAST 134 /* Default: TIPC selects. No arg */
[189] Fix | Delete
#define TIPC_GROUP_JOIN 135 /* Takes struct tipc_group_req* */
[190] Fix | Delete
#define TIPC_GROUP_LEAVE 136 /* No argument */
[191] Fix | Delete
#define TIPC_SOCK_RECVQ_USED 137 /* Default: none (read only) */
[192] Fix | Delete
#define TIPC_NODELAY 138 /* Default: false */
[193] Fix | Delete
[194] Fix | Delete
/*
[195] Fix | Delete
* Flag values
[196] Fix | Delete
*/
[197] Fix | Delete
#define TIPC_GROUP_LOOPBACK 0x1 /* Receive copy of sent msg when match */
[198] Fix | Delete
#define TIPC_GROUP_MEMBER_EVTS 0x2 /* Receive membership events in socket */
[199] Fix | Delete
[200] Fix | Delete
struct tipc_group_req {
[201] Fix | Delete
__u32 type; /* group id */
[202] Fix | Delete
__u32 instance; /* member id */
[203] Fix | Delete
__u32 scope; /* cluster/node */
[204] Fix | Delete
__u32 flags;
[205] Fix | Delete
};
[206] Fix | Delete
[207] Fix | Delete
/*
[208] Fix | Delete
* Maximum sizes of TIPC bearer-related names (including terminating NULL)
[209] Fix | Delete
* The string formatting for each name element is:
[210] Fix | Delete
* media: media
[211] Fix | Delete
* interface: media:interface name
[212] Fix | Delete
* link: node:interface-node:interface
[213] Fix | Delete
*/
[214] Fix | Delete
#define TIPC_NODEID_LEN 16
[215] Fix | Delete
#define TIPC_MAX_MEDIA_NAME 16
[216] Fix | Delete
#define TIPC_MAX_IF_NAME 16
[217] Fix | Delete
#define TIPC_MAX_BEARER_NAME 32
[218] Fix | Delete
#define TIPC_MAX_LINK_NAME 68
[219] Fix | Delete
[220] Fix | Delete
#define SIOCGETLINKNAME SIOCPROTOPRIVATE
[221] Fix | Delete
#define SIOCGETNODEID (SIOCPROTOPRIVATE + 1)
[222] Fix | Delete
[223] Fix | Delete
struct tipc_sioc_ln_req {
[224] Fix | Delete
__u32 peer;
[225] Fix | Delete
__u32 bearer_id;
[226] Fix | Delete
char linkname[TIPC_MAX_LINK_NAME];
[227] Fix | Delete
};
[228] Fix | Delete
[229] Fix | Delete
struct tipc_sioc_nodeid_req {
[230] Fix | Delete
__u32 peer;
[231] Fix | Delete
char node_id[TIPC_NODEID_LEN];
[232] Fix | Delete
};
[233] Fix | Delete
[234] Fix | Delete
/*
[235] Fix | Delete
* TIPC Crypto, AEAD
[236] Fix | Delete
*/
[237] Fix | Delete
#define TIPC_AEAD_ALG_NAME (32)
[238] Fix | Delete
[239] Fix | Delete
struct tipc_aead_key {
[240] Fix | Delete
char alg_name[TIPC_AEAD_ALG_NAME];
[241] Fix | Delete
unsigned int keylen; /* in bytes */
[242] Fix | Delete
char key[];
[243] Fix | Delete
};
[244] Fix | Delete
[245] Fix | Delete
#define TIPC_AEAD_KEYLEN_MIN (16 + 4)
[246] Fix | Delete
#define TIPC_AEAD_KEYLEN_MAX (32 + 4)
[247] Fix | Delete
#define TIPC_AEAD_KEY_SIZE_MAX (sizeof(struct tipc_aead_key) + \
[248] Fix | Delete
TIPC_AEAD_KEYLEN_MAX)
[249] Fix | Delete
[250] Fix | Delete
static __inline__ int tipc_aead_key_size(struct tipc_aead_key *key)
[251] Fix | Delete
{
[252] Fix | Delete
return sizeof(*key) + key->keylen;
[253] Fix | Delete
}
[254] Fix | Delete
[255] Fix | Delete
#define TIPC_REKEYING_NOW (~0U)
[256] Fix | Delete
[257] Fix | Delete
/* The macros and functions below are deprecated:
[258] Fix | Delete
*/
[259] Fix | Delete
[260] Fix | Delete
#define TIPC_CFG_SRV 0
[261] Fix | Delete
#define TIPC_ZONE_SCOPE 1
[262] Fix | Delete
[263] Fix | Delete
#define TIPC_ADDR_NAMESEQ 1
[264] Fix | Delete
#define TIPC_ADDR_NAME 2
[265] Fix | Delete
#define TIPC_ADDR_ID 3
[266] Fix | Delete
[267] Fix | Delete
#define TIPC_NODE_BITS 12
[268] Fix | Delete
#define TIPC_CLUSTER_BITS 12
[269] Fix | Delete
#define TIPC_ZONE_BITS 8
[270] Fix | Delete
[271] Fix | Delete
#define TIPC_NODE_OFFSET 0
[272] Fix | Delete
#define TIPC_CLUSTER_OFFSET TIPC_NODE_BITS
[273] Fix | Delete
#define TIPC_ZONE_OFFSET (TIPC_CLUSTER_OFFSET + TIPC_CLUSTER_BITS)
[274] Fix | Delete
[275] Fix | Delete
#define TIPC_NODE_SIZE ((1UL << TIPC_NODE_BITS) - 1)
[276] Fix | Delete
#define TIPC_CLUSTER_SIZE ((1UL << TIPC_CLUSTER_BITS) - 1)
[277] Fix | Delete
#define TIPC_ZONE_SIZE ((1UL << TIPC_ZONE_BITS) - 1)
[278] Fix | Delete
[279] Fix | Delete
#define TIPC_NODE_MASK (TIPC_NODE_SIZE << TIPC_NODE_OFFSET)
[280] Fix | Delete
#define TIPC_CLUSTER_MASK (TIPC_CLUSTER_SIZE << TIPC_CLUSTER_OFFSET)
[281] Fix | Delete
#define TIPC_ZONE_MASK (TIPC_ZONE_SIZE << TIPC_ZONE_OFFSET)
[282] Fix | Delete
[283] Fix | Delete
#define TIPC_ZONE_CLUSTER_MASK (TIPC_ZONE_MASK | TIPC_CLUSTER_MASK)
[284] Fix | Delete
[285] Fix | Delete
#define tipc_portid tipc_socket_addr
[286] Fix | Delete
#define tipc_name tipc_service_addr
[287] Fix | Delete
#define tipc_name_seq tipc_service_range
[288] Fix | Delete
[289] Fix | Delete
static __inline__ __u32 tipc_addr(unsigned int zone,
[290] Fix | Delete
unsigned int cluster,
[291] Fix | Delete
unsigned int node)
[292] Fix | Delete
{
[293] Fix | Delete
return (zone << TIPC_ZONE_OFFSET) |
[294] Fix | Delete
(cluster << TIPC_CLUSTER_OFFSET) |
[295] Fix | Delete
node;
[296] Fix | Delete
}
[297] Fix | Delete
[298] Fix | Delete
static __inline__ unsigned int tipc_zone(__u32 addr)
[299] Fix | Delete
{
[300] Fix | Delete
return addr >> TIPC_ZONE_OFFSET;
[301] Fix | Delete
}
[302] Fix | Delete
[303] Fix | Delete
static __inline__ unsigned int tipc_cluster(__u32 addr)
[304] Fix | Delete
{
[305] Fix | Delete
return (addr & TIPC_CLUSTER_MASK) >> TIPC_CLUSTER_OFFSET;
[306] Fix | Delete
}
[307] Fix | Delete
[308] Fix | Delete
static __inline__ unsigned int tipc_node(__u32 addr)
[309] Fix | Delete
{
[310] Fix | Delete
return addr & TIPC_NODE_MASK;
[311] Fix | Delete
}
[312] Fix | Delete
[313] Fix | Delete
#endif
[314] Fix | Delete
[315] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function