1/**********
2This library is free software; you can redistribute it and/or modify it under
3the terms of the GNU Lesser General Public License as published by the
4Free Software Foundation; either version 3 of the License, or (at your
5option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
6
7This library is distributed in the hope that it will be useful, but WITHOUT
8ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
10more details.
11
12You should have received a copy of the GNU Lesser General Public License
13along with this library; if not, write to the Free Software Foundation, Inc.,
1451 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
32class GroupEId {
33public:
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
51private:
52 void init(struct in_addr const& groupAddr,
53 struct in_addr const& sourceFilterAddr,
54 portNumBits portNum,
55 u_int8_t ttl);
56
57private:
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