freewifi 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab5a959e2ac3941e7ada126ee918699faee5c559
4
- data.tar.gz: 39725d300880d7834e5a1f625f5f605c7c236461
3
+ metadata.gz: 100fb9531a597e99f24be5924cfded3db21bd0ab
4
+ data.tar.gz: 7f521430b11c168d0cc51769f3d2016000c080ce
5
5
  SHA512:
6
- metadata.gz: 71b71b4d815fe3112128c90b716452eb45324179e4088810aaddb820965f137833fcc4b78ebf52817badf8a30e3501d0fbb77d4d8ab5f96aa4f2d5281448cc9f
7
- data.tar.gz: b35e79e254119d37c847459010bdfdc0a06a219700abbb472dd9d19954a292bfd484f0826a961de718f18f32492f832e5c499710794750126a3d2834f41ca7e0
6
+ metadata.gz: 6eb2ac4551ff52265b17108af3b16993589580f33cb056b882120970df0c5ceb4c4cfb0a0116e70d7a0fe422e4f857ce111f2fd49ce9a37f8763ded75a82f92d
7
+ data.tar.gz: 4fca917d29cb5a415cbc9a942caadd86adee567369790d87cb412074f4447950ee01cc12917d702c7701436b3b7788cd2fa0c69cb91ccebe0c3f97cdb0ef809c
@@ -96,6 +96,25 @@
96
96
  <RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
97
97
  <method />
98
98
  </configuration>
99
+ <configuration default="false" name="get_iwag_data" type="RubyRunConfigurationType" factoryName="Ruby" temporary="true">
100
+ <module name="freewifi" />
101
+ <RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
102
+ <RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="$MODULE_DIR$/lib/freewifi/cisco/iwag" />
103
+ <RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
104
+ <RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
105
+ <RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
106
+ <envs />
107
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="true" />
108
+ <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
109
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
110
+ <COVERAGE_PATTERN ENABLED="true">
111
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
112
+ </COVERAGE_PATTERN>
113
+ </EXTENSION>
114
+ <RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="$MODULE_DIR$/lib/freewifi/cisco/iwag/get_iwag_data.rb" />
115
+ <RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
116
+ <method />
117
+ </configuration>
99
118
  </component>
100
119
  <component name="NewModuleRootManager">
101
120
  <content url="file://$MODULE_DIR$" />
@@ -111,7 +130,7 @@
111
130
  <orderEntry type="library" scope="PROVIDED" name="ipaddr (v1.2.2, RVM: ruby-2.4.1) [gem]" level="application" />
112
131
  <orderEntry type="library" scope="PROVIDED" name="json (v2.3.0, RVM: ruby-2.4.1) [gem]" level="application" />
113
132
  <orderEntry type="library" scope="PROVIDED" name="mini_portile2 (v2.4.0, RVM: ruby-2.4.1) [gem]" level="application" />
114
- <orderEntry type="library" scope="PROVIDED" name="minitest (v5.14.0, RVM: ruby-2.4.1) [gem]" level="application" />
133
+ <orderEntry type="library" scope="PROVIDED" name="minitest (v5.14.1, RVM: ruby-2.4.1) [gem]" level="application" />
115
134
  <orderEntry type="library" scope="PROVIDED" name="mongo (v2.11.4, RVM: ruby-2.4.1) [gem]" level="application" />
116
135
  <orderEntry type="library" scope="PROVIDED" name="mtik (v4.0.3, RVM: ruby-2.4.1) [gem]" level="application" />
117
136
  <orderEntry type="library" scope="PROVIDED" name="mysql2 (v0.5.3, RVM: ruby-2.4.1) [gem]" level="application" />
@@ -21,6 +21,8 @@
21
21
  <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/freewifi.rb" />
22
22
  <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/freewifi/additional/additional_functions.rb" />
23
23
  <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/freewifi/cisco/any/cisco_schemes_conf_gen.rb" />
24
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/freewifi/cisco/iwag/get_iwag_data.rb" />
25
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/freewifi/cisco/iwag/iwag_database_worker.rb" />
24
26
  <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/freewifi/cisco/iwag/iwag_telnet_connector.rb" />
25
27
  <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/freewifi/config.rb" />
26
28
  <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/freewifi/database/mongo/mongoconnector.rb" />
@@ -47,29 +49,70 @@
47
49
  <component name="ChangesViewManager" flattened_view="false" />
48
50
  <component name="CoverageDataManager">
49
51
  <SUITE FILE_PATH="coverage/freewifi@additional_functions.coverage" NAME="additional_functions Coverage Results" MODIFIED="1588023723762" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/lib/freewifi/additional" MODULE_NAME="freewifi" />
50
- <SUITE FILE_PATH="coverage/freewifi@test_helper.coverage" NAME="test_helper Coverage Results" MODIFIED="1588202901568" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test" MODULE_NAME="freewifi" />
52
+ <SUITE FILE_PATH="coverage/freewifi@test_helper.coverage" NAME="test_helper Coverage Results" MODIFIED="1600377923678" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test" MODULE_NAME="freewifi" />
51
53
  <SUITE FILE_PATH="coverage/freewifi@test.coverage" NAME="test Coverage Results" MODIFIED="1587924491650" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test" MODULE_NAME="freewifi" />
52
54
  <SUITE FILE_PATH="coverage/freewifi@wifi_portal_procedures.coverage" NAME="wifi_portal_procedures Coverage Results" MODIFIED="1588069407762" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/lib/freewifi/general" MODULE_NAME="freewifi" />
55
+ <SUITE FILE_PATH="coverage/freewifi@get_iwag_data.coverage" NAME="get_iwag_data Coverage Results" MODIFIED="1600377682284" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/lib/freewifi/cisco/iwag" MODULE_NAME="freewifi" />
53
56
  <SUITE FILE_PATH="coverage/freewifi@hewhub_mtik_ssh.coverage" NAME="hewhub_mtik_ssh Coverage Results" MODIFIED="1587796347972" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/lib/freewifi/mikrotik" MODULE_NAME="freewifi" />
54
57
  </component>
55
58
  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
56
59
  <component name="FileEditorManager">
57
60
  <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
58
- <file leaf-file-name="freewifi.rb" pinned="false" current-in-tab="true">
61
+ <file leaf-file-name="freewifi.rb" pinned="false" current-in-tab="false">
59
62
  <entry file="file://$PROJECT_DIR$/lib/freewifi.rb">
60
63
  <provider selected="true" editor-type-id="text-editor">
61
- <state relative-caret-position="521">
62
- <caret line="357" column="137" lean-forward="false" selection-start-line="357" selection-start-column="137" selection-end-line="357" selection-end-column="137" />
64
+ <state relative-caret-position="316">
65
+ <caret line="68" column="32" lean-forward="false" selection-start-line="68" selection-start-column="32" selection-end-line="68" selection-end-column="32" />
63
66
  <folding />
64
67
  </state>
65
68
  </provider>
66
69
  </entry>
67
70
  </file>
68
- <file leaf-file-name="get_data_ssh_fun.rb" pinned="false" current-in-tab="false">
69
- <entry file="file://$PROJECT_DIR$/lib/freewifi/mikrotik/automation/get_data_ssh_fun.rb">
71
+ <file leaf-file-name="version.rb" pinned="false" current-in-tab="true">
72
+ <entry file="file://$PROJECT_DIR$/lib/freewifi/version.rb">
70
73
  <provider selected="true" editor-type-id="text-editor">
