Browse Source

MT#55283 rename module

Change-Id: I81f5370655af00d3a99593eb17cb1d62d961370c
pull/2035/head
Richard Fuchs 1 week ago
parent
commit
b9d1509244
29 changed files with 56 additions and 55 deletions
  1. +1
    -1
      daemon/call.c
  2. +1
    -1
      daemon/crypto.c
  3. +1
    -1
      daemon/kernel.c
  4. +1
    -1
      daemon/media_socket.c
  5. +1
    -1
      daemon/nftables.c
  6. +1
    -1
      daemon/recording.c
  7. +2
    -2
      debian/ngcp-rtpengine-daemon.postinst
  8. +1
    -1
      debian/ngcp-rtpengine-kernel-dkms.dkms
  9. +1
    -1
      debian/ngcp-rtpengine-kernel-dkms.prerm
  10. +1
    -1
      docs/architecture.md
  11. +3
    -3
      docs/compiling_and_installing.md
  12. +8
    -8
      docs/usage.md
  13. +4
    -4
      el/rtpengine.init
  14. +4
    -4
      el/rtpengine.spec
  15. +1
    -1
      include/call.h
  16. +1
    -1
      include/kernel.h
  17. +1
    -1
      include/media_socket.h
  18. +2
    -2
      kernel-module/Makefile
  19. +12
    -11
      kernel-module/nft_rtpengine.c
  20. +0
    -0
      kernel-module/nft_rtpengine.h
  21. +2
    -0
      kernel-module/nft_rtpengine.modules.load.d
  22. +0
    -2
      kernel-module/xt_RTPENGINE.modules.load.d
  23. +1
    -1
      lib/socket.c
  24. +1
    -1
      pkg/deb/old-dkms/dkms.conf.in
  25. +1
    -1
      pkg/deb/old-dkms/rtpengine-kernel-dkms.prerm
  26. +1
    -1
      t/test-kernel-module.c
  27. +1
    -1
      tests/kernel-module-test.c
  28. +1
    -1
      utils/kplay-test.c
  29. +1
    -1
      utils/kplay-test2.c

+ 1
- 1
daemon/call.c View File

