aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/misc
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2014-05-09 13:54:21 +0200
committerRaimo Niskanen <[email protected]>2014-07-25 12:15:15 +0200
commit36426bcc894853dfd38a4d8db7b4971934df9692 (patch)
treed87475937480983ddc0e2a3f29d5de125947356b /lib/snmp/src/misc
parent100b3345793043d50f90619c25123dc4d218e5cd (diff)
downloadotp-36426bcc894853dfd38a4d8db7b4971934df9692.tar.gz
otp-36426bcc894853dfd38a4d8db7b4971934df9692.tar.bz2
otp-36426bcc894853dfd38a4d8db7b4971934df9692.zip
Go back to passing (Domain, Addr) to net_if filters
Diffstat (limited to 'lib/snmp/src/misc')
-rw-r--r--lib/snmp/src/misc/snmp_pdus.erl17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/snmp/src/misc/snmp_pdus.erl b/lib/snmp/src/misc/snmp_pdus.erl
index 15156f7467..a780fee7a3 100644
--- a/lib/snmp/src/misc/snmp_pdus.erl
+++ b/lib/snmp/src/misc/snmp_pdus.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-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
@@ -664,7 +664,20 @@ enc_value('BITS', Val) ->
enc_oct_str_tag(bits_to_str(Val));
enc_value('OBJECT IDENTIFIER', Val) ->
enc_oid_tag(Val);
-enc_value('IpAddress', Val) ->
+enc_value('IpAddress', {A, B, C, D}) ->
+ enc_value('IpAddress', [A,B,C,D]);
+enc_value('IpAddress', {A, B, C, D, E, F, G, H}) ->
+ enc_value(
+ 'IpAddress',
+ [A bsr 8, A band 255,
+ B bsr 8, B band 255,
+ C bsr 8, C band 255,
+ D bsr 8, D band 255,
+ E bsr 8, E band 255,
+ F bsr 8, F band 255,
+ G bsr 8, G band 255,
+ H bsr 8, H band 255]);
+enc_value('IpAddress', Val) when is_list(Val) ->
Bytes2 = enc_oct_str_notag(Val),
Len2 = elength(length(Bytes2)),
lists:append([64 | Len2],Bytes2);