71
- <state relative-caret-position="30">
72
- <caret line="2" column="0" lean-forward="false" selection-start-line="2" selection-start-column="0" selection-end-line="2" selection-end-column="0" />
74
+ <state relative-caret-position="45">
75
+ <caret line="3" column="0" lean-forward="true" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
76
+ <folding />
77
+ </state>
78
+ </provider>
79
+ </entry>
80
+ </file>
81
+ <file leaf-file-name="wifi_portal_procedures.rb" pinned="false" current-in-tab="false">
82
+ <entry file="file://$PROJECT_DIR$/lib/freewifi/general/wifi_portal_procedures.rb">
83
+ <provider selected="true" editor-type-id="text-editor">
84
+ <state relative-caret-position="327">
85
+ <caret line="42" column="35" lean-forward="false" selection-start-line="42" selection-start-column="35" selection-end-line="42" selection-end-column="35" />
86
+ <folding />
87
+ </state>
88
+ </provider>
89
+ </entry>
90
+ </file>
91
+ <file leaf-file-name="get_iwag_data.rb" pinned="false" current-in-tab="false">
92
+ <entry file="file://$PROJECT_DIR$/lib/freewifi/cisco/iwag/get_iwag_data.rb">
93
+ <provider selected="true" editor-type-id="text-editor">
94
+ <state relative-caret-position="362">
95
+ <caret line="94" column="46" lean-forward="false" selection-start-line="94" selection-start-column="46" selection-end-line="94" selection-end-column="46" />
96
+ <folding />
97
+ </state>
98
+ </provider>
99
+ </entry>
100
+ </file>
101
+ <file leaf-file-name="test.rb" pinned="false" current-in-tab="false">
102
+ <entry file="file://$PROJECT_DIR$/test/test.rb">
103
+ <provider selected="true" editor-type-id="text-editor">
104
+ <state relative-caret-position="75">
105
+ <caret line="5" column="22" lean-forward="false" selection-start-line="5" selection-start-column="22" selection-end-line="5" selection-end-column="22" />
106
+ <folding />
107
+ </state>
108
+ </provider>
109
+ </entry>
110
+ </file>
111
+ <file leaf-file-name="test_helper.rb" pinned="false" current-in-tab="false">
112
+ <entry file="file://$PROJECT_DIR$/test/test_helper.rb">
113
+ <provider selected="true" editor-type-id="text-editor">
114
+ <state relative-caret-position="337">
115
+ <caret line="84" column="46" lean-forward="true" selection-start-line="84" selection-start-column="46" selection-end-line="84" selection-end-column="46" />
73
116
  <folding />
74
117
  </state>
75
118
  </provider>
@@ -97,15 +140,17 @@
97
140
  <option value="$PROJECT_DIR$/lib/freewifi/additional/additional_functions.rb" />
98
141
  <option value="$PROJECT_DIR$/lib/freewifi/database/mongo/mongoconnector.rb" />
99
142
  <option value="$PROJECT_DIR$/lib/freewifi/mikrotik/newhub_mtik_ssh.rb" />
100
- <option value="$PROJECT_DIR$/lib/freewifi/version.rb" />
101
143
  <option value="$PROJECT_DIR$/lib/freewifi/cisco/iwag/iwag_telnet_connector.rb" />
102
- <option value="$PROJECT_DIR$/test/test_helper.rb" />
103
144
  <option value="$PROJECT_DIR$/lib/freewifi/mikrotik/newhub_mtik_api.rb" />
104
- <option value="$PROJECT_DIR$/lib/freewifi/general/wifi_portal_procedures.rb" />
105
145
  <option value="$PROJECT_DIR$/lib/freewifi/cisco/any/cisco_schemes_conf_gen.rb" />
106
146
  <option value="$PROJECT_DIR$/lib/freewifi/config.rb" />
107
147
  <option value="$PROJECT_DIR$/lib/freewifi/mikrotik/automation/get_data_ssh_fun.rb" />
148
+ <option value="$PROJECT_DIR$/lib/freewifi/cisco/iwag/iwag_database_worker.rb" />
149
+ <option value="$PROJECT_DIR$/lib/freewifi/cisco/iwag/get_iwag_data.rb" />
108
150
  <option value="$PROJECT_DIR$/lib/freewifi.rb" />
151
+ <option value="$PROJECT_DIR$/lib/freewifi/general/wifi_portal_procedures.rb" />
152
+ <option value="$PROJECT_DIR$/test/test_helper.rb" />
153
+ <option value="$PROJECT_DIR$/lib/freewifi/version.rb" />
109
154
  </list>
110
155
  </option>
111
156
  </component>
@@ -134,6 +179,7 @@
134
179
  <foldersAlwaysOnTop value="true" />
135
180
  </navigator>
136
181
  <panes>
182
+ <pane id="Scratches" />
137
183
  <pane id="ProjectPane">
138
184
  <subPane>
139
185
  <PATH>
@@ -210,14 +256,83 @@
210
256
  <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
211
257
  </PATH_ELEMENT>
212
258
  <PATH_ELEMENT>
213
- <option name="myItemId" value="mikrotik" />
259
+ <option name="myItemId" value="general" />
260
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
261
+ </PATH_ELEMENT>
262
+ </PATH>
263
+ <PATH>
264
+ <PATH_ELEMENT>
265
+ <option name="myItemId" value="freewifi" />
266
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
267
+ </PATH_ELEMENT>
268
+ <PATH_ELEMENT>
269
+ <option name="myItemId" value="freewifi" />
270
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
271
+ </PATH_ELEMENT>
272
+ <PATH_ELEMENT>
273
+ <option name="myItemId" value="lib" />
274
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
275
+ </PATH_ELEMENT>
276
+ <PATH_ELEMENT>
277
+ <option name="myItemId" value="freewifi" />
278
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
279
+ </PATH_ELEMENT>
280
+ <PATH_ELEMENT>
281
+ <option name="myItemId" value="cisco" />
282
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
283
+ </PATH_ELEMENT>
284
+ <PATH_ELEMENT>
285
+ <option name="myItemId" value="iwag" />
286
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
287
+ </PATH_ELEMENT>
288
+ </PATH>
289
+ <PATH>
290
+ <PATH_ELEMENT>
291
+ <option name="myItemId" value="freewifi" />
292
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
293
+ </PATH_ELEMENT>
294
+ <PATH_ELEMENT>
295
+ <option name="myItemId" value="freewifi" />
296
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
297
+ </PATH_ELEMENT>
298
+ <PATH_ELEMENT>
299
+ <option name="myItemId" value="lib" />
300
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
301
+ </PATH_ELEMENT>
302
+ <PATH_ELEMENT>
303
+ <option name="myItemId" value="freewifi" />
304
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
305
+ </PATH_ELEMENT>
306
+ <PATH_ELEMENT>
307
+ <option name="myItemId" value="cisco" />
308
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
309
+ </PATH_ELEMENT>
310
+ </PATH>
311
+ <PATH>
312
+ <PATH_ELEMENT>
313
+ <option name="myItemId" value="freewifi" />
314
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
315
+ </PATH_ELEMENT>
316
+ <PATH_ELEMENT>
317
+ <option name="myItemId" value="freewifi" />
318
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
319
+ </PATH_ELEMENT>
320
+ <PATH_ELEMENT>
321
+ <option name="myItemId" value="lib" />
322
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
323
+ </PATH_ELEMENT>
324
+ <PATH_ELEMENT>
325
+ <option name="myItemId" value="freewifi" />
326
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
327
+ </PATH_ELEMENT>
328
+ <PATH_ELEMENT>
329
+ <option name="myItemId" value="additional" />
214
330
  <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
215
331
  </PATH_ELEMENT>
216
332
  </PATH>
217
333
  </subPane>
218
334
  </pane>
