Commit 4c45595e authored by Martin Mareš's avatar Martin Mareš

o FIB flags now available for FIB users.

o  struct network: FIB flags used for kernel syncing.
o  struct network: `next' field deleted (historical relic).
parent ab3a76a3
...@@ -29,7 +29,7 @@ struct proto; ...@@ -29,7 +29,7 @@ struct proto;
struct fib_node { struct fib_node {
ip_addr prefix; /* In host order */ ip_addr prefix; /* In host order */
byte pxlen; byte pxlen;
byte flags; /* ??? define them ??? */ byte flags; /* User-defined */
byte pad0, pad1; /* ??? use ??? */ byte pad0, pad1; /* ??? use ??? */
struct fib_node *next; /* Next in hash chain */ struct fib_node *next; /* Next in hash chain */
}; };
...@@ -65,6 +65,7 @@ void fib_free(struct fib *); /* Destroy the fib */ ...@@ -65,6 +65,7 @@ void fib_free(struct fib *); /* Destroy the fib */
* representing routes to given network. * representing routes to given network.
* Each of the RTE's contains variable data (the preference and protocol-dependent * Each of the RTE's contains variable data (the preference and protocol-dependent
* metrics) and a pointer to a route attribute block common for many routes). * metrics) and a pointer to a route attribute block common for many routes).
* It's guaranteed that there is at most one RTE for every (prefix,proto,source) triplet.
*/ */
typedef struct rtable { typedef struct rtable {
...@@ -72,15 +73,16 @@ typedef struct rtable { ...@@ -72,15 +73,16 @@ typedef struct rtable {
byte tos; /* TOS for this table */ byte tos; /* TOS for this table */
struct fib fib; struct fib fib;
char *name; /* Name of this table */ char *name; /* Name of this table */
/* FIXME: Data for kernel synchronization */
} rtable; } rtable;
typedef struct network { typedef struct network {
struct fib_node n; struct fib_node n; /* FIB flags hold kernel sync info (KRF_...) */
struct rte *routes; /* Available routes for this network */ struct rte *routes; /* Available routes for this network */
struct network *next; /* Next in Recalc Chain */
} net; } net;
#define KRF_SEEN 1 /* Seen in kernel table during last scan */
#define KRF_UPDATE 2 /* Need to update this entry */
typedef struct rte { typedef struct rte {
struct rte *next; struct rte *next;
struct rtattr *attrs; struct rtattr *attrs;
......
...@@ -112,7 +112,6 @@ fib_get(struct fib *f, ip_addr *a, int len) ...@@ -112,7 +112,6 @@ fib_get(struct fib *f, ip_addr *a, int len)
e = sl_alloc(f->fib_slab); e = sl_alloc(f->fib_slab);
e->prefix = *a; e->prefix = *a;
e->pxlen = len; e->pxlen = len;
e->flags = 0;
e->next = *ee; e->next = *ee;
*ee = e; *ee = e;
f->init(e); f->init(e);
......
...@@ -21,7 +21,7 @@ rte_init(struct fib_node *N) ...@@ -21,7 +21,7 @@ rte_init(struct fib_node *N)
{ {
net *n = (net *) N; net *n = (net *) N;
n->next = NULL; N->flags = 0;
n->routes = NULL; n->routes = NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment