linux/include/uapi/linux/tipc.h

/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
/*
 * include/uapi/linux/tipc.h: Header for TIPC socket interface
 *
 * Copyright (c) 2003-2006, 2015-2016 Ericsson AB
 * Copyright (c) 2005, 2010-2011, Wind River Systems
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the names of the copyright holders nor the names of its
 *    contributors may be used to endorse or promote products derived from
 *    this software without specific prior written permission.
 *
 * Alternatively, this software may be distributed under the terms of the
 * GNU General Public License ("GPL") version 2 as published by the Free
 * Software Foundation.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef _LINUX_TIPC_H_
#define _LINUX_TIPC_H_

#include <linux/types.h>
#include <linux/sockios.h>

/*
 * TIPC addressing primitives
 */

struct tipc_socket_addr {};

struct tipc_service_addr {};

struct tipc_service_range {};

/*
 * Application-accessible service types
 */

#define TIPC_NODE_STATE
#define TIPC_TOP_SRV
#define TIPC_LINK_STATE
#define TIPC_RESERVED_TYPES

/*
 * Publication scopes when binding service / service range
 */
enum tipc_scope {};

/*
 * Limiting values for messages
 */

#define TIPC_MAX_USER_MSG_SIZE

/*
 * Message importance levels
 */

#define TIPC_LOW_IMPORTANCE
#define TIPC_MEDIUM_IMPORTANCE
#define TIPC_HIGH_IMPORTANCE
#define TIPC_CRITICAL_IMPORTANCE

/*
 * Msg rejection/connection shutdown reasons
 */

#define TIPC_OK
#define TIPC_ERR_NO_NAME
#define TIPC_ERR_NO_PORT
#define TIPC_ERR_NO_NODE
#define TIPC_ERR_OVERLOAD
#define TIPC_CONN_SHUTDOWN

/*
 * TIPC topology subscription service definitions
 */

#define TIPC_SUB_PORTS
#define TIPC_SUB_SERVICE
#define TIPC_SUB_CANCEL

#define TIPC_WAIT_FOREVER

struct tipc_subscr {};

#define TIPC_PUBLISHED
#define TIPC_WITHDRAWN
#define TIPC_SUBSCR_TIMEOUT

struct tipc_event {};

/*
 * Socket API
 */

#ifndef AF_TIPC
#define AF_TIPC
#endif

#ifndef PF_TIPC
#define PF_TIPC
#endif

#ifndef SOL_TIPC
#define SOL_TIPC
#endif

#define TIPC_ADDR_MCAST
#define TIPC_SERVICE_RANGE
#define TIPC_SERVICE_ADDR
#define TIPC_SOCKET_ADDR

struct sockaddr_tipc {};

/*
 * Ancillary data objects supported by recvmsg()
 */

#define TIPC_ERRINFO
#define TIPC_RETDATA
#define TIPC_DESTNAME

/*
 * TIPC-specific socket option names
 */

#define TIPC_IMPORTANCE
#define TIPC_SRC_DROPPABLE
#define TIPC_DEST_DROPPABLE
#define TIPC_CONN_TIMEOUT
#define TIPC_NODE_RECVQ_DEPTH
#define TIPC_SOCK_RECVQ_DEPTH
#define TIPC_MCAST_BROADCAST
#define TIPC_MCAST_REPLICAST
#define TIPC_GROUP_JOIN
#define TIPC_GROUP_LEAVE
#define TIPC_SOCK_RECVQ_USED
#define TIPC_NODELAY

/*
 * Flag values
 */
#define TIPC_GROUP_LOOPBACK
#define TIPC_GROUP_MEMBER_EVTS

struct tipc_group_req {};

/*
 * Maximum sizes of TIPC bearer-related names (including terminating NULL)
 * The string formatting for each name element is:
 * media: media
 * interface: media:interface name
 * link: node:interface-node:interface
 */
#define TIPC_NODEID_LEN
#define TIPC_MAX_MEDIA_NAME
#define TIPC_MAX_IF_NAME
#define TIPC_MAX_BEARER_NAME
#define TIPC_MAX_LINK_NAME

#define SIOCGETLINKNAME
#define SIOCGETNODEID

struct tipc_sioc_ln_req {};

struct tipc_sioc_nodeid_req {};

/*
 * TIPC Crypto, AEAD
 */
#define TIPC_AEAD_ALG_NAME

struct tipc_aead_key {};

#define TIPC_AEAD_KEYLEN_MIN
#define TIPC_AEAD_KEYLEN_MAX
#define TIPC_AEAD_KEY_SIZE_MAX

static inline int tipc_aead_key_size(struct tipc_aead_key *key)
{}

#define TIPC_REKEYING_NOW

/* The macros and functions below are deprecated:
 */

#define TIPC_CFG_SRV
#define TIPC_ZONE_SCOPE

#define TIPC_ADDR_NAMESEQ
#define TIPC_ADDR_NAME
#define TIPC_ADDR_ID

#define TIPC_NODE_BITS
#define TIPC_CLUSTER_BITS
#define TIPC_ZONE_BITS

#define TIPC_NODE_OFFSET
#define TIPC_CLUSTER_OFFSET
#define TIPC_ZONE_OFFSET

#define TIPC_NODE_SIZE
#define TIPC_CLUSTER_SIZE
#define TIPC_ZONE_SIZE

#define TIPC_NODE_MASK
#define TIPC_CLUSTER_MASK
#define TIPC_ZONE_MASK

#define TIPC_ZONE_CLUSTER_MASK

#define tipc_portid
#define tipc_name
#define tipc_name_seq

static inline __u32 tipc_addr(unsigned int zone,
			      unsigned int cluster,
			      unsigned int node)
{}

static inline unsigned int tipc_zone(__u32 addr)
{}

static inline unsigned int tipc_cluster(__u32 addr)
{}

static inline unsigned int tipc_node(__u32 addr)
{}

#endif