@ -39,7 +39,7 @@
#include "audio_player.h" #include "audio_player.h"
#include "bufferpool.h" #include "bufferpool.h"
#include "xt_RTPENGINE.h"
#include "nft_rtpengine.h"
struct iterator_helper { struct iterator_helper {
uint64_t count; uint64_t count;


+ 1
- 1
daemon/crypto.c View File

@ -16,7 +16,7 @@
#include "ssllib.h" #include "ssllib.h"
#include "types.h" #include "types.h"
#include "xt_RTPENGINE.h"
#include "nft_rtpengine.h"
static int aes_cm_encrypt_rtp(struct crypto_context *, const struct rtp_header *, str *, uint32_t); static int aes_cm_encrypt_rtp(struct crypto_context *, const struct rtp_header *, str *, uint32_t);
static int aes_cm_encrypt_rtcp(struct crypto_context *, const struct rtcp_packet *, str *, uint32_t); static int aes_cm_encrypt_rtcp(struct crypto_context *, const struct rtcp_packet *, str *, uint32_t);


+ 1
- 1
daemon/kernel.c View File

@ -16,7 +16,7 @@
#include "main.h" #include "main.h"
#include "statistics.h" #include "statistics.h"
#include "xt_RTPENGINE.h"
#include "nft_rtpengine.h"
#define PREFIX "/proc/rtpengine" #define PREFIX "/proc/rtpengine"


+ 1
- 1
daemon/media_socket.c View File

@ -33,7 +33,7 @@
#include "janus.h" #include "janus.h"
#include "bufferpool.h" #include "bufferpool.h"
#include "xt_RTPENGINE.h"
#include "nft_rtpengine.h"
#ifndef PORT_RANDOM_MIN #ifndef PORT_RANDOM_MIN
#define PORT_RANDOM_MIN 6 #define PORT_RANDOM_MIN 6


+ 1
- 1
daemon/nftables.c View File

@ -17,7 +17,7 @@
#include "netfilter_api.h" #include "netfilter_api.h"
#include "helpers.h" #include "helpers.h"
#include "xt_RTPENGINE.h"
#include "nft_rtpengine.h"
#define HANDLER_COMMENT "rtpengine UDP handler" #define HANDLER_COMMENT "rtpengine UDP handler"


+ 1
- 1
daemon/recording.c View File

@ -23,7 +23,7 @@
#include "call_interfaces.h" #include "call_interfaces.h"
#include "media_player.h" #include "media_player.h"
#include "xt_RTPENGINE.h"
#include "nft_rtpengine.h"
struct rec_pcap_format { struct rec_pcap_format {
int linktype; int linktype;


+ 2
- 2
debian/ngcp-rtpengine-daemon.postinst View File

@ -3,7 +3,7 @@
set -e set -e
default=/etc/default/ngcp-rtpengine-daemon default=/etc/default/ngcp-rtpengine-daemon
modname=xt_RTPENGINE
modname=nft_rtpengine
if [ -x "$(which ngcp-virt-identify)" ]; then if [ -x "$(which ngcp-virt-identify)" ]; then
if ngcp-virt-identify --type container; then if ngcp-virt-identify --type container; then
@ -52,7 +52,7 @@ if [ "$1" = configure ]; then
# set up modprobe.d fragment for auto-load usage # set up modprobe.d fragment for auto-load usage
if ! [ -f /etc/modprobe.d/rtpengine.conf ] || grep -q DPKG-GENERATED /etc/modprobe.d/rtpengine.conf; then if ! [ -f /etc/modprobe.d/rtpengine.conf ] || grep -q DPKG-GENERATED /etc/modprobe.d/rtpengine.conf; then
OPTIONS="options xt_RTPENGINE proc_mask=0x7"
OPTIONS="options nft_rtpengine proc_mask=0x7"
PUID=$(id -u rtpengine 2> /dev/null) PUID=$(id -u rtpengine 2> /dev/null)
test -z "$PUID" || OPTIONS="$OPTIONS proc_uid=$PUID" test -z "$PUID" || OPTIONS="$OPTIONS proc_uid=$PUID"


+ 1
- 1
debian/ngcp-rtpengine-kernel-dkms.dkms View File

@ -6,5 +6,5 @@ BUILD_EXCLUSIVE_KERNEL_MIN="4.4"
MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build RTPENGINE_VERSION=\"${PACKAGE_VERSION}\"" MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build RTPENGINE_VERSION=\"${PACKAGE_VERSION}\""
CLEAN="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean" CLEAN="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean"
AUTOINSTALL=yes AUTOINSTALL=yes
BUILT_MODULE_NAME[0]="xt_RTPENGINE"
BUILT_MODULE_NAME[0]="nft_rtpengine"
DEST_MODULE_LOCATION[0]=/extra DEST_MODULE_LOCATION[0]=/extra

+ 1
- 1
debian/ngcp-rtpengine-kernel-dkms.prerm View File

@ -14,7 +14,7 @@ else
# make sure it's not running # make sure it's not running
if [ -x /etc/init.d/ngcp-rtpengine-daemon ] ; then if [ -x /etc/init.d/ngcp-rtpengine-daemon ] ; then
invoke-rc.d ngcp-rtpengine-daemon stop || true invoke-rc.d ngcp-rtpengine-daemon stop || true
rmmod "xt_RTPENGINE" 2>/dev/null || true
rmmod "nft_rtpengine" 2>/dev/null || true
fi fi
fi fi


+ 1
- 1
docs/architecture.md View File

@ -220,7 +220,7 @@ This allows packet handling on multiple ports and streams belonging to the same
Kernel forwarding Kernel forwarding
----------------- -----------------
The kernel forwarding of RTP/RTCP packets is handled in the `xt_RTPENGINE.c` / `xt_RTPENGINE.h`.
The kernel forwarding of RTP/RTCP packets is handled in the `nft_rtpengine.c` / `nft_rtpengine.h`.
The linkage between user-space and kernel module is in the `kernelize_one()` (`media_socket.c`),\ The linkage between user-space and kernel module is in the `kernelize_one()` (`media_socket.c`),\
which populates the struct that is passed to the kernel module. which populates the struct that is passed to the kernel module.


+ 3
- 3
docs/compiling_and_installing.md View File

@ -110,11 +110,11 @@ test suite.
must be present in `/lib/modules/4.19-1-amd64/build/`. The last component of this path (`build`) must be present in `/lib/modules/4.19-1-amd64/build/`. The last component of this path (`build`)
is usually a symlink somewhere into `/usr/src/`, which is fine. is usually a symlink somewhere into `/usr/src/`, which is fine.
Successful compilation of the module will produce the file `xt_RTPENGINE.ko`. The module can be inserted
into the running kernel manually through `insmod xt_RTPENGINE.ko` (which will result in an error if
Successful compilation of the module will produce the file `nft_rtpengine.ko`. The module can be inserted
into the running kernel manually through `insmod nft_rtpengine.ko` (which will result in an error if
depending modules aren't loaded, for example the `x_tables` module), but it's recommended to copy the depending modules aren't loaded, for example the `x_tables` module), but it's recommended to copy the
module into `/lib/modules/$VERSION/updates/`, followed by running `depmod -a`. This copying is performed module into `/lib/modules/$VERSION/updates/`, followed by running `depmod -a`. This copying is performed
on `make install`. After this, the module can be loaded by issuing `modprobe xt_RTPENGINE`.
on `make install`. After this, the module can be loaded by issuing `modprobe nft_rtpengine`.
* `recording-daemon` * `recording-daemon`


+ 8
- 8
docs/usage.md View File

@ -27,14 +27,14 @@ eliminated, CPU usage greatly reduced and the number of concurrent calls possibl
In-kernel packet forwarding is implemented as an *nftables* module In-kernel packet forwarding is implemented as an *nftables* module
(or more precisely, an *x\_tables* module). As such, it requires two parts (or more precisely, an *x\_tables* module). As such, it requires two parts
for proper operation. One part is the actual kernel module called for proper operation. One part is the actual kernel module called
`xt_RTPENGINE`. The second part is a rule in the local *nftables* chains that
`nft_rtpengine`. The second part is a rule in the local *nftables* chains that
gets hit by UDP packets so that they can be processed by the kernel module. gets hit by UDP packets so that they can be processed by the kernel module.
### Overview ### ### Overview ###
In short, the prerequisites for in-kernel packet forwarding are: In short, the prerequisites for in-kernel packet forwarding are:
1. The `xt_RTPENGINE` kernel module must be loaded. The module supports
1. The `nft_rtpengine` kernel module must be loaded. The module supports
auto-loading when correctly installed. auto-loading when correctly installed.
2. A rule added to an *nftables* chain that gets called by an *input* hook in 2. A rule added to an *nftables* chain that gets called by an *input* hook in
the *filter* table, which sends packets the *filter* table, which sends packets
@ -76,14 +76,14 @@ Each forwarding table can be thought of a separate proxy instance. Each running
running instance of the daemon at any given time. In the most common setup, there will be only a single running instance of the daemon at any given time. In the most common setup, there will be only a single
instance of the daemon running and there will be only a single forwarding table in use, with ID zero. instance of the daemon running and there will be only a single forwarding table in use, with ID zero.
The kernel module can be loaded with the command `modprobe xt_RTPENGINE`. It
The kernel module can be loaded with the command `modprobe nft_rtpengine`. It
isn't normally necessary to do this explicitly or manually as the module is isn't normally necessary to do this explicitly or manually as the module is
automatically loaded when the appropriate *nftables* rule is created (see automatically loaded when the appropriate *nftables* rule is created (see
below). The module supports a few options (see `modinfo -p xt_RTPENGINE`) which
below). The module supports a few options (see `modinfo -p nft_rtpengine`) which
can either be set at the `modprobe` command line, and/or through an entry in can either be set at the `modprobe` command line, and/or through an entry in
`/etc/modprobe.d/` (by default `/etc/modprobe.d/rtpengine.conf`) for options to `/etc/modprobe.d/` (by default `/etc/modprobe.d/rtpengine.conf`) for options to
be set when auto-loading the module. Options can be inspected during runtime be set when auto-loading the module. Options can be inspected during runtime
via `/sys/module/xt_RTPENGINE/parameters/`.
via `/sys/module/nft_rtpengine/parameters/`.
With the module loaded, a new With the module loaded, a new
directory will appear in `/proc/`, namely `/proc/rtpengine/`. After loading, the directory will contain directory will appear in `/proc/`, namely `/proc/rtpengine/`. After loading, the directory will contain
@ -116,7 +116,7 @@ Manual creation of forwarding tables is normally not required as the daemon will
deletion of tables may be required after shutdown of the daemon or before a restart to ensure that the deletion of tables may be required after shutdown of the daemon or before a restart to ensure that the
daemon can create the table it wants to use. daemon can create the table it wants to use.
The kernel module can be unloaded through `rmmod xt_RTPENGINE`, however this only works if no forwarding
The kernel module can be unloaded through `rmmod nft_rtpengine`, however this only works if no forwarding
table currently exists and no *nftables* rule currently exists. table currently exists and no *nftables* rule currently exists.
### The *nftables* Rule ### ### The *nftables* Rule ###
@ -167,11 +167,11 @@ A cheat sheet with various related commands is below:
# Load module: this only needs to be done once after system # Load module: this only needs to be done once after system
# (re-) boot, but can be omitted if auto-load is working correctly # (re-) boot, but can be omitted if auto-load is working correctly
modprobe xt_RTPENGINE
modprobe nft_rtpengine
# Load module with some options set # Load module with some options set
# (usually handled via /etc/modprobe.d/rtpengine.conf) # (usually handled via /etc/modprobe.d/rtpengine.conf)
modprobe xt_RTPENGINE proc_uid=1234 proc_gid=5678
modprobe nft_rtpengine proc_uid=1234 proc_gid=5678
# Create nftables rules: This normally happens automatically during # Create nftables rules: This normally happens automatically during
# startup. Kernel table ID and nftables chain names are taken from # startup. Kernel table ID and nftables chain names are taken from


+ 4
- 4
el/rtpengine.init View File

@ -62,16 +62,16 @@ start() {
build_opts build_opts
if [[ $MODULE == 1 ]];then if [[ $MODULE == 1 ]];then
echo "Loading module for in-kernel packet forwarding" echo "Loading module for in-kernel packet forwarding"
rmmod xt_RTPENGINE 2> /dev/null
rmmod nft_rtpengine 2> /dev/null
if [[ -n "$SET_USER" ]];then if [[ -n "$SET_USER" ]];then
if [[ -n "$SET_GROUP" ]];then if [[ -n "$SET_GROUP" ]];then
proc_gid="$(grep "^$SET_GROUP:" /etc/group | cut -f3 -d:)" proc_gid="$(grep "^$SET_GROUP:" /etc/group | cut -f3 -d:)"
else else
proc_gid="$(id "$SET_USER" -g)" proc_gid="$(id "$SET_USER" -g)"
fi fi
modprobe xt_RTPENGINE proc_uid="$(id "$SET_USER" -u)" proc_gid="$proc_gid"
modprobe nft_rtpengine proc_uid="$(id "$SET_USER" -u)" proc_gid="$proc_gid"
else else
modprobe xt_RTPENGINE
modprobe nft_rtpengine
fi fi
if firewall-cmd --state 2>/dev/null ; then if firewall-cmd --state 2>/dev/null ; then
# Using firewalld # Using firewalld
@ -141,7 +141,7 @@ stop() {
$fw -X rtpengine $fw -X rtpengine
done done
fi fi
rmmod xt_RTPENGINE
rmmod nft_rtpengine
rm -f "$cachefile" rm -f "$cachefile"
fi fi


+ 4
- 4
el/rtpengine.spec View File

@ -200,10 +200,10 @@ install -D -p -m644 kernel-module/Makefile \
%{buildroot}%{_usrsrc}/%{name}-%{version}-%{release}/Makefile %{buildroot}%{_usrsrc}/%{name}-%{version}-%{release}/Makefile
install -D -p -m755 kernel-module/gen-rtpengine-kmod-flags \ install -D -p -m755 kernel-module/gen-rtpengine-kmod-flags \
%{buildroot}%{_usrsrc}/%{name}-%{version}-%{release}/gen-rtpengine-kmod-flags %{buildroot}%{_usrsrc}/%{name}-%{version}-%{release}/gen-rtpengine-kmod-flags
install -D -p -m644 kernel-module/xt_RTPENGINE.c \
%{buildroot}%{_usrsrc}/%{name}-%{version}-%{release}/xt_RTPENGINE.c
install -D -p -m644 kernel-module/xt_RTPENGINE.h \
%{buildroot}%{_usrsrc}/%{name}-%{version}-%{release}/xt_RTPENGINE.h
install -D -p -m644 kernel-module/nft_rtpengine.c \
%{buildroot}%{_usrsrc}/%{name}-%{version}-%{release}/nft_rtpengine.c
install -D -p -m644 kernel-module/nft_rtpengine.h \
%{buildroot}%{_usrsrc}/%{name}-%{version}-%{release}/nft_rtpengine.h
install -D -p -m644 kernel-module/common_stats.h \ install -D -p -m644 kernel-module/common_stats.h \
%{buildroot}%{_usrsrc}/%{name}-%{version}-%{release}/common_stats.h %{buildroot}%{_usrsrc}/%{name}-%{version}-%{release}/common_stats.h
install -D -p -m644 kernel-module/*.inc \ install -D -p -m644 kernel-module/*.inc \


+ 1
- 1
include/call.h View File

@ -21,7 +21,7 @@
#include "t38.h" #include "t38.h"
#include "types.h" #include "types.h"
#include "xt_RTPENGINE.h"
#include "nft_rtpengine.h"
#define UNDEFINED ((unsigned int) -1) #define UNDEFINED ((unsigned int) -1)


+ 1
- 1
include/kernel.h View File

@ -8,7 +8,7 @@
#include "containers.h" #include "containers.h"
#include "auxlib.h" #include "auxlib.h"
#include "xt_RTPENGINE.h"
#include "nft_rtpengine.h"
#define UNINIT_IDX ((unsigned int) -1) #define UNINIT_IDX ((unsigned int) -1)


+ 1
- 1
include/media_socket.h View File

@ -14,7 +14,7 @@
#include "containers.h" #include "containers.h"
#include "codec.h" #include "codec.h"
#include "xt_RTPENGINE.h"
#include "nft_rtpengine.h"
#include "common_stats.h" #include "common_stats.h"
struct media_packet; struct media_packet;


+ 2
- 2
kernel-module/Makefile View File

@ -8,7 +8,7 @@ include $(M)/rtpengine-kmod.mk
ccflags-y += -DRTPENGINE_VERSION="\"$(RTPENGINE_VERSION)\"" ccflags-y += -DRTPENGINE_VERSION="\"$(RTPENGINE_VERSION)\""
obj-m += xt_RTPENGINE.o
obj-m += nft_rtpengine.o
.PHONY: modules clean install .PHONY: modules clean install
@ -20,7 +20,7 @@ clean:
rm -f rtpengine-kmod.mk rm -f rtpengine-kmod.mk
install: install:
install -D xt_RTPENGINE.ko $(DESTDIR)/lib/modules/$(shell uname -r)/updates/xt_RTPENGINE.ko
install -D nft_rtpengine.ko $(DESTDIR)/lib/modules/$(shell uname -r)/updates/nft_rtpengine.ko
depmod -a depmod -a
$(M)/rtpengine-kmod.mk: $(M)/rtpengine-kmod.mk:


kernel-module/xt_RTPENGINE.c → kernel-module/nft_rtpengine.c View File


kernel-module/xt_RTPENGINE.h → kernel-module/nft_rtpengine.h View File


+ 2
- 0
kernel-module/nft_rtpengine.modules.load.d View File

@ -0,0 +1,2 @@
# Load nft_rtpengine kernel module at boot.
nft_rtpengine

+ 0
- 2
kernel-module/xt_RTPENGINE.modules.load.d View File

@ -1,2 +0,0 @@
# Load xt_RTPENGINE kernel module at boot.
xt_RTPENGINE

+ 1
- 1
lib/socket.c View File

@ -9,7 +9,7 @@
#include <sys/socket.h> #include <sys/socket.h>
#include "str.h" #include "str.h"
#include "auxlib.h" #include "auxlib.h"
#include "xt_RTPENGINE.h"
#include "nft_rtpengine.h"
#include "log.h" #include "log.h"
static bool __ip4_addr_parse(sockaddr_t *dst, const char *src); static bool __ip4_addr_parse(sockaddr_t *dst, const char *src);


+ 1
- 1
pkg/deb/old-dkms/dkms.conf.in View File

@ -3,5 +3,5 @@ PACKAGE_VERSION="__VERSION__"
MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build RTPENGINE_VERSION=\"__VERSION__\"" MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build RTPENGINE_VERSION=\"__VERSION__\""
CLEAN="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean" CLEAN="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean"
AUTOINSTALL=yes AUTOINSTALL=yes
BUILT_MODULE_NAME[0]="xt_RTPENGINE"
BUILT_MODULE_NAME[0]="nft_rtpengine"
DEST_MODULE_LOCATION[0]=/extra DEST_MODULE_LOCATION[0]=/extra

+ 1
- 1
pkg/deb/old-dkms/rtpengine-kernel-dkms.prerm View File

@ -4,7 +4,7 @@ set -e
package=rtpengine-kernel-dkms package=rtpengine-kernel-dkms
name=rtpengine name=rtpengine
modname=xt_RTPENGINE
modname=nft_rtpengine
version=$(dpkg-query -W -f="\${Version}" "$package" \ version=$(dpkg-query -W -f="\${Version}" "$package" \
|rev|cut -d- -f2-|rev|cut -d':' -f2|tr -d "\n") |rev|cut -d- -f2-|rev|cut -d':' -f2|tr -d "\n")


+ 1
- 1
t/test-kernel-module.c View File

@ -1,6 +1,6 @@
#include <assert.h> #include <assert.h>
#include "kernel.h" #include "kernel.h"
#include "../kernel-module/xt_RTPENGINE.h"
#include "../kernel-module/nft_rtpengine.h"
int main(void) { int main(void) {
int ret; int ret;


+ 1
- 1
tests/kernel-module-test.c View File

@ -11,7 +11,7 @@
#include <string.h> #include <string.h>
#include <signal.h> #include <signal.h>
#include <errno.h> #include <errno.h>
#include "xt_RTPENGINE.h"
#include "nft_rtpengine.h"
#define NUM_SOCKETS 41 #define NUM_SOCKETS 41
#define PORT_BASE 36000 #define PORT_BASE 36000


+ 1
- 1
utils/kplay-test.c View File

@ -11,7 +11,7 @@
#include <stdbool.h> #include <stdbool.h>
#define atomic64 uint64_t #define atomic64 uint64_t
#include "../kernel-module/xt_RTPENGINE.h"
#include "../kernel-module/nft_rtpengine.h"
int main() { int main() {
int fd = open("/proc/rtpengine/control", O_WRONLY); int fd = open("/proc/rtpengine/control", O_WRONLY);


+ 1
- 1
utils/kplay-test2.c View File

@ -12,7 +12,7 @@
#include <sys/mman.h> #include <sys/mman.h>
#define atomic64 uint64_t #define atomic64 uint64_t
#include "../kernel-module/xt_RTPENGINE.h"
#include "../kernel-module/nft_rtpengine.h"
#define PAGE_SIZE 4096 #define PAGE_SIZE 4096


Loading…
Cancel
Save