Skip to content

Commit

Permalink
Merge branch 'libnet:master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ivalery111 authored Nov 16, 2024
2 parents 8336ccb + 8a7ea78 commit f57c41f
Show file tree
Hide file tree
Showing 12 changed files with 2,600 additions and 65 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/build-freebsd.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: FreeBSD
name: FreeBSD DISABLED PLEASE HELP

on: [push, pull_request]
# DISABLED DUE TO VM NOT STARTING UP PROPERLY
#on: [push, pull_request]
on: workflow_dispatch

env:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
Expand All @@ -19,15 +21,15 @@ jobs:
os: macos-latest
cc: clang

runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build
# https://github.com/vmactions/freebsd-vm
uses: vmactions/freebsd-vm@v0
uses: vmactions/freebsd-vm@v1
with:
prepare: |
pkg install -y autotools gcc llvm doxygen tree
pkg install -y autotools libtool gcc llvm doxygen tree
run: |
./autogen.sh
./configure --prefix=/usr CC=${{ matrix.cc }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
arch: [x86, x86_64]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: microsoft/[email protected]
- name: Install Npcap
run: |
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ jobs:

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install MacOS dependencies
if: startsWith(matrix.os,'macos')
run: |
brew update
brew install automake tree doxygen
brew install autoconf automake libtool tree doxygen
- name: Install Linux dependencies
if: startsWith(matrix.os,'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y build-essential autoconf automake clang tree doxygen
sudo apt-get install -y build-essential autoconf automake libtool clang tree doxygen
- name: Configure
run: |
./autogen.sh
Expand Down Expand Up @@ -65,17 +65,17 @@ jobs:

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install MacOS dependencies
if: startsWith(matrix.os,'macos')
run: |
brew update
brew install automake tree doxygen cmocka
brew install autoconf automake libtool pkg-config tree doxygen cmocka
- name: Install Linux dependencies
if: startsWith(matrix.os,'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y build-essential autoconf automake tree doxygen libcmocka-dev
sudo apt-get install -y build-essential autoconf automake libtool pkg-config tree doxygen libcmocka-dev
- name: Configure
run: |
if ${{ matrix.cc == 'gcc' }}; then
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Installing dependencies ...
run: |
sudo apt-get update
sudo apt-get install -y build-essential autoconf automake tree doxygen libcmocka-dev
sudo apt-get install -y build-essential autoconf automake pkg-config tree doxygen libcmocka-dev
- name: Creating Makefiles ...
run: |
./autogen.sh
Expand Down
21 changes: 8 additions & 13 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ AC_USE_SYSTEM_EXTENSIONS
# This can still be overwritten with --without-pic
LT_INIT([pic-only])

# Check for pkg-config first, warn if it's not installed
PKG_PROG_PKG_CONFIG

#
# Check for headers
#
Expand All @@ -63,15 +66,7 @@ AC_CHECK_FUNCS([getifaddrs])
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T

AC_MSG_CHECKING(for socklen_t)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/socket.h>
]], [[ socklen_t x; ]])],[have_socklen_t=yes],[have_socklen_t=no])
AS_IF([test "x$have_socklen_t" = "xyes"], [
AC_DEFINE(HAVE_SOCKLEN_T, 1, [define if socklen_t is defined])])
AC_MSG_RESULT($have_socklen_t)
AX_TYPE_SOCKLEN_T

#
# And some custom things
Expand All @@ -85,10 +80,9 @@ AC_SUBST(PKG_CONFIG_CFLAGS)
AC_SUBST(LTLIBOBJS)

# Get link-layer interface type
AC_ARG_WITH(
[link-layer],
[AS_HELP_STRING([--with-link-layer],
[when cross-compiling, one of * from libnet_link_*.c @<:@autodetect@:>@])])
AC_ARG_WITH([link-layer], [
AS_HELP_STRING([--with-link-layer], [
when cross-compiling, one of * from libnet_link_*.c @<:@autodetect@:>@])])

AC_CHECK_HEADERS([net/pfilt.h sys/net/nit.h net/raw.h sys/dlpi.h linux/socket.h])

Expand Down Expand Up @@ -187,6 +181,7 @@ AC_ARG_ENABLE([tests],
AC_MSG_RESULT([$enable_tests])
AM_CONDITIONAL([ENABLE_TESTS], [test "$enable_tests" = "yes"])
AS_IF([test "$enable_tests" = "yes"], [
PKG_CHECK_MODULES([cmocka], [cmocka >= 1.0.0])
AC_DEFINE(LIBNET_ENABLE_TESTS, 1, [Useful define for testing purposes.])
])

Expand Down
Loading

0 comments on commit f57c41f

Please sign in to comment.