-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.config
272 lines (272 loc) · 10.9 KB
/
app.config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration"/>
<!-- Register a section handler for the log4net section -->
<section name="log4net" type="System.Configuration.IgnoreSectionHandler"/>
</configSections>
<unity>
<namespace name="Lextm.SharpSnmpLib.Pipeline"/>
<namespace name="Lextm.SharpSnmpLib.Messaging"/>
<namespace name="Lextm.SharpSnmpLib.Agent"/>
<namespace name="Lextm.SharpSnmpLib.Security"/>
<namespace name="Lextm.SharpSnmpLib"/>
<assembly name="snmpd"/>
<assembly name="SharpSnmpLib"/>
<aliases>
<add alias="Logger" type="snmpd.RollingLogger, snmpd"/>
<add alias="singleton" type="Microsoft.Practices.Unity.ContainerControlledLifetimeManager, Microsoft.Practices.Unity"/>
</aliases>
<containers>
<container name="agent">
<register type="Listener">
<lifetime type="singleton"/>
<property name="Users" dependencyType="UserRegistry"/>
</register>
<register type="UserRegistry">
<lifetime type="singleton"/>
<constructor>
<param name="users" dependencyType="User[]"/>
</constructor>
</register>
<!-- message handler settings-->
<register type="MessageHandlerFactory" name="MessageFactory">
<lifetime type="singleton"/>
<constructor>
<param name="mappings">
<array>
<!--here we only have four-->
<dependency name="GET"/>
<dependency name="GET23"/>
<dependency name="SET"/>
<dependency name="SET23"/>
<dependency name="GETNEXT"/>
<dependency name="GETNEXT23"/>
<dependency name="GETBULK"/>
<dependency name="ALL"/>
</array>
</param>
</constructor>
</register>
<register type="HandlerMapping" name="GET">
<lifetime type="singleton"/>
<constructor>
<param name="version" value="v1"/>
<param name="command" value="GET"/>
<param name="handler" dependencyType="IMessageHandler" dependencyName="GetHandler"/>
</constructor>
</register>
<register type="HandlerMapping" name="GET23">
<lifetime type="singleton"/>
<constructor>
<param name="version" value="v2,v3"/>
<param name="command" value="GET"/>
<param name="handler" dependencyType="IMessageHandler" dependencyName="GetV2V3Handler"/>
</constructor>
</register>
<register type="HandlerMapping" name="SET">
<lifetime type="singleton"/>
<constructor>
<param name="version" value="v1"/>
<param name="command" value="SET"/>
<param name="handler" dependencyType="IMessageHandler" dependencyName="SetHandler"/>
</constructor>
</register>
<register type="HandlerMapping" name="SET23">
<lifetime type="singleton"/>
<constructor>
<param name="version" value="v2,v3"/>
<param name="command" value="SET"/>
<param name="handler" dependencyType="IMessageHandler" dependencyName="SetV2V3Handler"/>
</constructor>
</register>
<register type="HandlerMapping" name="GETNEXT">
<lifetime type="singleton"/>
<constructor>
<param name="version" value="v1"/>
<param name="command" value="GETNEXT"/>
<param name="handler" dependencyType="IMessageHandler" dependencyName="GetNextHandler"/>
</constructor>
</register>
<register type="HandlerMapping" name="GETNEXT23">
<lifetime type="singleton"/>
<constructor>
<param name="version" value="v2,v3"/>
<param name="command" value="GETNEXT"/>
<param name="handler" dependencyType="IMessageHandler" dependencyName="GetNextV2V3Handler"/>
</constructor>
</register>
<register type="HandlerMapping" name="GETBULK">
<lifetime type="singleton"/>
<constructor>
<param name="version" value="v2,v3"/>
<param name="command" value="GETBULK"/>
<param name="handler" dependencyType="IMessageHandler" dependencyName="GetBulkHandler"/>
</constructor>
</register>
<register type="HandlerMapping" name="ALL">
<lifetime type="singleton"/>
<constructor>
<param name="version" value="*"/>
<param name="command" value="*"/>
<param name="handler" dependencyType="IMessageHandler" dependencyName="NullHandler"/>
</constructor>
</register>
<register type="IMessageHandler" mapTo="GetV1MessageHandler" name="GetHandler">
<lifetime type="singleton"/>
</register>
<register type="IMessageHandler" mapTo="GetMessageHandler" name="GetV2V3Handler">
<lifetime type="singleton"/>
</register>
<register type="IMessageHandler" mapTo="SetV1MessageHandler" name="SetHandler">
<lifetime type="singleton"/>
</register>
<register type="IMessageHandler" mapTo="SetMessageHandler" name="SetV2V3Handler">
<lifetime type="singleton"/>
</register>
<register type="IMessageHandler" mapTo="GetNextV1MessageHandler" name="GetNextHandler">
<lifetime type="singleton"/>
</register>
<register type="IMessageHandler" mapTo="GetNextMessageHandler" name="GetNextV2V3Handler">
<lifetime type="singleton"/>
</register>
<register type="IMessageHandler" mapTo="GetBulkMessageHandler" name="GetBulkHandler">
<lifetime type="singleton"/>
</register>
<register type="IMessageHandler" mapTo="NullMessageHandler" name="NullHandler">
<lifetime type="singleton"/>
</register>
<!-- application factory and its parts -->
<register type="SnmpApplicationFactory">
<lifetime type="singleton"/>
<constructor>
<param name="logger" dependencyType="ILogger"/>
<param name="store" dependencyType="ObjectStore"/>
<param name="membershipProvider" dependencyType="IMembershipProvider" dependencyName="Composed"/>
<param name="factory" dependencyType="MessageHandlerFactory"/>
</constructor>
</register>
<register type="ILogger" mapTo="Logger">
<lifetime type="singleton"/>
</register>
<register type="ObjectStore">
<lifetime type="singleton"/>
</register>
<!-- this is the membership provider -->
<register type="IMembershipProvider" mapTo="ComposedMembershipProvider" name="Composed">
<lifetime type="singleton"/>
<constructor>
<param name="providers">
<array>
<dependency name="v1"/>
<dependency name="v2"/>
<dependency name="v3"/>
</array>
</param>
</constructor>
</register>
<register type="IMembershipProvider" mapTo="Version1MembershipProvider" name="v1">
<lifetime type="singleton"/>
<constructor>
<param name="getCommunity" dependencyType="OctetString" dependencyName="get"/>
<param name="setCommunity" dependencyType="OctetString" dependencyName="set"/>
</constructor>
</register>
<register type="IMembershipProvider" mapTo="Version2MembershipProvider" name="v2">
<lifetime type="singleton"/>
<constructor>
<param name="getCommunity" dependencyType="OctetString" dependencyName="get"/>
<param name="setCommunity" dependencyType="OctetString" dependencyName="set"/>
</constructor>
</register>
<register type="IMembershipProvider" mapTo="Version3MembershipProvider" name="v3">
<lifetime type="singleton"/>
</register>
<register type="OctetString" name="get">
<lifetime type="singleton"/>
<constructor>
<param name="content" value="public"/>
</constructor>
</register>
<register type="OctetString" name="set">
<lifetime type="singleton"/>
<constructor>
<param name="content" value="public"/>
</constructor>
</register>
<!-- finally we construct the engine -->
<register type="SnmpEngine">
<lifetime type="singleton"/>
<constructor>
<param name="factory" dependencyType="SnmpApplicationFactory"/>
<param name="listener" dependencyType="Listener"/>
<param name="group" dependencyType="EngineGroup"/>
</constructor>
</register>
</container>
</containers>
</unity>
<!-- This section contains the log4net configuration settings -->
<log4net>
<!-- Define some output appenders -->
<appender name="RollingLogFileAppender" type="Lextm.Common.RollingFileAppender">
<file value="snmp"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<datePattern value="yyMMdd"/>
<staticLogFileName value="false"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%message%newline"/>
</layout>
</appender>
<!-- Setup the root category, add the appenders and set the default level -->
<root>
<level value="WARN"/>
</root>
<!-- Specify the level for some specific categories -->
<logger name="Lextm.SharpSnmpLib.Agent.RollingLogger">
<level value="ALL"/>
<appender-ref ref="RollingLogFileAppender"/>
</logger>
</log4net>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
</startup>
<!--<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="System.Net">
<listeners>
<add name="System.Net"/>
</listeners>
</source>
<source name="System.Net.HttpListener">
<listeners>
<add name="System.Net"/>
</listeners>
</source>
<source name="System.Net.Sockets">
<listeners>
<add name="System.Net"/>
</listeners>
</source>
<source name="System.Net.Cache">
<listeners>
<add name="System.Net"/>
</listeners>
</source>
</sources>
<sharedListeners>
<add
name="System.Net"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="d:\\snmp.log" traceOutputOptions = "DateTime" />
</sharedListeners>
<switches>
<add name="System.Net" value="Verbose" />
<add name="System.Net.Sockets" value="Verbose" />
<add name="System.Net.Cache" value="Verbose" />
<add name="System.Net.HttpListener" value="Verbose" />
</switches>
</system.diagnostics>-->
</configuration>