-
Notifications
You must be signed in to change notification settings - Fork 1
/
msrp.h
executable file
·119 lines (99 loc) · 2.18 KB
/
msrp.h
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#ifndef MSRP_H
#define MSRP_H
#include "avb_util.h"
#pragma pack(push, 1)
struct domain_msrp_first_value {
u8 sr_class_id;
u8 sr_class_prio;
u16 sr_class_VID;
};
struct listener_msrp_first_value {
u8 stream_id[8];
};
struct talker_msrp_first_value {
u8 stream_id[8];
u8 data_frame_params[8];
u16 max_frame_size;
u16 max_interval_frames;
u8 priority_and_rank;
u32 accumalated_latency;
};
struct bridge_msrp_firstvalue {
u8 stream_id[8];
u8 data_frame_params[8];
u16 max_frame_size;
u16 max_interval_frames;
u8 priority_and_rank;
u32 accumalated_latency;
u8 bridge_id[8];
u8 failure_reason;
};
struct vector_header {
u16 number_of_values;
};
struct domain_vector_attribute {
struct vector_header hdr;
struct domain_msrp_first_value val;
u8 vector[2];
};
struct listner_vector_attribute {
struct vector_header hdr;
struct listener_msrp_first_value val;
u8 vector[2];
};
struct talker_vector_attribute {
struct vector_header hdr;
struct talker_msrp_first_value val;
u8 vector[1];
};
struct domain_mrp_msg {
u8 attribute_type;
u8 attribute_len;
u16 attribute_list_len;
struct domain_vector_attribute attibute_list;
u16 end_marker;
};
struct listner_mrp_msg {
u8 attribute_type;
u8 attribute_len;
u16 attribute_list_len;
struct listner_vector_attribute attibute_list;
u16 end_marker;
};
struct talker_mrp_msg {
u8 attribute_type;
u8 attribute_len;
u16 attribute_list_len;
struct talker_vector_attribute attibute_list;
u16 end_marker;
};
struct domain_msrp_du {
u8 protocol_version;
struct domain_mrp_msg msg;
u16 end_marker;
};
struct listner_msrp_du {
u8 protocol_version;
struct listner_mrp_msg msg;
u16 end_marker;
};
struct talker_msrp_du {
u8 protocol_version;
struct talker_mrp_msg msg;
u16 end_marker;
};
#pragma pack(pop)
struct msrp {
bool initialized;
bool started;
int rx_state;
int tx_state;
struct socketdata sd;
u8 stream_id[8];
};
bool avb_msrp_init(const char *ifname, struct msrp *msrp);
void avb_msrp_domaindeclarations(struct msrp *msrp);
void avb_msrp_talkerdeclarations(struct msrp *msrp, bool join, int state);
void avb_msrp_listenerdeclarations(struct msrp *msrp, bool join, int state);
int avb_msrp_listen(struct msrp *msrp);
#endif