]> git.stg.codes - ssmd.git/blob - tests/test_switch.cpp
gssmd -> ssmd.
[ssmd.git] / tests / test_switch.cpp
1 #include <iostream>
2 #include <exception>
3
4 #include "snmp_pp/snmp_pp.h"
5
6 #include "settings.h"
7 #include "switch.h"
8 #include "subscriber.h"
9 #include "logger.h"
10
11 SSMD::Logger logger;
12
13 int main()
14 {
15     SSMD::Settings settings;
16
17     settings.setIsDebug(true);
18     settings.setUpProfileId(1);
19     settings.setDownProfileId(2);
20
21     int status = 0;
22     Snmp snmp(status);
23
24     if (status) {
25         logger << "Failed to initialize SNMP" << std::endl;
26         return -1;
27     }
28
29     SSMD::Switch sw(settings,
30                    snmp,
31                    "172.16.47.10",
32                    "gts_community_r",
33                    "gts_community_w",
34                    10);
35
36     sw.addSubscriber(
37             SSMD::Subscriber(
38                 "485b3936a273",
39                 1,
40                 8192,
41                 8192,
42                 256,
43                 512
44             )
45     );
46
47     sw.sync();
48     return 0;
49 }