With splitting off UDP support from the rtipv4 kernel module and the
advent of RT-TCP RTnet now supports three distinct protocols: packet,
udp and tcp.

This patch introduces a new variable in rtnet.conf: RT_PROTOCOLS. It
is set to "packet udp" by default. The rtnet loading script takes care
of loading the desired protocol drivers.

Signed-off-by: Sebastian Smolorz <[email protected]>
---
 tools/rtnet.conf.in |    3 +++
 tools/rtnet.in      |   12 +++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/tools/rtnet.conf.in b/tools/rtnet.conf.in
index 28a5eae..32f384d 100644
--- a/tools/rtnet.conf.in
+++ b/tools/rtnet.conf.in
@@ -29,6 +29,9 @@ NETMASK=""
 # Start realtime loopback device ("yes" or "no")
 RT_LOOPBACK="yes"
 
+# Use the following RTnet protocol drivers
+RT_PROTOCOLS="udp packet"
+
 # Start capturing interface ("yes" or "no")
 RTCAP="no"
 
diff --git a/tools/rtnet.in b/tools/rtnet.in
index 251fada..5f797a6 100755
--- a/tools/rtnet.in
+++ b/tools/rtnet.in
@@ -33,9 +33,12 @@ EOF
 init_rtnet() {
     insmod $RTNET_MOD/rtnet$MODULE_EXT >/dev/null || exit 1
     insmod $RTNET_MOD/rtipv4$MODULE_EXT >/dev/null || exit 1
-    insmod $RTNET_MOD/rtpacket$MODULE_EXT >/dev/null || exit 1
     insmod $RTNET_MOD/$RT_DRIVER$MODULE_EXT $RT_DRIVER_OPTIONS >/dev/null || 
exit 1
 
+    for PROTOCOL in $RT_PROTOCOLS; do
+        insmod $RTNET_MOD/rt$PROTOCOL$MODULE_EXT >/dev/null || exit 1
+    done
+
     if [ $RT_LOOPBACK = "yes" ]; then
         insmod $RTNET_MOD/rt_loopback$MODULE_EXT >/dev/null || exit 1
     fi
@@ -307,7 +310,7 @@ case "$1" in
         $RTIFCONFIG rteth0 down 2>/dev/null
         $RTIFCONFIG rtlo down 2>/dev/null
 
-        rmmod tdma rtmac rtcfg rtcap rt_loopback $RT_DRIVER rtpacket rtipv4 
rtnet 2>/dev/null
+        rmmod tdma rtmac rtcfg rtcap rt_loopback $RT_DRIVER rtpacket rtudp 
rttcp rtipv4 rtnet 2>/dev/null
         ;;
 
     master)
@@ -329,7 +332,10 @@ case "$1" in
     loopback)
         insmod $RTNET_MOD/rtnet$MODULE_EXT >/dev/null || exit 1
         insmod $RTNET_MOD/rtipv4$MODULE_EXT >/dev/null || exit 1
-        insmod $RTNET_MOD/rtpacket$MODULE_EXT >/dev/null || exit 1
+
+        for PROTOCOL in $RT_PROTOCOLS; do
+            insmod $RTNET_MOD/rt$PROTOCOL$MODULE_EXT >/dev/null || exit 1
+        done
 
         insmod $RTNET_MOD/rt_loopback$MODULE_EXT >/dev/null || exit 1
 
-- 
Sebastian

------------------------------------------------------------------------------
_______________________________________________
RTnet-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rtnet-developers

Reply via email to