219
335
  <pane id="Scope" />
220
- <pane id="Scratches" />
221
336
  </panes>
222
337
  </component>
223
338
  <component name="PropertiesComponent">
@@ -246,6 +361,25 @@
246
361
  </option>
247
362
  </component>
248
363
  <component name="RunManager" selected="Ruby.test_helper">
364
+ <configuration default="false" name="get_iwag_data" type="RubyRunConfigurationType" factoryName="Ruby" temporary="true">
365
+ <module name="freewifi" />
366
+ <RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
367
+ <RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="$MODULE_DIR$/lib/freewifi/cisco/iwag" />
368
+ <RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
369
+ <RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
370
+ <RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
371
+ <envs />
372
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="true" />
373
+ <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
374
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
375
+ <COVERAGE_PATTERN ENABLED="true">
376
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
377
+ </COVERAGE_PATTERN>
378
+ </EXTENSION>
379
+ <RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="$MODULE_DIR$/lib/freewifi/cisco/iwag/get_iwag_data.rb" />
380
+ <RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
381
+ <method />
382
+ </configuration>
249
383
  <configuration default="true" type="CucumberRunConfigurationType" factoryName="Cucumber">
250
384
  <predefined_log_file id="RUBY_CUCUMBER" enabled="true" />
251
385
  <module name="" />
@@ -389,13 +523,19 @@
389
523
  <envs />
390
524
  <method />
391
525
  </configuration>
392
- <list size="5">
526
+ <list size="6">
393
527
  <item index="0" class="java.lang.String" itemvalue="Ruby.test_helper" />
394
528
  <item index="1" class="java.lang.String" itemvalue="Ruby.newhub_mtik_ssh" />
395
529
  <item index="2" class="java.lang.String" itemvalue="Ruby.test" />
396
530
  <item index="3" class="java.lang.String" itemvalue="Ruby.additional_functions" />
397
531
  <item index="4" class="java.lang.String" itemvalue="Ruby.wifi_portal_procedures" />
532
+ <item index="5" class="java.lang.String" itemvalue="Ruby.get_iwag_data" />
398
533
  </list>
534
+ <recent_temporary>
535
+ <list size="1">
536
+ <item index="0" class="java.lang.String" itemvalue="Ruby.get_iwag_data" />
537
+ </list>
538
+ </recent_temporary>
399
539
  </component>
400
540
  <component name="ShelveChangesManager" show_recycled="false">
401
541
  <option name="remove_strategy" value="false" />
@@ -434,22 +574,23 @@
434
574
  <workItem from="1589977677181" duration="552000" />
435
575
  <workItem from="1590439173325" duration="1040000" />
436
576
  <workItem from="1590829321571" duration="371000" />
437
- <workItem from="1591252934951" duration="231000" />
577
+ <workItem from="1591252934951" duration="3869000" />
578
+ <workItem from="1600375108678" duration="2779000" />
438
579
  </task>
439
580
  <servers />
440
581
  </component>
441
582
  <component name="TimeTrackingManager">
442
- <option name="totallyTimeSpent" value="90635000" />
583
+ <option name="totallyTimeSpent" value="97052000" />
443
584
  </component>
444
585
  <component name="ToolWindowManager">
445
- <frame x="0" y="0" width="1440" height="900" extended-state="0" />
586
+ <frame x="0" y="0" width="1440" height="900" extended-state="6" />
446
587
  <editor active="true" />
447
588
  <layout>
448
- <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.26680973" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
589
+ <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.27038628" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
449
590
  <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
450
591
  <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
451
592
  <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
452
- <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.44527364" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
593
+ <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.35945272" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
453
594
  <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
454
595
  <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.24964234" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
455
596
  <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
@@ -475,21 +616,6 @@
475
616
  <watches-manager />
476
617
  </component>
477
618
  <component name="editorHistoryManager">
478
- <entry file="file://$PROJECT_DIR$/lib/freewifi/version.rb">
479
- <provider selected="true" editor-type-id="text-editor">
480
- <state relative-caret-position="45">
481
- <caret line="3" column="0" lean-forward="false" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
482
- </state>
483
- </provider>
484
- </entry>
485
- <entry file="file://$PROJECT_DIR$/lib/freewifi.rb">
486
- <provider selected="true" editor-type-id="text-editor">
487
- <state relative-caret-position="150">
488
- <caret line="10" column="5" lean-forward="false" selection-start-line="10" selection-start-column="5" selection-end-line="10" selection-end-column="5" />
489
- <folding />
490
- </state>
491
- </provider>
492
- </entry>
493
619
  <entry file="file://$PROJECT_DIR$/lib/freewifi/mikrotik/newhub_mtik_ssh.rb">
494
620
  <provider selected="true" editor-type-id="text-editor">
495
621
  <state relative-caret-position="360">
@@ -661,13 +787,6 @@
661
787
  </state>
662
788
  </provider>
663
789
  </entry>
664
- <entry file="file://$PROJECT_DIR$/test/test.rb">
665
- <provider selected="true" editor-type-id="text-editor">
666
- <state relative-caret-position="75">
667
- <caret line="5" column="22" lean-forward="false" selection-start-line="5" selection-start-column="22" selection-end-line="5" selection-end-column="22" />
668
- </state>
669
- </provider>
670
- </entry>
671
790
  <entry file="file://$PROJECT_DIR$/Gemfile">
672
791
  <provider selected="true" editor-type-id="text-editor">
673
792
  <state relative-caret-position="0">
@@ -689,13 +808,6 @@
689
808
  </state>
690
809
  </provider>
691
810
  </entry>
692
- <entry file="file://$PROJECT_DIR$/freewifi.gemspec">
693
- <provider selected="true" editor-type-id="text-editor">
694
- <state relative-caret-position="407">
695
- <caret line="44" column="48" lean-forward="false" selection-start-line="44" selection-start-column="48" selection-end-line="44" selection-end-column="48" />
696
- </state>
697
- </provider>
698
- </entry>
699
811
  <entry file="file://$PROJECT_DIR$/lib/freewifi/params.rb">
700
812
  <provider selected="true" editor-type-id="text-editor">
701
813
  <state relative-caret-position="482">
@@ -703,13 +815,6 @@
703
815
  </state>
704
816
  </provider>
705
817
  </entry>
706
- <entry file="file://$PROJECT_DIR$/test/freewifi_test.rb">
707
- <provider selected="true" editor-type-id="text-editor">
708
- <state relative-caret-position="0">
709
- <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
710
- </state>
711
- </provider>
712
- </entry>
713
818
  <entry file="file://$PROJECT_DIR$/lib/freewifi/huawei/hua_controller_class.rb">
714
819
  <provider selected="true" editor-type-id="text-editor">
715
820
  <state relative-caret-position="1560">
@@ -724,13 +829,6 @@
724
829
  </state>
725
830
  </provider>
726
831
  </entry>
727
- <entry file="file://$PROJECT_DIR$/lib/freewifi/version.rb">
728
- <provider selected="true" editor-type-id="text-editor">
729
- <state relative-caret-position="45">
730
- <caret line="3" column="0" lean-forward="true" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
731
- </state>
732
- </provider>
733
- </entry>
734
832
  <entry file="file://$USER_HOME$/.rvm/gems/ruby-2.4.1/gems/net-ssh-4.0.1/lib/net/ssh.rb">
735
833
  <provider selected="true" editor-type-id="text-editor">
736
834
  <state relative-caret-position="109">
@@ -752,13 +850,6 @@
752
850
  </state>
753
851
  </provider>
754
852
  </entry>
