Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions ext/sockets/sockets.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -1783,6 +1783,70 @@
const SOL_LOCAL = UNKNOWN;
#endif

#ifdef SOL_PACKET
/**
* @var int
* @cvalue SOL_PACKET
*/
const SOL_PACKET = UNKNOWN;
#endif

#ifdef PACKET_FANOUT
/**
* @var int
* @cvalue PACKET_FANOUT
*/
const PACKET_FANOUT = UNKNOWN;
#endif

#ifdef PACKET_FANOUT_HASH
/**
* @var int
* @cvalue PACKET_FANOUT_HASH
*/
const PACKET_FANOUT_HASH = UNKNOWN;
#endif

#ifdef PACKET_FANOUT_LB
/**
* @var int
* @cvalue PACKET_FANOUT_LB
*/
const PACKET_FANOUT_LB = UNKNOWN;
#endif

#ifdef PACKET_FANOUT_CPU
/**
* @var int
* @cvalue PACKET_FANOUT_CPU
*/
const PACKET_FANOUT_CPU = UNKNOWN;
#endif

#ifdef PACKET_FANOUT_ROLLOVER
/**
* @var int
* @cvalue PACKET_FANOUT_ROLLOVER
*/
const PACKET_FANOUT_ROLLOVER = UNKNOWN;
#endif

#ifdef PACKET_FANOUT_RND
/**
* @var int
* @cvalue PACKET_FANOUT_RND
*/
const PACKET_FANOUT_RND = UNKNOWN;
#endif

#ifdef PACKET_FANOUT_QM
/**
* @var int
* @cvalue PACKET_FANOUT_QM
*/
const PACKET_FANOUT_QM = UNKNOWN;
#endif

#if (defined(IPV6_RECVPKTINFO) && defined(HAVE_IPV6))
/**
* IPv6 ancillary data
Expand Down
26 changes: 25 additions & 1 deletion ext/sockets/sockets_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions ext/sockets/tests/socket_sol_packet.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
--TEST--
socket_setopt() with SOL_PACKET
--EXTENSIONS--
sockets
posix
--SKIPIF--
<?php if (!defined("SOL_PACKET")) die('SKIP SOL_PACKET not supported on this platform.');
if (!function_exists("posix_getuid") || posix_getuid() != 0) die('SKIP AF_PACKET requires root permissions.');
?>
--FILE--
<?php
$s = socket_create(AF_PACKET, SOCK_RAW, ETH_P_ALL);
var_dump($s);
var_dump(socket_setopt($s, SOL_PACKET, PACKET_FANOUT, PACKET_FANOUT_LB));
socket_close($s);
?>
--EXPECTF--
object(Socket)#1 (0) {
}
bool(true)