# test divert-reply with icmp and socket reuse
+# create a divert-reply out rule on the remote machine
+# client sends a ICMP echo packet from the remote machine
+# kernel reflects the ICMP echo packet at the local machine
+# client receives the ICMP echo reply packet at the remote machine
+# client sends a different ICMP echo packet from the remote machine
+# kernel reflects the ICMP echo packet at the local machine
+# client receives the ICMP echo reply packet at the remote machine
use strict;
use warnings;
# test divert-reply with icmp with out and in packet
+# create a divert-reply out rule on the remote machine
+# client sends a ICMP echo packet from the remote machine
+# kernel reflects the ICMP echo packet at the local machine
+# client receives the ICMP echo reply packet at the remote machine
use strict;
use warnings;
# test divert-to with icmp
+# create a divert-to in rule on the remote machine
+# client sends a ICMP echo packet from the local machine
+# server receives the ICMP echo packet at the remote machine
use strict;
use warnings;
# test divert-reply with raw ip with out and in packet
+# create a divert-reply out rule on the remote machine
+# client sends a proto 245 packet from the remote machine
+# server reflects the proto 245 packet at the local machine
+# client receives the proto 245 packet at the remote machine
use strict;
use warnings;
our %args = (
socktype => Socket::SOCK_RAW,
protocol => 254,
- client => {
- func => sub {
- my $self = shift;
- write_datagram($self);
- read_datagram($self);
- },
- },
- server => {
- func => sub {
- my $self = shift;
- read_datagram($self);
- $self->{toaddr} = $self->{fromaddr};
- $self->{toport} = $self->{fromport};
- write_datagram($self);
- },
- },
+ client => { func => \&write_read_datagram },
+ server => { func => \&read_write_datagram },
divert => "reply",
);
# test divert-reply with raw ip
+# create a divert-reply out rule on the remote machine
+# client sends a proto 254 packet from the remote machine
+# server receives the proto 254 packet at the local machine
use strict;
use warnings;
# test divert-to with raw ip
+# create a divert-to in rule on the remote machine
+# client sends a proto 254 packet from the local machine
+# server receives the proto 254 packet at the remote machine
use strict;
use warnings;
# test divert-reply with tcp
+# create a divert-reply out rule on the remote machine
+# client writes into TCP stream and reads from it on the remote machine
+# server writes into TCP stream and reads from it on the local machine
use strict;
use warnings;
# test divert-to with tcp
+# create a divert-to in rule on the remote machine
+# client writes into TCP stream and reads from it on the local machine
+# server writes into TCP stream and reads from it on the remote machine
use strict;
use warnings;
# test divert-packet input rule with udp
+# create a divert-packet in rule on the remote machine
+# client sends a UDP packet from the local machine
+# packet process reflects the UDP packet on divert socket on the remote machine
+# server receives the UDP packet at the remote machine
use strict;
use warnings;
# test divert-packet output rule with udp
+# create a divert-packet out rule on the remote machine
+# client sends a UDP packet from the remote machine
+# packet process reflects the UDP packet on divert socket on the remote machine
+# server receives the UDP packet at the local machine
use strict;
use warnings;
# test divert-reply with udp with out and in packet
+# create a divert-reply out rule on the remote machine
+# client sends a UDP packet from the remote machine
+# server reflects the UDP packet at the local machine
+# client receives the UDP packet at the remote machine
use strict;
use warnings;
# test divert-reply with udp
+# create a divert-reply out rule on the remote machine
+# client sends a UDP packet from the remote machine
+# server receives the UDP packet at the local machine
use strict;
use warnings;
# test divert-to with udp
+# create a divert-to in rule on the remote machine
+# client sends a UDP packet from the local machine
+# server receives the UDP packet at the remote machine
use strict;
use warnings;