755
- <entry file="file://$PROJECT_DIR$/test/test_helper.rb">
756
- <provider selected="true" editor-type-id="text-editor">
757
- <state relative-caret-position="162">
758
- <caret line="49" column="25" lean-forward="true" selection-start-line="49" selection-start-column="25" selection-end-line="49" selection-end-column="25" />
759
- </state>
760
- </provider>
761
- </entry>
762
853
  <entry file="file://$PROJECT_DIR$/lib/freewifi/cisco/any/cisco_schemes_conf_gen.rb">
763
854
  <provider selected="true" editor-type-id="text-editor">
764
855
  <state relative-caret-position="120">
@@ -766,20 +857,6 @@
766
857
  </state>
767
858
  </provider>
768
859
  </entry>
769
- <entry file="file://$PROJECT_DIR$/lib/freewifi/general/wifi_portal_procedures.rb">
770
- <provider selected="true" editor-type-id="text-editor">
771
- <state relative-caret-position="4020">
772
- <caret line="268" column="24" lean-forward="false" selection-start-line="268" selection-start-column="24" selection-end-line="268" selection-end-column="24" />
773
- </state>
774
- </provider>
775
- </entry>
776
- <entry file="file://$PROJECT_DIR$/lib/freewifi/cisco/iwag/iwag_telnet_connector.rb">
777
- <provider selected="true" editor-type-id="text-editor">
778
- <state relative-caret-position="60">
779
- <caret line="4" column="17" lean-forward="false" selection-start-line="4" selection-start-column="17" selection-end-line="4" selection-end-column="17" />
780
- </state>
781
- </provider>
782
- </entry>
783
860
  <entry file="file://$PROJECT_DIR$/lib/freewifi/config.rb">
784
861
  <provider selected="true" editor-type-id="text-editor">
785
862
  <state relative-caret-position="30">
@@ -822,6 +899,30 @@
822
899
  </state>
823
900
  </provider>
824
901
  </entry>
902
+ <entry file="file://$PROJECT_DIR$/lib/freewifi/cisco/iwag/iwag_database_worker.rb">
903
+ <provider selected="true" editor-type-id="text-editor">
904
+ <state relative-caret-position="195">
905
+ <caret line="13" column="4" lean-forward="true" selection-start-line="13" selection-start-column="4" selection-end-line="13" selection-end-column="4" />
906
+ <folding />
907
+ </state>
908
+ </provider>
909
+ </entry>
910
+ <entry file="file://$PROJECT_DIR$/lib/freewifi/cisco/iwag/iwag_telnet_connector.rb">
911
+ <provider selected="true" editor-type-id="text-editor">
912
+ <state relative-caret-position="-426">
913
+ <caret line="4" column="17" lean-forward="false" selection-start-line="4" selection-start-column="17" selection-end-line="4" selection-end-column="17" />
914
+ <folding />
915
+ </state>
916
+ </provider>
917
+ </entry>
918
+ <entry file="file://$PROJECT_DIR$/freewifi.gemspec">
919
+ <provider selected="true" editor-type-id="text-editor">
920
+ <state relative-caret-position="476">
921
+ <caret line="32" column="49" lean-forward="false" selection-start-line="32" selection-start-column="49" selection-end-line="32" selection-end-column="49" />
922
+ <folding />
923
+ </state>
924
+ </provider>
925
+ </entry>
825
926
  <entry file="file://$PROJECT_DIR$/lib/freewifi/mikrotik/automation/get_data_ssh_fun.rb">
826
927
  <provider selected="true" editor-type-id="text-editor">
827
928
  <state relative-caret-position="30">
@@ -830,10 +931,58 @@
830
931
  </state>
831
932
  </provider>
832
933
  </entry>
934
+ <entry file="file://$PROJECT_DIR$/test/freewifi_test.rb">
935
+ <provider selected="true" editor-type-id="text-editor">
936
+ <state relative-caret-position="0">
937
+ <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
938
+ <folding />
939
+ </state>
940
+ </provider>
941
+ </entry>
942
+ <entry file="file://$PROJECT_DIR$/test/test.rb">
943
+ <provider selected="true" editor-type-id="text-editor">
944
+ <state relative-caret-position="75">
945
+ <caret line="5" column="22" lean-forward="false" selection-start-line="5" selection-start-column="22" selection-end-line="5" selection-end-column="22" />
946
+ <folding />
947
+ </state>
948
+ </provider>
949
+ </entry>
950
+ <entry file="file://$PROJECT_DIR$/lib/freewifi/cisco/iwag/get_iwag_data.rb">
951
+ <provider selected="true" editor-type-id="text-editor">
952
+ <state relative-caret-position="362">
953
+ <caret line="94" column="46" lean-forward="false" selection-start-line="94" selection-start-column="46" selection-end-line="94" selection-end-column="46" />
954
+ <folding />
955
+ </state>
956
+ </provider>
957
+ </entry>
958
+ <entry file="file://$PROJECT_DIR$/lib/freewifi/general/wifi_portal_procedures.rb">
959
+ <provider selected="true" editor-type-id="text-editor">
960
+ <state relative-caret-position="327">
961
+ <caret line="42" column="35" lean-forward="false" selection-start-line="42" selection-start-column="35" selection-end-line="42" selection-end-column="35" />
962
+ <folding />
963
+ </state>
964
+ </provider>
965
+ </entry>
966
+ <entry file="file://$PROJECT_DIR$/test/test_helper.rb">
967
+ <provider selected="true" editor-type-id="text-editor">
968
+ <state relative-caret-position="337">
969
+ <caret line="84" column="46" lean-forward="true" selection-start-line="84" selection-start-column="46" selection-end-line="84" selection-end-column="46" />
970
+ <folding />
971
+ </state>
972
+ </provider>
973
+ </entry>
833
974
  <entry file="file://$PROJECT_DIR$/lib/freewifi.rb">
834
975
  <provider selected="true" editor-type-id="text-editor">
835
- <state relative-caret-position="521">
836
- <caret line="357" column="137" lean-forward="false" selection-start-line="357" selection-start-column="137" selection-end-line="357" selection-end-column="137" />
976
+ <state relative-caret-position="316">
977
+ <caret line="68" column="32" lean-forward="false" selection-start-line="68" selection-start-column="32" selection-end-line="68" selection-end-column="32" />
978
+ <folding />
979
+ </state>
980
+ </provider>
981
+ </entry>
982
+ <entry file="file://$PROJECT_DIR$/lib/freewifi/version.rb">
983
+ <provider selected="true" editor-type-id="text-editor">
984
+ <state relative-caret-position="45">
985
+ <caret line="3" column="0" lean-forward="true" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
837
986
  <folding />
838
987
  </state>
839
988
  </provider>
@@ -66,8 +66,7 @@ module Freewifi_1
66
66
  capsman_password,
67
67
  hub_vip,
68
68
  ap_admin_password,
69
- capsman_ip_wifi
70
- )
69
+ capsman_ip_wifi)
71
70
 
72
71
  @mtik_hub1_ip = hub1ip
73
72
  @mtik_hub2_ip = hub2ip
@@ -300,7 +299,10 @@ class PortalFwifi_1
300
299
  hua_wlc_login,
301
300
  hua_wlc_password,
302
301
  telegram_api_url,
303
- telegram_chat_id
302
+ telegram_chat_id,
303
+ iwag2_host,
304
+ iwag2_username,
305
+ iwag2_password
304
306
  )
305
307
 
