args-rip-reply-to.pl revision 1.1
1# test divert-reply with raw ip with out and in packet
2
3use strict;
4use warnings;
5use Socket;
6
7our %args = (
8    socktype => Socket::SOCK_RAW,
9    protocol => 254,
10    client => {
11	func => sub {
12	    my $self = shift;
13	    write_datagram($self);
14	    read_datagram($self);
15	},
16    },
17    server => {
18	func => sub {
19	    my $self = shift;
20	    read_datagram($self);
21	    $self->{toaddr} = $self->{fromaddr};
22	    $self->{toport} = $self->{fromport};
23	    write_datagram($self);
24	},
25    },
26    divert => "reply",
27);
28