Back to home page
Back to previous page

Author: R. Koucha
Last update: 27-Jan-2011

SourceForge.net Logo
Support This Project

UDP console

(UDPC)



Introduction
Overview
Internals
Usage
Examples
Download
Installation & build
About the author
Related links


Introduction

UDPC is a Linux console based on UDP (User Datagram Protocol) and UDP-lite. It captures and displays on its standard output the messages generated by the kernel (i.e. the messages from printk() and vprintk() kernel services).


Overview

The principle of UDPC is depicted in the following figure :

u

On the local system, the kernel module udpc.ko must be loaded to redirect the kernel messages to the UDPC server. The IP address and the UDP port of the UDPC server are configured by writing into /proc/udpc as shown in the examples.


Internals

The software consists of an UDPC server listening on a given UDP port passed as parameter (option -p) and a kernel module udpc.ko capturing the kernel messages and redirecting them to the UDPC server. The details are shown on the following figure :

u

The kernel module registers to the Linux console subsystem. Each kernel messages are sent from the latter to all the registered consoles. In the figure, they are sent to the serial driver for the local console and to the udpc.ko kernel module. The latter actually provided a callback which stores the messages in internal buffers. The kernel thread udpc picks them and sends them to the remote UDPC server through the UDP/IP stack. Then, the UDPC server displays them on its standard output.

To know the IP address as well as the UDP port of the UDPC server, the entry /proc/udpc is provided by the udpc.ko module to get or set those information:

The configuration in /proc/udpc is a set of colon separated "name=value" where name can be:

Those examples show how to use /proc/udpc.


Usage

The command line to launch UDPC looks like:

udpc [ -p port ] [ -h ] [ -V ]

The options are:

-p UDP_port | --port=UDP_port
UDP port from which the kernel messages are received (default is 13).

-h | --help

Display the help of the command (subset of this man page).

-V | --version
Display the version of the software.


Examples

The following example shows udpc listening on UDP port 1042 :

         $ udpc -p 1042
         Listening on UDP port 1042

If the UDPC server is at IP address 135.120.137.22, the corresponding kernel module is configured as follow :

         > cat /proc/udpc
         ip=135.120.137.22:port=23
         > echo "ip=135.120.137.22:port=1042" > /proc/udpc
         > cat /proc/udpc
         ip=135.120.137.22:port=1042

The following example shows udpc listening on UDP-lite port 2023 :

         $ udpc -l -p 2023
         Listening on UDP-lite port 2023

The corresponding kernel module is configured as follow if the UDPC server is at address 135.120.137.74 and the checksum coverage of the UDP-lite packets is 8 bytes:

         > cat /proc/udpc
         ip=135.120.137.22:port=23
         > echo "ip=135.120.137.74:port=2023:lite=8" > /proc/udpc
         > cat /proc/udpc
         ip=135.120.137.74:port=2023:lite=8


Download


UDPC can be downloaded from this page in one of the following three ways:

Installation & build

UDPC can be installed in three ways:

           1. Installation from the sources
           2. Installation from the DEB binary package
           3. Installation from the RPM binary package

From the sources, you can generate a DEB or binary package:
           4. Generation of a DEB binary package
           5. Generation of a RPM binary package

You can generate a zipped tar file of the sources:
           6. Generation of a zipped tar file


1. Installation from the sources

The installation from the sources supposes that cmake is installed on your Linux system.
Unpack the tar compressed file udpc-xxx.tgz into a directory. This will create a sub-directory called udpc-xxx with the source files of the program:

$ tar xvfz udpc-xxx.tgz

Go into the newly created directory:

$ cd udpc-xxx

Make sure the file 'udpc_install.sh' has the execute permission:

$ chmod +x udpc_install.sh

Launch the script 'udpc_install.sh' to get the help:

$ ./udpc_install.sh -h

Usage: udpc_install.sh [-d install_root_dir] [-P DEB | RPM] [-B] [-I] [-A] [-h]

             -d : Installation directory (default: /usr/local)
             -P : Generate a DEB or RPM package
             -B : Build the software
             -I : Install the software
             -A : Generate an archive of the software (sources)
             -h : this help

Under root identity, launch the installation by passing '-I' and optionnaly '-d' to specify an installation directory different than '/usr/local':

For example, for an installation in '/usr/local', type:

$ sudo ./udpc_install.sh -I

For an installation in '/usr', type;