306
308
  @general_procedures = WiFiPortal_1.new(apigw_wsdl,
@@ -317,7 +319,10 @@ class PortalFwifi_1
317
319
  hua_wlc_1_ip,
318
320
  hua_wlc_2_ip,
319
321
  hua_wlc_login,
320
- hua_wlc_password
322
+ hua_wlc_password,
323
+ iwag2_host,
324
+ iwag2_username,
325
+ iwag2_password,
321
326
  )
322
327
  @mtik_control_ips_get = mtik_control_ips_get
323
328
  @mtik_user = mtik_user
@@ -360,6 +365,36 @@ class PortalFwifi_1
360
365
  output_params
361
366
  end
362
367
 
368
+
369
+ def wifi_get_subs_inf_ret_ssh_1(ipaddress, remote_ip, real_ip)
370
+ input_params = {:ipaddress => ipaddress}
371
+ output_params = {}
372
+
373
+ subs_info_ret_1_thr1 = Thread.new do
374
+ begin
375
+ resp_procedure = general_procedures.get_subs_info_ret_ssh_1(ipaddress)
376
+ output_params = resp_procedure
377
+ rescue
378
+ output_params = {:code => 507, :result => "Unknown SDK error"}
379
+ end
380
+ end
381
+ subs_info_ret_1_thr1.join
382
+
383
+ subs_info_ret_1_thr2 = Thread.new do
384
+ begin
385
+ p "mongo"
386
+ #mongo_connector_wifi_1 = MongoWifiCl_1.new(mongo_ip, mongo_port, mongo_database)
387
+ #mongo_connector_wifi_1.audit_logger_wifi_portal_1("wifi_get_subs_info_return_1", remote_ip, input_params, output_params, real_ip)
388
+ rescue
389
+ additional_func_wifi_1.printer_texter_wifi_1({:input_params => input_params, :output_params => {:result => "mongo failed"}, :procedure => "wifi_get_subs_info_return_1", :file => "freewifi.rb"}, "debug")
390
+ additional_func_wifi_1.telegram_message_1("{:function => \"wifi_get_subs_info_return_1\", :result => \"failed communicate with mongo database\", :sdk => \"freewifi\"}", telegram_api_url, telegram_chat_id)
391
+ end
392
+ end
393
+ subs_info_ret_1_thr2.join
394
+
395
+ output_params
396
+ end
397
+
363
398
  end
364
399
 
365
400
  #tested on 6.46.2 router os
@@ -0,0 +1,99 @@
1
+ require 'net/ssh'
2
+
3
+ class IwagRequester
4
+
5
+ attr_accessor :iwag_host, :iwag_login, :iwag_password
6
+
7
+ def initialize(iwag_host, iwag_login, iwag_password)
8
+ @iwag_host = iwag_host
9
+ @iwag_login = iwag_login
10
+ @iwag_password = iwag_password
11
+ end
12
+
13
+ def mac_parse(mac)
14
+ a = mac.upcase
15
+ pos = a[0] + a[1]
16
+ if pos == "01"
17
+ subscribers_mac = a[2] + a[3] + ":" + a[5] + a[6] + ":" + a[7] + a[8] + ":" + a[10] + a[11] + ":" + a[12] + a[13] + ":" + a[15] + a[16]
18
+ else
19
+ subscribers_mac = a[0] + a[1] + ":" + a[2] + a[3] + ":" + a[5] + a[6] + ":" + a[7] + a[8] + ":" + a[10] + a[11] + ":" + a[12] + a[13]
20
+ end
21
+ subscribers_mac
22
+ end
23
+
24
+
25
+ def iwag_get_dhcp_binding_ssh(bind_ip)
26
+ mac = "Unknown"
27
+ accessinterface = "Unknown"
28
+ hostname = "Unknown"
29
+ ssid = "Unknown"
30
+ iwag_thr = Thread.new do
31
+ Net::SSH.start(iwag_host, iwag_login, :password => iwag_password) do |session|
32
+ answ_bind = session.exec!("show ip dhcp binding #{bind_ip}")
33
+ regexp_main = /\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}\s{1,20}(\w{2,4}.\w{2,4}.\w{2,4}.\w{2,4})|\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}\s{1,20}(\w{4}.\w{4}.\w{4})/
34
+ #regexp_main = /\r\n(\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})\s+(\S{13,18})\s+Sep 18 2020 07:44 PM\s+Automatic\s+Active\s+Tunnel201\r\n/
35
+ ggg7 = answ_bind.match(regexp_main)
36
+ begin
37
+ if ggg7[1] != nil
38
+ mac = mac_parse(ggg7[1])
39
+ else
40
+ mac = mac_parse(ggg7[2])
41
+ end
42
+ rescue
43
+ mac = "Unknown"
44
+ end
45
+ regexp_remote_id = /Remote id :\s(\S{2,100})/
46
+ regexp_tunnel = /Active\s{2,40}(\S{2,40})|Selecting\s{2,40}(\S{2,40})/
47
+ regexp_curcuit_id = /Circuit id :\s(\S{2,100})/
48
+ ggg9 = answ_bind.match(regexp_tunnel)
49
+
50
+ begin
51
+ if ggg9[1] != nil
52
+ accessinterface = ggg9[1]
53
+ else
54
+ accessinterface = ggg9[2]
55
+ end
56
+ rescue
57
+ accessinterface = "Unknown"
58
+ end
59
+ ggg8 = answ_bind.match(regexp_remote_id)
60
+ ggg10 = answ_bind.match(regexp_curcuit_id)
61
+ begin
62
+ a1 = ggg8[1].split(":")
63
+ hostname = a1[0]
64
+ ssid = a1[1]
65
+ rescue
66
+ begin
67
+ if ggg8[1] != nil
68
+ if ggg8[1].include?("wireless_public_interface")
69
+ hostname = ggg10[1]
70
+ ssid = "Unknown"
71
+ else
72
+ hostname = ggg8[1]
73
+ ssid = "Unknown"
74
+ end
75
+ else
76
+ ssid = "Unknown"
77
+ hostname = "Unknown"
78
+ end
79
+ rescue
80
+ ssid = "Unknown"
81
+ hostname = "Unknown"
82
+ end
83
+ end
84
+ end
85
+ end
86
+ iwag_thr.join
87
+ {"mac": mac, "iwaginterface": accessinterface, "aphostname": hostname, "SSID": ssid}
88
+ end
89
+
90
+ end
91
+
92
+
93
+ hhh = IwagRequester.new("172.24.223.149", "soapgw2", "eb5Swd8Yhq2Snd3eD")
94
+
95
+ p hhh.iwag_get_dhcp_binding_ssh("100.75.15.127")
96
+
97
+
98
+
99
+
@@ -0,0 +1,20 @@
1
+
2
+
3
+ class IwagDbCache
4
+
5
+ attr_accessor :db_host, :db_login, :db_password
6
+
7
+ def initialize(db_host, db_login, db_password)
8
+ @db_host = db_host
9
+ @db_login = db_login
10
+ @db_password = db_password
11
+ end
12
+
13
+ def check_db_exists(ip)
14
+
15
+ end
16
+
17
+
18
+
19
+ end
20
+
@@ -5,6 +5,7 @@ $LOAD_PATH.unshift File.expand_path("../huawei", __dir__)
5
5
  require 'freewifi/cisco/iwag/iwag_telnet_connector'
6
6
  require 'freewifi/mikrotik/newhub_mtik_api'
7
7
  require 'freewifi/huawei/hua_controller_class'
8
+ require 'freewifi/cisco/iwag/get_iwag_data'
8
9
  require 'rubygems'
9
10
  require 'savon'
10
11
 
@@ -18,29 +19,51 @@ class WiFiPortal_1
18
19
  :mtik_user,
19
20
  :mtik_password,
20
21
  :mtik_api_connector,
