Skip to content

Socket ether linux step2 #17926

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
start to address test changes
  • Loading branch information
devnexen committed Jul 2, 2025
commit f72d78c04aa83502d2a965c6f6d8abe49c0254bc
144 changes: 41 additions & 103 deletions ext/sockets/tests/socket_afpacket.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -236,75 +236,52 @@ if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
bool(true)
bool(true)
string(2) "lo"
int(%i)
int(1)

Warning: socket_getpeername(): unable to retrieve peer name [95]: %sot supported in %s on line %d
Warning: socket_getpeername(): unable to retrieve peer name [95]: Operation not supported in %s on line %d
int(60)
int(60)
string(2) "lo"
object(Socket\EthernetPacket)#3 (%d) {
["headerSize"]=>
int(%d)
["rawPacket"]=>
string(%d) "%r(.|\n)*?"%r
["socket"]=>
object(Socket)#1 (0) {
}
["ethProtocol"]=>
int(%i)
["srcMac"]=>
string(%d) "%s:%s:%s:%s:%s:%s"
["dstMac"]=>
string(%d) "%s:%s:%s:%s:%s:%s"
["payload"]=>
%a
}
int(60)
unsupported ethernet protocol
int(60)
int(%d)
string(2) "lo"
object(Socket\EthernetPacket)#2 (7) {
object(Socket\EthernetPacket)#3 (7) {
["headerSize"]=>
int(14)
["rawPacket"]=>
string(%d) "%r(.|\n)*?"%r
["socket"]=>
object(Socket)#%d (0) {
object(Socket)#1 (0) {
}
["ethProtocol"]=>
int(%d)
int(96)
["srcMac"]=>
string(%d) "%s:%s:%s:%s:%s:%s"
string(11) "0:0:0:0:0:0"
["dstMac"]=>
string(%d) "%s:%s:%s:%s:%s:%s"
string(17) "ff:ff:ff:ff:ff:ff"
["payload"]=>
object(Socket\Ipv%sPacket)#%d (5) {
object(Socket\EthernetPacket)#4 (7) {
["headerSize"]=>
int(%d)
int(14)
["rawPacket"]=>
string(%d) "%r(.|\n)*?"%r
["srcAddr"]=>
string(%d) "%s"
["dstAddr"]=>
string(%d) "%s"
["payload"]=>
object(Socket\%sPacket)#%d (4) {
["headerSize"]=>
int(%d)
["rawPacket"]=>
string(%d) "%r(.|\n)*?"%r
["srcPort"]=>
int(%d)
["dstPort"]=>
int(%d)
["socket"]=>
object(Socket)#1 (0) {
}
["ethProtocol"]=>
int(0)
["srcMac"]=>
string(17) "41:41:41:41:41:41"
["dstMac"]=>
string(17) "41:41:41:41:41:41"
["payload"]=>
NULL
}
}
int(%d)
int(%d)
int(60)
unsupported ethernet protocol
int(60)
int(72)
int(72)
string(2) "lo"
object(Socket\EthernetPacket)#%d (7) {
object(Socket\EthernetPacket)#8 (7) {
["headerSize"]=>
int(14)
["rawPacket"]=>
Expand All @@ -313,75 +290,36 @@ object(Socket\EthernetPacket)#%d (7) {
object(Socket)#3 (0) {
}
["ethProtocol"]=>
int(%d)
int(34525)
["srcMac"]=>
string(%d) "%s:%s:%s:%s:%s:%s"
string(11) "0:0:0:0:0:0"
["dstMac"]=>
string(%d) "%s:%s:%s:%s:%s:%s"
string(17) "ff:ff:ff:ff:ff:ff"
["payload"]=>
object(Socket\Ipv6Packet)#%d (5) {
object(Socket\Ipv6Packet)#1 (5) {
["headerSize"]=>
int(%d)
int(5160)
["rawPacket"]=>
string(%d) "%A"
string(%d) "%r(.|\n)*?"%r
["srcAddr"]=>
string(%d) "%s"
string(3) "::1"
["dstAddr"]=>
string(%d) "%s"
string(3) "::1"
["payload"]=>
object(Socket\TcpPacket)#%d (4) {
object(Socket\TcpPacket)#11 (4) {
["headerSize"]=>
int(%d)
int(20)
["rawPacket"]=>
string(%d) "%r(.|\n)*?"%r
["srcPort"]=>
int(%d)
int(0)
["dstPort"]=>
int(%d)
int(0)
}
}
}
int(%d)
int(74)
unsupported ipv6 header protocol
int(%d)
%A
int(%d)
%A
string(%d) "%s"
object(Socket\EthernetPacket)#%d (7) {
["headerSize"]=>
int(%d)
["rawPacket"]=>
string(%d) "%r(.|\n)*?"%r
["socket"]=>
object(Socket)#%d (0) {
}
["ethProtocol"]=>
int(2048)
["srcMac"]=>
string(%d) "%s"
["dstMac"]=>
string(%d) "%s"
["payload"]=>
object(Socket\Ipv4Packet)#%d (5) {
["headerSize"]=>
int(%d)
["rawPacket"]=>
string(%d) "%s"
["srcAddr"]=>
string(%d) "%s.%s.%s.%s"
["dstAddr"]=>
string(%d) "%s.%s.%s.%s"
["payload"]=>
object(Socket\TcpPacket)#%d (4) {
["headerSize"]=>
int(%d)
["rawPacket"]=>
string(%d) "%r(.|\n)*?"%r
["srcPort"]=>
int(%d)
["dstPort"]=>
int(%d)
}
}
}
int(84)
unsupported ip header protocol
int(194)