aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/agent/snmpa_net_if_filter.erl
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2014-08-07 17:36:26 +0200
committerErlang/OTP <[email protected]>2014-08-07 17:36:26 +0200
commit6828c2ed8fdd5f19cad002a7dae07dd5f1c4409c (patch)
treed86469ff46b5b7a53f85f245963e1084f8bd3710 /lib/snmp/src/agent/snmpa_net_if_filter.erl
parentf68b689662dcfba7f6e82bad03938eeb3a48a300 (diff)
parente910f8568a4d19093f7ea8c6865367c3e73703f0 (diff)
downloadotp-6828c2ed8fdd5f19cad002a7dae07dd5f1c4409c.tar.gz
otp-6828c2ed8fdd5f19cad002a7dae07dd5f1c4409c.tar.bz2
otp-6828c2ed8fdd5f19cad002a7dae07dd5f1c4409c.zip
Merge branch 'raimo/snmp/ipv4+ipv6/OTP-12020' into maint-17
* refs/heads/fetch-and-merge.maint-17-opu/FETCH_HEAD/54676: (46 commits) Fix error printouts to not crash Improve ct_snmp test cases Fix misspelled community in manager Rearrange test suite group structure Fix testcase for really dual ip Adjust test cases for daily builds Fix call to non-existent function Fix test manager in agent tests for IPv6 Call new Net-SNMP test suite from top suite Improve external snmp commands args Test inform to dual transports Write list of trap targets Improve dual stack test suite Use {ipv6_v6only, true} Remove commented out code Add dual_ip tests in snmp_to_snmpnet_SUITE Silence logging from agent net_if at shutdown Rewrite agent for IPv4 + IPv6 snmp: Add inform test snmp: Add new test suite ...
Diffstat (limited to 'lib/snmp/src/agent/snmpa_net_if_filter.erl')
-rw-r--r--lib/snmp/src/agent/snmpa_net_if_filter.erl56
1 files changed, 35 insertions, 21 deletions
diff --git a/lib/snmp/src/agent/snmpa_net_if_filter.erl b/lib/snmp/src/agent/snmpa_net_if_filter.erl
index 989f7c95b3..dd77b143d0 100644
--- a/lib/snmp/src/agent/snmpa_net_if_filter.erl
+++ b/lib/snmp/src/agent/snmpa_net_if_filter.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2014. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -18,35 +18,49 @@
%%
-module(snmpa_net_if_filter).
--export([accept_recv/2,
- accept_send/2,
- accept_recv_pdu/3,
- accept_send_pdu/2]).
+%% Behaviour
+-export([accept_recv/2, accept_send/2, accept_recv_pdu/3, accept_send_pdu/2]).
-include("snmp_debug.hrl").
-accept_recv(_Addr, _Port) ->
- ?d("accept_recv -> entry with"
- "~n Addr: ~p"
- "~n Port: ~p", [_Addr, _Port]),
+accept_recv(Domain, _Address) when is_atom(Domain) ->
+ ?d("accept_recv -> entry with~n"
+ " Domain: ~p~n"
+ " Address: ~p", [Domain, _Address]),
+ true;
+accept_recv(_Addr, Port) when is_integer(Port) ->
+ ?d("accept_recv -> entry with~n"
+ " Addr: ~p~n"
+ " Port: ~p", [_Addr, Port]),
true.
-accept_send(_Addr, _Port) ->
- ?d("accept_send -> entry with"
- "~n Addr: ~p"
- "~n Port: ~p", [_Addr, _Port]),
+accept_send(Domain, _Address) when is_atom(Domain) ->
+ ?d("accept_send -> entry with~n"
+ " Domain: ~p~n"
+ " Address: ~p", [Domain, _Address]),
+ true;
+accept_send(_Addr, Port) when is_integer(Port) ->
+ ?d("accept_send -> entry with~n"
+ " Addr: ~p~n"
+ " Port: ~p", [_Addr, Port]),
true.
-accept_recv_pdu(_Addr, _Port, _PduType) ->
- ?d("accept_recv_pdu -> entry with"
- "~n Addr: ~p"
- "~n Port: ~p"
- "~n PduType: ~p", [_Addr, _Port, _PduType]),
+accept_recv_pdu(Domain, _Address, _PduType) when is_atom(Domain) ->
+ ?d("accept_recv -> entry with~n"
+ " Domain: ~p~n"
+ " Address: ~p~n"
+ " PduType: ~p", [Domain, _Address, _PduType]),
+ true;
+accept_recv_pdu(_Addr, Port, _PduType) when is_integer(Port) ->
+ ?d("accept_recv_pdu -> entry with~n"
+ " Addr: ~p~n"
+ " Port: ~p~n"
+ " PduType: ~p", [_Addr, Port, _PduType]),
true.
accept_send_pdu(_Targets, _PduType) ->
- ?d("accept_send_pdu -> entry with"
- "~n Targets: ~p"
- "~n PduType: ~p", [_Targets, _PduType]),
+ ?d("accept_send_pdu -> entry with~n"
+ " Targets: ~p~n"
+ " PduType: ~p", [_Targets, _PduType]),
true.