21
- :hua_controller_connector
22
-
23
- def initialize(apigw_wsdl, apigw_endpoint, apigw_namespace, apigw_wsse_aut_log, apigw_wsse_aut_pass, iwag1_host, iwag_username, iwag_password, mtik_control_ips_get, mtik_user, mtik_password, hua_wlc_1_ip, hua_wlc_2_ip, hua_wlc_login, hua_wlc_password)
24
- @iwag_telnet_connector = CSRtelnet_1.new(iwag1_host, iwag_username, iwag_password)
25
- @ard_api_gw_connector_wifi = Savon.client do
26
- #ssl_verify_mode :none
27
- wsdl apigw_wsdl
28
- endpoint apigw_endpoint
29
- namespace apigw_namespace
30
- wsse_auth(apigw_wsse_aut_log, apigw_wsse_aut_pass, :digest)
31
- encoding 'UTF-8'
32
- headers = {"Accept-Encoding" => "gzip, deflate", "Connection" => "Keep-Alive"}
33
- end
22
+ :hua_controller_connector,
23
+ :iwag_connector1,
24
+ :iwag_connector2
25
+
26
+ def initialize(apigw_wsdl,
27
+ apigw_endpoint,
28
+ apigw_namespace,
29
+ apigw_wsse_aut_log,
30
+ apigw_wsse_aut_pass,
31
+ iwag1_host,
32
+ iwag_username,
33
+ iwag_password,
34
+ mtik_control_ips_get,
35
+ mtik_user,
36
+ mtik_password,
37
+ hua_wlc_1_ip,
38
+ hua_wlc_2_ip,
39
+ hua_wlc_login,
40
+ hua_wlc_password,
41
+ iwag2_host,
42
+ iwag2_username,
43
+ iwag2_password)
44
+ @iwag_telnet_connector = CSRtelnet_1.new(iwag1_host, iwag_username, iwag_password)
45
+ @ard_api_gw_connector_wifi = Savon.client do
46
+ #ssl_verify_mode :none
47
+ wsdl apigw_wsdl
48
+ endpoint apigw_endpoint
49
+ namespace apigw_namespace
50
+ wsse_auth(apigw_wsse_aut_log, apigw_wsse_aut_pass, :digest)
51
+ encoding 'UTF-8'
52
+ headers = {"Accept-Encoding" => "gzip, deflate", "Connection" => "Keep-Alive"}
53
+ end
34
54
 
35
- @iwag1_host = iwag1_host
36
- @iwag_username = iwag_username
37
- @iwag_password = iwag_password
55
+ @iwag1_host = iwag1_host
56
+ @iwag_username = iwag_username
57
+ @iwag_password = iwag_password
38
58
 
39
- @mtik_api_connector = NEWhubWifiApi_1.new(mtik_control_ips_get, mtik_user, mtik_password)
59
+ @mtik_api_connector = NEWhubWifiApi_1.new(mtik_control_ips_get, mtik_user, mtik_password)
40
60
 
41
- @hua_controller_connector = HuaWifi_1.new(hua_wlc_1_ip, hua_wlc_2_ip, hua_wlc_login, hua_wlc_password)
61
+ @hua_controller_connector = HuaWifi_1.new(hua_wlc_1_ip, hua_wlc_2_ip, hua_wlc_login, hua_wlc_password)
42
62
 
43
- end
63
+ @iwag_connector1 = IwagRequester.new(iwag1_host, iwag_username, iwag_password)
64
+ @iwag_connector2 = IwagRequester.new(iwag2_host, iwag2_username, iwag2_password)
65
+
66
+ end
44
67
 
45
68
 
46
69
  def python_mac_iwag1_1(ipaddress)
@@ -55,6 +78,16 @@ class WiFiPortal_1
55
78
  end
56
79
  end
57
80
 
81
+
82
+ def ssh_mac_iwag1_1(ipaddress)
83
+ begin
84
+ data_iw1 = iwag_connector1.iwag_get_dhcp_binding_ssh(ipaddress)
85
+ "#{data_iw1[:mac]} #{data_iw1[:iwaginterface]} #{data_iw1[:aphostname]} #{data_iw1[:SSID]}"
86
+ rescue
87
+ return "Unknown Unknown Unknown Unknown"
88
+ end
89
+ end
90
+
58
91
  def python_mac_iwag2_1(ipaddress)
59
92
  begin
60
93
  response = ard_api_gw_connector_wifi.call(:mts_python_mac_iwag2) do
@@ -67,6 +100,15 @@ class WiFiPortal_1
67
100
  end
68
101
  end
69
102
 
103
+ def ssh_mac_iwag2_1(ipaddress)
104
+ begin
105
+ data_iw1 = iwag_connector2.iwag_get_dhcp_binding_ssh(ipaddress)
106
+ "#{data_iw1[:mac]} #{data_iw1[:iwaginterface]} #{data_iw1[:aphostname]} #{data_iw1[:SSID]}"
107
+ rescue
108
+ return "Unknown Unknown Unknown Unknown"
109
+ end
110
+ end
111
+
70
112
  def get_subs_add_info3_1(ipaddress, access_interface)
71
113
 
72
114
 
@@ -626,5 +668,385 @@ class WiFiPortal_1
626
668
  end
627
669
 
628
670
 
