xref: /PHP-5.4/ext/sockets/multicast.h (revision c0d060f5)
1 /*
2    +----------------------------------------------------------------------+
3    | PHP Version 5                                                        |
4    +----------------------------------------------------------------------+
5    | Copyright (c) 1997-2014 The PHP Group                                |
6    +----------------------------------------------------------------------+
7    | This source file is subject to version 3.01 of the PHP license,      |
8    | that is bundled with this package in the file LICENSE, and is        |
9    | available through the world-wide-web at the following url:           |
10    | http://www.php.net/license/3_01.txt                                  |
11    | If you did not receive a copy of the PHP license and are unable to   |
12    | obtain it through the world-wide-web, please send a note to          |
13    | license@php.net so we can mail you a copy immediately.               |
14    +----------------------------------------------------------------------+
15    | Authors: Gustavo Lopes    <cataphract@php.net>                       |
16    +----------------------------------------------------------------------+
17  */
18 
19 /* $Id$ */
20 
21 #if defined(MCAST_JOIN_GROUP) && \
22 	(!defined(PHP_WIN32) || (_WIN32_WINNT >= 0x600 && SOCKETS_ENABLE_VISTA_API)) && \
23 	!defined(__APPLE__)
24 #define RFC3678_API 1
25 /* has block/unblock and source membership, in this case for both IPv4 and IPv6 */
26 #define HAS_MCAST_EXT 1
27 #elif defined(IP_ADD_SOURCE_MEMBERSHIP) && !defined(__APPLE__)
28 /* has block/unblock and source membership, but only for IPv4 */
29 #define HAS_MCAST_EXT 1
30 #endif
31 
32 int php_if_index_to_addr4(
33         unsigned if_index,
34         php_socket *php_sock,
35         struct in_addr *out_addr TSRMLS_DC);
36 
37 int php_add4_to_if_index(
38         struct in_addr *addr,
39         php_socket *php_sock,
40         unsigned *if_index TSRMLS_DC);
41 
42 int php_mcast_join(
43 	php_socket *sock,
44 	int level,
45 	struct sockaddr *group,
46 	socklen_t group_len,
47 	unsigned int if_index TSRMLS_DC);
48 
49 int php_mcast_leave(
50 	php_socket *sock,
51 	int level,
52 	struct sockaddr *group,
53 	socklen_t group_len,
54 	unsigned int if_index TSRMLS_DC);
55 
56 #ifdef HAS_MCAST_EXT
57 int php_mcast_join_source(
58 	php_socket *sock,
59 	int level,
60 	struct sockaddr *group,
61 	socklen_t group_len,
62 	struct sockaddr *source,
63 	socklen_t source_len,
64 	unsigned int if_index TSRMLS_DC);
65 
66 int php_mcast_leave_source(
67 	php_socket *sock,
68 	int level,
69 	struct sockaddr *group,
70 	socklen_t group_len,
71 	struct sockaddr *source,
72 	socklen_t source_len,
73 	unsigned int if_index TSRMLS_DC);
74 
75 int php_mcast_block_source(
76 	php_socket *sock,
77 	int level,
78 	struct sockaddr *group,
79 	socklen_t group_len,
80 	struct sockaddr *source,
81 	socklen_t source_len,
82 	unsigned int if_index TSRMLS_DC);
83 
84 int php_mcast_unblock_source(
85 	php_socket *sock,
86 	int level,
87 	struct sockaddr *group,
88 	socklen_t group_len,
89 	struct sockaddr *source,
90 	socklen_t source_len,
91 	unsigned int if_index TSRMLS_DC);
92 #endif
93