diff options
author | Pavel Machek <pavel@ucw.cz> | 1998-07-09 19:39:04 +0000 |
---|---|---|
committer | Pavel Machek <pavel@ucw.cz> | 1998-07-09 19:39:04 +0000 |
commit | a103373f6147f27e4ac71e5903563e57ce52902c (patch) | |
tree | 34ca60b328fd906c50af90740fdc006f014b3aa2 /proto/rip/rip.h | |
parent | 86b0023033a25cdc6ab5480e03893f516184a2a5 (diff) |
Commiting RIP. RIP should somehow listen, will not reply. I needed to
commit it so that whole thing compiles.
Diffstat (limited to 'proto/rip/rip.h')
-rw-r--r-- | proto/rip/rip.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/proto/rip/rip.h b/proto/rip/rip.h new file mode 100644 index 00000000..8bcd0ce8 --- /dev/null +++ b/proto/rip/rip.h @@ -0,0 +1,60 @@ +/* + * Structures for RIP protocol + */ + +struct rip_connection { + ip_addr addr; + struct rip_entry *sendptr; + sock *send; +}; + +struct rip_packet_heading { + u8 command; + u8 version; +#define RIP_V1 1 +#define RIP_V2 2 + u16 unused; +}; + +struct rip_block { + u16 family; /* 0xffff on first message means this is authentication */ + u16 tag; + u32 network; + u32 netmask; + u32 nexthop; + u32 metric; +}; + +struct rip_entry { + node n; + ip_addr whotoldme; + + ip_addr network; + ip_addr netmask; + ip_addr nexthop; + + int metric; + u16 tag; + + bird_clock_t updated, changed; +}; + +struct rip_packet { + struct rip_packet_heading heading; + struct rip_block block[25]; +}; + +struct rip_data { + struct proto inherited; + sock *listen; + timer *timer; + list connections; + list rtable; + int magic; +}; + +#define P ((struct rip_data *) p) +#define E ((struct rip_entry *) e) + +#define RIP_MAGIC 81861253 +#define CHK_MAGIC do { if (P->magic != RIP_MAGIC) die( "Not enough magic\n" ); } while (0) |