live
GroupEId.hh
Go to the documentation of this file.
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-2021, 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 sockaddr_storage const& groupAddr,
35  portNumBits portNum, u_int8_t ttl);
36  // used for a 'source-independent multicast' group
37  GroupEId(struct sockaddr_storage const& groupAddr,
38  struct sockaddr_storage const& sourceFilterAddr,
40  // used for a 'source-specific multicast' group
41  GroupEId(); // tmp default constructor, until "Groupsock" interface uses "sockaddr_storage"
42 
43  struct sockaddr_storage const& groupAddress() const { return fGroupAddress; }
44  struct sockaddr_storage const& sourceFilterAddress() const { return fSourceFilterAddress; }
45 
46  Boolean isSSM() const;
47 
48  portNumBits portNum() const;
49 
50  u_int8_t ttl() const { return fTTL; }
51 
52 private:
53  void init(struct sockaddr_storage const& groupAddr,
54  struct sockaddr_storage const& sourceFilterAddr,
56  u_int8_t ttl);
57 
58 private:
59  struct sockaddr_storage fGroupAddress; // also includes port number (in network byte order)
60  struct sockaddr_storage fSourceFilterAddress;
61  u_int8_t fTTL;
62 };
63 
64 #endif
unsigned char Boolean
Definition: Boolean.hh:25
u_int8_t fTTL
Definition: GroupEId.hh:61
struct sockaddr_storage fGroupAddress
Definition: GroupEId.hh:59
u_int16_t portNumBits
Definition: NetAddress.hh:102
portNumBits portNum() const
void init(struct sockaddr_storage const &groupAddr, struct sockaddr_storage const &sourceFilterAddr, portNumBits portNum, u_int8_t ttl)
u_int8_t ttl() const
Definition: GroupEId.hh:50
struct sockaddr_storage const & sourceFilterAddress() const
Definition: GroupEId.hh:44
struct sockaddr_storage fSourceFilterAddress
Definition: GroupEId.hh:60
Boolean isSSM() const
struct sockaddr_storage const & groupAddress() const
Definition: GroupEId.hh:43