diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2010-02-13 12:26:26 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2010-02-13 12:26:26 +0100 |
commit | dca75fd7c207f0bfc627cb6b74a484da3b27e05f (patch) | |
tree | c8e2f7469e10bb692c3b09b3735b90883318180b /proto/pipe/pipe.h | |
parent | 9db74169be76f658df2207d1ec99eac48fa36f5f (diff) |
Removes phantom protocol from the pipe design.
It seems that by adding one pipe-specific exception to route
announcement code and by adding one argument to rt_notify() callback i
could completely eliminate the need for the phantom protocol instance
and therefore make the code more straightforward. It will also fix some
minor bugs (like ignoring debug flag changes from the command line).
Diffstat (limited to 'proto/pipe/pipe.h')
-rw-r--r-- | proto/pipe/pipe.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/proto/pipe/pipe.h b/proto/pipe/pipe.h index 368ba41b..fbd21291 100644 --- a/proto/pipe/pipe.h +++ b/proto/pipe/pipe.h @@ -21,8 +21,20 @@ struct pipe_config { struct pipe_proto { struct proto p; struct rtable *peer; + struct proto_stats peer_stats; /* Statistics for the direction peer->primary */ int mode; /* PIPE_OPAQUE or PIPE_TRANSPARENT */ - struct pipe_proto *phantom; }; + +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 |