1 | ----------------------------------------------------------------------------- |
---|
2 | -- -- |
---|
3 | -- ADASOCKETS COMPONENTS -- |
---|
4 | -- -- |
---|
5 | -- S O C K E T S . M U L T I C A S T -- |
---|
6 | -- -- |
---|
7 | -- S p e c -- |
---|
8 | -- -- |
---|
9 | -- $ReleaseVersion: 0.1.3 $ -- |
---|
10 | -- -- |
---|
11 | -- Copyright (C) 1998 Ãcole Nationale Supérieure des Télécommunications -- |
---|
12 | -- -- |
---|
13 | -- AdaSockets is free software; you can redistribute it and/or modify -- |
---|
14 | -- it under terms of the GNU General Public License as published by -- |
---|
15 | -- the Free Software Foundation; either version 2, or (at your option) -- |
---|
16 | -- any later version. AdaSockets is distributed in the hope that it -- |
---|
17 | -- will be useful, but WITHOUT ANY WARRANTY; without even the implied -- |
---|
18 | -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -- |
---|
19 | -- See the GNU General Public License for more details. You should -- |
---|
20 | -- have received a copy of the GNU General Public License distributed -- |
---|
21 | -- with AdaSockets; see file COPYING. If not, write to the Free -- |
---|
22 | -- Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- |
---|
23 | -- 02111-1307, USA. -- |
---|
24 | -- -- |
---|
25 | -- As a special exception, if other files instantiate generics from -- |
---|
26 | -- this unit, or you link this unit with other files to produce an -- |
---|
27 | -- executable, this unit does not by itself cause the resulting -- |
---|
28 | -- executable to be covered by the GNU General Public License. This -- |
---|
29 | -- exception does not however invalidate any other reasons why the -- |
---|
30 | -- executable file might be covered by the GNU Public License. -- |
---|
31 | -- -- |
---|
32 | -- The main repository for this software is located at: -- |
---|
33 | -- http://www-inf.enst.fr/ANC/ -- |
---|
34 | -- -- |
---|
35 | ----------------------------------------------------------------------------- |
---|
36 | |
---|
37 | with Sockets.Thin; |
---|
38 | |
---|
39 | package Sockets.Multicast is |
---|
40 | |
---|
41 | pragma Elaborate_Body; |
---|
42 | |
---|
43 | -- This package aims at helping the creation of multicast sockets |
---|
44 | |
---|
45 | type Multicast_Socket_FD is new Socket_FD with private; |
---|
46 | |
---|
47 | function Create_Multicast_Socket |
---|
48 | (Group : String; |
---|
49 | Port : Positive; |
---|
50 | TTL : Positive := 16; |
---|
51 | Self_Loop : Boolean := True) |
---|
52 | return Multicast_Socket_FD; |
---|
53 | -- Create a multicast socket |
---|
54 | |
---|
55 | procedure Send (Socket : in Multicast_Socket_FD; |
---|
56 | Data : in Ada.Streams.Stream_Element_Array); |
---|
57 | -- Send data over a multicast socket |
---|
58 | |
---|
59 | private |
---|
60 | |
---|
61 | procedure Socket |
---|
62 | (Sock : out Multicast_Socket_FD; |
---|
63 | Domain : in Socket_Domain := AF_INET; |
---|
64 | Typ : in Socket_Type := SOCK_STREAM); |
---|
65 | -- Do not call this one, it will raise Program_Error |
---|
66 | |
---|
67 | type Multicast_Socket_FD is new Socket_FD with record |
---|
68 | Target : Sockets.Thin.Sockaddr_In; |
---|
69 | end record; |
---|
70 | |
---|
71 | end Sockets.Multicast; |
---|