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 :
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 :
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:
ip: IP address of the
UDPC server. It is specified in the dotted notation form (default is
local 127.0.0.1);
port: UDP or UDP-lite
port of the UDPC server (default is 13);
lite: UDP-lite mode
(default is UDP mode) along with the checksum coverage length which can
be 0 (complete coverage) or a value inside [1,65535].
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:
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:
-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:
-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:
-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:
-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.