1 /*
2  * This file is auto-generated. Modifications will be lost.
3  *
4  * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5  * for more information.
6  */
7 #ifndef _UAPILINUX_PHONET_H
8 #define _UAPILINUX_PHONET_H
9 #include <linux/types.h>
10 #include <linux/socket.h>
11 #define PN_PROTO_TRANSPORT 0
12 #define PN_PROTO_PHONET 1
13 #define PN_PROTO_PIPE 2
14 #define PHONET_NPROTO 3
15 #define PNPIPE_ENCAP 1
16 #define PNPIPE_IFINDEX 2
17 #define PNPIPE_HANDLE 3
18 #define PNPIPE_INITSTATE 4
19 #define PNADDR_ANY 0
20 #define PNADDR_BROADCAST 0xFC
21 #define PNPORT_RESOURCE_ROUTING 0
22 #define PNPIPE_ENCAP_NONE 0
23 #define PNPIPE_ENCAP_IP 1
24 #define SIOCPNGETOBJECT (SIOCPROTOPRIVATE + 0)
25 #define SIOCPNENABLEPIPE (SIOCPROTOPRIVATE + 13)
26 #define SIOCPNADDRESOURCE (SIOCPROTOPRIVATE + 14)
27 #define SIOCPNDELRESOURCE (SIOCPROTOPRIVATE + 15)
28 struct phonethdr {
29   __u8 pn_rdev;
30   __u8 pn_sdev;
31   __u8 pn_res;
32   __be16 pn_length;
33   __u8 pn_robj;
34   __u8 pn_sobj;
35 } __attribute__((packed));
36 struct phonetmsg {
37   __u8 pn_trans_id;
38   __u8 pn_msg_id;
39   union {
40     struct {
41       __u8 pn_submsg_id;
42       __u8 pn_data[5];
43     } base;
44     struct {
45       __u16 pn_e_res_id;
46       __u8 pn_e_submsg_id;
47       __u8 pn_e_data[3];
48     } ext;
49   } pn_msg_u;
50 };
51 #define PN_COMMON_MESSAGE 0xF0
52 #define PN_COMMGR 0x10
53 #define PN_PREFIX 0xE0
54 #define pn_submsg_id pn_msg_u.base.pn_submsg_id
55 #define pn_e_submsg_id pn_msg_u.ext.pn_e_submsg_id
56 #define pn_e_res_id pn_msg_u.ext.pn_e_res_id
57 #define pn_data pn_msg_u.base.pn_data
58 #define pn_e_data pn_msg_u.ext.pn_e_data
59 #define PN_COMM_SERVICE_NOT_IDENTIFIED_RESP 0x01
60 #define PN_COMM_ISA_ENTITY_NOT_REACHABLE_RESP 0x14
61 #define pn_orig_msg_id pn_data[0]
62 #define pn_status pn_data[1]
63 #define pn_e_orig_msg_id pn_e_data[0]
64 #define pn_e_status pn_e_data[1]
65 struct sockaddr_pn {
66   __kernel_sa_family_t spn_family;
67   __u8 spn_obj;
68   __u8 spn_dev;
69   __u8 spn_resource;
70   __u8 spn_zero[sizeof(struct sockaddr) - sizeof(__kernel_sa_family_t) - 3];
71 } __attribute__((packed));
72 #define PN_DEV_PC 0x10
73 #endif
74