1 | /********** |
2 | This library is free software; you can redistribute it and/or modify it under |
3 | the terms of the GNU Lesser General Public License as published by the |
4 | Free Software Foundation; either version 3 of the License, or (at your |
5 | option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.) |
6 | |
7 | This library is distributed in the hope that it will be useful, but WITHOUT |
8 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
9 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for |
10 | more details. |
11 | |
12 | You should have received a copy of the GNU Lesser General Public License |
13 | along with this library; if not, write to the Free Software Foundation, Inc., |
14 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
15 | **********/ |
16 | // "multikit" Multicast Application Shell |
17 | // Copyright (c) 1996-2020, Live Networks, Inc. All rights reserved |
18 | // "Group Endpoint Id" |
19 | // C++ header |
20 | |
21 | #ifndef _GROUPEID_HH |
22 | #define _GROUPEID_HH |
23 | |
24 | #ifndef _BOOLEAN_HH |
25 | #include "Boolean.hh" |
26 | #endif |
27 | |
28 | #ifndef _NET_ADDRESS_HH |
29 | #include "NetAddress.hh" |
30 | #endif |
31 | |
32 | class GroupEId { |
33 | public: |
34 | GroupEId(struct in_addr const& groupAddr, |
35 | portNumBits portNum, u_int8_t ttl); |
36 | // used for a 'source-independent multicast' group |
37 | GroupEId(struct in_addr const& groupAddr, |
38 | struct in_addr const& sourceFilterAddr, |
39 | portNumBits portNum); |
40 | // used for a 'source-specific multicast' group |
41 | |
42 | struct in_addr const& groupAddress() const { return fGroupAddress; } |
43 | struct in_addr const& sourceFilterAddress() const { return fSourceFilterAddress; } |
44 | |
45 | Boolean isSSM() const; |
46 | |
47 | portNumBits portNum() const { return fPortNum; } |
48 | |
49 | u_int8_t ttl() const { return fTTL; } |
50 | |
51 | private: |
52 | void init(struct in_addr const& groupAddr, |
53 | struct in_addr const& sourceFilterAddr, |
54 | portNumBits portNum, |
55 | u_int8_t ttl); |
56 | |
57 | private: |
58 | struct in_addr fGroupAddress; |
59 | struct in_addr fSourceFilterAddress; |
60 | portNumBits fPortNum; // in network byte order |
61 | u_int8_t fTTL; |
62 | }; |
63 | |
64 | #endif |
65 | |