mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-15 12:14:32 +01:00
Add some comments to the ARP module
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
38657d9f98
commit
a732f6e538
@ -43,6 +43,11 @@ our @builtins;
|
|||||||
our $arptablesjf;
|
our $arptablesjf;
|
||||||
our @map = ( qw( 0 Request Reply Request_Reverse Reply_Reverse DRARP_Request DRARP_Reply DRARP_Error InARP_Request ARP_NAK ) );
|
our @map = ( qw( 0 Request Reply Request_Reverse Reply_Reverse DRARP_Request DRARP_Reply DRARP_Error InARP_Request ARP_NAK ) );
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Handles the network and mac parts of the SOURCE ($source == 1 ) and DEST ($source == 0) columns in the arprules file.
|
||||||
|
# Returns any match(es) specified.
|
||||||
|
#
|
||||||
sub match_arp_net( $$$ ) {
|
sub match_arp_net( $$$ ) {
|
||||||
my ( $net, $mac, $source ) = @_;
|
my ( $net, $mac, $source ) = @_;
|
||||||
|
|
||||||
@ -74,6 +79,9 @@ sub match_arp_net( $$$ ) {
|
|||||||
$return;
|
$return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Process a rule in the arprules file
|
||||||
|
#
|
||||||
sub process_arprule() {
|
sub process_arprule() {
|
||||||
my ( $originalaction, $source, $dest, $opcode ) = split_line( 'arprules file entry', {action => 0, source => 1, dest => 2, opcode => 3 } );
|
my ( $originalaction, $source, $dest, $opcode ) = split_line( 'arprules file entry', {action => 0, source => 1, dest => 2, opcode => 3 } );
|
||||||
|
|
||||||
@ -174,6 +182,9 @@ sub process_arprule() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Process the arprules file -- returns true if there were any arp rules
|
||||||
|
#
|
||||||
sub process_arprules() {
|
sub process_arprules() {
|
||||||
my $result = 0;
|
my $result = 0;
|
||||||
|
|
||||||
@ -206,6 +217,9 @@ sub process_arprules() {
|
|||||||
$result;
|
$result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Generate the arptables_load() function
|
||||||
|
#
|
||||||
sub create_arptables_load( $ ) {
|
sub create_arptables_load( $ ) {
|
||||||
my $test = shift;
|
my $test = shift;
|
||||||
|
|
||||||
@ -268,6 +282,9 @@ sub create_arptables_load( $ ) {
|
|||||||
emit "}\n";
|
emit "}\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Preview the generated ARP rules
|
||||||
|
#
|
||||||
sub preview_arptables_load() {
|
sub preview_arptables_load() {
|
||||||
|
|
||||||
my $date = localtime;
|
my $date = localtime;
|
||||||
|
Loading…
Reference in New Issue
Block a user