diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2012-03-15 11:58:08 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2012-03-15 12:13:04 +0100 |
commit | c0adf7e9fc0bb920175a639c6f56ed7b4190f3e4 (patch) | |
tree | 8bc6ac9e4c9288d7e7009a80a04d7278325ff05c /proto/pipe/pipe.h | |
parent | 46c1a583a5c1ea81e8d8f372bd7f614506a63938 (diff) |
Better support for multitable protocols.
The nest-protocol interaction is changed to better handle multitable
protocols. Multitable protocols now declare that by 'multitable' field,
which tells nest that a protocol handles things related to proto-rtable
interaction (table locking, announce hook adding, reconfiguration of
filters) itself.
Filters and stats are moved to announce hooks, a protocol could have
different filters and stats to different tables.
The patch is based on one from Alexander V. Chernikov, thanks.
Diffstat (limited to 'proto/pipe/pipe.h')
-rw-r--r-- | proto/pipe/pipe.h | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/proto/pipe/pipe.h b/proto/pipe/pipe.h index fbd21291..50b31698 100644 --- a/proto/pipe/pipe.h +++ b/proto/pipe/pipe.h @@ -20,7 +20,8 @@ struct pipe_config { struct pipe_proto { struct proto p; - struct rtable *peer; + struct rtable *peer_table; + struct announce_hook *peer_ahook; /* Announce hook for direction peer->primary */ struct proto_stats peer_stats; /* Statistics for the direction peer->primary */ int mode; /* PIPE_OPAQUE or PIPE_TRANSPARENT */ }; @@ -31,10 +32,4 @@ extern struct protocol proto_pipe; static inline int proto_is_pipe(struct proto *p) { return p->proto == &proto_pipe; } -static inline struct rtable * pipe_get_peer_table(struct proto *P) -{ return ((struct pipe_proto *) P)->peer; } - -static inline struct proto_stats * pipe_get_peer_stats(struct proto *P) -{ return &((struct pipe_proto *) P)->peer_stats; } - #endif |