Skip to content

Commit 20258c5

Browse files
Carsten SchaferCarsten Schafer
authored andcommitted
Merge remote-tracking branch 'origin/main' into release/v3.0.0
2 parents fadb740 + c782981 commit 20258c5

13 files changed

Lines changed: 162 additions & 114 deletions

BUILDING.md

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Building from source
22

3-
In order to build the OWSEC, you will need to install its dependencies, which includes the following:
3+
In order to build OWSEC, you will need to install its dependencies, which includes the following:
44
- cmake
55
- boost
66
- POCO 1.10.1 or later
@@ -13,43 +13,43 @@ In order to build the OWSEC, you will need to install its dependencies, which in
1313

1414
The build is done in 2 parts. The first part is to build a local copy of the framework tailored to your environment. This
1515
framework is called [Poco](https://github.com/pocoproject/poco). The version used in this project has a couple of fixes
16-
from the master copy needed for cmake. Please use the version of this [Poco fix](https://github.com/AriliaWireless/poco). Building
16+
from the master copy needed for cmake. Please use the version of this [Poco fix](https://github.com/Telecominfraproject/wlan-cloud-lib-poco). Building
1717
Poco may take several minutes depending on the platform you are building on.
1818

1919
## Ubuntu
2020
These instructions have proven to work on Ubuntu 20.4.
2121
```bash
22-
sudo apt install git cmake g++ libssl-dev libmariadb-dev
23-
sudo apt install libpq-dev libaprutil1-dev apache2-dev libboost-all-dev
24-
sudo apt install librdkafka-dev default-libmysqlclient-dev
25-
sudo apt install nlohmann-json-dev
22+
sudo apt install git cmake g++ libssl-dev libmariadb-dev \
23+
libpq-dev libaprutil1-dev apache2-dev libboost-all-dev \
24+
librdkafka-dev default-libmysqlclient-dev \
25+
nlohmann-json-dev
2626

27-
cd ~
28-
git clone https://github.com/AriliaWireless/poco --branch poco-tip-v1
27+
git clone https://github.com/Telecominfraproject/wlan-cloud-lib-poco --branch poco-tip-v1 poco
2928
cd poco
3029
mkdir cmake-build
3130
cd cmake-build
3231
cmake ..
3332
cmake --build . --config Release
3433
sudo cmake --build . --target install
34+
cd ../..
3535

36-
cd ~
37-
git clone https://github.com/AriliaWireless/cppkafka --branch tip-v1
36+
git clone https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka --branch tip-v1 cppkafka
3837
cd cppkafka
3938
mkdir cmake-build
4039
cd cmake-build
4140
cmake ..
4241
cmake --build . --config Release
4342
sudo cmake --build . --target install
43+
cd ../..
4444

45-
cd ~
46-
git clone https://github.com/AriliaWireless/valijson --branch tip-v1
45+
git clone https://github.com/Telecominfraproject/wlan-cloud-lib-valijson --branch tip-v1 valijson
4746
cd valijson
4847
mkdir cmake-build
4948
cd cmake-build
5049
cmake ..
5150
cmake --build . --config Release
5251
sudo cmake --build . --target install
52+
cd ../..
5353

5454
git clone https://github.com/fmtlib/fmt --branch 9.0.0 /fmtlib
5555
cd fmtlib
@@ -58,56 +58,59 @@ cd cmake-build
5858
cmake ..
5959
make
6060
make install
61+
cd ../..
6162

62-
cd ~
6363
git clone https://github.com/Telecominfraproject/wlan-cloud-ucentralsec
6464
cd wlan-cloud-ucentralsec
6565
mkdir cmake-build
6666
cd cmake-build
6767
cmake ..
6868
make -j 8
69+
cd ../..
6970
```
7071

7172
## Fedora
7273
The following instructions have proven to work on Fedora 33
7374
```bash
74-
sudo yum install cmake g++ openssl-devel mysql-devel mysql apr-util-devel boost boost-devel
75-
sudo yum install yaml-cpp-devel lua-devel
75+
sudo yum install cmake g++ openssl-devel mysql-devel mysql apr-util-devel boost boost-devel \
76+
yaml-cpp-devel lua-devel
7677
sudo dnf install postgresql.x86_64 librdkafka-devel
7778
sudo dnf install postgresql-devel json-devel
7879

79-
git clone https://github.com/AriliaWireless/poco --branch poco-tip-v1
80+
git clone https://github.com/Telecominfraproject/wlan-cloud-lib-poco --branch poco-tip-v1 poco
8081
cd poco
8182
mkdir cmake-build
8283
cd cmake-build
8384
cmake ..
8485
cmake --build . --config Release
8586
sudo cmake --build . --target install
87+
cd ../..
8688

87-
git clone https://github.com/AriliaWireless/cppkafka --branch tip-v1
89+
git clone https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka --branch tip-v1 cppkafka
8890
cd cppkafka
8991
mkdir cmake-build
9092
cd cmake-build
9193
cmake ..
9294
cmake --build . --config Release
9395
sudo cmake --build . --target install
96+
cd ../..
9497

95-
cd ~
96-
git clone https://github.com/AriliaWireless/valijson --branch tip-v1
98+
git clone https://github.com/Telecominfraproject/wlan-cloud-lib-valijson --branch tip-v1 valijson
9799
cd valijson
98100
mkdir cmake-build
99101
cd cmake-build
100102
cmake ..
101103
cmake --build . --config Release
102104
sudo cmake --build . --target install
105+
cd ../..
103106

104-
cd ~
105107
git clone https://github.com/Telecominfraproject/wlan-cloud-ucentralsec
106108
cd wlan-cloud-ucentralsec
107109
mkdir cmake-build
108110
cd cmake-build
109111
cmake ..
110112
make
113+
cd ../..
111114
```
112115

113116
## macOS Build
@@ -126,7 +129,7 @@ brew install openssl \
126129
nlohmann-json \
127130
fmt
128131

129-
git clone https://github.com/AriliaWireless/poco --branch poco-tip-v1
132+
git clone https://github.com/Telecominfraproject/wlan-cloud-lib-poco --branch poco-tip-v1 poco
130133
pushd poco
131134
mkdir cmake-build
132135
push cmake-build
@@ -136,7 +139,7 @@ sudo cmake --build . --target install
136139
popd
137140
popd
138141

139-
git clone https://github.com/AriliaWireless/cppkafka --branch tip-v1
142+
git clone https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka --branch tip-v1 cppkafka
140143
pushd cppkafka
141144
mkdir cmake-build
142145
pushd cmake-build
@@ -146,10 +149,10 @@ sudo cmake --build . --target install
146149
popd
147150
popd
148151

149-
git clone https://github.com/AriliaWireless/valijson --branch tip-v1
150-
cd valijson
152+
git clone https://github.com/Telecominfraproject/wlan-cloud-lib-valijson --branch tip-v1 valijson
153+
pushd valijson
151154
mkdir cmake-build
152-
cd cmake-build
155+
pushd cmake-build
153156
cmake ..
154157
cmake --build . --config Release
155158
sudo cmake --build . --target install
@@ -172,20 +175,23 @@ support. You can build with only SQLite support by not installing the packages f
172175
adding -DSMALL_BUILD=1 on the cmake build line.
173176

174177
```bash
175-
sudo apt install git cmake g++ libssl-dev libaprutil1-dev apache2-dev libboost-all-dev libyaml-cpp-dev
176-
git clone https://github.com/stephb9959/poco
178+
sudo apt install git cmake g++ libssl-dev libaprutil1-dev apache2-dev \
179+
libboost-all-dev libyaml-cpp-dev
180+
181+
git clone https://github.com/Telecominfraproject/wlan-cloud-lib-poco --branch poco-tip-v1 poco
177182
cd poco
178183
mkdir cmake-build
179184
cd cmake-build
180185
cmake ..
181186
cmake --build . --config Release
182187
sudo cmake --build . --target install
188+
cd ../..
183189

184-
cd ~
185190
git clone https://github.com/Telecominfraproject/wlan-cloud-ucentralsec
186191
cd wlan-cloud-ucentralsec
187192
mkdir cmake-build
188193
cd cmake-build
189194
cmake -DSMALL_BUILD=1 ..
190195
make
196+
cd ../..
191197
```

Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ FROM build-base AS poco-build
1515

1616
ARG POCO_VERSION
1717

18-
ADD https://api.github.com/repos/AriliaWireless/poco/git/refs/tags/${POCO_VERSION} version.json
19-
RUN git clone https://github.com/AriliaWireless/poco --branch ${POCO_VERSION} /poco
18+
ADD https://api.github.com/repos/Telecominfraproject/wlan-cloud-lib-poco/git/refs/tags/${POCO_VERSION} version.json
19+
RUN git clone https://github.com/Telecominfraproject/wlan-cloud-lib-poco --branch ${POCO_VERSION} /poco
2020

2121
WORKDIR /poco
2222
RUN mkdir cmake-build
@@ -29,8 +29,8 @@ FROM build-base AS cppkafka-build
2929

3030
ARG CPPKAFKA_VERSION
3131

32-
ADD https://api.github.com/repos/AriliaWireless/cppkafka/git/refs/tags/${CPPKAFKA_VERSION} version.json
33-
RUN git clone https://github.com/AriliaWireless/cppkafka --branch ${CPPKAFKA_VERSION} /cppkafka
32+
ADD https://api.github.com/repos/Telecominfraproject/wlan-cloud-lib-cppkafka/git/refs/tags/${CPPKAFKA_VERSION} version.json
33+
RUN git clone https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka --branch ${CPPKAFKA_VERSION} /cppkafka
3434

3535
WORKDIR /cppkafka
3636
RUN mkdir cmake-build
@@ -43,8 +43,8 @@ FROM build-base AS valijson-build
4343

4444
ARG VALIJASON_VERSION
4545

46-
ADD https://api.github.com/repos/AriliaWireless/valijson/git/refs/tags/${VALIJASON_VERSION} version.json
47-
RUN git clone https://github.com/AriliaWireless/valijson --branch ${VALIJASON_VERSION} /valijson
46+
ADD https://api.github.com/repos/Telecominfraproject/wlan-cloud-lib-valijson/git/refs/tags/${VALIJASON_VERSION} version.json
47+
RUN git clone https://github.com/Telecominfraproject/wlan-cloud-lib-valijson --branch ${VALIJASON_VERSION} /valijson
4848

4949
WORKDIR /valijson
5050
RUN mkdir cmake-build

build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6
1+
7

src/RESTObjects/RESTAPI_ProvObjects.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,9 @@ namespace OpenWifi::ProvObjects {
587587
field_to_json(Obj, "locale", locale);
588588
field_to_json(Obj, "realMacAddress", realMacAddress);
589589
field_to_json(Obj, "doNotAllowOverrides", doNotAllowOverrides);
590+
field_to_json(Obj, "imported", imported);
591+
field_to_json(Obj, "connected", connected);
592+
field_to_json(Obj, "platform", platform);
590593
}
591594

592595
bool InventoryTag::from_json(const Poco::JSON::Object::Ptr &Obj) {
@@ -609,6 +612,9 @@ namespace OpenWifi::ProvObjects {
609612
field_from_json(Obj, "locale", locale);
610613
field_from_json(Obj, "realMacAddress", realMacAddress);
611614
field_from_json(Obj, "doNotAllowOverrides", doNotAllowOverrides);
615+
field_from_json(Obj, "imported", imported);
616+
field_from_json(Obj, "connected", connected);
617+
field_from_json(Obj, "platform", platform);
612618
return true;
613619
} catch (...) {
614620
}

src/RESTObjects/RESTAPI_ProvObjects.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,9 +490,11 @@ namespace OpenWifi::ProvObjects {
490490
std::string locale;
491491
std::string realMacAddress;
492492
bool doNotAllowOverrides = false;
493+
std::uint64_t imported=0;
494+
std::uint64_t connected=0;
495+
std::string platform{"AP"};
493496

494497
void to_json(Poco::JSON::Object &Obj) const;
495-
496498
bool from_json(const Poco::JSON::Object::Ptr &Obj);
497499
};
498500

src/framework/EventBusManager.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ namespace OpenWifi {
1616
KafkaManager()->PostMessage(KafkaTopics::SERVICE_EVENTS, MicroServicePrivateEndPoint(), Msg,
1717
false);
1818
while (Running_) {
19-
Poco::Thread::trySleep((unsigned long)MicroServiceDaemonBusTimer());
20-
if (!Running_)
21-
break;
19+
if(!Poco::Thread::trySleep((unsigned long)MicroServiceDaemonBusTimer())) {
20+
break;
21+
}
2222
Msg = (MicroServiceMakeSystemEventMessage(KafkaTopics::ServiceEvents::EVENT_KEEP_ALIVE));
2323
KafkaManager()->PostMessage(KafkaTopics::SERVICE_EVENTS, MicroServicePrivateEndPoint(),
2424
Msg, false);
@@ -29,19 +29,19 @@ namespace OpenWifi {
2929
};
3030

3131
void EventBusManager::Start() {
32-
poco_information(Logger(), "Starting...");
32+
poco_information(Logger_, "Starting...");
3333
if (KafkaManager()->Enabled()) {
3434
Thread_.start(*this);
3535
}
3636
}
3737

3838
void EventBusManager::Stop() {
3939
if (KafkaManager()->Enabled()) {
40-
poco_information(Logger(), "Stopping...");
40+
poco_information(Logger_, "Stopping...");
4141
Running_ = false;
4242
Thread_.wakeUp();
4343
Thread_.join();
44-
poco_information(Logger(), "Stopped...");
44+
poco_information(Logger_, "Stopped...");
4545
}
4646
}
4747

src/framework/EventBusManager.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ namespace OpenWifi {
2222
return instance_;
2323
}
2424

25-
explicit EventBusManager(Poco::Logger &L);
2625
void run() final;
2726
void Start();
2827
void Stop();

src/framework/KafkaManager.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ namespace OpenWifi {
7979
Utils::SetThreadName("Kafka:Prod");
8080
cppkafka::Configuration Config(
8181
{{"client.id", MicroServiceConfigGetString("openwifi.kafka.client.id", "")},
82-
{"metadata.broker.list",
83-
MicroServiceConfigGetString("openwifi.kafka.brokerlist", "")}});
82+
{"metadata.broker.list",MicroServiceConfigGetString("openwifi.kafka.brokerlist", "")} // ,
83+
// {"send.buffer.bytes", KafkaManager()->KafkaManagerMaximumPayloadSize() }
84+
}
85+
);
8486

8587
AddKafkaSecurity(Config);
8688

@@ -275,6 +277,7 @@ namespace OpenWifi {
275277
int KafkaManager::Start() {
276278
if (!KafkaEnabled_)
277279
return 0;
280+
MaxPayloadSize_ = MicroServiceConfigGetInt("openwifi.kafka.max.payload", 250000);
278281
ConsumerThr_.Start();
279282
ProducerThr_.Start();
280283
return 0;

src/framework/KafkaManager.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,14 @@ namespace OpenWifi {
9494
return ConsumerThr_.UnregisterTopicWatcher(Topic,Id);
9595
}
9696

97+
std::uint64_t KafkaManagerMaximumPayloadSize() const { return MaxPayloadSize_; }
98+
9799
private:
98100
bool KafkaEnabled_ = false;
99101
std::string SystemInfoWrapper_;
100102
KafkaProducer ProducerThr_;
101103
KafkaConsumer ConsumerThr_;
104+
std::uint64_t MaxPayloadSize_ = 250000;
102105

103106
void PartitionAssignment(const cppkafka::TopicPartitionList &partitions);
104107
void PartitionRevocation(const cppkafka::TopicPartitionList &partitions);

0 commit comments

Comments
 (0)