1 /****************************************************************************
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 _UAPILINUX_PHONET_H
20 #define _UAPILINUX_PHONET_H
21 #include <linux/types.h>
22 #include <linux/socket.h>
23 #define PN_PROTO_TRANSPORT 0
24 #define PN_PROTO_PHONET 1
25 #define PN_PROTO_PIPE 2
26 #define PHONET_NPROTO 3
27 #define PNPIPE_ENCAP 1
28 #define PNPIPE_IFINDEX 2
29 #define PNPIPE_HANDLE 3
30 #define PNPIPE_INITSTATE 4
31 #define PNADDR_ANY 0
32 #define PNADDR_BROADCAST 0xFC
33 #define PNPORT_RESOURCE_ROUTING 0
34 #define PNPIPE_ENCAP_NONE 0
35 #define PNPIPE_ENCAP_IP 1
36 #define SIOCPNGETOBJECT (SIOCPROTOPRIVATE + 0)
37 #define SIOCPNENABLEPIPE (SIOCPROTOPRIVATE + 13)
38 #define SIOCPNADDRESOURCE (SIOCPROTOPRIVATE + 14)
39 #define SIOCPNDELRESOURCE (SIOCPROTOPRIVATE + 15)
40 struct phonethdr {
41   __u8 pn_rdev;
42   __u8 pn_sdev;
43   __u8 pn_res;
44   __be16 pn_length;
45   __u8 pn_robj;
46   __u8 pn_sobj;
47 } __attribute__((packed));
48 struct phonetmsg {
49   __u8 pn_trans_id;
50   __u8 pn_msg_id;
51   union {
52     struct {
53       __u8 pn_submsg_id;
54       __u8 pn_data[5];
55     } base;
56     struct {
57       __u16 pn_e_res_id;
58       __u8 pn_e_submsg_id;
59       __u8 pn_e_data[3];
60     } ext;
61   } pn_msg_u;
62 };
63 #define PN_COMMON_MESSAGE 0xF0
64 #define PN_COMMGR 0x10
65 #define PN_PREFIX 0xE0
66 #define pn_submsg_id pn_msg_u.base.pn_submsg_id
67 #define pn_e_submsg_id pn_msg_u.ext.pn_e_submsg_id
68 #define pn_e_res_id pn_msg_u.ext.pn_e_res_id
69 #define pn_data pn_msg_u.base.pn_data
70 #define pn_e_data pn_msg_u.ext.pn_e_data
71 #define PN_COMM_SERVICE_NOT_IDENTIFIED_RESP 0x01
72 #define PN_COMM_ISA_ENTITY_NOT_REACHABLE_RESP 0x14
73 #define pn_orig_msg_id pn_data[0]
74 #define pn_status pn_data[1]
75 #define pn_e_orig_msg_id pn_e_data[0]
76 #define pn_e_status pn_e_data[1]
77 struct sockaddr_pn {
78   __kernel_sa_family_t spn_family;
79   __u8 spn_obj;
80   __u8 spn_dev;
81   __u8 spn_resource;
82   __u8 spn_zero[sizeof(struct sockaddr) - sizeof(__kernel_sa_family_t) - 3];
83 } __attribute__((packed));
84 #define PN_DEV_PC 0x10
85 #endif
86