Debian Codegraph @

srtcore/group_common.h

raw
1 /*
2 * SRT - Secure, Reliable, Transport
3 * Copyright (c) 2021 Haivision Systems Inc.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 */
10
11 /*****************************************************************************
12 Written by
13 Haivision Systems Inc.
14 *****************************************************************************/
15
16 #ifndef INC_SRT_GROUP_COMMON_H
17 #define INC_SRT_GROUP_COMMON_H
18
19 #include "srt.h"
20 #include "common.h"
21 #include "core.h"
22
23 #include <list>
24
25 namespace srt
26 {
27 namespace groups
28 {
29 typedef SRT_MEMBERSTATUS GroupState;
30
31 struct SocketData
32 {
33 SRTSOCKET id; // same as ps->m_SocketID
34 CUDTSocket* ps;
35 int token;
36 SRT_SOCKSTATUS laststatus;
37 GroupState sndstate;
38 GroupState rcvstate;
39 int sndresult;
40 int rcvresult;
41 sockaddr_any agent;
42 sockaddr_any peer;
43 bool ready_read;
44 bool ready_write;
45 bool ready_error;
46
47 // Configuration
48 uint16_t weight;
49
50 // Stats
51 int64_t pktSndDropTotal;
52 };
53
54 SocketData prepareSocketData(CUDTSocket* s);
55
56 typedef std::list<SocketData> group_t;
57 typedef group_t::iterator gli_t;
58
59 } // namespace groups
60 } // namespace srt
61
62 #endif // INC_SRT_GROUP_COMMON_H