Skip to content

Commit

Permalink
Merge pull request #128 from polycube-network/pr/improve_firewall
Browse files Browse the repository at this point in the history
improve firewall - rules management
  • Loading branch information
frisso committed May 21, 2019
2 parents f516714 + 51b562f commit a434057
Show file tree
Hide file tree
Showing 59 changed files with 2,410 additions and 549 deletions.
20 changes: 20 additions & 0 deletions src/services/pcn-firewall/datamodel/firewall.yang
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,26 @@ module firewall {
}
}

action insert {
input {
leaf id {
type uint32;
}
uses "firewall:rule-fields";
}
output {
leaf id {
type uint32;
}
}
}

action delete {
input {
uses "firewall:rule-fields";
}
}

action reset-counters {
description "Reset the counters to 0 for the chain.";
output {
Expand Down
24 changes: 14 additions & 10 deletions src/services/pcn-firewall/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,33 @@ include(${PROJECT_SOURCE_DIR}/cmake/LoadFileAsVariable.cmake)

aux_source_directory(serializer SERIALIZER_SOURCES)
aux_source_directory(api API_SOURCES)
aux_source_directory(default-src SRC_SOURCES)
aux_source_directory(modules MODULES)
aux_source_directory(base BASE_SOURCES)

include_directories(serializer)
include_directories(interface)
include_directories(default-src)
include_directories(modules)

if (NOT DEFINED POLYCUBE_STANDALONE_SERVICE OR POLYCUBE_STANDALONE_SERVICE)
find_package(PkgConfig REQUIRED)
pkg_check_modules(POLYCUBE libpolycube)
include_directories(${POLYCUBE_INCLUDE_DIRS})
endif(NOT DEFINED POLYCUBE_STANDALONE_SERVICE OR POLYCUBE_STANDALONE_SERVICE)

# Needed to load files as variables
include_directories(${CMAKE_CURRENT_BINARY_DIR})

add_library(pcn-firewall SHARED
${SERIALIZER_SOURCES}
${API_SOURCES}
${SRC_SOURCES}
${MODULES}
${BASE_SOURCES}
Chain.cpp
ChainRule.cpp
ChainStats.cpp
SessionTable.cpp
Firewall.cpp
Firewall-lib.cpp
Utils.cpp)
Utils.cpp
Firewall-lib.cpp)

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

# load datamodel in a variable
load_file_as_variable(pcn-firewall ../datamodel/firewall.yang firewall_datamodel)
load_file_as_variable(pcn-firewall
../datamodel/firewall.yang
firewall_datamodel)

target_link_libraries(pcn-firewall
polycube
uuid)
target_link_libraries(pcn-firewall ${POLYCUBE_LIBRARIES})

# Specify shared library install directory

Expand Down

0 comments on commit a434057

Please sign in to comment.