Skip to content

Commit

Permalink
add libdict to repo
Browse files Browse the repository at this point in the history
  • Loading branch information
GIC-de committed Dec 12, 2023
1 parent f4204f6 commit bc9ee58
Show file tree
Hide file tree
Showing 51 changed files with 11,386 additions and 47 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Download RtBrick libdict
shell: bash
run: wget https://github.com/rtbrick/libdict/releases/download/1.0.3/libdict-${{matrix.os}}.zip

- name: Install RtBrick libdict
shell: bash
run: unzip libdict-${{matrix.os}}.zip; sudo dpkg -i libdict_1.0.3_amd64.deb; sudo dpkg -i libdict-dev_1.0.3_amd64.deb

- name: Install Dependencies
shell: bash
run: sudo apt install -y libcunit1-dev libncurses-dev libssl-dev libjansson-dev libcmocka-dev libpcap-dev
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,6 @@ jobs:
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

- name: Download RtBrick libdict
shell: bash
run: wget https://github.com/rtbrick/libdict/releases/download/1.0.3/libdict-ubuntu-22.04.zip

- name: Install RtBrick libdict
shell: bash
run: unzip libdict-ubuntu-22.04.zip; sudo dpkg -i libdict_1.0.3_amd64.deb; sudo dpkg -i libdict-dev_1.0.3_amd64.deb

- name: Install Dependencies
shell: bash
run: sudo apt install -y libcunit1-dev libncurses5-dev libssl-dev libjansson-dev libcmocka-dev libpcap-dev
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Download RtBrick libdict
shell: bash
run: wget https://github.com/rtbrick/libdict/releases/download/1.0.3/libdict-${{matrix.os}}.zip

- name: Install RtBrick libdict
shell: bash
run: unzip libdict-${{matrix.os}}.zip; sudo dpkg -i libdict_1.0.3_amd64.deb; sudo dpkg -i libdict-dev_1.0.3_amd64.deb

- name: Install Dependencies
shell: bash
run: sudo apt install -y libcunit1-dev libncurses-dev libssl-dev libjansson-dev libcmocka-dev libpcap-dev
Expand Down
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "..." FORCE)
endif()

# libdict will be statically linked
find_library(libdict NAMES libdict.a REQUIRED)

if(BNGBLASTER_TESTS)
include(CTest)
endif()
Expand Down
2 changes: 2 additions & 0 deletions code/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
include_directories("common/src/")
include_directories("libdict/include/")

add_subdirectory(common)
add_subdirectory(lwip)
add_subdirectory(libdict)
add_subdirectory(bngblaster)
add_subdirectory(lspgen)

Expand Down
6 changes: 6 additions & 0 deletions code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ support.

https://savannah.nongnu.org/projects/lwip/

### libdict

Local fork of libdict:

https://github.com/fmela/libdict

### bngblaster

BNG Blaster directory.
Expand Down
2 changes: 1 addition & 1 deletion code/bngblaster/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ foreach(_file ${BBL_SOURCES})
set_property(SOURCE ${_file} APPEND_STRING PROPERTY COMPILE_FLAGS "-frandom-seed=0x${checksum}")
endforeach()

add_executable(bngblaster ${COMMON_SOURCES} ${BBL_SOURCES})
add_executable(bngblaster ${LIBDICT_SOURCES} ${COMMON_SOURCES} ${BBL_SOURCES})

set(PLATFORM_SPECIFIC_LIBS "-lpthread")
string(APPEND CMAKE_C_FLAGS "-pthread")
Expand Down
3 changes: 1 addition & 2 deletions code/bngblaster/fuzzing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ set(PROPERTIES
include_directories("../src")
include_directories("../../common/src")

find_library(libdict NAMES libdict.a REQUIRED)
set(LINK_LIBS ${libdict} m)
set(LINK_LIBS m)
add_executable(fuzz-protocols-decode protocols_decode.c ../src/bbl_protocols.c)
target_link_libraries(fuzz-protocols-decode ${LINK_LIBS})
target_compile_options(fuzz-protocols-decode PRIVATE -Wall -Wextra -pedantic)
1 change: 1 addition & 0 deletions code/libdict/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BasedOnStyle: None
9 changes: 9 additions & 0 deletions code/libdict/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
words-*
shuffle.pl
bin/*
build/
*.log
*.pdf
*.aux
.*.swp
*.pdf
13 changes: 13 additions & 0 deletions code/libdict/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# list of source files.
FILE(GLOB LIBDICT_SOURCES src/*.c)

# Deterministic randomness for symbol name creation
list(SORT LIBDICT_SOURCES)
foreach(_file ${LIBDICT_SOURCES})
file(SHA1 ${_file} checksum)
string(SUBSTRING ${checksum} 0 8 checksum)
set_property(SOURCE ${_file} APPEND_STRING PROPERTY COMPILE_FLAGS "-frandom-seed=0x${checksum}")
endforeach()

# Export variable one level up
set(LIBDICT_SOURCES ${LIBDICT_SOURCES} PARENT_SCOPE)
Loading

0 comments on commit bc9ee58

Please sign in to comment.