php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
multicast.c File Reference
#include "php.h"
#include "php_network.h"
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "php_sockets.h"
#include "multicast.h"
#include "sockaddr_conv.h"

Go to the source code of this file.

Enumerations

enum  source_op { JOIN_SOURCE , LEAVE_SOURCE , BLOCK_SOURCE , UNBLOCK_SOURCE }
 

Functions

zend_result php_string_to_if_index (const char *val, unsigned *out)
 
int php_do_setsockopt_ip_mcast (php_socket *php_sock, int level, int optname, zval *arg4)
 
int php_do_setsockopt_ipv6_mcast (php_socket *php_sock, int level, int optname, zval *arg4)
 
int php_mcast_join (php_socket *sock, int level, struct sockaddr *group, socklen_t group_len, unsigned int if_index)
 
int php_mcast_leave (php_socket *sock, int level, struct sockaddr *group, socklen_t group_len, unsigned int if_index)
 
zend_result php_if_index_to_addr4 (unsigned if_index, php_socket *php_sock, struct in_addr *out_addr)
 
 if (ioctl(php_sock->bsd_socket, SIOCGIFADDR, &if_req)==-1)
 
 memcpy (out_addr, &((struct sockaddr_in *) &if_req.ifr_addr) ->sin_addr, sizeof *out_addr)
 
zend_result php_add4_to_if_index (struct in_addr *addr, php_socket *php_sock, unsigned *if_index)
 
 inet_ntop (AF_INET, addr, addr_str, sizeof(addr_str))
 
 php_error_docref (NULL, E_WARNING, "The interface with IP address %s was not found", addr_str)
 

Variables

return SUCCESS
 
err __pad0__
 
return FAILURE
 

Enumeration Type Documentation

◆ source_op

enum source_op
Enumerator
JOIN_SOURCE 
LEAVE_SOURCE 
BLOCK_SOURCE 
UNBLOCK_SOURCE 

Definition at line 43 of file multicast.c.

Function Documentation

◆ if()

if ( ioctl(php_sock->bsd_socket, SIOCGIFADDR, &if_req) = = -1)

Definition at line 736 of file multicast.c.

◆ inet_ntop()

inet_ntop ( AF_INET ,
addr ,
addr_str ,
sizeof(addr_str)  )

◆ memcpy()

memcpy ( out_addr ,
&((struct sockaddr_in *) &if_req.ifr_addr) -> sin_addr,
sizeof * out_addr )

◆ php_add4_to_if_index()

zend_result php_add4_to_if_index ( struct in_addr * addr,
php_socket * php_sock,
unsigned * if_index )

Definition at line 747 of file multicast.c.

◆ php_do_setsockopt_ip_mcast()

int php_do_setsockopt_ip_mcast ( php_socket * php_sock,
int level,
int optname,
zval * arg4 )

Definition at line 235 of file multicast.c.

◆ php_do_setsockopt_ipv6_mcast()

int php_do_setsockopt_ipv6_mcast ( php_socket * php_sock,
int level,
int optname,
zval * arg4 )

Definition at line 304 of file multicast.c.

◆ php_error_docref()

php_error_docref ( NULL ,
E_WARNING ,
"The interface with IP address %s was not found" ,
addr_str  )

◆ php_if_index_to_addr4()

zend_result php_if_index_to_addr4 ( unsigned if_index,
php_socket * php_sock,
struct in_addr * out_addr )

Definition at line 710 of file multicast.c.

◆ php_mcast_join()

int php_mcast_join ( php_socket * sock,
int level,
struct sockaddr * group,
socklen_t group_len,
unsigned int if_index )

Definition at line 368 of file multicast.c.

◆ php_mcast_leave()

int php_mcast_leave ( php_socket * sock,
int level,
struct sockaddr * group,
socklen_t group_len,
unsigned int if_index )

Definition at line 378 of file multicast.c.

◆ php_string_to_if_index()

zend_result php_string_to_if_index ( const char * val,
unsigned * out )

Definition at line 62 of file multicast.c.

Variable Documentation

◆ __pad0__

err __pad0__

Definition at line 834 of file multicast.c.

◆ FAILURE

return FAILURE

Definition at line 837 of file multicast.c.

◆ SUCCESS

return SUCCESS

Definition at line 744 of file multicast.c.