671
+ def get_subs_info_ret_ssh_1(ip_address)
672
+
673
+ input_params = {:ip_address => ip_address}
674
+ output_params = {}
675
+
676
+ begin
677
+ ipaddr_transformed = IPAddr.new ip_address
678
+ ipaddr_network = ipaddr_transformed.mask(17).to_s
679
+
680
+ if ipaddr_network == "100.71.0.0" #iwag old
681
+
682
+ output_params = self.proc_100_71_0_0_ssh(ip_address)
683
+
684
+ elsif ipaddr_network == "100.75.0.0" #min11iwag2
685
+
686
+ output_params = self.proc_100_75_0_0_ssh(ip_address)
687
+
688
+ elsif ipaddr_network == "100.70.0.0" #min11iwag1
689
+
690
+ output_params = self.proc_100_70_0_0_ssh(ip_address)
691
+
692
+ else
693
+ output_params = {:code => 404, :result => "ERROR. Unknown IP Pool."}
694
+ end
695
+
696
+ rescue
697
+ output_params = {:code => 500, :result => "ERROR. Something wrong.", :body => "SOAP mts_wifi_get_subs_info_return errorMethod unknown error"}
698
+ end
699
+
700
+ output_params
701
+
702
+ end
703
+
704
+
705
+ def proc_100_71_0_0_ssh(ip_address)
706
+ begin
707
+ p access_int = iwag_telnet_connector.return_iwag_access_interface_1(ip_address)
708
+
709
+ ip_a = ip_address
710
+
711
+ access_poi = "unknown"
712
+ ssid_a = "unknown"
713
+ tx_rate_se = "unknown"
714
+ tx_rat = "unknown"
715
+ rx_rat = "unknown"
716
+ rx_signa = "unknown"
717
+ uptim = "unknown"
718
+ packet = "unknown"
719
+ byt = "unknown"
720
+
721
+ if access_int == "Tunnel5"
722
+ mikr_info2 = self.get_subs_add_info3_1(ip_address, access_int)
723
+ splitting2 = mikr_info2.split("---")
724
+ subs_mac = splitting2[0]
725
+ access_poi = "belrw_3_Cisco_ap1-1"
726
+ ssid_a = "BelRW_WiFi"
727
+ tx_rate_se = "unknown"
728
+ tx_rat = "unknown"
729
+ rx_rat = "unknown"
730
+ rx_signa = "unknown"
731
+ uptim = "unknown"
732
+ packet = "unknown"
733
+ byt = "unknown"
734
+ elsif access_int == "GigabitEthernet2.4008"
735
+ mikr_info3 = self.get_subs_add_info3_1(ip_address, access_int)
736
+ splitting3 = mikr_info3.split("---")
737
+ subs_mac = splitting3[0]
738
+ access_poi = "belrw_4_HP_ap1-1"
739
+ ssid_a = "BelRW_WiFi"
740
+ tx_rate_se = "unknown"
741
+ tx_rat = "unknown"
742
+ rx_rat = "unknown"
743
+ rx_signa = "unknown"
744
+ uptim = "unknown"
745
+ packet = "unknown"
746
+ byt = "unknown"
747
+ elsif access_int == "Tunnel9"
748
+ subs_mac = iwag_telnet_connector.get_subs_mac2_1(ip_address)
749
+ p resp1 = hua_controller_connector.get_sub_info_1(subs_mac)
750
+ p resp=resp1.split(",,,")
751
+
752
+ p access_poi = resp[1]
753
+ p ssid_a = resp[2]
754
+ p tx_rate_se = resp[3]
755
+ p tx_rat = resp[4]
756
+ p rx_rat = resp[5]
757
+ p rx_signa = resp[6]
758
+ p uptim = resp[7]
759
+ p packet = resp[8]
760
+ p byt = resp[9]
761
+ elsif access_int == "Tunnel16"
762
+ subs_mac = iwag_telnet_connector.get_subs_mac2_1(ip_address)
763
+ p resp1 = hua_controller_connector.get_sub_info2_1(subs_mac)
764
+ p resp=resp1.split(",,,")
765
+
766
+ p access_poi = resp[1]
767
+ p ssid_a = resp[2]
768
+ p tx_rate_se = resp[3]
769
+ p tx_rat = resp[4]
770
+ p rx_rat = resp[5]
771
+ p rx_signa = resp[6]
772
+ p uptim = resp[7]
773
+ p packet = resp[8]
774
+ p byt = resp[9]
775
+ else
776
+ p "before get info"
777
+ p mikr_info5 = self.get_subs_add_info3_1(ip_address, access_int)
778
+ p "after get info"
779
+ splitting5 = mikr_info5.split("---")
780
+ p subs_mac = splitting5[0]
781
+
782
+ p access_poi = splitting5[1]
783
+ p ssid_a = splitting5[2]
784
+ p tx_rate_se = splitting5[3]
785
+ p tx_rat = splitting5[4]
786
+ p rx_rat = splitting5[5]
787
+ p rx_signa = splitting5[6]
788
+ p uptim = splitting5[7]
789
+ p packet = splitting5[8]
790
+ p byt = splitting5[9]
791
+
792
+
793
+ if access_poi==nil || access_poi=="" || access_poi=="unknown"
794
+ access_poi = "not on mikrotik controller"
795
+ end
796
+
797
+ if ssid_a==nil || ssid_a=="" || ssid_a=="unknown"
798
+ ssid_a = "unknown"
799
+ tx_rate_se = "unknown"
800
+ tx_rat = "unknown"
801
+ rx_rat = "unknown"
802
+ rx_signa = "unknown"
803
+ uptim = "unknown"
804
+ packet = "unknown"
805
+ byt = "unknown"
806
+ end
807
+
808
+ end
809
+
810
+ if subs_mac=="unknown"
811
+ output_params = {:code => 505, :result => "ERROR. Something wrong."}
812
+ end
813
+
814
+ if subs_mac==""
815
+ subs_mac="unknown"
816
+ end
817
+
818
+
819
+ mess = {:iwag_access_interface => access_int,
820
+ :subscribers_mac => subs_mac,
821
+ :access_point => access_poi,
822
+ :ssid_ap => ssid_a,
823
+ :apid => "unknown",
824
+ :statistics =>
825
+ {:tx_rate_set => tx_rate_se,
826
+ :tx_rate => tx_rat,
827
+ :rx_rate => rx_rat,
828
+ :rx_signal => rx_signa,
829
+ :uptime => uptim,
830
+ :packets => packet,
831
+ :bytes => byt}
832
+ }
833
+ # logger.info "HAproxy #{request.remote_ip}, request device real ip: #{request.headers['X-Client']}, ipaddressinputparameter: #{ip_address} recieved from mts_wifi_get_subs_info_return procedure of wifi_portal_controller such information as: #{mess.to_xml}"
834
+ output_params = {:code => 200, :result => "Request completed", :body => {:message => mess}}
835
+ rescue
836
+
837
+ puts 'SOAP mts_wifi_get_subs_info_return errorMethod'
838
+ output_params = {:code => 505, :result => "ERROR. Something wrong."}
839
+ end
840
+ output_params
841
+ end
842
+
843
+ def proc_100_75_0_0_ssh(ip_address)
844
+
845
+ begin
846
+ result_iwag = self.ssh_mac_iwag2_1(ip_address)
847
+ if result_iwag.split(" ")[0]!="Unknown"
848
+ ppp = result_iwag.split(" ")
849
+
850
+ subs_mac = ppp[0]
851
+ access_int = ppp[1]
852
+ access_poi = ppp[2]
853
+ ssid_a = ppp[3]
854
+
855
+ tx_rate_se = "unknown"
856
+ tx_rat = "unknown"
857
+ rx_rat = "unknown"
858
+ rx_signa = "unknown"
859
+ uptim = "unknown"
860
+ packet = "unknown"
861
+ byt = "unknown"
862
+
863
+ if access_int=='GigabitEthernet4.3002'
864
+ access_poi = "belrw_4_HP_ap1-1"
865
+ ssid_a = "BelRW_WiFi"
866
+ elsif access_int=='GigabitEthernet4.3005'
867
+ access_poi = "belbiz-AP1-1"
868
+ ssid_a = "IMAGURU_GUEST"
869
+ end
870
+
871
+ if access_poi == "Unknown" && ssid_a == "Unknown" && subs_mac != "Unknown"
872
+ frommikrotik = self.get_subs_add_info4new_1(access_int, subs_mac)
873
+ splitting5 = frommikrotik.split("---")
874
+ p access_poi = splitting5[1]
875
+ p ssid_a = splitting5[2]
876
+ p tx_rate_se = splitting5[3]
877
+ p tx_rat = splitting5[4]
878
+ p rx_rat = splitting5[5]
879
+ p rx_signa = splitting5[6]
880
+ p uptim = splitting5[7]
881
+ p packet = splitting5[8]
882
+ p byt = splitting5[9]
883
+ end
884
+
885
+ if subs_mac=="unknown"
886
+ output_params = {:code => 505, :result => "ERROR. Something wrong."}
887
+ end
888
+
889
+ if subs_mac==""
890
+ subs_mac="unknown"
891
+ end
892
+
893
+
894
+ mess = {:iwag_access_interface => access_int,
895
+ :subscribers_mac => subs_mac,
896
+ :access_point => access_poi,
897
+ :ssid_ap => ssid_a,
898
+ :apid => "unknown",
899
+ :statistics =>
900
+ {:tx_rate_set => tx_rate_se,
901
+ :tx_rate => tx_rat,
902
+ :rx_rate => rx_rat,
903
+ :rx_signal => rx_signa,
904
+ :uptime => uptim,
905
+ :packets => packet,
906
+ :bytes => byt}
907
+ }
908
+ # logger.info "HAproxy #{request.remote_ip}, request device real ip: #{request.headers['X-Client']}, ipaddressinputparameter: #{ip_address} recieved from mts_wifi_get_subs_info_return procedure of wifi_portal_controller such information as: #{mess.to_xml}"
909
+ output_params = {:code => 200, :result => "Request completed", :body => {:message => mess}}
910
+ p output_params
911
+
912
+ else
913
+
914
+ mess = {:iwag_access_interface => "unknown",
915
+ :subscribers_mac => "unknown",
916
+ :access_point => "unknown",
917
+ :ssid_ap => "unknown",
918
+ :apid => "unknown",
919
+ :statistics =>
920
+ {:tx_rate_set => "unknown",
921
+ :tx_rate => "unknown",
922
+ :rx_rate => "unknown",
923
+ :rx_signal => "unknown",
924
+ :uptime => "unknown",
925
+ :packets => "unknown",
926
+ :bytes => "unknown"}
927
+ }
928
+ # logger.info "HAproxy #{request.remote_ip}, request device real ip: #{request.headers['X-Client']}, ipaddressinputparameter: #{params[:ipaddress]} recieved from mts_wifi_get_subs_info_return procedure of wifi_portal_controller such information as: #{mess.to_xml}"
929
+ output_params = {:code => 202, :result => "Request completed", :body => {:message => mess}}
930
+ p output_params
931
+
932
+ end
933
+ rescue
934
+ puts 'SOAP mts_wifi_get_subs_info_return errorMethod'
935
+ output_params = {:code => 505, :result => "ERROR. Something wrong."}
936
+ end
937
+
938
+ output_params
939
+
940
+ ####
941
+ end
942
+
943
+
944
+ def proc_100_70_0_0_ssh(ip_address)
945
+ p "min11iwag1"
946
+
947
+ begin
948
+ result_iwag = self.ssh_mac_iwag1_1(ip_address)
949
+ p result_iwag
950
+ if result_iwag.split(" ")[0]!="Unknown"
951
+ ppp = result_iwag.split(" ")
952
+
953
+ subs_mac = ppp[0]
954
+ access_int = ppp[1]
955
+ access_poi = ppp[2]
956
+ ssid_a = ppp[3]
957
+
958
+
959
+ if access_int=='GigabitEthernet4.3002'
960
+ access_poi = "belrw_4_HP_ap1-1"
961
+ ssid_a = "BelRW_WiFi"
962
+ elsif access_int=='GigabitEthernet4.3005'
963
+ access_poi = "belbiz-AP1-1"
964
+ ssid_a = "IMAGURU_GUEST"
965
+ end
966
+
967
+ if access_poi == "Unknown" && ssid_a == "Unknown" && subs_mac != "Unknown"
968
+ frommikrotik = self.get_subs_add_info4new_1(access_int, subs_mac)
969
+ splitting5 = frommikrotik.split("---")
970
+ p access_poi = splitting5[1]
971
+ p ssid_a = splitting5[2]
972
+ p tx_rate_se = splitting5[3]
973
+ p tx_rat = splitting5[4]
974
+ p rx_rat = splitting5[5]
975
+ p rx_signa = splitting5[6]
976
+ p uptim = splitting5[7]
977
+ p packet = splitting5[8]
978
+ p byt = splitting5[9]
979
+ end
980
+
981
+ tx_rate_se = "unknown"
982
+ tx_rat = "unknown"
983
+ rx_rat = "unknown"
984
+ rx_signa = "unknown"
985
+ uptim = "unknown"
986
+ packet = "unknown"
987
+ byt = "unknown"
988
+
989
+ if subs_mac=="unknown"
990
+ output_params = {:code => 505, :result => "ERROR. Something wrong."}
991
+ end
992
+
993
+ if subs_mac==""
994
+ output_params = {:code => 505, :result => "ERROR. Something wrong."}
995
+ end
996
+
997
+ mess = {:iwag_access_interface => access_int,
998
+ :subscribers_mac => subs_mac,
999
+ :access_point => access_poi,
1000
+ :ssid_ap => ssid_a,
1001
+ :apid => "unknown",
1002
+ :statistics =>
1003
+ {:tx_rate_set => tx_rate_se,
1004
+ :tx_rate => tx_rat,
1005
+ :rx_rate => rx_rat,
1006
+ :rx_signal => rx_signa,
1007
+ :uptime => uptim,
1008
+ :packets => packet,
1009
+ :bytes => byt}
1010
+ }
1011
+ # logger.info "HAproxy #{request.remote_ip}, request device real ip: #{request.headers['X-Client']}, ipaddressinputparameter: #{ip_address} recieved from mts_wifi_get_subs_info_return procedure of wifi_portal_controller such information as: #{mess.to_xml}"
1012
+ output_params = {:code => 200, :result => "Request completed", :body => {:message => mess}}
1013
+ p output_params
1014
+
1015
+ else
1016
+
1017
+ mess = {:iwag_access_interface => "unknown",
1018
+ :subscribers_mac => "unknown",
1019
+ :access_point => "unknown",
1020
+ :ssid_ap => "unknown",
1021
+ :apid => "unknown",
1022
+ :statistics =>
1023
+ {:tx_rate_set => "unknown",
1024
+ :tx_rate => "unknown",
1025
+ :rx_rate => "unknown",
1026
+ :rx_signal => "unknown",
1027
+ :uptime => "unknown",
1028
+ :packets => "unknown",
1029
+ :bytes => "unknown"}
1030
+ }
1031
+
1032
+ # logger.info "HAproxy #{request.remote_ip}, request device real ip: #{request.headers['X-Client']}, ipaddressinputparameter: #{ip_address} recieved from mts_wifi_get_subs_info_return procedure of wifi_portal_controller such information as: #{mess.to_xml}"
1033
+
1034
+ output_params = {:code => 405, :result => "ERROR. MAC address not found on IWAG."}
1035
+
1036
+ #render :soap => mess
1037
+
1038
+ end
1039
+ rescue
1040
+ puts 'SOAP mts_wifi_get_subs_info_return errorMethod'
1041
+ output_params = {:code => 505, :result => "ERROR. Something wrong."}
1042
+ end
1043
+
1044
+ output_params
1045
+
1046
+ ####
1047
+
1048
+ end
1049
+
1050
+
629
1051
  end
