Data Structures | Defines | Functions

software/wrsw_rtud/rtu.h File Reference

#include <stdint.h>
#include <errno.h>
#include <string.h>
#include <time.h>
#include <linux/if_ether.h>
#include <stdio.h>
#include "mac.h"

Go to the source code of this file.

Data Structures

struct  rtu_request
 RTU request: input for the RTU. More...
struct  filtering_entry
 RTU Filtering Database Entry Object. More...
struct  vlan_table_entry
 RTU VLAN registration entry object. More...

Defines

#define RTU_BANKS   2
#define RTU_BUCKETS   4
#define LAST_RTU_BUCKET   ((RTU_BUCKETS)-1)
#define RTU_ENTRIES   (16384/(RTU_BANKS))
#define HTAB_ENTRIES   ((RTU_ENTRIES)/(RTU_BUCKETS))
#define LAST_HTAB_ENTRY   ((HTAB_ENTRIES)-1)
#define ENTRY_WORDS   8
#define CAM_ENTRIES   (((RTU_HCAM_WORDS)/(ENTRY_WORDS))/(RTU_BANKS))
#define LAST_CAM_ENTRY   ((CAM_ENTRIES)-1)
#define MIN_PORT   0
#define MAX_PORT   9
#define NIC_PORT   10
#define NUM_VLANS   4096
#define NUM_RESERVED_ADDR   16
#define DEFAULT_AGING_TIME   300
#define MIN_AGING_TIME   10
#define MAX_AGING_TIME   10000
#define DEFAULT_AGING_RES   20
#define time_after(a, b)   ((long)(b) - (long)(a) < 0)
#define TRACE_DBG(...)

Functions

static struct filtering_entryrtu_fe_copy (struct filtering_entry *dst, struct filtering_entry *src)
 Copies src filtering entry body into dst filtering entry body.
static struct filtering_entryrtu_fe_clean (struct filtering_entry *ent)
 Cleans MAC entry from mirror MAC table. All entry fields are reset.
static unsigned long now ()
 Returns number of seconds since the epoch.
int rtud_init_exports ()
void rtud_handle_wripc ()

Define Documentation

#define CAM_ENTRIES   (((RTU_HCAM_WORDS)/(ENTRY_WORDS))/(RTU_BANKS))
#define DEFAULT_AGING_RES   20
#define DEFAULT_AGING_TIME   300
#define ENTRY_WORDS   8
#define HTAB_ENTRIES   ((RTU_ENTRIES)/(RTU_BUCKETS))
#define LAST_CAM_ENTRY   ((CAM_ENTRIES)-1)
#define LAST_HTAB_ENTRY   ((HTAB_ENTRIES)-1)
#define LAST_RTU_BUCKET   ((RTU_BUCKETS)-1)
#define MAX_AGING_TIME   10000
#define MAX_PORT   9
#define MIN_AGING_TIME   10
#define MIN_PORT   0
#define NIC_PORT   10
#define NUM_RESERVED_ADDR   16
#define NUM_VLANS   4096
#define RTU_BANKS   2
#define RTU_BUCKETS   4
#define RTU_ENTRIES   (16384/(RTU_BANKS))
#define time_after (   a,
 
)    ((long)(b) - (long)(a) < 0)
#define TRACE_DBG (   ... )

Function Documentation

static unsigned long now (  ) [inline, static]

Returns number of seconds since the epoch.

static struct filtering_entry* rtu_fe_clean ( struct filtering_entry ent ) [static, read]

Cleans MAC entry from mirror MAC table. All entry fields are reset.

Parameters:
entpointer to entry to clean (either in HCAM or HTAB)
Returns:
pointer to filtering entry that was cleaned
static struct filtering_entry* rtu_fe_copy ( struct filtering_entry dst,
struct filtering_entry src 
) [static, read]

Copies src filtering entry body into dst filtering entry body.

Returns:
pointer to dst filtering entry.
void rtud_handle_wripc (  )
int rtud_init_exports (  )
 All Data Structures Files Functions Variables Defines