Skip to content

Commit a434057

Browse files
authored
Merge pull request #128 from polycube-network/pr/improve_firewall
improve firewall - rules management
2 parents f516714 + 51b562f commit a434057

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+2410
-549
lines changed

src/services/pcn-firewall/datamodel/firewall.yang

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,26 @@ module firewall {
230230
}
231231
}
232232

233+
action insert {
234+
input {
235+
leaf id {
236+
type uint32;
237+
}
238+
uses "firewall:rule-fields";
239+
}
240+
output {
241+
leaf id {
242+
type uint32;
243+
}
244+
}
245+
}
246+
247+
action delete {
248+
input {
249+
uses "firewall:rule-fields";
250+
}
251+
}
252+
233253
action reset-counters {
234254
description "Reset the counters to 0 for the chain.";
235255
output {

src/services/pcn-firewall/src/CMakeLists.txt

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,33 @@ include(${PROJECT_SOURCE_DIR}/cmake/LoadFileAsVariable.cmake)
22

33
aux_source_directory(serializer SERIALIZER_SOURCES)
44
aux_source_directory(api API_SOURCES)
5-
aux_source_directory(default-src SRC_SOURCES)
65
aux_source_directory(modules MODULES)
6+
aux_source_directory(base BASE_SOURCES)
77

88
include_directories(serializer)
9-
include_directories(interface)
10-
include_directories(default-src)
119
include_directories(modules)
1210

11+
if (NOT DEFINED POLYCUBE_STANDALONE_SERVICE OR POLYCUBE_STANDALONE_SERVICE)
12+
find_package(PkgConfig REQUIRED)
13+
pkg_check_modules(POLYCUBE libpolycube)
14+
include_directories(${POLYCUBE_INCLUDE_DIRS})
15+
endif(NOT DEFINED POLYCUBE_STANDALONE_SERVICE OR POLYCUBE_STANDALONE_SERVICE)
16+
1317
# Needed to load files as variables
1418
include_directories(${CMAKE_CURRENT_BINARY_DIR})
1519

1620
add_library(pcn-firewall SHARED
1721
${SERIALIZER_SOURCES}
1822
${API_SOURCES}
19-
${SRC_SOURCES}
2023
${MODULES}
24+
${BASE_SOURCES}
2125
Chain.cpp
2226
ChainRule.cpp
2327
ChainStats.cpp
2428
SessionTable.cpp
2529
Firewall.cpp
26-
Firewall-lib.cpp
27-
Utils.cpp)
30+
Utils.cpp
31+
Firewall-lib.cpp)
2832

2933
# load ebpf datapath code in std::string variables
3034
load_file_as_variable(pcn-firewall datapaths/Firewall_ActionLookup_dp.c firewall_code_actionlookup)
@@ -41,11 +45,11 @@ load_file_as_variable(pcn-firewall datapaths/Firewall_Parser_dp.c firewall_code_
4145
load_file_as_variable(pcn-firewall datapaths/Firewall_TcpFlagsLookup_dp.c firewall_code_tcpflagslookup)
4246

4347
# load datamodel in a variable
44-
load_file_as_variable(pcn-firewall ../datamodel/firewall.yang firewall_datamodel)
48+
load_file_as_variable(pcn-firewall
49+
../datamodel/firewall.yang
50+
firewall_datamodel)
4551

46-
target_link_libraries(pcn-firewall
47-
polycube
48-
uuid)
52+
target_link_libraries(pcn-firewall ${POLYCUBE_LIBRARIES})
4953

5054
# Specify shared library install directory
5155

0 commit comments

Comments
 (0)