summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ripd/rip.h
diff options
context:
space:
mode:
authornorby <norby@openbsd.org>2006-10-18 16:11:58 +0000
committernorby <norby@openbsd.org>2006-10-18 16:11:58 +0000
commitddeeec14405d9fddd84352ee7462e9ed0c83f431 (patch)
treec08eb975b2afccfc84b48563d99c25a480efdabb /usr.sbin/ripd/rip.h
parentWelcome ripd started by Michele Marchetto some time ago by using the imsg/three process framework of ospfd. He implemented most of the daemon with a little help and guidance from Claudio and I. Currently the daemon is more or less complete, with the exception of key lifetime and rollover. Not yet... (diff)
downloadwireguard-openbsd-ddeeec14405d9fddd84352ee7462e9ed0c83f431.tar.xz
wireguard-openbsd-ddeeec14405d9fddd84352ee7462e9ed0c83f431.zip
Welcome ripd
started by Michele Marchetto some time ago by using the imsg/three process framework of ospfd. He implemented most of the daemon with a little help and guidance from Claudio and I. Currently the daemon is more or less complete, with the exception of key lifetime and rollover. Not yet connected to the builds. OK claudio@
Diffstat (limited to 'usr.sbin/ripd/rip.h')
-rw-r--r--usr.sbin/ripd/rip.h82
1 files changed, 82 insertions, 0 deletions
diff --git a/usr.sbin/ripd/rip.h b/usr.sbin/ripd/rip.h
new file mode 100644
index 00000000000..a1b2a3c3d91
--- /dev/null
+++ b/usr.sbin/ripd/rip.h
@@ -0,0 +1,82 @@
+/* $OpenBSD: rip.h,v 1.1 2006/10/18 16:11:58 norby Exp $ */
+
+/*
+ * Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* RIP protocol definitions */
+
+#ifndef _RIP_H_
+#define _RIP_H_
+
+/* misc */
+#define RIP_VERSION 2
+#define ALL_RIP_ROUTERS "224.0.0.9"
+#define RIP_PORT 520
+
+#define MIN_MD_ID 0
+#define MAX_MD_ID 255
+
+/* metric */
+#define INFINITY 16
+
+/* timers */
+#define KEEPALIVE 30
+#define OFFSET 10
+
+#define MAX_RIP_ENTRIES 25
+
+/* RIP command */
+#define COMMAND_REQUEST 1
+#define COMMAND_RESPONSE 2
+
+#define RIP_HDR_LEN sizeof(struct rip_hdr)
+#define RIP_ENTRY_LEN sizeof(struct rip_entry)
+
+struct rip_hdr {
+ u_int8_t command;
+ u_int8_t version;
+ u_int16_t dummy;
+};
+
+struct rip_entry {
+ u_int16_t AFI;
+ u_int16_t route_tag;
+ u_int32_t address;
+ u_int32_t mask;
+ u_int32_t nexthop;
+ u_int32_t metric;
+};
+
+/* auth */
+#define AUTH 0xFFFF
+#define AUTH_TRLR_HDR_LEN 4
+
+/* auth general struct */
+struct rip_auth {
+ u_int16_t auth_fixed;
+ u_int16_t auth_type;
+};
+
+/* Keyed MD5 auth struct */
+struct md5_auth {
+ u_int16_t auth_offset;
+ u_int8_t auth_keyid;
+ u_int8_t auth_length;
+ u_int32_t auth_seq;
+ u_int64_t auth_reserved;
+};
+
+#endif /* _RIP_H_ */