$ sudo ./udpc_install.sh -I -d /usr

If your PATH variable is correctly set, UDPC help can be displayed:

$ udpc --help
[...]

If your MANPATH variable is correctly set, UDPC's online manual can be displayed:

$ man udpc
[...]

The kernel module udpc.ko is installed in /lib/modules/`uname -r`/kernel.

2. Installation of the binaries from the DEB package

The files are installed in via the command:

$ sudo dpkg -i udpc-xxx.deb

The module udpc.ko is put in /lib/modules.

3. Installation of the binaries from the RPM package

The files are installed via the command:

$ sudo rpm -i udpc-xxx.rpm

The module udpc.ko is put in /lib/modules.

4. Generation of a DEB binary package

The installation from the sources supposes that cmake is installed on your Linux system.
Unpack the tar compressed file udpc-xxx.tgz into a directory. This will create a sub-directory called 'udpc-xxx' with the source files of the program:

$ tar xvfz udpc-xxx.tgz

Go into the newly created directory:

$ cd udpc-xxx

Make sure the file 'udpc_install.sh' has the execute permission:

$ chmod +x udpc_install.sh

Launch the script 'udpc_install.sh' to get the help:

$ ./udpc_install.sh -h

Usage: udpc_install.sh [-d install_root_dir] [-P DEB | RPM] [-B] [-I] [-A] [-h]

             -d : Installation directory (default: /usr/local)
             -P : Generate a DEB or RPM package
             -B : Build the software
             -I : Install the software
             -A : Generate an archive of the software (sources)
             -h : this help

Under root identity, launch the installation by passing '-P DEB' and optionnaly '-d' to specify an installation directory different than '/usr/local':

For example, for a package which will be installed in '/usr/local', type:

$ sudo ./udpc_install.sh -P DEB

For an installation in '/usr', type;

$ sudo ./udpc_install.sh -P DEB -d /usr

The module udpc.ko is configured to be installed in /lib/modules.

5. Generation of a RPM binary package

The installation from the sources supposes that cmake is installed on your Linux system.
Unpack the tar compressed file udpc-xxx.tgz into a directory. This will create a sub-directory called 'udpc-xxx' with the source files of the program:

$ tar xvfz udpc-xxx.tgz

Go into the newly created directory:

$ cd udpc-xxx

Make sure the file 'udpc_install.sh' has the execute permission:

$ chmod +x udpc_install.sh

Launch the script 'udpc_install.sh' to get the help:

$ ./udpc_install.sh -h

Usage: udpc_install.sh [-d install_root_dir] [-P DEB | RPM] [-B] [-I] [-A] [-h]

             -d : Installation directory (default: /usr/local)
             -P : Generate a DEB or RPM package
             -B : Build the software
             -I : Install the software
             -A : Generate an archive of the software (sources)
             -h : this help

Under root identity, launch the installation by passing '-P RPM' and optionnaly '-d' to specify an installation directory different than '/usr/local':

For example, for a package which will be installed in '/usr/local', type:

$ sudo ./udpc_install.sh -P RPM

For an installation in '/usr', type;

$ sudo ./udpc_install.sh -P RPM -d /usr

The module udpc.ko is configured to be installed in /lib/modules.

6. Generation of a zipped tar file

The Generation of the source package supposes that cmake is installed on your Linux system.
Unpack the tar compressed file udpc-xxx.tgz into a directory. This will create a sub-directory called 'udpc-xxx' with the source files of the program:

$ tar xvfz udpc-xxx.tgz

Go into the newly created directory:

$ cd udpc-xxx

Make sure the file 'pdip_install.sh' has the execute permission:

$ chmod +x udpc_install.sh

Launch the script 'udpc_install.sh' to get the help:

$ ./udpc_install.sh -h

Usage: udpc_install.sh [-d install_root_dir] [-P DEB | RPM] [-B] [-I] [-A] [-h]

             -d : Installation directory (default: /usr/local)
             -P : Generate a DEB or RPM package
             -B : Build the software
             -I : Install the software
             -A : Generate an archive of the software (sources)
             -h : this help

Under root identity, launch the installation by passing '-A':

$ sudo ./udpc_install.sh -A



About the author

The author is an engineer in computer sciences located in France. He is glad to graciously offer this simple utility under the GPL open source license. He can be contacted here or you can have a look at his WEB home page.


Related links



Back to home page
Back to previous page