# software/wrsw_rtud/rtud.c File Reference

`#include <unistd.h>`
`#include <stdlib.h>`
`#include <pthread.h>`
`#include <signal.h>`
`#include <hw/switch_hw.h>`
`#include <hal_client.h>`
`#include "rtu.h"`
`#include "mac.h"`
`#include "rtu_fd.h"`
`#include "rtu_drv.h"`
`#include "rtu_hash.h"`
`#include "utils.h"`

## Functions

static int | rtu_create_static_entries ()
| Creates the static entries in the filtering database.
static void * | rtu_daemon_aging_process (void *arg)
| Periodically removes the filtering database old entries.
static void * | rtu_daemon_wripc_process (void *arg)
| Handles WRIPC requests. Currently used to dump the filtering database contents when requested by external processes.
static int | rtu_daemon_learning_process ()
| Handles the learning process.
static int | rtu_daemon_init (uint16_t poly, unsigned long aging_time)
| RTU set up. Initialises routing table cache and RTU at hardware.
static void | rtu_daemon_destroy ()
| RTU shutdown.
void | sigint (int signum)
int | main (int argc, char **argv)
| Starts up the learning and aging processes.

## Variables

static pthread_t | aging_process
static pthread_t | wripc_process

## Function Documentation

int main | ( | int | argc,
|  | char ** | argv
| ) |  |

Starts up the learning and aging processes.

static int rtu_create_static_entries | ( | ) | `[static]`

Creates the static entries in the filtering database.

Returns:
  error code

static void* rtu_daemon_aging_process | ( | void * | arg ) | `[static]`

Periodically removes the filtering database old entries.

static void rtu_daemon_destroy | ( | ) | `[static]`

RTU shutdown.

static int rtu_daemon_init | ( | uint16_t | poly,
|  | unsigned long | aging_time
| ) |  | `[static]`

RTU set up. Initialises routing table cache and RTU at hardware.

Parameters:

  poly | hash polinomial.
  aging_time | Aging time in seconds.

Returns:
  error code.

static int rtu_daemon_learning_process | ( | ) | `[static]`

Handles the learning process.

Returns:
  error code

static void* rtu_daemon_wripc_process | ( | void * | arg ) | `[static]`

Handles WRIPC requests. Currently used to dump the filtering database contents when requested by external processes.

void sigint | ( | int | signum ) |

## Variable Documentation

pthread_t aging_process `[static]`

pthread_t wripc_process `[static]`

All Data Structures Files Functions Variables Defines