linux/include/uapi/linux/phonet.h

/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/**
 * file phonet.h
 *
 * Phonet sockets kernel interface
 *
 * Copyright (C) 2008 Nokia Corporation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA
 */

#ifndef _UAPILINUX_PHONET_H
#define _UAPILINUX_PHONET_H

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

/* Automatic protocol selection */
#define PN_PROTO_TRANSPORT
/* Phonet datagram socket */
#define PN_PROTO_PHONET
/* Phonet pipe */
#define PN_PROTO_PIPE
#define PHONET_NPROTO

/* Socket options for SOL_PNPIPE level */
#define PNPIPE_ENCAP
#define PNPIPE_IFINDEX
#define PNPIPE_HANDLE
#define PNPIPE_INITSTATE

#define PNADDR_ANY
#define PNADDR_BROADCAST
#define PNPORT_RESOURCE_ROUTING

/* Values for PNPIPE_ENCAP option */
#define PNPIPE_ENCAP_NONE
#define PNPIPE_ENCAP_IP

/* ioctls */
#define SIOCPNGETOBJECT
#define SIOCPNENABLEPIPE
#define SIOCPNADDRESOURCE
#define SIOCPNDELRESOURCE

/* Phonet protocol header */
struct phonethdr {} __attribute__((packed));

/* Common Phonet payload header */
struct phonetmsg {};
#define PN_COMMON_MESSAGE
#define PN_COMMGR
#define PN_PREFIX
#define pn_submsg_id
#define pn_e_submsg_id
#define pn_e_res_id
#define pn_data
#define pn_e_data

/* data for unreachable errors */
#define PN_COMM_SERVICE_NOT_IDENTIFIED_RESP
#define PN_COMM_ISA_ENTITY_NOT_REACHABLE_RESP
#define pn_orig_msg_id
#define pn_status
#define pn_e_orig_msg_id
#define pn_e_status

/* Phonet socket address structure */
struct sockaddr_pn {} __attribute__((packed));

/* Well known address */
#define PN_DEV_PC

static inline __u16 pn_object(__u8 addr, __u16 port)
{}

static inline __u8 pn_obj(__u16 handle)
{}

static inline __u8 pn_dev(__u16 handle)
{}

static inline __u16 pn_port(__u16 handle)
{}

static inline __u8 pn_addr(__u16 handle)
{}

static inline void pn_sockaddr_set_addr(struct sockaddr_pn *spn, __u8 addr)
{}

static inline void pn_sockaddr_set_port(struct sockaddr_pn *spn, __u16 port)
{}

static inline void pn_sockaddr_set_object(struct sockaddr_pn *spn,
						__u16 handle)
{}

static inline void pn_sockaddr_set_resource(struct sockaddr_pn *spn,
						__u8 resource)
{}

static inline __u8 pn_sockaddr_get_addr(const struct sockaddr_pn *spn)
{}

static inline __u16 pn_sockaddr_get_port(const struct sockaddr_pn *spn)
{}

static inline __u16 pn_sockaddr_get_object(const struct sockaddr_pn *spn)
{}

static inline __u8 pn_sockaddr_get_resource(const struct sockaddr_pn *spn)
{}

/* Phonet device ioctl requests */

#endif /* _UAPILINUX_PHONET_H */