630
1052
 
@@ -1,3 +1,3 @@
1
1
  module Freewifi_1
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: freewifi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dzmitry Buynovskiy
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-04 00:00:00.000000000 Z
11
+ date: 2020-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -218,6 +218,8 @@ files:
218
218
  - lib/freewifi.rb
219
219
  - lib/freewifi/additional/additional_functions.rb
220
220
  - lib/freewifi/cisco/any/cisco_schemes_conf_gen.rb
221
+ - lib/freewifi/cisco/iwag/get_iwag_data.rb
222
+ - lib/freewifi/cisco/iwag/iwag_database_worker.rb
221
223
  - lib/freewifi/cisco/iwag/iwag_telnet_connector.rb
222
224
  - lib/freewifi/config.rb
223
225
  - lib/freewifi/database/mongo/mongoconnector.rb
@@ -236,7 +238,7 @@ licenses:
236
238
  - MIT
237
239
  metadata:
238
240
  allowed_push_host: https://rubygems.org/
239
- post_install_message:
241
+ post_install_message:
240
242
  rdoc_options: []
241
243
  require_paths:
242
244
  - lib
@@ -251,9 +253,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
251
253
  - !ruby/object:Gem::Version
252
254
  version: '0'
253
255
  requirements: []
254
- rubyforge_project:
256
+ rubyforge_project:
255
257
  rubygems_version: 2.6.14
256
- signing_key:
258
+ signing_key:
257
259
  specification_version: 4
258
260
  summary: gem for Public WiFi
259
261
  test_files: []