hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _LINUX_QRTR_H
#define _LINUX_QRTR_H
 
#include <linux/socket.h>
#include <linux/types.h>
 
#ifndef AF_QIPCRTR
#define AF_QIPCRTR 42
#endif
 
#define QRTR_NODE_BCAST    0xffffffffu
#define QRTR_PORT_CTRL    0xfffffffeu
 
struct sockaddr_qrtr {
   __kernel_sa_family_t sq_family;
   __u32 sq_node;
   __u32 sq_port;
};
 
enum qrtr_pkt_type {
   QRTR_TYPE_DATA        = 1,
   QRTR_TYPE_HELLO        = 2,
   QRTR_TYPE_BYE        = 3,
   QRTR_TYPE_NEW_SERVER    = 4,
   QRTR_TYPE_DEL_SERVER    = 5,
   QRTR_TYPE_DEL_CLIENT    = 6,
   QRTR_TYPE_RESUME_TX    = 7,
   QRTR_TYPE_EXIT          = 8,
   QRTR_TYPE_PING          = 9,
   QRTR_TYPE_NEW_LOOKUP    = 10,
   QRTR_TYPE_DEL_LOOKUP    = 11,
};
 
#define QRTR_TYPE_DEL_PROC 13
 
struct qrtr_ctrl_pkt {
   __le32 cmd;
 
   union {
       struct {
           __le32 service;
           __le32 instance;
           __le32 node;
           __le32 port;
       } server;
 
       struct {
           __le32 node;
           __le32 port;
       } client;
 
       struct {
           __le32 rsvd;
           __le32 node;
       } proc;
 
   };
} __attribute__ ((packed));
 
#define QRTR_PROTO_VER_1 1
 
struct qrtr_hdr_v1 {
   __le32 version;
   __le32 type;
   __le32 src_node_id;
   __le32 src_port_id;
   __le32 confirm_rx;
   __le32 size;
   __le32 dst_node_id;
   __le32 dst_port_id;
} __attribute__ ((packed));
 
#endif /* _LINUX_QRTR_H */