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
Show file tree
Hide file tree
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
further tests changes
  • Loading branch information
devnexen committed Jul 2, 2025
commit e939ddab9d1967996445ff3c0b6c5b64ebb5150d
10 changes: 10 additions & 0 deletions ext/sockets/tests/socket_afpacket.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
var_dump($addr);
var_dump($rsp);

var_dump(bin2hex($rsp->rawPacket));
var_dump(bin2hex($rsp->payload->rawPacket));

socket_close($s_c);
// purposely unsupported ethernet protocol (ARP)

Expand Down Expand Up @@ -140,6 +143,9 @@ if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
var_dump($addr);
var_dump($rsp);

var_dump(bin2hex($rsp->rawPacket));
var_dump(bin2hex($rsp->payload->rawPacket));

$first_4_bytes = hex2bin("60000000");

$payload_len = hex2bin("0014");
Expand Down Expand Up @@ -275,6 +281,8 @@ object(Socket\EthernetPacket)#3 (7) {
NULL
}
}
string(120) "ffffffffffff000000000000006041414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141"
string(28) "4141414141414141414141414141"
int(60)
unsupported ethernet protocol
int(60)
Expand Down Expand Up @@ -318,6 +326,8 @@ object(Socket\EthernetPacket)#8 (7) {
}
}
}
string(144) "ffffffffffff00000000000086dd600000000014064000000000000000000000000000000001000000000000000000000000000000013039005000000000000000005002ffff0000"
string(10320) "600000000014064000000000000000000000000000000001000000000000000000000000000000013039005000000000000000005002ffff000000000000000000000000000000000000000000000000000000000000000000006800000000000000812c%a"
int(74)
unsupported ipv6 header protocol
int(84)
Expand Down
3 changes: 3 additions & 0 deletions ext/sockets/tests/socket_afpacket32.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ if (PHP_INT_SIZE != 4) die("skip this test is for 32-bit only");
var_dump($rsp->ethProtocol === 0x0060);
var_dump($rsp->payload->rawPacket !== NULL);

var_dump(bin2hex($rsp->rawPacket));
var_dump(bin2hex($rsp->payload->rawPacket));

socket_close($sender);
socket_close($receiver);
?>
Expand Down
Loading