Next: Packet Flow Through OpenRG
Up: The Main Task
Previous: Entities
Contents
As previously mentioned, a task is a set of functions that implement a certain
protocol or service, for example PPP, DNS or HTTP. A task can be characterized
as being self-contained and system independent. It does not rely on other
tasks, configuration files or any other kind of outside help.
The OpenRG library, libOpenRG, provides the task with rudimentary
services such as an event dispatch loop, memory allocation and logging
functions. The entire configuration that a task may require is imparted as
parameters to its open() function. The task's genuine work is
actually performed by the callback function, a pointer which is also given
as a parameter to the open() function.
It follows that tasks are inherently portable and reusable. To illustrate, the
Ping task can be employed in two different ways:
- The DHCP server may use the Ping task to test whether an IP address it
is about to lease is already taken by pinging the address in question. The
task parameters in this case will be a ping packet, a brief time-out reply
and callback functions. All of these are implemented in the DHCP code.
- The Web-based management may use the Ping task to implement a
'Connectivity Diagnostics Test' interface screen. The task parameters will
be the number of ping attempts, a ten second time-out and callback
functions. Again, these parameters are implemented in the Web-based
management code.
Next: Packet Flow Through OpenRG
Up: The Main Task
Previous: Entities
Contents
Jungo Software Technologies