~clint-fewbar/ubuntu/precise/erlang/merge-15b

« back to all changes in this revision

Viewing changes to lib/snmp/src/agent/snmp_community_mib.erl

  • Committer: Package Import Robot
  • Author(s): Sergei Golovan
  • Date: 2011-12-15 19:20:10 UTC
  • mfrom: (1.1.18) (3.5.15 sid)
  • mto: (3.5.16 sid)
  • mto: This revision was merged to the branch mainline in revision 33.
  • Revision ID: package-import@ubuntu.com-20111215192010-jnxcfe3tbrpp0big
Tags: 1:15.b-dfsg-1
* New upstream release.
* Upload to experimental because this release breaks external drivers
  API along with ABI, so several applications are to be fixed.
* Removed SSL patch because the old SSL implementation is removed from
  the upstream distribution.
* Removed never used patch which added native code to erlang beam files.
* Removed the erlang-docbuilder binary package because the docbuilder
  application was dropped by upstream.
* Documented dropping ${erlang-docbuilder:Depends} substvar in
  erlang-depends(1) manpage.
* Made erlang-base and erlang-base-hipe provide virtual package
  erlang-abi-15.b (the number means the first erlang version, which
  provides current ABI).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
%%
2
2
%% %CopyrightBegin%
3
3
%% 
4
 
%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
 
4
%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
5
5
%% 
6
6
%% The contents of this file are subject to the Erlang Public License,
7
7
%% Version 1.1, (the "License"); you may not use this file except in
25
25
         snmpTargetAddrExtTable/3,
26
26
         community2vacm/2, vacm2community/2,
27
27
         get_target_addr_ext_mms/2]).
28
 
-export([add_community/5, delete_community/1]).
 
28
-export([add_community/5, add_community/6, delete_community/1]).
29
29
-export([check_community/1]).
30
30
 
31
31
-include("SNMP-COMMUNITY-MIB.hrl").
128
128
    Comms.
129
129
 
130
130
check_community({Index, CommunityName, SecName, CtxName, TransportTag}) ->
 
131
    EngineID = get_engine_id(),
 
132
    check_community({Index, CommunityName, SecName, 
 
133
                     EngineID, CtxName, TransportTag});
 
134
check_community({Index, CommunityName, SecName, 
 
135
                 EngineID, CtxName, TransportTag}) ->
131
136
    snmp_conf:check_string(Index,{gt,0}),
132
137
    snmp_conf:check_string(CommunityName),
133
138
    snmp_conf:check_string(SecName),
134
139
    snmp_conf:check_string(CtxName),
135
140
    snmp_conf:check_string(TransportTag),
136
 
    EngineID = get_engine_id(),
137
141
    Comm = {Index, CommunityName, SecName, EngineID, CtxName, TransportTag,
138
142
            ?'StorageType_nonVolatile', ?'RowStatus_active'},
139
143
    {ok, Comm};
173
177
%% FIXME: does not work with mnesia
174
178
add_community(Idx, CommName, SecName, CtxName, TransportTag) ->
175
179
    Community = {Idx, CommName, SecName, CtxName, TransportTag},
 
180
    do_add_community(Community).
 
181
 
 
182
add_community(Idx, CommName, SecName, EngineId, CtxName, TransportTag) ->
 
183
    Community = {Idx, CommName, SecName, EngineId, CtxName, TransportTag},
 
184
    do_add_community(Community).
 
185
 
 
186
do_add_community(Community) ->
176
187
    case (catch check_community(Community)) of
177
188
        {ok, Row} ->
178
189
            Key = element(1, Row),
336
347
                    get_target_addr_ext_mms(TDomain, TAddress, NextKey)
337
348
            end
338
349
    end.
 
350
 
 
351
 
339
352
%%-----------------------------------------------------------------
340
353
%% Instrumentation Functions
341
354
%%-----------------------------------------------------------------
347
360
    PrintRow = 
348
361
        fun(Prefix, Row) ->
349
362
                lists:flatten(
350
 
                  io_lib:format("~sIndex:             ~p"
 
363
                  io_lib:format("~sIndex:           ~p"
351
364
                                "~n~sName:            ~p"
352
365
                                "~n~sSecurityName:    ~p"
353
366
                                "~n~sContextEngineID: ~p"